om-memory-system 6.2.0 → 6.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/importer/external-api-test.d.ts +4 -2
- package/dist/importer/external-api-test.js +3 -2
- package/dist/services/ai/provider-config.d.ts +1 -1
- package/dist/services/openrouter-models.d.ts +25 -0
- package/dist/services/openrouter-models.js +58 -0
- package/dist/services/openrouter-providers.d.ts +6 -0
- package/dist/services/openrouter-providers.js +23 -0
- package/dist/services/openrouter-routes.js +9 -0
- package/dist/web/assets/{index-Tc6q6ju1.css → index-EQEdDRLu.css} +1 -1
- package/dist/web/assets/index-uqSsb7yC.js +171 -0
- package/dist/web/assets/react-SIfiwpqq.js +1 -0
- package/dist/web/index.html +3 -2
- package/package.json +1 -1
- package/dist/web/assets/index-DgFc9nSc.js +0 -171
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,o)=>(o=n==null?{}:e(i(n)),c(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var u=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`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`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function N(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),N(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=N(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=N(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return N(M(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function P(e,t,n){if(e==null)return e;var r=[],i=0;return N(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ee(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var F=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},I={map:P,forEach:function(e,t,n){P(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return P(e,function(){t++}),t},toArray:function(e){return P(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=I,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:ee}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,F)}catch(e){F(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.8`})),d=o(((e,t)=>{t.exports=u()})),f=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}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(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),p=o(((e,t)=>{t.exports=f()})),m=o((e=>{var t=d();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;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.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.8`})),h=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=m()})),g=o((e=>{var t=p(),n=d(),r=h();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;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.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(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 s(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 c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}var m=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),E=Symbol.for(`react.suspense_list`),D=Symbol.for(`react.memo`),O=Symbol.for(`react.lazy`),k=Symbol.for(`react.activity`),A=Symbol.for(`react.memo_cache_sentinel`),j=Symbol.iterator;function M(e){return typeof e!=`object`||!e?null:(e=j&&e[j]||e[`@@iterator`],typeof e==`function`?e:null)}var N=Symbol.for(`react.client.reference`);function P(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===N?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case E:return`SuspenseList`;case k:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case D:return t=e.displayName||null,t===null?P(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return P(e(t))}catch{}}return null}var ee=Array.isArray,F=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,te={pending:!1,data:null,method:null,action:null},L=[],ne=-1;function re(e){return{current:e}}function R(e){0>ne||(e.current=L[ne],L[ne]=null,ne--)}function ie(e,t){ne++,L[ne]=e.current,e.current=t}var ae=re(null),oe=re(null),se=re(null),ce=re(null);function le(e,t){switch(ie(se,t),ie(oe,e),ie(ae,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?qd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=qd(t),e=Jd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}R(ae),ie(ae,e)}function ue(){R(ae),R(oe),R(se)}function de(e){e.memoizedState!==null&&ie(ce,e);var t=ae.current,n=Jd(t,e.type);t!==n&&(ie(oe,e),ie(ae,n))}function fe(e){oe.current===e&&(R(ae),R(oe)),ce.current===e&&(R(ce),np._currentValue=te)}var pe,me;function he(e){if(pe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);pe=t&&t[1]||``,me=-1<e.stack.indexOf(`
|
|
2
|
-
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
3
|
-
`+pe+e+me}var ge=!1;function _e(e,t){if(!e||ge)return``;ge=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
4
|
-
`),l=s.split(`
|
|
5
|
-
`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
|
|
6
|
-
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{ge=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?he(n):``}function ve(e,t){switch(e.tag){case 26:case 27:case 5:return he(e.type);case 16:return he(`Lazy`);case 13:return e.child!==t&&t!==null?he(`Suspense Fallback`):he(`Suspense`);case 19:return he(`SuspenseList`);case 0:case 15:return _e(e.type,!1);case 11:return _e(e.type.render,!1);case 1:return _e(e.type,!0);case 31:return he(`Activity`);default:return``}}function ye(e){try{var t=``,n=null;do t+=ve(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
7
|
-
Error generating stack: `+e.message+`
|
|
8
|
-
`+e.stack}}var be=Object.prototype.hasOwnProperty,xe=t.unstable_scheduleCallback,Se=t.unstable_cancelCallback,Ce=t.unstable_shouldYield,we=t.unstable_requestPaint,Te=t.unstable_now,Ee=t.unstable_getCurrentPriorityLevel,De=t.unstable_ImmediatePriority,Oe=t.unstable_UserBlockingPriority,ke=t.unstable_NormalPriority,Ae=t.unstable_LowPriority,je=t.unstable_IdlePriority,Me=t.log,Ne=t.unstable_setDisableYieldValue,Pe=null,Fe=null;function Ie(e){if(typeof Me==`function`&&Ne(e),Fe&&typeof Fe.setStrictMode==`function`)try{Fe.setStrictMode(Pe,e)}catch{}}var Le=Math.clz32?Math.clz32:Be,Re=Math.log,ze=Math.LN2;function Be(e){return e>>>=0,e===0?32:31-(Re(e)/ze|0)|0}var Ve=256,He=262144,Ue=4194304;function We(e){var t=e&42;if(t!==0)return t;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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ge(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=We(n))):i=We(o):i=We(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=We(n))):i=We(o)):i=We(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Ke(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function qe(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32: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:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Je(){var e=Ue;return Ue<<=1,!(Ue&62914560)&&(Ue=4194304),e}function Ye(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Xe(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ze(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Le(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&Qe(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function Qe(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Le(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function $e(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Le(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function et(e,t){var n=t&-t;return n=n&42?1:tt(n),(n&(e.suspendedLanes|t))===0?n:0}function tt(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function nt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function rt(){var e=I.p;return e===0?(e=window.event,e===void 0?32:vp(e.type)):e}function it(e,t){var n=I.p;try{return I.p=e,t()}finally{I.p=n}}var at=Math.random().toString(36).slice(2),ot=`__reactFiber$`+at,st=`__reactProps$`+at,ct=`__reactContainer$`+at,lt=`__reactEvents$`+at,ut=`__reactListeners$`+at,dt=`__reactHandles$`+at,ft=`__reactResources$`+at,pt=`__reactMarker$`+at;function mt(e){delete e[ot],delete e[st],delete e[lt],delete e[ut],delete e[dt]}function ht(e){var t=e[ot];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ct]||n[ot]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=gf(e);e!==null;){if(n=e[ot])return n;e=gf(e)}return t}e=n,n=e.parentNode}return null}function gt(e){if(e=e[ot]||e[ct]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function _t(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function vt(e){var t=e[ft];return t||=e[ft]={hoistableStyles:new Map,hoistableScripts:new Map},t}function yt(e){e[pt]=!0}var bt=new Set,xt={};function St(e,t){Ct(e,t),Ct(e+`Capture`,t)}function Ct(e,t){for(xt[e]=t,e=0;e<t.length;e++)bt.add(t[e])}var wt=RegExp(`^[: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]*$`),Tt={},Et={};function Dt(e){return be.call(Et,e)?!0:be.call(Tt,e)?!1:wt.test(e)?Et[e]=!0:(Tt[e]=!0,!1)}function Ot(e,t,n){if(Dt(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}}function kt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function At(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function jt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Mt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Nt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Pt(e){if(!e._valueTracker){var t=Mt(e)?`checked`:`value`;e._valueTracker=Nt(e,t,``+e[t])}}function Ft(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Mt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}function It(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Lt=/[\n"\\]/g;function Rt(e){return e.replace(Lt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function zt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+jt(t)):e.value!==``+jt(t)&&(e.value=``+jt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Vt(e,o,jt(n)):Vt(e,o,jt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+jt(s):e.removeAttribute(`name`)}function Bt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Pt(e);return}n=n==null?``:``+jt(n),t=t==null?n:``+jt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Pt(e)}function Vt(e,t,n){t===`number`&&It(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Ht(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+jt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Ut(e,t,n){if(t!=null&&(t=``+jt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+jt(n)}function Wt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ee(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=jt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Pt(e)}function Gt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Kt=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function qt(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Kt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Jt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&qt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&qt(e,o,t[o])}function Yt(e){if(e.indexOf(`-`)===-1)return!1;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 Xt=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),Zt=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Qt(e){return Zt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function $t(){}var en=null;function tn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var nn=null,rn=null;function an(e){var t=gt(e);if(t&&(e=t.stateNode)){var n=e[st]||null;a:switch(e=t.stateNode,t.type){case`input`:if(zt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Rt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[st]||null;if(!a)throw Error(i(90));zt(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Ft(r)}break a;case`textarea`:Ut(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Ht(e,!!n.multiple,t,!1)}}}var on=!1;function sn(e,t,n){if(on)return e(t,n);on=!0;try{return e(t)}finally{if(on=!1,(nn!==null||rn!==null)&&(Cu(),nn&&(t=nn,e=rn,rn=nn=null,an(t),e)))for(t=0;t<e.length;t++)an(e[t])}}function cn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[st]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var ln=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),un=!1;if(ln)try{var dn={};Object.defineProperty(dn,"passive",{get:function(){un=!0}}),window.addEventListener(`test`,dn,dn),window.removeEventListener(`test`,dn,dn)}catch{un=!1}var fn=null,pn=null,mn=null;function hn(){if(mn)return mn;var e,t=pn,n=t.length,r,i=`value`in fn?fn.value:fn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return mn=i.slice(e,1<r?1-r:void 0)}function gn(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 _n(){return!0}function vn(){return!1}function yn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?_n:vn,this.isPropagationStopped=vn,this}return m(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=_n)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=_n)},persist:function(){},isPersistent:_n}),t}var bn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},xn=yn(bn),Sn=m({},bn,{view:0,detail:0}),Cn=yn(Sn),wn,Tn,En,Dn=m({},Sn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Rn,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!==En&&(En&&e.type===`mousemove`?(wn=e.screenX-En.screenX,Tn=e.screenY-En.screenY):Tn=wn=0,En=e),wn)},movementY:function(e){return`movementY`in e?e.movementY:Tn}}),On=yn(Dn),kn=yn(m({},Dn,{dataTransfer:0})),An=yn(m({},Sn,{relatedTarget:0})),jn=yn(m({},bn,{animationName:0,elapsedTime:0,pseudoElement:0})),Mn=yn(m({},bn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Nn=yn(m({},bn,{data:0})),Pn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Fn={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`},In={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Ln(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=In[e])?!!t[e]:!1}function Rn(){return Ln}var zn=yn(m({},Sn,{key:function(e){if(e.key){var t=Pn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=gn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Fn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Rn,charCode:function(e){return e.type===`keypress`?gn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?gn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Bn=yn(m({},Dn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Vn=yn(m({},Sn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Rn})),Hn=yn(m({},bn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Un=yn(m({},Dn,{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})),Wn=yn(m({},bn,{newState:0,oldState:0})),Gn=[9,13,27,32],Kn=ln&&`CompositionEvent`in window,qn=null;ln&&`documentMode`in document&&(qn=document.documentMode);var Jn=ln&&`TextEvent`in window&&!qn,Yn=ln&&(!Kn||qn&&8<qn&&11>=qn),Xn=` `,Zn=!1;function Qn(e,t){switch(e){case`keyup`:return Gn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function $n(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var er=!1;function tr(e,t){switch(e){case`compositionend`:return $n(t);case`keypress`:return t.which===32?(Zn=!0,Xn):null;case`textInput`:return e=t.data,e===Xn&&Zn?null:e;default:return null}}function nr(e,t){if(er)return e===`compositionend`||!Kn&&Qn(e,t)?(e=hn(),mn=pn=fn=null,er=!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 Yn&&t.locale!==`ko`?null:t.data;default:return null}}var rr={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 ir(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!rr[e.type]:t===`textarea`}function ar(e,t,n,r){nn?rn?rn.push(r):rn=[r]:nn=r,t=jd(t,`onChange`),0<t.length&&(n=new xn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var or=null,sr=null;function cr(e){Cd(e,0)}function lr(e){if(Ft(_t(e)))return e}function z(e,t){if(e===`change`)return t}var ur=!1;if(ln){var dr;if(ln){var fr=`oninput`in document;if(!fr){var pr=document.createElement(`div`);pr.setAttribute(`oninput`,`return;`),fr=typeof pr.oninput==`function`}dr=fr}else dr=!1;ur=dr&&(!document.documentMode||9<document.documentMode)}function mr(){or&&(or.detachEvent(`onpropertychange`,hr),sr=or=null)}function hr(e){if(e.propertyName===`value`&&lr(sr)){var t=[];ar(t,sr,e,tn(e)),sn(cr,t)}}function gr(e,t,n){e===`focusin`?(mr(),or=t,sr=n,or.attachEvent(`onpropertychange`,hr)):e===`focusout`&&mr()}function B(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return lr(sr)}function _r(e,t){if(e===`click`)return lr(t)}function vr(e,t){if(e===`input`||e===`change`)return lr(t)}function yr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var br=typeof Object.is==`function`?Object.is:yr;function xr(e,t){if(br(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!be.call(t,i)||!br(e[i],t[i]))return!1}return!0}function Sr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Cr(e,t){var n=Sr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Sr(n)}}function wr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?wr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Tr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=It(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=It(e.document)}return t}function Er(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`)}var Dr=ln&&`documentMode`in document&&11>=document.documentMode,Or=null,kr=null,Ar=null,jr=!1;function Mr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;jr||Or==null||Or!==It(r)||(r=Or,`selectionStart`in r&&Er(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Ar&&xr(Ar,r)||(Ar=r,r=jd(kr,`onSelect`),0<r.length&&(t=new xn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Or)))}function Nr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Pr={animationend:Nr(`Animation`,`AnimationEnd`),animationiteration:Nr(`Animation`,`AnimationIteration`),animationstart:Nr(`Animation`,`AnimationStart`),transitionrun:Nr(`Transition`,`TransitionRun`),transitionstart:Nr(`Transition`,`TransitionStart`),transitioncancel:Nr(`Transition`,`TransitionCancel`),transitionend:Nr(`Transition`,`TransitionEnd`)},V={},Fr={};ln&&(Fr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Pr.animationend.animation,delete Pr.animationiteration.animation,delete Pr.animationstart.animation),`TransitionEvent`in window||delete Pr.transitionend.transition);function H(e){if(V[e])return V[e];if(!Pr[e])return e;var t=Pr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Fr)return V[e]=t[n];return e}var Ir=H(`animationend`),Lr=H(`animationiteration`),Rr=H(`animationstart`),zr=H(`transitionrun`),Br=H(`transitionstart`),Vr=H(`transitioncancel`),Hr=H(`transitionend`),Ur=new Map,Wr=`abort auxClick beforeToggle 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(` `);Wr.push(`scrollEnd`);function Gr(e,t){Ur.set(e,t),St(t,[e])}var Kr=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},qr=[],Jr=0,Yr=0;function Xr(){for(var e=Jr,t=Yr=Jr=0;t<e;){var n=qr[t];qr[t++]=null;var r=qr[t];qr[t++]=null;var i=qr[t];qr[t++]=null;var a=qr[t];if(qr[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&ei(n,i,a)}}function Zr(e,t,n,r){qr[Jr++]=e,qr[Jr++]=t,qr[Jr++]=n,qr[Jr++]=r,Yr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Qr(e,t,n,r){return Zr(e,t,n,r),ti(e)}function $r(e,t){return Zr(e,null,null,t),ti(e)}function ei(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Le(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ti(e){if(50<mu)throw mu=0,hu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var U={};function ni(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ri(e,t,n,r){return new ni(e,t,n,r)}function ii(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ai(e,t){var n=e.alternate;return n===null?(n=ri(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&65011712,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.refCleanup=e.refCleanup,n}function oi(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function si(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)ii(e)&&(s=1);else if(typeof e==`string`)s=qf(e,n,ae.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case k:return e=ri(31,n,t,a),e.elementType=k,e.lanes=o,e;case y:return ci(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=ri(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=ri(13,n,t,a),e.elementType=T,e.lanes=o,e;case E:return e=ri(19,n,t,a),e.elementType=E,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case D:s=14;break a;case O:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=ri(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function ci(e,t,n,r){return e=ri(7,e,r,t),e.lanes=n,e}function li(e,t,n){return e=ri(6,e,null,t),e.lanes=n,e}function ui(e){var t=ri(18,null,null,0);return t.stateNode=e,t}function di(e,t,n){return t=ri(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var fi=new WeakMap;function pi(e,t){if(typeof e==`object`&&e){var n=fi.get(e);return n===void 0?(t={value:e,source:t,stack:ye(t)},fi.set(e,t),t):n}return{value:e,source:t,stack:ye(t)}}var mi=[],hi=0,gi=null,W=0,_i=[],vi=0,yi=null,bi=1,xi=``;function Si(e,t){mi[hi++]=W,mi[hi++]=gi,gi=e,W=t}function Ci(e,t,n){_i[vi++]=bi,_i[vi++]=xi,_i[vi++]=yi,yi=e;var r=bi;e=xi;var i=32-Le(r)-1;r&=~(1<<i),n+=1;var a=32-Le(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,bi=1<<32-Le(t)+i|n<<i|r,xi=a+e}else bi=1<<a|n<<i|r,xi=e}function wi(e){e.return!==null&&(Si(e,1),Ci(e,1,0))}function Ti(e){for(;e===gi;)gi=mi[--hi],mi[hi]=null,W=mi[--hi],mi[hi]=null;for(;e===yi;)yi=_i[--vi],_i[vi]=null,xi=_i[--vi],_i[vi]=null,bi=_i[--vi],_i[vi]=null}function Ei(e,t){_i[vi++]=bi,_i[vi++]=xi,_i[vi++]=yi,bi=t.id,xi=t.overflow,yi=e}var Di=null,Oi=null,ki=!1,Ai=null,ji=!1,Mi=Error(i(519));function Ni(e){throw zi(pi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Mi}function Pi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[ot]=e,t[st]=r,n){case`dialog`:wd(`cancel`,t),wd(`close`,t);break;case`iframe`:case`object`:case`embed`:wd(`load`,t);break;case`video`:case`audio`:for(n=0;n<xd.length;n++)wd(xd[n],t);break;case`source`:wd(`error`,t);break;case`img`:case`image`:case`link`:wd(`error`,t),wd(`load`,t);break;case`details`:wd(`toggle`,t);break;case`input`:wd(`invalid`,t),Bt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:wd(`invalid`,t);break;case`textarea`:wd(`invalid`,t),Wt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Ld(t.textContent,n)?(r.popover!=null&&(wd(`beforetoggle`,t),wd(`toggle`,t)),r.onScroll!=null&&wd(`scroll`,t),r.onScrollEnd!=null&&wd(`scrollend`,t),r.onClick!=null&&(t.onclick=$t),t=!0):t=!1,t||Ni(e,!0)}function Fi(e){for(Di=e.return;Di;)switch(Di.tag){case 5:case 31:case 13:ji=!1;return;case 27:case 3:ji=!0;return;default:Di=Di.return}}function Ii(e){if(e!==Di)return!1;if(!ki)return Fi(e),ki=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||Yd(e.type,e.memoizedProps)),n=!n),n&&Oi&&Ni(e),Fi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Oi=hf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Oi=hf(e)}else t===27?(t=Oi,nf(e.type)?(e=mf,mf=null,Oi=e):Oi=t):Oi=Di?pf(e.stateNode.nextSibling):null;return!0}function Li(){Oi=Di=null,ki=!1}function Ri(){var e=Ai;return e!==null&&(eu===null?eu=e:eu.push.apply(eu,e),Ai=null),e}function zi(e){Ai===null?Ai=[e]:Ai.push(e)}var Bi=re(null),Vi=null,Hi=null;function Ui(e,t,n){ie(Bi,t._currentValue),t._currentValue=n}function Wi(e){e._currentValue=Bi.current,R(Bi)}function Gi(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Ki(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Gi(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Gi(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function qi(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;br(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===ce.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[np]:e.push(np))}a=a.return}e!==null&&Ki(t,e,n,r),t.flags|=262144}function Ji(e){for(e=e.firstContext;e!==null;){if(!br(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Yi(e){Vi=e,Hi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Xi(e){return Qi(Vi,e)}function Zi(e,t){return Vi===null&&Yi(e),Qi(e,t)}function Qi(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Hi===null){if(e===null)throw Error(i(308));Hi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Hi=Hi.next=t;return n}var $i=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},ea=t.unstable_scheduleCallback,ta=t.unstable_NormalPriority,na={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ra(){return{controller:new $i,data:new Map,refCount:0}}function ia(e){e.refCount--,e.refCount===0&&ea(ta,function(){e.controller.abort()})}var aa=null,oa=0,sa=0,ca=null;function la(e,t){if(aa===null){var n=aa=[];oa=0,sa=hd(),ca={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return oa++,t.then(ua,ua),t}function ua(){if(--oa===0&&aa!==null){ca!==null&&(ca.status=`fulfilled`);var e=aa;aa=null,sa=0,ca=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function da(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var fa=F.S;F.S=function(e,t){ru=Te(),typeof t==`object`&&t&&typeof t.then==`function`&&la(e,t),fa!==null&&fa(e,t)};var pa=re(null);function ma(){var e=pa.current;return e===null?Rl.pooledCache:e}function ha(e,t){t===null?ie(pa,pa.current):ie(pa,t.pool)}function ga(){var e=ma();return e===null?null:{parent:na._currentValue,pool:e}}var _a=Error(i(460)),va=Error(i(474)),ya=Error(i(542)),ba={then:function(){}};function xa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Sa(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then($t,$t),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ta(e),e;default:if(typeof t.status==`string`)t.then($t,$t);else{if(e=Rl,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ta(e),e}throw Ca=t,_a}}function G(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Ca=e,_a):e}}var Ca=null;function wa(){if(Ca===null)throw Error(i(459));var e=Ca;return Ca=null,e}function Ta(e){if(e===_a||e===ya)throw Error(i(483))}var Ea=null,Da=0;function Oa(e){var t=Da;return Da+=1,Ea===null&&(Ea=[]),Sa(Ea,e,t)}function ka(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Aa(e,t){throw t.$$typeof===g?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function ja(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=ai(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=li(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===O&&G(i)===t.type)?(t=a(t,n.props),ka(t,n),t.return=e,t):(t=si(n.type,n.key,n.props,null,e.mode,r),ka(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=di(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=ci(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=li(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=si(t.type,t.key,t.props,null,e.mode,n),ka(n,t),n.return=e,n;case v:return t=di(t,e.mode,n),t.return=e,t;case O:return t=G(t),f(e,t,n)}if(ee(t)||M(t))return t=ci(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Oa(t),n);if(t.$$typeof===C)return f(e,Zi(e,t),n);Aa(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case _:return n.key===i?l(e,t,n,r):null;case v:return n.key===i?u(e,t,n,r):null;case O:return n=G(n),p(e,t,n,r)}if(ee(n)||M(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Oa(n),r);if(n.$$typeof===C)return p(e,t,Zi(e,n),r);Aa(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case _:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case O:return r=G(r),m(e,t,n,r,i)}if(ee(r)||M(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Oa(r),i);if(r.$$typeof===C)return m(e,t,n,Zi(t,r),i);Aa(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),ki&&Si(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return ki&&Si(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),ki&&Si(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),ki&&Si(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return ki&&Si(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),ki&&Si(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===O&&G(l)===r.type){n(e,r.sibling),c=a(r,o.props),ka(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===y?(c=ci(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=si(o.type,o.key,o.props,null,e.mode,c),ka(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=di(o,e.mode,c),c.return=e,e=c}return s(e);case O:return o=G(o),b(e,r,o,c)}if(ee(o))return h(e,r,o,c);if(M(o)){if(l=M(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Oa(o),c);if(o.$$typeof===C)return b(e,r,Zi(e,o),c);Aa(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=li(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Da=0;var i=b(e,t,n,r);return Ea=null,i}catch(t){if(t===_a||t===ya)throw t;var a=ri(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Ma=ja(!0),Na=ja(!1),Pa=!1;function Fa(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ia(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function La(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ra(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Ll&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ti(e),ei(e,null,n),t}return Zr(e,r,t,n),ti(e)}function za(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,$e(e,n)}}function Ba(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Va=!1;function Ha(){if(Va){var e=ca;if(e!==null)throw e}}function Ua(e,t,n,r){Va=!1;var i=e.updateQueue;Pa=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(Bl&f)===f:(r&f)===f){f!==0&&f===sa&&(Va=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,f);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,f=typeof h==`function`?h.call(_,d,f):h,f==null)break a;d=m({},d,f);break a;case 2:Pa=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Jl|=o,e.lanes=o,e.memoizedState=d}}function Wa(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Ga(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Wa(n[e],t)}var Ka=re(null),qa=re(0);function Ja(e,t){e=Kl,ie(qa,e),ie(Ka,t),Kl=e|t.baseLanes}function Ya(){ie(qa,Kl),ie(Ka,Ka.current)}function Xa(){Kl=qa.current,R(Ka),R(qa)}var Za=re(null),Qa=null;function $a(e){var t=e.alternate;ie(io,io.current&1),ie(Za,e),Qa===null&&(t===null||Ka.current!==null||t.memoizedState!==null)&&(Qa=e)}function eo(e){ie(io,io.current),ie(Za,e),Qa===null&&(Qa=e)}function to(e){e.tag===22?(ie(io,io.current),ie(Za,e),Qa===null&&(Qa=e)):no(e)}function no(){ie(io,io.current),ie(Za,Za.current)}function ro(e){R(Za),Qa===e&&(Qa=null),R(io)}var io=re(0);function ao(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||uf(n)||df(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){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 oo=0,K=null,so=null,co=null,lo=!1,uo=!1,fo=!1,po=0,mo=0,ho=null,go=0;function _o(){throw Error(i(321))}function vo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!br(e[n],t[n]))return!1;return!0}function yo(e,t,n,r,i,a){return oo=a,K=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,F.H=e===null||e.memoizedState===null?Fs:Is,fo=!1,a=n(r,i),fo=!1,uo&&(a=xo(t,n,r,i)),bo(e),a}function bo(e){F.H=Ps;var t=so!==null&&so.next!==null;if(oo=0,co=so=K=null,lo=!1,mo=0,ho=null,t)throw Error(i(300));e===null||$s||(e=e.dependencies,e!==null&&Ji(e)&&($s=!0))}function xo(e,t,n,r){K=e;var a=0;do{if(uo&&(ho=null),mo=0,uo=!1,25<=a)throw Error(i(301));if(a+=1,co=so=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}F.H=Ls,o=t(n,r)}while(uo);return o}function So(){var e=F.H,t=e.useState()[0];return t=typeof t.then==`function`?ko(t):t,e=e.useState()[0],(so===null?null:so.memoizedState)!==e&&(K.flags|=1024),t}function Co(){var e=po!==0;return po=0,e}function wo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function To(e){if(lo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}lo=!1}oo=0,co=so=K=null,uo=!1,mo=po=0,ho=null}function Eo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return co===null?K.memoizedState=co=e:co=co.next=e,co}function Do(){if(so===null){var e=K.alternate;e=e===null?null:e.memoizedState}else e=so.next;var t=co===null?K.memoizedState:co.next;if(t!==null)co=t,so=e;else{if(e===null)throw K.alternate===null?Error(i(467)):Error(i(310));so=e,e={memoizedState:so.memoizedState,baseState:so.baseState,baseQueue:so.baseQueue,queue:so.queue,next:null},co===null?K.memoizedState=co=e:co=co.next=e}return co}function Oo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ko(e){var t=mo;return mo+=1,ho===null&&(ho=[]),e=Sa(ho,e,t),t=K,(co===null?t.memoizedState:co.next)===null&&(t=t.alternate,F.H=t===null||t.memoizedState===null?Fs:Is),e}function Ao(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return ko(e);if(e.$$typeof===C)return Xi(e)}throw Error(i(438,String(e)))}function q(e){var t=null,n=K.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=K.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=Oo(),K.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=A;return t.index++,n}function jo(e,t){return typeof t==`function`?t(e):t}function Mo(e){return No(Do(),so,e)}function No(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(oo&f)===f:(Bl&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===sa&&(d=!0);else if((oo&p)===p){u=u.next,p===sa&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,K.lanes|=p,Jl|=p;f=u.action,fo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,K.lanes|=f,Jl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!br(o,e.memoizedState)&&($s=!0,d&&(n=ca,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Po(e){var t=Do(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);br(o,t.memoizedState)||($s=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Fo(e,t,n){var r=K,a=Do(),o=ki;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!br((so||a).memoizedState,n);if(s&&(a.memoizedState=n,$s=!0),a=a.queue,os(Ro.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||co!==null&&co.memoizedState.tag&1){if(r.flags|=2048,ts(9,{destroy:void 0},Lo.bind(null,r,a,n,t),null),Rl===null)throw Error(i(349));o||oo&127||Io(r,t,n)}return n}function Io(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=K.updateQueue,t===null?(t=Oo(),K.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Lo(e,t,n,r){t.value=n,t.getSnapshot=r,zo(t)&&Bo(e)}function Ro(e,t,n){return n(function(){zo(t)&&Bo(e)})}function zo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!br(e,n)}catch{return!0}}function Bo(e){var t=$r(e,2);t!==null&&vu(t,e,2)}function Vo(e){var t=Eo();if(typeof e==`function`){var n=e;if(e=n(),fo){Ie(!0);try{n()}finally{Ie(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:jo,lastRenderedState:e},t}function Ho(e,t,n,r){return e.baseState=n,No(e,so,typeof r==`function`?r:jo)}function Uo(e,t,n,r,a){if(js(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};F.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Wo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Wo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=F.T,o={};F.T=o;try{var s=n(i,r),c=F.S;c!==null&&c(o,s),Go(e,t,s)}catch(n){qo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),F.T=a}}else try{a=n(i,r),Go(e,t,a)}catch(n){qo(e,t,n)}}function Go(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Ko(e,t,n)},function(n){return qo(e,t,n)}):Ko(e,t,n)}function Ko(e,t,n){t.status=`fulfilled`,t.value=n,Jo(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Wo(e,n)))}function qo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Jo(t),t=t.next;while(t!==r)}e.action=null}function Jo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Yo(e,t){return t}function Xo(e,t){if(ki){var n=Rl.formState;if(n!==null){a:{var r=K;if(ki){if(Oi){b:{for(var i=Oi,a=ji;i.nodeType!==8;){if(!a){i=null;break b}if(i=pf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Oi=pf(i.nextSibling),r=i.data===`F!`;break a}}Ni(r)}r=!1}r&&(t=n[0])}}return n=Eo(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yo,lastRenderedState:t},n.queue=r,n=Os.bind(null,K,r),r.dispatch=n,r=Vo(!1),a=As.bind(null,K,!1,r.queue),r=Eo(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Uo.bind(null,K,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Zo(e){return Qo(Do(),so,e)}function Qo(e,t,n){if(t=No(e,t,Yo)[0],e=Mo(jo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=ko(t)}catch(e){throw e===_a?ya:e}else r=t;t=Do();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(K.flags|=2048,ts(9,{destroy:void 0},$o.bind(null,i,n),null)),[r,a,e]}function $o(e,t){e.action=t}function es(e){var t=Do(),n=so;if(n!==null)return Qo(t,n,e);Do(),t=t.memoizedState,n=Do();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function ts(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=K.updateQueue,t===null&&(t=Oo(),K.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function ns(){return Do().memoizedState}function rs(e,t,n,r){var i=Eo();K.flags|=e,i.memoizedState=ts(1|t,{destroy:void 0},n,r===void 0?null:r)}function is(e,t,n,r){var i=Do();r=r===void 0?null:r;var a=i.memoizedState.inst;so!==null&&r!==null&&vo(r,so.memoizedState.deps)?i.memoizedState=ts(t,a,n,r):(K.flags|=e,i.memoizedState=ts(1|t,a,n,r))}function as(e,t){rs(8390656,8,e,t)}function os(e,t){is(2048,8,e,t)}function ss(e){K.flags|=4;var t=K.updateQueue;if(t===null)t=Oo(),K.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function cs(e){var t=Do().memoizedState;return ss({ref:t,nextImpl:e}),function(){if(Ll&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function ls(e,t){return is(4,2,e,t)}function us(e,t){return is(4,4,e,t)}function ds(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function fs(e,t,n){n=n==null?null:n.concat([e]),is(4,4,ds.bind(null,t,e),n)}function ps(){}function ms(e,t){var n=Do();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&vo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function hs(e,t){var n=Do();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&vo(t,r[1]))return r[0];if(r=e(),fo){Ie(!0);try{e()}finally{Ie(!1)}}return n.memoizedState=[r,t],r}function gs(e,t,n){return n===void 0||oo&1073741824&&!(Bl&261930)?e.memoizedState=t:(e.memoizedState=n,e=_u(),K.lanes|=e,Jl|=e,n)}function _s(e,t,n,r){return br(n,t)?n:Ka.current===null?!(oo&42)||oo&1073741824&&!(Bl&261930)?($s=!0,e.memoizedState=n):(e=_u(),K.lanes|=e,Jl|=e,t):(e=gs(e,n,r),br(e,t)||($s=!0),e)}function vs(e,t,n,r,i){var a=I.p;I.p=a!==0&&8>a?a:8;var o=F.T,s={};F.T=s,As(e,!1,t,n);try{var c=i(),l=F.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?ks(e,t,da(c,r),gu(e)):ks(e,t,r,gu(e))}catch(n){ks(e,t,{then:function(){},status:`rejected`,reason:n},gu())}finally{I.p=a,o!==null&&s.types!==null&&(o.types=s.types),F.T=o}}function ys(){}function bs(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=xs(e).queue;vs(e,a,t,te,n===null?ys:function(){return Ss(e),n(r)})}function xs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:te,baseState:te,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:jo,lastRenderedState:te},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:jo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ss(e){var t=xs(e);t.next===null&&(t=e.alternate.memoizedState),ks(e,t.next.queue,{},gu())}function Cs(){return Xi(np)}function ws(){return Do().memoizedState}function Ts(){return Do().memoizedState}function Es(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=gu();e=La(n);var r=Ra(t,e,n);r!==null&&(vu(r,t,n),za(r,t,n)),t={cache:ra()},e.payload=t;return}t=t.return}}function Ds(e,t,n){var r=gu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},js(e)?Ms(t,n):(n=Qr(e,t,n,r),n!==null&&(vu(n,e,r),Ns(n,t,r)))}function Os(e,t,n){ks(e,t,n,gu())}function ks(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(js(e))Ms(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,br(s,o))return Zr(e,t,i,0),Rl===null&&Xr(),!1}catch{}if(n=Qr(e,t,i,r),n!==null)return vu(n,e,r),Ns(n,t,r),!0}return!1}function As(e,t,n,r){if(r={lane:2,revertLane:hd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},js(e)){if(t)throw Error(i(479))}else t=Qr(e,n,r,2),t!==null&&vu(t,e,2)}function js(e){var t=e.alternate;return e===K||t!==null&&t===K}function Ms(e,t){uo=lo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ns(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,$e(e,n)}}var Ps={readContext:Xi,use:Ao,useCallback:_o,useContext:_o,useEffect:_o,useImperativeHandle:_o,useLayoutEffect:_o,useInsertionEffect:_o,useMemo:_o,useReducer:_o,useRef:_o,useState:_o,useDebugValue:_o,useDeferredValue:_o,useTransition:_o,useSyncExternalStore:_o,useId:_o,useHostTransitionStatus:_o,useFormState:_o,useActionState:_o,useOptimistic:_o,useMemoCache:_o,useCacheRefresh:_o};Ps.useEffectEvent=_o;var Fs={readContext:Xi,use:Ao,useCallback:function(e,t){return Eo().memoizedState=[e,t===void 0?null:t],e},useContext:Xi,useEffect:as,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),rs(4194308,4,ds.bind(null,t,e),n)},useLayoutEffect:function(e,t){return rs(4194308,4,e,t)},useInsertionEffect:function(e,t){rs(4,2,e,t)},useMemo:function(e,t){var n=Eo();t=t===void 0?null:t;var r=e();if(fo){Ie(!0);try{e()}finally{Ie(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Eo();if(n!==void 0){var i=n(t);if(fo){Ie(!0);try{n(t)}finally{Ie(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Ds.bind(null,K,e),[r.memoizedState,e]},useRef:function(e){var t=Eo();return e={current:e},t.memoizedState=e},useState:function(e){e=Vo(e);var t=e.queue,n=Os.bind(null,K,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ps,useDeferredValue:function(e,t){return gs(Eo(),e,t)},useTransition:function(){var e=Vo(!1);return e=vs.bind(null,K,e.queue,!0,!1),Eo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=K,a=Eo();if(ki){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Rl===null)throw Error(i(349));Bl&127||Io(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,as(Ro.bind(null,r,o,e),[e]),r.flags|=2048,ts(9,{destroy:void 0},Lo.bind(null,r,o,n,t),null),n},useId:function(){var e=Eo(),t=Rl.identifierPrefix;if(ki){var n=xi,r=bi;n=(r&~(1<<32-Le(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=po++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=go++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Cs,useFormState:Xo,useActionState:Xo,useOptimistic:function(e){var t=Eo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=As.bind(null,K,!0,n),n.dispatch=t,[e,t]},useMemoCache:q,useCacheRefresh:function(){return Eo().memoizedState=Es.bind(null,K)},useEffectEvent:function(e){var t=Eo(),n={impl:e};return t.memoizedState=n,function(){if(Ll&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Is={readContext:Xi,use:Ao,useCallback:ms,useContext:Xi,useEffect:os,useImperativeHandle:fs,useInsertionEffect:ls,useLayoutEffect:us,useMemo:hs,useReducer:Mo,useRef:ns,useState:function(){return Mo(jo)},useDebugValue:ps,useDeferredValue:function(e,t){return _s(Do(),so.memoizedState,e,t)},useTransition:function(){var e=Mo(jo)[0],t=Do().memoizedState;return[typeof e==`boolean`?e:ko(e),t]},useSyncExternalStore:Fo,useId:ws,useHostTransitionStatus:Cs,useFormState:Zo,useActionState:Zo,useOptimistic:function(e,t){return Ho(Do(),so,e,t)},useMemoCache:q,useCacheRefresh:Ts};Is.useEffectEvent=cs;var Ls={readContext:Xi,use:Ao,useCallback:ms,useContext:Xi,useEffect:os,useImperativeHandle:fs,useInsertionEffect:ls,useLayoutEffect:us,useMemo:hs,useReducer:Po,useRef:ns,useState:function(){return Po(jo)},useDebugValue:ps,useDeferredValue:function(e,t){var n=Do();return so===null?gs(n,e,t):_s(n,so.memoizedState,e,t)},useTransition:function(){var e=Po(jo)[0],t=Do().memoizedState;return[typeof e==`boolean`?e:ko(e),t]},useSyncExternalStore:Fo,useId:ws,useHostTransitionStatus:Cs,useFormState:es,useActionState:es,useOptimistic:function(e,t){var n=Do();return so===null?(n.baseState=e,[e,n.queue.dispatch]):Ho(n,so,e,t)},useMemoCache:q,useCacheRefresh:Ts};Ls.useEffectEvent=cs;function Rs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:m({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var zs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=gu(),i=La(r);i.payload=t,n!=null&&(i.callback=n),t=Ra(e,i,r),t!==null&&(vu(t,e,r),za(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=gu(),i=La(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ra(e,i,r),t!==null&&(vu(t,e,r),za(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=gu(),r=La(n);r.tag=2,t!=null&&(r.callback=t),t=Ra(e,r,n),t!==null&&(vu(t,e,n),za(t,e,n))}};function Bs(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!xr(n,r)||!xr(i,a):!0}function Vs(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&zs.enqueueReplaceState(t,t.state,null)}function Hs(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=m({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Us(e){Kr(e)}function Ws(e){console.error(e)}function Gs(e){Kr(e)}function Ks(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function qs(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Js(e,t,n){return n=La(n),n.tag=3,n.payload={element:null},n.callback=function(){Ks(e,t)},n}function Ys(e){return e=La(e),e.tag=3,e}function Xs(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){qs(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){qs(t,n,r),typeof i!=`function`&&(ou===null?ou=new Set([this]):ou.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Zs(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&qi(t,n,a,!0),n=Za.current,n!==null){switch(n.tag){case 31:case 13:return Qa===null?Au():n.alternate===null&&ql===0&&(ql=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===ba?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Yu(e,r,a)),!1;case 22:return n.flags|=65536,r===ba?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Yu(e,r,a)),!1}throw Error(i(435,n.tag))}return Yu(e,r,a),Au(),!1}if(ki)return t=Za.current,t===null?(r!==Mi&&(t=Error(i(423),{cause:r}),zi(pi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=pi(r,n),a=Js(e.stateNode,r,a),Ba(e,a),ql!==4&&(ql=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Mi&&(e=Error(i(422),{cause:r}),zi(pi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=pi(o,n),$l===null?$l=[o]:$l.push(o),ql!==4&&(ql=2),t===null)return!0;r=pi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Js(n.stateNode,r,e),Ba(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(ou===null||!ou.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Ys(a),Xs(a,e,n,r),Ba(n,a),!1}n=n.return}while(n!==null);return!1}var Qs=Error(i(461)),$s=!1;function ec(e,t,n,r){t.child=e===null?Na(t,null,n,r):Ma(t,e.child,n,r)}function tc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Yi(t),r=yo(e,t,n,o,a,i),s=Co(),e!==null&&!$s?(wo(e,t,i),Tc(e,t,i)):(ki&&s&&wi(t),t.flags|=1,ec(e,t,r,i),t.child)}function nc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ii(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,rc(e,t,a,r,i)):(e=si(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Ec(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?xr:n,n(o,r)&&e.ref===t.ref)return Tc(e,t,i)}return t.flags|=1,e=ai(a,r),e.ref=t.ref,e.return=t,t.child=e}function rc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(xr(a,r)&&e.ref===t.ref){if($s=!1,t.pendingProps=r=a,Ec(e,i))e.flags&131072&&($s=!0);else return t.lanes=e.lanes,Tc(e,t,i)}}return dc(e,t,n,r,i)}function ic(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return oc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ha(t,a===null?null:a.cachePool),a===null?Ya():Ja(t,a),to(t);else return r=t.lanes=536870912,oc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&ha(t,null),Ya(),no(t)):(ha(t,a.cachePool),Ja(t,a),no(t),t.memoizedState=null);return ec(e,t,i,n),t.child}function ac(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function oc(e,t,n,r,i){var a=ma();return a=a===null?null:{parent:na._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&ha(t,null),Ya(),to(t),e!==null&&qi(e,t,r,!0),t.childLanes=i,null}function sc(e,t){return t=bc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function cc(e,t,n){return Ma(t,e.child,null,n),e=sc(t,t.pendingProps),e.flags|=2,ro(t),t.memoizedState=null,e}function lc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(ki){if(r.mode===`hidden`)return e=sc(t,r),t.lanes=536870912,ac(null,e);if(eo(t),(e=Oi)?(e=lf(e,ji),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:yi===null?null:{id:bi,overflow:xi},retryLane:536870912,hydrationErrors:null},n=ui(e),n.return=t,t.child=n,Di=t,Oi=null)):e=null,e===null)throw Ni(t);return t.lanes=536870912,null}return sc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(eo(t),a){if(t.flags&256)t.flags&=-257,t=cc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if($s||qi(e,t,n,!1),a=(n&e.childLanes)!==0,$s||a){if(r=Rl,r!==null&&(s=et(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,$r(e,s),vu(r,e,s),Qs;Au(),t=cc(e,t,n)}else e=o.treeContext,Oi=pf(s.nextSibling),Di=t,ki=!0,Ai=null,ji=!1,e!==null&&Ei(t,e),t=sc(t,r),t.flags|=4096;return t}return e=ai(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function uc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function dc(e,t,n,r,i){return Yi(t),n=yo(e,t,n,r,void 0,i),r=Co(),e!==null&&!$s?(wo(e,t,i),Tc(e,t,i)):(ki&&r&&wi(t),t.flags|=1,ec(e,t,n,i),t.child)}function fc(e,t,n,r,i,a){return Yi(t),t.updateQueue=null,n=xo(t,r,n,i),bo(e),r=Co(),e!==null&&!$s?(wo(e,t,a),Tc(e,t,a)):(ki&&r&&wi(t),t.flags|=1,ec(e,t,n,a),t.child)}function pc(e,t,n,r,i){if(Yi(t),t.stateNode===null){var a=U,o=n.contextType;typeof o==`object`&&o&&(a=Xi(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=zs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Fa(t),o=n.contextType,a.context=typeof o==`object`&&o?Xi(o):U,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Rs(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&zs.enqueueReplaceState(a,a.state,null),Ua(t,r,a,i),Ha(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Hs(n,s);a.props=c;var l=a.context,u=n.contextType;o=U,typeof u==`object`&&u&&(o=Xi(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Vs(t,a,r,o),Pa=!1;var f=t.memoizedState;a.state=f,Ua(t,r,a,i),Ha(),l=t.memoizedState,s||f!==l||Pa?(typeof d==`function`&&(Rs(t,n,d,r),l=t.memoizedState),(c=Pa||Bs(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Ia(e,t),o=t.memoizedProps,u=Hs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=U,typeof l==`object`&&l&&(c=Xi(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Vs(t,a,r,c),Pa=!1,f=t.memoizedState,a.state=f,Ua(t,r,a,i),Ha();var p=t.memoizedState;o!==d||f!==p||Pa||e!==null&&e.dependencies!==null&&Ji(e.dependencies)?(typeof s==`function`&&(Rs(t,n,s,r),p=t.memoizedState),(u=Pa||Bs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Ji(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,uc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Ma(t,e.child,null,i),t.child=Ma(t,null,n,i)):ec(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Tc(e,t,i),e}function mc(e,t,n,r){return Li(),t.flags|=256,ec(e,t,n,r),t.child}var hc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function gc(e){return{baseLanes:e,cachePool:ga()}}function _c(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Zl),e}function vc(e,t,n){var r=t.pendingProps,a=!1,o=!!(t.flags&128),s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:!!(io.current&2)),s&&(a=!0,t.flags&=-129),s=!!(t.flags&32),t.flags&=-33,e===null){if(ki){if(a?$a(t):no(t),(e=Oi)?(e=lf(e,ji),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:yi===null?null:{id:bi,overflow:xi},retryLane:536870912,hydrationErrors:null},n=ui(e),n.return=t,t.child=n,Di=t,Oi=null)):e=null,e===null)throw Ni(t);return df(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(no(t),a=t.mode,c=bc({mode:`hidden`,children:c},a),r=ci(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=gc(n),r.childLanes=_c(e,s,n),t.memoizedState=hc,ac(null,r)):($a(t),yc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?($a(t),t.flags&=-257,t=xc(e,t,n)):t.memoizedState===null?(no(t),c=r.fallback,a=t.mode,r=bc({mode:`visible`,children:r.children},a),c=ci(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Ma(t,e.child,null,n),r=t.child,r.memoizedState=gc(n),r.childLanes=_c(e,s,n),t.memoizedState=hc,t=ac(null,r)):(no(t),t.child=e.child,t.flags|=128,t=null);else if($a(t),df(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,zi({value:r,source:null,stack:null}),t=xc(e,t,n)}else if($s||qi(e,t,n,!1),s=(n&e.childLanes)!==0,$s||s){if(s=Rl,s!==null&&(r=et(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,$r(e,r),vu(s,e,r),Qs;uf(c)||Au(),t=xc(e,t,n)}else uf(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Oi=pf(c.nextSibling),Di=t,ki=!0,Ai=null,ji=!1,e!==null&&Ei(t,e),t=yc(t,r.children),t.flags|=4096);return t}return a?(no(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=ai(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=ci(c,a,n,null),c.flags|=2):c=ai(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,ac(null,r),r=t.child,c=e.child.memoizedState,c===null?c=gc(n):(a=c.cachePool,a===null?a=ga():(l=na._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=_c(e,s,n),t.memoizedState=hc,ac(e.child,r)):($a(t),n=e.child,e=n.sibling,n=ai(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function yc(e,t){return t=bc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function bc(e,t){return e=ri(22,e,null,t),e.lanes=0,e}function xc(e,t,n){return Ma(t,e.child,null,n),e=yc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Sc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Gi(e.return,t,n)}function Cc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function wc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=io.current,s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,ie(io,o),ec(e,t,r,n),r=ki?W:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Sc(e,n,t);else if(e.tag===19)Sc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&ao(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Cc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&ao(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Cc(t,!0,n,null,a,r);break;case`together`:Cc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Tc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Jl|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(qi(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=ai(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ai(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Ec(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&Ji(e)))}function Dc(e,t,n){switch(t.tag){case 3:le(t,t.stateNode.containerInfo),Ui(t,na,e.memoizedState.cache),Li();break;case 27:case 5:de(t);break;case 4:le(t,t.stateNode.containerInfo);break;case 10:Ui(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,eo(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?($a(t),e=Tc(e,t,n),e===null?null:e.sibling):vc(e,t,n):($a(t),t.flags|=128,null);$a(t);break;case 19:var i=!!(e.flags&128);if(r=(n&t.childLanes)!==0,r||=(qi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return wc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),ie(io,io.current),r)break;return null;case 22:return t.lanes=0,ic(e,t,n,t.pendingProps);case 24:Ui(t,na,e.memoizedState.cache)}return Tc(e,t,n)}function Oc(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)$s=!0;else{if(!Ec(e,n)&&!(t.flags&128))return $s=!1,Dc(e,t,n);$s=!!(e.flags&131072)}}else $s=!1,ki&&t.flags&1048576&&Ci(t,W,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=G(t.elementType),t.type=e,typeof e==`function`)ii(e)?(r=Hs(e,r),t.tag=1,t=pc(null,t,e,r,n)):(t.tag=0,t=dc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=tc(null,t,e,r,n);break a}if(a===D){t.tag=14,t=nc(null,t,e,r,n);break a}}throw t=P(e)||e,Error(i(306,t,``))}}return t;case 0:return dc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Hs(r,t.pendingProps),pc(e,t,r,a,n);case 3:a:{if(le(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Ia(e,t),Ua(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Ui(t,na,r),r!==o.cache&&Ki(t,[na],n,!0),Ha(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=mc(e,t,r,n);break a}if(r!==a){a=pi(Error(i(424)),t),zi(a),t=mc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Oi=pf(e.firstChild),Di=t,ki=!0,Ai=null,ji=!0,n=Na(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Li(),r===a){t=Tc(e,t,n);break a}ec(e,t,r,n)}t=t.child}return t;case 26:return uc(e,t),e===null?(n=Pf(t.type,null,t.pendingProps,null))?t.memoizedState=n:ki||(n=t.type,e=t.pendingProps,r=Kd(se.current).createElement(n),r[ot]=t,r[st]=e,Bd(r,n,e),yt(r),t.stateNode=r):t.memoizedState=Pf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return de(t),e===null&&ki&&(r=t.stateNode=_f(t.type,t.pendingProps,se.current),Di=t,ji=!0,a=Oi,nf(t.type)?(mf=a,Oi=pf(r.firstChild)):Oi=a),ec(e,t,t.pendingProps.children,n),uc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ki&&((a=r=Oi)&&(r=sf(r,t.type,t.pendingProps,ji),r===null?a=!1:(t.stateNode=r,Di=t,Oi=pf(r.firstChild),ji=!1,a=!0)),a||Ni(t)),de(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Yd(a,o)?r=null:s!==null&&Yd(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=yo(e,t,So,null,null,n),np._currentValue=a),uc(e,t),ec(e,t,r,n),t.child;case 6:return e===null&&ki&&((e=n=Oi)&&(n=cf(n,t.pendingProps,ji),n===null?e=!1:(t.stateNode=n,Di=t,Oi=null,e=!0)),e||Ni(t)),null;case 13:return vc(e,t,n);case 4:return le(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ma(t,null,r,n):ec(e,t,r,n),t.child;case 11:return tc(e,t,t.type,t.pendingProps,n);case 7:return ec(e,t,t.pendingProps,n),t.child;case 8:return ec(e,t,t.pendingProps.children,n),t.child;case 12:return ec(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Ui(t,t.type,r.value),ec(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,Yi(t),a=Xi(a),r=r(a),t.flags|=1,ec(e,t,r,n),t.child;case 14:return nc(e,t,t.type,t.pendingProps,n);case 15:return rc(e,t,t.type,t.pendingProps,n);case 19:return wc(e,t,n);case 31:return lc(e,t,n);case 22:return ic(e,t,n,t.pendingProps);case 24:return Yi(t),r=Xi(na),e===null?(a=ma(),a===null&&(a=Rl,o=ra(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Fa(t),Ui(t,na,a)):((e.lanes&n)!==0&&(Ia(e,t),Ua(t,null,null,n),Ha()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Ui(t,na,r),r!==a.cache&&Ki(t,[na],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Ui(t,na,r))),ec(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function kc(e){e.flags|=4}function Ac(e,t,n,r,i){if((t=!!(e.mode&32))&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Du())e.flags|=8192;else throw Ca=ba,va}}else e.flags&=-16777217}function jc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Jf(t)){if(Du())e.flags|=8192;else throw Ca=ba,va}}function Mc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Je(),e.lanes|=t,Ql|=t)}function Nc(e,t){if(!ki)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Pc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Fc(e,t,n){var r=t.pendingProps;switch(Ti(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Pc(t),null;case 1:return Pc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Wi(na),ue(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Ii(t)?kc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ri())),Pc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(kc(t),o===null?(Pc(t),Ac(t,a,null,r,n)):(Pc(t),jc(t,o))):o?o===e.memoizedState?(Pc(t),t.flags&=-16777217):(kc(t),Pc(t),jc(t,o)):(e=e.memoizedProps,e!==r&&kc(t),Pc(t),Ac(t,a,e,r,n)),null;case 27:if(fe(t),n=se.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&kc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Pc(t),null}e=ae.current,Ii(t)?Pi(t,e):(e=_f(a,r,n),t.stateNode=e,kc(t))}return Pc(t),null;case 5:if(fe(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&kc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Pc(t),null}if(o=ae.current,Ii(t))Pi(t,o);else{var s=Kd(se.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[ot]=t,o[st]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Bd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&kc(t)}}return Pc(t),Ac(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&kc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=se.current,Ii(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Di,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[ot]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Ld(e.nodeValue,n)),e||Ni(t,!0)}else e=Kd(e).createTextNode(r),e[ot]=t,t.stateNode=e}return Pc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Ii(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[ot]=t}else Li(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Pc(t),e=!1}else n=Ri(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(ro(t),t):(ro(t),null);if(t.flags&128)throw Error(i(558))}return Pc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Ii(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[ot]=t}else Li(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Pc(t),a=!1}else a=Ri(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(ro(t),t):(ro(t),null)}return ro(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Mc(t,t.updateQueue),Pc(t),null);case 4:return ue(),e===null&&Dd(t.stateNode.containerInfo),Pc(t),null;case 10:return Wi(t.type),Pc(t),null;case 19:if(R(io),r=t.memoizedState,r===null)return Pc(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)Nc(r,!1);else{if(ql!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=ao(e),o!==null){for(t.flags|=128,Nc(r,!1),e=o.updateQueue,t.updateQueue=e,Mc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)oi(n,e),n=n.sibling;return ie(io,io.current&1|2),ki&&Si(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Te()>iu&&(t.flags|=128,a=!0,Nc(r,!1),t.lanes=4194304)}}else{if(!a){if(e=ao(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Mc(t,e),Nc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!ki)return Pc(t),null}else 2*Te()-r.renderingStartTime>iu&&n!==536870912&&(t.flags|=128,a=!0,Nc(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Pc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Te(),e.sibling=null,n=io.current,ie(io,a?n&1|2:n&1),ki&&Si(t,r.treeForkCount),e);case 22:case 23:return ro(t),Xa(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Pc(t),t.subtreeFlags&6&&(t.flags|=8192)):Pc(t),n=t.updateQueue,n!==null&&Mc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&R(pa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Wi(na),Pc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Ic(e,t){switch(Ti(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Wi(na),ue(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return fe(t),null;case 31:if(t.memoizedState!==null){if(ro(t),t.alternate===null)throw Error(i(340));Li()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ro(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Li()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return R(io),null;case 4:return ue(),null;case 10:return Wi(t.type),null;case 22:case 23:return ro(t),Xa(),e!==null&&R(pa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Wi(na),null;case 25:return null;default:return null}}function Lc(e,t){switch(Ti(t),t.tag){case 3:Wi(na),ue();break;case 26:case 27:case 5:fe(t);break;case 4:ue();break;case 31:t.memoizedState!==null&&ro(t);break;case 13:ro(t);break;case 19:R(io);break;case 10:Wi(t.type);break;case 22:case 23:ro(t),Xa(),e!==null&&R(pa);break;case 24:Wi(na)}}function Rc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Ju(t,t.return,e)}}function zc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Ju(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Ju(t,t.return,e)}}function Bc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ga(t,n)}catch(t){Ju(e,e.return,t)}}}function Vc(e,t,n){n.props=Hs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Ju(e,t,n)}}function Hc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Ju(e,t,n)}}function Uc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){Ju(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Ju(e,t,n)}else n.current=null}}function Wc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Ju(e,e.return,t)}}function Gc(e,t,n){try{var r=e.stateNode;Vd(r,e.type,n,t),r[st]=t}catch(t){Ju(e,e.return,t)}}function Kc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&nf(e.type)||e.tag===4}function qc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Kc(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.tag===27&&nf(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Jc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=$t));else if(r!==4&&(r===27&&nf(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Jc(e,t,n),e=e.sibling;e!==null;)Jc(e,t,n),e=e.sibling}function Yc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&nf(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Yc(e,t,n),e=e.sibling;e!==null;)Yc(e,t,n),e=e.sibling}function Xc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Bd(t,r,n),t[ot]=e,t[st]=n}catch(t){Ju(e,e.return,t)}}var Zc=!1,Qc=!1,$c=!1,el=typeof WeakSet==`function`?WeakSet:Set,tl=null;function nl(e,t){if(e=e.containerInfo,Wd=dp,e=Tr(e),Er(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Gd={focusedElem:e,selectionRange:n},dp=!1,tl=t;tl!==null;)if(t=tl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,tl=e;else for(;tl!==null;){switch(t=tl,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Hs(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Ju(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)of(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:of(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,tl=e;break}tl=t.return}}function rl(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:vl(e,n),r&4&&Rc(5,n);break;case 1:if(vl(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Ju(n,n.return,e)}else{var i=Hs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Ju(n,n.return,e)}}}r&64&&Bc(n),r&512&&Hc(n,n.return);break;case 3:if(vl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Ga(e,t)}catch(e){Ju(n,n.return,e)}}break;case 27:t===null&&r&4&&Xc(n);case 26:case 5:vl(e,n),t===null&&r&4&&Wc(n),r&512&&Hc(n,n.return);break;case 12:vl(e,n);break;case 31:vl(e,n),r&4&&ll(e,n);break;case 13:vl(e,n),r&4&&ul(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Qu.bind(null,n),ff(e,n))));break;case 22:if(r=n.memoizedState!==null||Zc,!r){t=t!==null&&t.memoizedState!==null||Qc,i=Zc;var a=Qc;Zc=r,(Qc=t)&&!a?bl(e,n,!!(n.subtreeFlags&8772)):vl(e,n),Zc=i,Qc=a}break;case 30:break;default:vl(e,n)}}function il(e){var t=e.alternate;t!==null&&(e.alternate=null,il(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&mt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var al=null,ol=!1;function sl(e,t,n){for(n=n.child;n!==null;)cl(e,t,n),n=n.sibling}function cl(e,t,n){if(Fe&&typeof Fe.onCommitFiberUnmount==`function`)try{Fe.onCommitFiberUnmount(Pe,n)}catch{}switch(n.tag){case 26:Qc||Uc(n,t),sl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Qc||Uc(n,t);var r=al,i=ol;nf(n.type)&&(al=n.stateNode,ol=!1),sl(e,t,n),vf(n.stateNode),al=r,ol=i;break;case 5:Qc||Uc(n,t);case 6:if(r=al,i=ol,al=null,sl(e,t,n),al=r,ol=i,al!==null){if(ol)try{(al.nodeType===9?al.body:al.nodeName===`HTML`?al.ownerDocument.body:al).removeChild(n.stateNode)}catch(e){Ju(n,t,e)}else try{al.removeChild(n.stateNode)}catch(e){Ju(n,t,e)}}break;case 18:al!==null&&(ol?(e=al,rf(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Lp(e)):rf(al,n.stateNode));break;case 4:r=al,i=ol,al=n.stateNode.containerInfo,ol=!0,sl(e,t,n),al=r,ol=i;break;case 0:case 11:case 14:case 15:zc(2,n,t),Qc||zc(4,n,t),sl(e,t,n);break;case 1:Qc||(Uc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Vc(n,t,r)),sl(e,t,n);break;case 21:sl(e,t,n);break;case 22:Qc=(r=Qc)||n.memoizedState!==null,sl(e,t,n),Qc=r;break;default:sl(e,t,n)}}function ll(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Lp(e)}catch(e){Ju(t,t.return,e)}}}function ul(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Lp(e)}catch(e){Ju(t,t.return,e)}}function dl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new el),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new el),t;default:throw Error(i(435,e.tag))}}function fl(e,t){var n=dl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=$u.bind(null,e,t);t.then(r,r)}})}function pl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(nf(c.type)){al=c.stateNode,ol=!1;break a}break;case 5:al=c.stateNode,ol=!1;break a;case 3:case 4:al=c.stateNode.containerInfo,ol=!0;break a}c=c.return}if(al===null)throw Error(i(160));cl(o,s,a),al=null,ol=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)hl(t,e),t=t.sibling}var ml=null;function hl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:pl(t,e),gl(e),r&4&&(zc(3,e,e.return),Rc(3,e),zc(5,e,e.return));break;case 1:pl(t,e),gl(e),r&512&&(Qc||n===null||Uc(n,n.return)),r&64&&Zc&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=ml;if(pl(t,e),gl(e),r&512&&(Qc||n===null||Uc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null){if(r===null){if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[pt]||o[ot]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Bd(o,r,n),o[ot]=e,yt(o),r=o;break a;case`link`:var s=Gf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Bd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Gf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Bd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[ot]=e,yt(o),r=o}e.stateNode=r}else Kf(a,e.type,e.stateNode)}else e.stateNode=Bf(a,r,e.memoizedProps)}else o===r?r===null&&e.stateNode!==null&&Gc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Kf(a,e.type,e.stateNode):Bf(a,r,e.memoizedProps))}break;case 27:pl(t,e),gl(e),r&512&&(Qc||n===null||Uc(n,n.return)),n!==null&&r&4&&Gc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(pl(t,e),gl(e),r&512&&(Qc||n===null||Uc(n,n.return)),e.flags&32){a=e.stateNode;try{Gt(a,``)}catch(t){Ju(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Gc(e,a,n===null?a:n.memoizedProps)),r&1024&&($c=!0);break;case 6:if(pl(t,e),gl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Ju(e,e.return,t)}}break;case 3:if(Wf=null,a=ml,ml=xf(t.containerInfo),pl(t,e),ml=a,gl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Lp(t.containerInfo)}catch(t){Ju(e,e.return,t)}$c&&($c=!1,_l(e));break;case 4:r=ml,ml=xf(e.stateNode.containerInfo),pl(t,e),gl(e),ml=r;break;case 12:pl(t,e),gl(e);break;case 31:pl(t,e),gl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,fl(e,r)));break;case 13:pl(t,e),gl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(nu=Te()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,fl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=Zc,d=Qc;if(Zc=u||a,Qc=d||l,pl(t,e),Qc=d,Zc=u,gl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||Zc||Qc||yl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Ju(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Ju(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?af(m,!0):af(l.stateNode,!1)}catch(e){Ju(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,fl(e,n))));break;case 19:pl(t,e),gl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,fl(e,r)));break;case 30:break;case 21:break;default:pl(t,e),gl(e)}}function gl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Kc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;Yc(e,qc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Gt(o,``),n.flags&=-33),Yc(e,qc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Jc(e,qc(e),s);break;default:throw Error(i(161))}}catch(t){Ju(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function _l(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;_l(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function vl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)rl(e,t.alternate,t),t=t.sibling}function yl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:zc(4,t,t.return),yl(t);break;case 1:Uc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Vc(t,t.return,n),yl(t);break;case 27:vf(t.stateNode);case 26:case 5:Uc(t,t.return),yl(t);break;case 22:t.memoizedState===null&&yl(t);break;case 30:yl(t);break;default:yl(t)}e=e.sibling}}function bl(e,t,n){for(n&&=!!(t.subtreeFlags&8772),t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:bl(i,a,n),Rc(4,a);break;case 1:if(bl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Ju(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Wa(c[i],s)}catch(e){Ju(r,r.return,e)}}n&&o&64&&Bc(a),Hc(a,a.return);break;case 27:Xc(a);case 26:case 5:bl(i,a,n),n&&r===null&&o&4&&Wc(a),Hc(a,a.return);break;case 12:bl(i,a,n);break;case 31:bl(i,a,n),n&&o&4&&ll(i,a);break;case 13:bl(i,a,n),n&&o&4&&ul(i,a);break;case 22:a.memoizedState===null&&bl(i,a,n),Hc(a,a.return);break;case 30:break;default:bl(i,a,n)}t=t.sibling}}function xl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&ia(n))}function Sl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ia(e))}function Cl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)wl(e,t,n,r),t=t.sibling}function wl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Cl(e,t,n,r),i&2048&&Rc(9,t);break;case 1:Cl(e,t,n,r);break;case 3:Cl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ia(e)));break;case 12:if(i&2048){Cl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Ju(t,t.return,e)}}else Cl(e,t,n,r);break;case 31:Cl(e,t,n,r);break;case 13:Cl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Cl(e,t,n,r):(a._visibility|=2,Tl(e,t,n,r,!!(t.subtreeFlags&10256)||!1)):a._visibility&2?Cl(e,t,n,r):El(e,t),i&2048&&xl(o,t);break;case 24:Cl(e,t,n,r),i&2048&&Sl(t.alternate,t);break;default:Cl(e,t,n,r)}}function Tl(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Tl(a,o,s,c,i),Rc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Tl(a,o,s,c,i)):u._visibility&2?Tl(a,o,s,c,i):El(a,o),i&&l&2048&&xl(o.alternate,o);break;case 24:Tl(a,o,s,c,i),i&&l&2048&&Sl(o.alternate,o);break;default:Tl(a,o,s,c,i)}t=t.sibling}}function El(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:El(n,r),i&2048&&xl(r.alternate,r);break;case 24:El(n,r),i&2048&&Sl(r.alternate,r);break;default:El(n,r)}t=t.sibling}}var Dl=8192;function Ol(e,t,n){if(e.subtreeFlags&Dl)for(e=e.child;e!==null;)kl(e,t,n),e=e.sibling}function kl(e,t,n){switch(e.tag){case 26:Ol(e,t,n),e.flags&Dl&&e.memoizedState!==null&&Yf(n,ml,e.memoizedState,e.memoizedProps);break;case 5:Ol(e,t,n);break;case 3:case 4:var r=ml;ml=xf(e.stateNode.containerInfo),Ol(e,t,n),ml=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Dl,Dl=16777216,Ol(e,t,n),Dl=r):Ol(e,t,n));break;default:Ol(e,t,n)}}function Al(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function jl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];tl=r,Pl(r,e)}Al(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ml(e),e=e.sibling}function Ml(e){switch(e.tag){case 0:case 11:case 15:jl(e),e.flags&2048&&zc(9,e,e.return);break;case 3:jl(e);break;case 12:jl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Nl(e)):jl(e);break;default:jl(e)}}function Nl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];tl=r,Pl(r,e)}Al(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:zc(8,t,t.return),Nl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Nl(t));break;default:Nl(t)}e=e.sibling}}function Pl(e,t){for(;tl!==null;){var n=tl;switch(n.tag){case 0:case 11:case 15:zc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:ia(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,tl=r;else a:for(n=e;tl!==null;){r=tl;var i=r.sibling,a=r.return;if(il(r),r===n){tl=null;break a}if(i!==null){i.return=a,tl=i;break a}tl=a}}}var Fl={getCacheForType:function(e){var t=Xi(na),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Xi(na).controller.signal}},Il=typeof WeakMap==`function`?WeakMap:Map,Ll=0,Rl=null,zl=null,Bl=0,Vl=0,Hl=null,Ul=!1,Wl=!1,Gl=!1,Kl=0,ql=0,Jl=0,Yl=0,Xl=0,Zl=0,Ql=0,$l=null,eu=null,tu=!1,nu=0,ru=0,iu=1/0,au=null,ou=null,su=0,cu=null,lu=null,uu=0,du=0,fu=null,pu=null,mu=0,hu=null;function gu(){return Ll&2&&Bl!==0?Bl&-Bl:F.T===null?rt():hd()}function _u(){if(Zl===0){if(!(Bl&536870912)||ki){var e=He;He<<=1,!(He&3932160)&&(He=262144),Zl=e}else Zl=536870912}return e=Za.current,e!==null&&(e.flags|=32),Zl}function vu(e,t,n){(e===Rl&&(Vl===2||Vl===9)||e.cancelPendingCommit!==null)&&(Tu(e,0),Su(e,Bl,Zl,!1)),Xe(e,n),(!(Ll&2)||e!==Rl)&&(e===Rl&&(!(Ll&2)&&(Yl|=n),ql===4&&Su(e,Bl,Zl,!1)),sd(e))}function yu(e,t,n){if(Ll&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||Ke(e,t),a=r?Nu(e,t):ju(e,t,!0),o=r;do{if(a===0){Wl&&!r&&Su(e,t,0,!1);break}if(n=e.current.alternate,o&&!xu(n)){a=ju(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=$l;var l=c.current.memoizedState.isDehydrated;if(l&&(Tu(c,s).flags|=256),s=ju(c,s,!1),s!==2){if(Gl&&!l){c.errorRecoveryDisabledLanes|=o,Yl|=o,a=4;break a}o=eu,eu=a,o!==null&&(eu===null?eu=o:eu.push.apply(eu,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Tu(e,0),Su(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:Su(r,t,Zl,!Ul);break a;case 2:eu=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=nu+300-Te(),10<a)){if(Su(r,t,Zl,!Ul),Ge(r,0,!0)!==0)break a;uu=t,r.timeoutHandle=J(bu.bind(null,r,n,eu,au,tu,t,Zl,Yl,Ql,Ul,o,`Throttled`,-0,0),a);break a}bu(r,n,eu,au,tu,t,Zl,Yl,Ql,Ul,o,null,-0,0)}break}while(1);sd(e)}function bu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:$t},kl(t,a,d);var m=(a&62914560)===a?nu-Te():(a&4194048)===a?ru-Te():0;if(m=Zf(d,m),m!==null){uu=a,e.cancelPendingCommit=m(Bu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),Su(e,a,o,!l);return}}Bu(e,t,a,n,r,i,o,s,c)}function xu(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!br(a(),i))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 Su(e,t,n,r){t&=~Xl,t&=~Yl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Le(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&Qe(e,n,t)}function Cu(){return Ll&6?!0:(cd(0,!1),!1)}function wu(){if(zl!==null){if(Vl===0)var e=zl.return;else e=zl,Hi=Vi=null,To(e),Ea=null,Da=0,e=zl;for(;e!==null;)Lc(e.alternate,e),e=e.return;zl=null}}function Tu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Qd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),uu=0,wu(),Rl=e,zl=n=ai(e.current,null),Bl=t,Vl=0,Hl=null,Ul=!1,Wl=Ke(e,t),Gl=!1,Ql=Zl=Xl=Yl=Jl=ql=0,eu=$l=null,tu=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Le(r),a=1<<i;t|=e[i],r&=~a}return Kl=t,Xr(),n}function Eu(e,t){K=null,F.H=Ps,t===_a||t===ya?(t=wa(),Vl=3):t===va?(t=wa(),Vl=4):Vl=t===Qs?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Hl=t,zl===null&&(ql=1,Ks(e,pi(t,e.current)))}function Du(){var e=Za.current;return e===null?!0:(Bl&4194048)===Bl?Qa===null:(Bl&62914560)===Bl||Bl&536870912?e===Qa:!1}function Ou(){var e=F.H;return F.H=Ps,e===null?Ps:e}function ku(){var e=F.A;return F.A=Fl,e}function Au(){ql=4,Ul||(Bl&4194048)!==Bl&&Za.current!==null||(Wl=!0),!(Jl&134217727)&&!(Yl&134217727)||Rl===null||Su(Rl,Bl,Zl,!1)}function ju(e,t,n){var r=Ll;Ll|=2;var i=Ou(),a=ku();(Rl!==e||Bl!==t)&&(au=null,Tu(e,t)),t=!1;var o=ql;a:do try{if(Vl!==0&&zl!==null){var s=zl,c=Hl;switch(Vl){case 8:wu(),o=6;break a;case 3:case 2:case 9:case 6:Za.current===null&&(t=!0);var l=Vl;if(Vl=0,Hl=null,Lu(e,s,c,l),n&&Wl){o=0;break a}break;default:l=Vl,Vl=0,Hl=null,Lu(e,s,c,l)}}Mu(),o=ql;break}catch(t){Eu(e,t)}while(1);return t&&e.shellSuspendCounter++,Hi=Vi=null,Ll=r,F.H=i,F.A=a,zl===null&&(Rl=null,Bl=0,Xr()),o}function Mu(){for(;zl!==null;)Fu(zl)}function Nu(e,t){var n=Ll;Ll|=2;var r=Ou(),a=ku();Rl!==e||Bl!==t?(au=null,iu=Te()+500,Tu(e,t)):Wl=Ke(e,t);a:do try{if(Vl!==0&&zl!==null){t=zl;var o=Hl;b:switch(Vl){case 1:Vl=0,Hl=null,Lu(e,t,o,1);break;case 2:case 9:if(xa(o)){Vl=0,Hl=null,Iu(t);break}t=function(){Vl!==2&&Vl!==9||Rl!==e||(Vl=7),sd(e)},o.then(t,t);break a;case 3:Vl=7;break a;case 4:Vl=5;break a;case 7:xa(o)?(Vl=0,Hl=null,Iu(t)):(Vl=0,Hl=null,Lu(e,t,o,7));break;case 5:var s=null;switch(zl.tag){case 26:s=zl.memoizedState;case 5:case 27:var c=zl;if(s?Jf(s):c.stateNode.complete){Vl=0,Hl=null;var l=c.sibling;if(l!==null)zl=l;else{var u=c.return;u===null?zl=null:(zl=u,Ru(u))}break b}}Vl=0,Hl=null,Lu(e,t,o,5);break;case 6:Vl=0,Hl=null,Lu(e,t,o,6);break;case 8:wu(),ql=6;break a;default:throw Error(i(462))}}Pu();break}catch(t){Eu(e,t)}while(1);return Hi=Vi=null,F.H=r,F.A=a,Ll=n,zl===null?(Rl=null,Bl=0,Xr(),ql):0}function Pu(){for(;zl!==null&&!Ce();)Fu(zl)}function Fu(e){var t=Oc(e.alternate,e,Kl);e.memoizedProps=e.pendingProps,t===null?Ru(e):zl=t}function Iu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=fc(n,t,t.pendingProps,t.type,void 0,Bl);break;case 11:t=fc(n,t,t.pendingProps,t.type.render,t.ref,Bl);break;case 5:To(t);default:Lc(n,t),t=zl=oi(t,Kl),t=Oc(n,t,Kl)}e.memoizedProps=e.pendingProps,t===null?Ru(e):zl=t}function Lu(e,t,n,r){Hi=Vi=null,To(t),Ea=null,Da=0;var i=t.return;try{if(Zs(e,i,t,n,Bl)){ql=1,Ks(e,pi(n,e.current)),zl=null;return}}catch(t){if(i!==null)throw zl=i,t;ql=1,Ks(e,pi(n,e.current)),zl=null;return}t.flags&32768?(ki||r===1?e=!0:Wl||Bl&536870912?e=!1:(Ul=e=!0,(r===2||r===9||r===3||r===6)&&(r=Za.current,r!==null&&r.tag===13&&(r.flags|=16384))),zu(t,e)):Ru(t)}function Ru(e){var t=e;do{if(t.flags&32768){zu(t,Ul);return}e=t.return;var n=Fc(t.alternate,t,Kl);if(n!==null){zl=n;return}if(t=t.sibling,t!==null){zl=t;return}zl=t=e}while(t!==null);ql===0&&(ql=5)}function zu(e,t){do{var n=Ic(e.alternate,e);if(n!==null){n.flags&=32767,zl=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){zl=e;return}zl=e=n}while(e!==null);ql=6,zl=null}function Bu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Gu();while(su!==0);if(Ll&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=Yr,Ze(e,n,o,s,c,l),e===Rl&&(zl=Rl=null,Bl=0),lu=t,cu=e,uu=n,du=o,fu=a,pu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,ed(ke,function(){return Ku(),null})):(e.callbackNode=null,e.callbackPriority=0),r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=F.T,F.T=null,a=I.p,I.p=2,s=Ll,Ll|=4;try{nl(e,t,n)}finally{Ll=s,I.p=a,F.T=r}}su=1,Vu(),Hu(),Uu()}}function Vu(){if(su===1){su=0;var e=cu,t=lu,n=!!(t.flags&13878);if(t.subtreeFlags&13878||n){n=F.T,F.T=null;var r=I.p;I.p=2;var i=Ll;Ll|=4;try{hl(t,e);var a=Gd,o=Tr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&wr(s.ownerDocument.documentElement,s)){if(c!==null&&Er(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Cr(s,h),v=Cr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}dp=!!Wd,Gd=Wd=null}finally{Ll=i,I.p=r,F.T=n}}e.current=t,su=2}}function Hu(){if(su===2){su=0;var e=cu,t=lu,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=F.T,F.T=null;var r=I.p;I.p=2;var i=Ll;Ll|=4;try{rl(e,t.alternate,t)}finally{Ll=i,I.p=r,F.T=n}}su=3}}function Uu(){if(su===4||su===3){su=0,we();var e=cu,t=lu,n=uu,r=pu;t.subtreeFlags&10256||t.flags&10256?su=5:(su=0,lu=cu=null,Wu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(ou=null),nt(n),t=t.stateNode,Fe&&typeof Fe.onCommitFiberRoot==`function`)try{Fe.onCommitFiberRoot(Pe,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=F.T,i=I.p,I.p=2,F.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{F.T=t,I.p=i}}uu&3&&Gu(),sd(e),i=e.pendingLanes,n&261930&&i&42?e===hu?mu++:(mu=0,hu=e):mu=0,cd(0,!1)}}function Wu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ia(t)))}function Gu(){return Vu(),Hu(),Uu(),Ku()}function Ku(){if(su!==5)return!1;var e=cu,t=du;du=0;var n=nt(uu),r=F.T,a=I.p;try{I.p=32>n?32:n,F.T=null,n=fu,fu=null;var o=cu,s=uu;if(su=0,lu=cu=null,uu=0,Ll&6)throw Error(i(331));var c=Ll;if(Ll|=4,Ml(o.current),wl(o,o.current,s,n),Ll=c,cd(0,!1),Fe&&typeof Fe.onPostCommitFiberRoot==`function`)try{Fe.onPostCommitFiberRoot(Pe,o)}catch{}return!0}finally{I.p=a,F.T=r,Wu(e,t)}}function qu(e,t,n){t=pi(n,t),t=Js(e.stateNode,t,2),e=Ra(e,t,2),e!==null&&(Xe(e,2),sd(e))}function Ju(e,t,n){if(e.tag===3)qu(e,e,n);else for(;t!==null;){if(t.tag===3){qu(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(ou===null||!ou.has(r))){e=pi(n,e),n=Ys(2),r=Ra(t,n,2),r!==null&&(Xs(n,r,t,e),Xe(r,2),sd(r));break}}t=t.return}}function Yu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Il;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Gl=!0,i.add(n),e=Xu.bind(null,e,t,n),t.then(e,e))}function Xu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Rl===e&&(Bl&n)===n&&(ql===4||ql===3&&(Bl&62914560)===Bl&&300>Te()-nu?!(Ll&2)&&Tu(e,0):Xl|=n,Ql===Bl&&(Ql=0)),sd(e)}function Zu(e,t){t===0&&(t=Je()),e=$r(e,t),e!==null&&(Xe(e,t),sd(e))}function Qu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Zu(e,n)}function $u(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Zu(e,n)}function ed(e,t){return xe(e,t)}var td=null,nd=null,rd=!1,id=!1,ad=!1,od=0;function sd(e){e!==nd&&e.next===null&&(nd===null?td=nd=e:nd=nd.next=e),id=!0,rd||(rd=!0,md())}function cd(e,t){if(!ad&&id){ad=!0;do for(var n=!1,r=td;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Le(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,pd(r,a))}else a=Bl,a=Ge(r,r===Rl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Ke(r,a)||(n=!0,pd(r,a))}r=r.next}while(n);ad=!1}}function ld(){ud()}function ud(){id=rd=!1;var e=0;od!==0&&Zd()&&(e=od);for(var t=Te(),n=null,r=td;r!==null;){var i=r.next,a=dd(r,t);a===0?(r.next=null,n===null?td=i:n.next=i,i===null&&(nd=n)):(n=r,(e!==0||a&3)&&(id=!0)),r=i}su!==0&&su!==5||cd(e,!1),od!==0&&(od=0)}function dd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Le(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=qe(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Rl,n=Bl,n=Ge(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Vl===2||Vl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Se(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Ke(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Se(r),nt(n)){case 2:case 8:n=Oe;break;case 32:n=ke;break;case 268435456:n=je;break;default:n=ke}return r=fd.bind(null,e),n=xe(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Se(r),e.callbackPriority=2,e.callbackNode=null,2}function fd(e,t){if(su!==0&&su!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Gu()&&e.callbackNode!==n)return null;var r=Bl;return r=Ge(e,e===Rl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(yu(e,r,t),dd(e,Te()),e.callbackNode!=null&&e.callbackNode===n?fd.bind(null,e):null)}function pd(e,t){if(Gu())return null;yu(e,t,!0)}function md(){ef(function(){Ll&6?xe(De,ld):ud()})}function hd(){if(od===0){var e=sa;e===0&&(e=Ve,Ve<<=1,!(Ve&261888)&&(Ve=256)),od=e}return od}function gd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Qt(``+e)}function _d(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function vd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=gd((i[st]||null).action),o=r.submitter;o&&(t=(t=o[st]||null)?gd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new xn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(od!==0){var e=o?_d(i,o):new FormData(i);bs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?_d(i,o):new FormData(i),bs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var yd=0;yd<Wr.length;yd++){var bd=Wr[yd];Gr(bd.toLowerCase(),`on`+(bd[0].toUpperCase()+bd.slice(1)))}Gr(Ir,`onAnimationEnd`),Gr(Lr,`onAnimationIteration`),Gr(Rr,`onAnimationStart`),Gr(`dblclick`,`onDoubleClick`),Gr(`focusin`,`onFocus`),Gr(`focusout`,`onBlur`),Gr(zr,`onTransitionRun`),Gr(Br,`onTransitionStart`),Gr(Vr,`onTransitionCancel`),Gr(Hr,`onTransitionEnd`),Ct(`onMouseEnter`,[`mouseout`,`mouseover`]),Ct(`onMouseLeave`,[`mouseout`,`mouseover`]),Ct(`onPointerEnter`,[`pointerout`,`pointerover`]),Ct(`onPointerLeave`,[`pointerout`,`pointerover`]),St(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),St(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),St(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),St(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),St(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),St(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var xd=`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(` `),Sd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(xd));function Cd(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Kr(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Kr(e)}i.currentTarget=null,a=c}}}}function wd(e,t){var n=t[lt];n===void 0&&(n=t[lt]=new Set);var r=e+`__bubble`;n.has(r)||(Od(t,e,2,!1),n.add(r))}function Td(e,t,n){var r=0;t&&(r|=4),Od(n,e,r,t)}var Ed=`_reactListening`+Math.random().toString(36).slice(2);function Dd(e){if(!e[Ed]){e[Ed]=!0,bt.forEach(function(t){t!==`selectionchange`&&(Sd.has(t)||Td(t,!1,e),Td(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ed]||(t[Ed]=!0,Td(`selectionchange`,!1,t))}}function Od(e,t,n,r){switch(vp(t)){case 2:var i=fp;break;case 8:i=pp;break;default:i=mp}n=i.bind(null,t,n,e),i=void 0,!un||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function kd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=ht(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}sn(function(){var r=a,i=tn(n),s=[];a:{var c=Ur.get(e);if(c!==void 0){var l=xn,u=e;switch(e){case`keypress`:if(gn(n)===0)break a;case`keydown`:case`keyup`:l=zn;break;case`focusin`:u=`focus`,l=An;break;case`focusout`:u=`blur`,l=An;break;case`beforeblur`:case`afterblur`:l=An;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=On;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=kn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Vn;break;case Ir:case Lr:case Rr:l=jn;break;case Hr:l=Hn;break;case`scroll`:case`scrollend`:l=Cn;break;case`wheel`:l=Un;break;case`copy`:case`cut`:case`paste`:l=Mn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Bn;break;case`toggle`:case`beforetoggle`:l=Wn}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=cn(m,p),g!=null&&d.push(Ad(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==en&&(u=n.relatedTarget||n.fromElement)&&(ht(u)||u[ct]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?ht(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=On,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Bn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:_t(l),h=u==null?c:_t(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,ht(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Md,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Nd(s,c,l,d,!1),u!==null&&f!==null&&Nd(s,f,u,d,!0)}}a:{if(c=r?_t(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=z;else if(ir(c)){if(ur)v=vr;else{v=B;var y=gr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Yt(r.elementType)&&(v=z):v=_r;if(v&&=v(e,r)){ar(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Vt(c,`number`,c.value)}switch(y=r?_t(r):window,e){case`focusin`:(ir(y)||y.contentEditable===`true`)&&(Or=y,kr=r,Ar=null);break;case`focusout`:Ar=kr=Or=null;break;case`mousedown`:jr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:jr=!1,Mr(s,n,i);break;case`selectionchange`:if(Dr)break;case`keydown`:case`keyup`:Mr(s,n,i)}var b;if(Kn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else er?Qn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Yn&&n.locale!==`ko`&&(er||x!==`onCompositionStart`?x===`onCompositionEnd`&&er&&(b=hn()):(fn=i,pn=`value`in fn?fn.value:fn.textContent,er=!0)),y=jd(r,x),0<y.length&&(x=new Nn(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=$n(n),b!==null&&(x.data=b)))),(b=Jn?tr(e,n):nr(e,n))&&(x=jd(r,`onBeforeInput`),0<x.length&&(y=new Nn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),vd(s,e,r,n,i)}Cd(s,t)})}function Ad(e,t,n){return{instance:e,listener:t,currentTarget:n}}function jd(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=cn(e,n),i!=null&&r.unshift(Ad(e,i,a)),i=cn(e,t),i!=null&&r.push(Ad(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Md(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Nd(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=cn(n,a),l!=null&&o.unshift(Ad(n,l,c))):i||(l=cn(n,a),l!=null&&o.push(Ad(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Pd=/\r\n?/g,Fd=/\u0000|\uFFFD/g;function Id(e){return(typeof e==`string`?e:``+e).replace(Pd,`
|
|
9
|
-
`).replace(Fd,``)}function Ld(e,t){return t=Id(t),Id(e)===t}function Rd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Gt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Gt(e,``+r);break;case`className`:kt(e,`class`,r);break;case`tabIndex`:kt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:kt(e,n,r);break;case`style`:Jt(e,r,o);break;case`data`:if(t!==`object`){kt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Qt(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&Rd(e,t,`name`,a.name,a,null),Rd(e,t,`formEncType`,a.formEncType,a,null),Rd(e,t,`formMethod`,a.formMethod,a,null),Rd(e,t,`formTarget`,a.formTarget,a,null)):(Rd(e,t,`encType`,a.encType,a,null),Rd(e,t,`method`,a.method,a,null),Rd(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Qt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=$t);break;case`onScroll`:r!=null&&wd(`scroll`,e);break;case`onScrollEnd`:r!=null&&wd(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=Qt(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:wd(`beforetoggle`,e),wd(`toggle`,e),Ot(e,`popover`,r);break;case`xlinkActuate`:At(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:At(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:At(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:At(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:At(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:At(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:At(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:At(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:At(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Ot(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Xt.get(n)||n,Ot(e,n,r))}}function zd(e,t,n,r,a,o){switch(n){case`style`:Jt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Gt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Gt(e,``+r);break;case`onScroll`:r!=null&&wd(`scroll`,e);break;case`onScrollEnd`:r!=null&&wd(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=$t);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!xt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[st]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):Ot(e,n,r)}}}function Bd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:wd(`error`,e),wd(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Rd(e,t,o,s,n,null)}}a&&Rd(e,t,`srcSet`,n.srcSet,n,null),r&&Rd(e,t,`src`,n.src,n,null);return;case`input`:wd(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:Rd(e,t,r,d,n,null)}}Bt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in wd(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Rd(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Ht(e,!!r,n,!0):Ht(e,!!r,t,!1);return;case`textarea`:for(s in wd(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Rd(e,t,s,c,n,null)}Wt(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Rd(e,t,l,r,n,null)}return;case`dialog`:wd(`beforetoggle`,e),wd(`toggle`,e),wd(`cancel`,e),wd(`close`,e);break;case`iframe`:case`object`:wd(`load`,e);break;case`video`:case`audio`:for(r=0;r<xd.length;r++)wd(xd[r],e);break;case`image`:wd(`error`,e),wd(`load`,e);break;case`details`:wd(`toggle`,e);break;case`embed`:case`source`:case`link`:wd(`error`,e),wd(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Rd(e,t,u,r,n,null)}return;default:if(Yt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&zd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Rd(e,t,c,r,n,null))}function Vd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Rd(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Rd(e,t,p,m,r,f)}}zt(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Rd(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Rd(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Ht(e,!!n,n?[]:``,!1):Ht(e,!!n,t,!0)):Ht(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Rd(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Rd(e,t,s,a,r,o)}Ut(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Rd(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Rd(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Rd(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:Rd(e,t,u,p,r,m)}return;default:if(Yt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&zd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||zd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Rd(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Rd(e,t,f,p,r,m)}function Hd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Ud(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Hd(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Hd(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Wd=null,Gd=null;function Kd(e){return e.nodeType===9?e:e.ownerDocument}function qd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Jd(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Yd(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Xd=null;function Zd(){var e=window.event;return e&&e.type===`popstate`?e!==Xd&&(Xd=e,!0):(Xd=null,!1)}var J=typeof setTimeout==`function`?setTimeout:void 0,Qd=typeof clearTimeout==`function`?clearTimeout:void 0,$d=typeof Promise==`function`?Promise:void 0,ef=typeof queueMicrotask==`function`?queueMicrotask:$d===void 0?J:function(e){return $d.resolve(null).then(e).catch(tf)};function tf(e){setTimeout(function(){throw e})}function nf(e){return e===`head`}function rf(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Lp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)vf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,vf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[pt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&vf(e.ownerDocument.body)}n=i}while(n);Lp(t)}function af(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function of(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:of(n),mt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function sf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[pt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=pf(e.nextSibling),e===null)break}return null}function cf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=pf(e.nextSibling),e===null))return null;return e}function lf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=pf(e.nextSibling),e===null))return null;return e}function uf(e){return e.data===`$?`||e.data===`$~`}function df(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function ff(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function pf(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===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var mf=null;function hf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return pf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function gf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function _f(e,t,n){switch(t=Kd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function vf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);mt(e)}var yf=new Map,bf=new Set;function xf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Sf=I.d;I.d={f:Cf,r:wf,D:Df,C:Of,L:kf,m:Af,X:Mf,S:jf,M:Nf};function Cf(){var e=Sf.f(),t=Cu();return e||t}function wf(e){var t=gt(e);t!==null&&t.tag===5&&t.type===`form`?Ss(t):Sf.r(e)}var Tf=typeof document>`u`?null:document;function Ef(e,t,n){var r=Tf;if(r&&typeof t==`string`&&t){var i=Rt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),bf.has(i)||(bf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Bd(t,`link`,e),yt(t),r.head.appendChild(t)))}}function Df(e){Sf.D(e),Ef(`dns-prefetch`,e,null)}function Of(e,t){Sf.C(e,t),Ef(`preconnect`,e,t)}function kf(e,t,n){Sf.L(e,t,n);var r=Tf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Rt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Rt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Rt(n.imageSizes)+`"]`)):i+=`[href="`+Rt(e)+`"]`;var a=i;switch(t){case`style`:a=Y(e);break;case`script`:a=Rf(e)}yf.has(a)||(e=m({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),yf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Ff(a))||t===`script`&&r.querySelector(zf(a))||(t=r.createElement(`link`),Bd(t,`link`,e),yt(t),r.head.appendChild(t)))}}function Af(e,t){Sf.m(e,t);var n=Tf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Rt(r)+`"][href="`+Rt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Rf(e)}if(!yf.has(a)&&(e=m({rel:`modulepreload`,href:e},t),yf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(zf(a)))return}r=n.createElement(`link`),Bd(r,`link`,e),yt(r),n.head.appendChild(r)}}}function jf(e,t,n){Sf.S(e,t,n);var r=Tf;if(r&&e){var i=vt(r).hoistableStyles,a=Y(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Ff(a)))s.loading=5;else{e=m({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=yf.get(a))&&Hf(e,n);var c=o=r.createElement(`link`);yt(c),Bd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Vf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Mf(e,t){Sf.X(e,t);var n=Tf;if(n&&e){var r=vt(n).hoistableScripts,i=Rf(e),a=r.get(i);a||(a=n.querySelector(zf(i)),a||(e=m({src:e,async:!0},t),(t=yf.get(i))&&Uf(e,t),a=n.createElement(`script`),yt(a),Bd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nf(e,t){Sf.M(e,t);var n=Tf;if(n&&e){var r=vt(n).hoistableScripts,i=Rf(e),a=r.get(i);a||(a=n.querySelector(zf(i)),a||(e=m({src:e,async:!0,type:`module`},t),(t=yf.get(i))&&Uf(e,t),a=n.createElement(`script`),yt(a),Bd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Pf(e,t,n,r){var a=(a=se.current)?xf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Y(n.href),n=vt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Y(n.href);var o=vt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Ff(e)))&&!o._p&&(s.instance=o,s.state.loading=5),yf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},yf.set(e,n),o||Lf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Rf(n),n=vt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Y(e){return`href="`+Rt(e)+`"`}function Ff(e){return`link[rel="stylesheet"][`+e+`]`}function If(e){return m({},e,{"data-precedence":e.precedence,precedence:null})}function Lf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Bd(t,`link`,n),yt(t),e.head.appendChild(t))}function Rf(e){return`[src="`+Rt(e)+`"]`}function zf(e){return`script[async]`+e}function Bf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Rt(n.href)+`"]`);if(r)return t.instance=r,yt(r),r;var a=m({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),yt(r),Bd(r,`style`,a),Vf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Y(n.href);var o=e.querySelector(Ff(a));if(o)return t.state.loading|=4,t.instance=o,yt(o),o;r=If(n),(a=yf.get(a))&&Hf(r,a),o=(e.ownerDocument||e).createElement(`link`),yt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Bd(o,`link`,r),t.state.loading|=4,Vf(o,n.precedence,e),t.instance=o;case`script`:return o=Rf(n.src),(a=e.querySelector(zf(o)))?(t.instance=a,yt(a),a):(r=n,(a=yf.get(o))&&(r=m({},n),Uf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),yt(a),Bd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Vf(r,n.precedence,e));return t.instance}function Vf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Hf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Uf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Wf=null;function Gf(e,t,n){if(Wf===null){var r=new Map,i=Wf=new Map;i.set(n,r)}else i=Wf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[pt]||a[ot]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Kf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function qf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Jf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Yf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Y(r.href),a=t.querySelector(Ff(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Qf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,yt(a);return}a=t.ownerDocument||t,r=If(r),(i=yf.get(i))&&Hf(r,i),a=a.createElement(`link`),yt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Bd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Qf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Xf=0;function Zf(e,t){return e.stylesheets&&e.count===0&&ep(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&ep(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Xf===0&&(Xf=62500*Ud());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ep(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Xf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Qf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ep(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var $f=null;function ep(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,$f=new Map,t.forEach(tp,e),$f=null,Qf.call(e))}function tp(e,t){if(!(t.state.loading&4)){var n=$f.get(e);if(n)var r=n.get(null);else{n=new Map,$f.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=Qf.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var np={$$typeof:C,Provider:null,Consumer:null,_currentValue:te,_currentValue2:te,_threadCount:0};function rp(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ye(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ye(0),this.hiddenUpdates=Ye(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function ip(e,t,n,r,i,a,o,s,c,l,u,d){return e=new rp(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ri(3,null,null,t),e.current=a,a.stateNode=e,t=ra(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Fa(a),e}function ap(e){return e?(e=U,e):U}function op(e,t,n,r,i,a){i=ap(i),r.context===null?r.context=i:r.pendingContext=i,r=La(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ra(e,r,t),n!==null&&(vu(n,e,t),za(n,e,t))}function sp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function cp(e,t){sp(e,t),(e=e.alternate)&&sp(e,t)}function lp(e){if(e.tag===13||e.tag===31){var t=$r(e,67108864);t!==null&&vu(t,e,67108864),cp(e,67108864)}}function up(e){if(e.tag===13||e.tag===31){var t=gu();t=tt(t);var n=$r(e,t);n!==null&&vu(n,e,t),cp(e,t)}}var dp=!0;function fp(e,t,n,r){var i=F.T;F.T=null;var a=I.p;try{I.p=2,mp(e,t,n,r)}finally{I.p=a,F.T=i}}function pp(e,t,n,r){var i=F.T;F.T=null;var a=I.p;try{I.p=8,mp(e,t,n,r)}finally{I.p=a,F.T=i}}function mp(e,t,n,r){if(dp){var i=hp(r);if(i===null)kd(e,t,r,gp,n),Dp(e,r);else if(kp(i,e,t,n,r))r.stopPropagation();else if(Dp(e,r),t&4&&-1<Ep.indexOf(e)){for(;i!==null;){var a=gt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=We(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Le(o);s.entanglements[1]|=c,o&=~c}sd(a),!(Ll&6)&&(iu=Te()+500,cd(0,!1))}}break;case 31:case 13:s=$r(a,2),s!==null&&vu(s,a,2),Cu(),cp(a,2)}if(a=hp(r),a===null&&kd(e,t,r,gp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else kd(e,t,r,null,n)}}function hp(e){return e=tn(e),_p(e)}var gp=null;function _p(e){if(gp=null,e=ht(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(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 gp=e,null}function vp(e){switch(e){case`beforetoggle`: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`toggle`: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 2;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`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Ee()){case De:return 2;case Oe:return 8;case ke:case Ae:return 32;case je:return 268435456;default:return 32}default:return 32}}var yp=!1,bp=null,xp=null,Sp=null,Cp=new Map,wp=new Map,Tp=[],Ep=`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`.split(` `);function Dp(e,t){switch(e){case`focusin`:case`focusout`:bp=null;break;case`dragenter`:case`dragleave`:xp=null;break;case`mouseover`:case`mouseout`:Sp=null;break;case`pointerover`:case`pointerout`:Cp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:wp.delete(t.pointerId)}}function Op(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=gt(t),t!==null&&lp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function kp(e,t,n,r,i){switch(t){case`focusin`:return bp=Op(bp,e,t,n,r,i),!0;case`dragenter`:return xp=Op(xp,e,t,n,r,i),!0;case`mouseover`:return Sp=Op(Sp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Cp.set(a,Op(Cp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,wp.set(a,Op(wp.get(a)||null,e,t,n,r,i)),!0}return!1}function Ap(e){var t=ht(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,it(e.priority,function(){up(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,it(e.priority,function(){up(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 jp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=hp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);en=r,n.target.dispatchEvent(r),en=null}else return t=gt(n),t!==null&&lp(t),e.blockedOn=n,!1;t.shift()}return!0}function Mp(e,t,n){jp(e)&&n.delete(t)}function Np(){yp=!1,bp!==null&&jp(bp)&&(bp=null),xp!==null&&jp(xp)&&(xp=null),Sp!==null&&jp(Sp)&&(Sp=null),Cp.forEach(Mp),wp.forEach(Mp)}function Pp(e,n){e.blockedOn===n&&(e.blockedOn=null,yp||(yp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Np)))}var Fp=null;function Ip(e){Fp!==e&&(Fp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Fp===e&&(Fp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(_p(r||n)===null)continue;break}var a=gt(n);a!==null&&(e.splice(t,3),t-=3,bs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Lp(e){function t(t){return Pp(t,e)}bp!==null&&Pp(bp,e),xp!==null&&Pp(xp,e),Sp!==null&&Pp(Sp,e),Cp.forEach(t),wp.forEach(t);for(var n=0;n<Tp.length;n++){var r=Tp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Tp.length&&(n=Tp[0],n.blockedOn===null);)Ap(n),n.blockedOn===null&&Tp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[st]||null;if(typeof a==`function`)o||Ip(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[st]||null)s=o.formAction;else if(_p(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Ip(n)}}}function Rp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function zp(e){this._internalRoot=e}Bp.prototype.render=zp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;op(n,gu(),e,t,null,null)},Bp.prototype.unmount=zp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;op(e.current,2,null,e,null,null),Cu(),t[ct]=null}};function Bp(e){this._internalRoot=e}Bp.prototype.unstable_scheduleHydration=function(e){if(e){var t=rt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Tp.length&&t!==0&&t<Tp[n].priority;n++);Tp.splice(n,0,e),n===0&&Ap(e)}};var Vp=n.version;if(Vp!==`19.2.8`)throw Error(i(527,Vp,`19.2.8`));I.findDOMNode=function(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=u(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var Hp={bundleType:0,version:`19.2.8`,rendererPackageName:`react-dom`,currentDispatcherRef:F,reconcilerVersion:`19.2.8`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Up=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Up.isDisabled&&Up.supportsFiber)try{Pe=Up.inject(Hp),Fe=Up}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Us,s=Ws,c=Gs;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=ip(e,1,!1,null,null,n,r,null,o,s,c,Rp),e[ct]=t.current,Dd(e),new zp(t)}})),_=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=g()})),v=l(d(),1),y=_(),b=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),x=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),S=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),C=e=>{let t=S(e);return t.charAt(0).toUpperCase()+t.slice(1)},w={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`},T=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},E=(0,v.createContext)({}),D=()=>(0,v.useContext)(E),O=(0,v.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=D()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,v.createElement)(`svg`,{ref:c,...w,width:t??l??w.width,height:t??l??w.height,stroke:e??f,strokeWidth:m,className:b(`lucide`,p,i),...!a&&!T(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,v.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),k=(e,t)=>{let n=(0,v.forwardRef)(({className:n,...r},i)=>(0,v.createElement)(O,{ref:i,iconNode:t,className:b(`lucide-${x(C(e))}`,`lucide-${e}`,n),...r}));return n.displayName=C(e),n},A=k(`activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),j=k(`anchor`,[[`path`,{d:`M12 6v16`,key:`nqf5sj`}],[`path`,{d:`m19 13 2-1a9 9 0 0 1-18 0l2 1`,key:`y7qv08`}],[`path`,{d:`M9 11h6`,key:`1fldmi`}],[`circle`,{cx:`12`,cy:`4`,r:`2`,key:`muu5ef`}]]),M=k(`archive-restore`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h2`,key:`tvwodi`}],[`path`,{d:`M20 8v11a2 2 0 0 1-2 2h-2`,key:`1gkqxj`}],[`path`,{d:`m9 15 3-3 3 3`,key:`1pd0qc`}],[`path`,{d:`M12 12v9`,key:`192myk`}]]),N=k(`archive`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]),P=k(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),ee=k(`arrow-left-right`,[[`path`,{d:`M8 3 4 7l4 4`,key:`9rb6wj`}],[`path`,{d:`M4 7h16`,key:`6tx8e3`}],[`path`,{d:`m16 21 4-4-4-4`,key:`siv7j2`}],[`path`,{d:`M20 17H4`,key:`h6l3hr`}]]),F=k(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),I=k(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),te=k(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),L=k(`atom`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`path`,{d:`M20.2 20.2c2.04-2.03.02-7.36-4.5-11.9-4.54-4.52-9.87-6.54-11.9-4.5-2.04 2.03-.02 7.36 4.5 11.9 4.54 4.52 9.87 6.54 11.9 4.5Z`,key:`1l2ple`}],[`path`,{d:`M15.7 15.7c4.52-4.54 6.54-9.87 4.5-11.9-2.03-2.04-7.36-.02-11.9 4.5-4.52 4.54-6.54 9.87-4.5 11.9 2.03 2.04 7.36.02 11.9-4.5Z`,key:`1wam0m`}]]),ne=k(`bird`,[[`path`,{d:`M16 7h.01`,key:`1kdx03`}],[`path`,{d:`M3.4 18H12a8 8 0 0 0 8-8V7a4 4 0 0 0-7.28-2.3L2 20`,key:`oj1oa8`}],[`path`,{d:`m20 7 2 .5-2 .5`,key:`12nv4d`}],[`path`,{d:`M10 18v3`,key:`1yea0a`}],[`path`,{d:`M14 17.75V21`,key:`1pymcb`}],[`path`,{d:`M7 18a6 6 0 0 0 3.84-10.61`,key:`1npnn0`}]]),re=k(`book-open`,[[`path`,{d:`M12 5v16`,key:`1f6ucr`}],[`path`,{d:`M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z`,key:`1fyvmf`}]]),R=k(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),ie=k(`boxes`,[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]),ae=k(`braces`,[[`path`,{d:`M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1`,key:`ezmyqa`}],[`path`,{d:`M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1`,key:`e1hn23`}]]),oe=k(`brain`,[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]),se=k(`bug`,[[`path`,{d:`M12 20v-9`,key:`1qisl0`}],[`path`,{d:`M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z`,key:`uouzyp`}],[`path`,{d:`M14.12 3.88 16 2`,key:`qol33r`}],[`path`,{d:`M21 21a4 4 0 0 0-3.81-4`,key:`1b0z45`}],[`path`,{d:`M21 5a4 4 0 0 1-3.55 3.97`,key:`5cxbf6`}],[`path`,{d:`M22 13h-4`,key:`1jl80f`}],[`path`,{d:`M3 21a4 4 0 0 1 3.81-4`,key:`1fjd4g`}],[`path`,{d:`M3 5a4 4 0 0 0 3.55 3.97`,key:`1d7oge`}],[`path`,{d:`M6 13H2`,key:`82j7cp`}],[`path`,{d:`m8 2 1.88 1.88`,key:`fmnt4t`}],[`path`,{d:`M9 7.13V6a3 3 0 1 1 6 0v1.13`,key:`1vgav8`}]]),ce=k(`cat`,[[`path`,{d:`M12 5c.67 0 1.35.09 2 .26 1.78-2 5.03-2.84 6.42-2.26 1.4.58-.42 7-.42 7 .57 1.07 1 2.24 1 3.44C21 17.9 16.97 21 12 21s-9-3-9-7.56c0-1.25.5-2.4 1-3.44 0 0-1.89-6.42-.5-7 1.39-.58 4.72.23 6.5 2.23A9.04 9.04 0 0 1 12 5Z`,key:`x6xyqk`}],[`path`,{d:`M8 14v.5`,key:`1nzgdb`}],[`path`,{d:`M16 14v.5`,key:`1lajdz`}],[`path`,{d:`M11.25 16.25h1.5L12 17l-.75-.75Z`,key:`12kq1m`}]]),le=k(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),ue=k(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),de=k(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),fe=k(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),pe=k(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),me=k(`circle-alert`,[[`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`}]]),he=k(`circle-arrow-up`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 12-4-4-4 4`,key:`177agl`}],[`path`,{d:`M12 16V8`,key:`1sbj14`}]]),ge=k(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),_e=k(`cloud`,[[`path`,{d:`M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z`,key:`p7xjir`}]]),ve=k(`code`,[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]),ye=k(`command`,[[`path`,{d:`M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3`,key:`11bfej`}]]),be=k(`compass`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z`,key:`9ktpf1`}]]),xe=k(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),Se=k(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),Ce=k(`database-backup`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 12a9 3 0 0 0 5 2.69`,key:`1ui2ym`}],[`path`,{d:`M21 9.3V5`,key:`6k6cib`}],[`path`,{d:`M3 5v14a9 3 0 0 0 6.47 2.88`,key:`i62tjy`}],[`path`,{d:`M12 12v4h4`,key:`1bxaet`}],[`path`,{d:`M13 20a5 5 0 0 0 9-3 4.5 4.5 0 0 0-4.5-4.5c-1.33 0-2.54.54-3.41 1.41L12 16`,key:`1f4ei9`}]]),we=k(`database`,[[`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`}]]),Te=k(`dog`,[[`path`,{d:`M11.25 16.25h1.5L12 17z`,key:`w7jh35`}],[`path`,{d:`M16 14v.5`,key:`1lajdz`}],[`path`,{d:`M4.42 11.247A13.152 13.152 0 0 0 4 14.556C4 18.728 7.582 21 12 21s8-2.272 8-6.444a11.702 11.702 0 0 0-.493-3.309`,key:`u7s9ue`}],[`path`,{d:`M8 14v.5`,key:`1nzgdb`}],[`path`,{d:`M8.5 8.5c-.384 1.05-1.083 2.028-2.344 2.5-1.931.722-3.576-.297-3.656-1-.113-.994 1.177-6.53 4-7 1.923-.321 3.651.845 3.651 2.235A7.497 7.497 0 0 1 14 5.277c0-1.39 1.844-2.598 3.767-2.277 2.823.47 4.113 6.006 4 7-.08.703-1.725 1.722-3.656 1-1.261-.472-1.855-1.45-2.239-2.5`,key:`v8hric`}]]),Ee=k(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),De=k(`ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]]),Oe=k(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),ke=k(`feather`,[[`path`,{d:`M14.086 18.412A2 2 0 0112.67 19H5v-7.672a2 2 0 01.586-1.414L11.75 3.75a6 6 0 118.49 8.49z`,key:`1nq9jb`}],[`path`,{d:`M16 8 2 22`,key:`vp34q`}],[`path`,{d:`M17.488 15H9`,key:`16yirz`}]]),Ae=k(`file-code`,[[`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 12.5 8 15l2 2.5`,key:`1tg20x`}],[`path`,{d:`m14 12.5 2 2.5-2 2.5`,key:`yinavb`}]]),je=k(`file-up`,[[`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:`M12 12v6`,key:`3ahymv`}],[`path`,{d:`m15 15-3-3-3 3`,key:`15xj92`}]]),Me=k(`fish`,[[`path`,{d:`M6.5 12c.94-3.46 4.94-6 8.5-6 3.56 0 6.06 2.54 7 6-.94 3.47-3.44 6-7 6s-7.56-2.53-8.5-6Z`,key:`15baut`}],[`path`,{d:`M18 12v.5`,key:`18hhni`}],[`path`,{d:`M16 17.93a9.77 9.77 0 0 1 0-11.86`,key:`16dt7o`}],[`path`,{d:`M7 10.67C7 8 5.58 5.97 2.73 5.5c-1 1.5-1 5 .23 6.5-1.24 1.5-1.24 5-.23 6.5C5.58 18.03 7 16 7 13.33`,key:`l9di03`}],[`path`,{d:`M10.46 7.26C10.2 5.88 9.17 4.24 8 3h5.8a2 2 0 0 1 1.98 1.67l.23 1.4`,key:`1kjonw`}],[`path`,{d:`m16.01 17.93-.23 1.4A2 2 0 0 1 13.8 21H9.5a5.96 5.96 0 0 0 1.49-3.98`,key:`1zlm23`}]]),Ne=k(`flame`,[[`path`,{d:`M12 3q1 4 4 6.5t3 5.5a1 1 0 0 1-14 0 5 5 0 0 1 1-3 1 1 0 0 0 5 0c0-2-1.5-3-1.5-5q0-2 2.5-4`,key:`1slcih`}]]),Pe=k(`flower`,[[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`path`,{d:`M12 16.5A4.5 4.5 0 1 1 7.5 12 4.5 4.5 0 1 1 12 7.5a4.5 4.5 0 1 1 4.5 4.5 4.5 4.5 0 1 1-4.5 4.5`,key:`14wa3c`}],[`path`,{d:`M12 7.5V9`,key:`1oy5b0`}],[`path`,{d:`M7.5 12H9`,key:`eltsq1`}],[`path`,{d:`M16.5 12H15`,key:`vk5kw4`}],[`path`,{d:`M12 16.5V15`,key:`k7eayi`}],[`path`,{d:`m8 8 1.88 1.88`,key:`nxy4qf`}],[`path`,{d:`M14.12 9.88 16 8`,key:`1lst6k`}],[`path`,{d:`m8 16 1.88-1.88`,key:`h2eex1`}],[`path`,{d:`M14.12 14.12 16 16`,key:`uqkrx3`}]]),Fe=k(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),Ie=k(`folder-plus`,[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),Le=k(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),Re=k(`gem`,[[`path`,{d:`M10.5 3 8 9l4 13 4-13-2.5-6`,key:`b3dvk1`}],[`path`,{d:`M17 3a2 2 0 0 1 1.6.8l3 4a2 2 0 0 1 .013 2.382l-7.99 10.986a2 2 0 0 1-3.247 0l-7.99-10.986A2 2 0 0 1 2.4 7.8l2.998-3.997A2 2 0 0 1 7 3z`,key:`7w4byz`}],[`path`,{d:`M2 9h20`,key:`16fsjt`}]]),ze=k(`ghost`,[[`path`,{d:`M9 10h.01`,key:`qbtxuw`}],[`path`,{d:`M15 10h.01`,key:`1qmjsl`}],[`path`,{d:`M12 2a8 8 0 0 0-8 8v12l3-3 2.5 2.5L12 19l2.5 2.5L17 19l3 3V10a8 8 0 0 0-8-8z`,key:`uwwb07`}]]),Be=k(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),Ve=k(`git-merge`,[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M6 21V9a9 9 0 0 0 9 9`,key:`7kw0sc`}]]),He=k(`globe`,[[`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`}]]),Ue=k(`hash`,[[`line`,{x1:`4`,x2:`20`,y1:`9`,y2:`9`,key:`4lhtct`}],[`line`,{x1:`4`,x2:`20`,y1:`15`,y2:`15`,key:`vyu0kd`}],[`line`,{x1:`10`,x2:`8`,y1:`3`,y2:`21`,key:`1ggp8o`}],[`line`,{x1:`16`,x2:`14`,y1:`3`,y2:`21`,key:`weycgp`}]]),We=k(`heart`,[[`path`,{d:`M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5`,key:`mvr1a0`}]]),Ge=k(`image-plus`,[[`path`,{d:`M16 5h6`,key:`1vod17`}],[`path`,{d:`M19 2v6`,key:`4bpg5p`}],[`path`,{d:`M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5`,key:`1ue2ih`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}]]),Ke=k(`infinity`,[[`path`,{d:`M6 16c5 0 7-8 12-8a4 4 0 0 1 0 8c-5 0-7-8-12-8a4 4 0 1 0 0 8`,key:`18ogeb`}]]),qe=k(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),Je=k(`key`,[[`path`,{d:`m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4`,key:`g0fldk`}],[`path`,{d:`m21 2-9.6 9.6`,key:`1j0ho8`}],[`circle`,{cx:`7.5`,cy:`15.5`,r:`5.5`,key:`yqb3hr`}]]),Ye=k(`layers`,[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]]),Xe=k(`layout-grid`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]),Ze=k(`leaf`,[[`path`,{d:`M11 20A7 7 0 0 1 9.8 6.1C15.5 5 17 4.48 19 2c1 2 2 4.18 2 8 0 5.5-4.78 10-10 10Z`,key:`nnexq3`}],[`path`,{d:`M2 21c0-3 1.85-5.36 5.08-6C9.5 14.52 12 13 13 12`,key:`mt58a7`}]]),Qe=k(`library`,[[`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`}]]),$e=k(`lightbulb`,[[`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`,key:`1gvzjb`}],[`path`,{d:`M9 18h6`,key:`x1upvd`}],[`path`,{d:`M10 22h4`,key:`ceow96`}]]),et=k(`link-2-off`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7`,key:`10o201`}],[`path`,{d:`M15 7h2a5 5 0 0 1 4 8`,key:`1d3206`}],[`line`,{x1:`8`,x2:`12`,y1:`12`,y2:`12`,key:`rvw6j4`}],[`line`,{x1:`2`,x2:`22`,y1:`2`,y2:`22`,key:`a6p6uj`}]]),tt=k(`link-2`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]),nt=k(`link`,[[`path`,{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`,key:`1cjeqo`}],[`path`,{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`,key:`19qd67`}]]),rt=k(`list`,[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]),it=k(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),at=k(`loader`,[[`path`,{d:`M12 2v4`,key:`3427ic`}],[`path`,{d:`m16.2 7.8 2.9-2.9`,key:`r700ao`}],[`path`,{d:`M18 12h4`,key:`wj9ykh`}],[`path`,{d:`m16.2 16.2 2.9 2.9`,key:`1bxg5t`}],[`path`,{d:`M12 18v4`,key:`jadmvz`}],[`path`,{d:`m4.9 19.1 2.9-2.9`,key:`bwix9q`}],[`path`,{d:`M2 12h4`,key:`j09sii`}],[`path`,{d:`m4.9 4.9 2.9 2.9`,key:`giyufr`}]]),ot=k(`menu`,[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]),st=k(`message-circle`,[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}]]),ct=k(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),lt=k(`messages-square`,[[`path`,{d:`M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z`,key:`1n2ejm`}],[`path`,{d:`M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1`,key:`1qfcsi`}]]),ut=k(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),dt=k(`monitor`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]),ft=k(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),pt=k(`mountain`,[[`path`,{d:`m8 3 4 8 5-5 5 15H2L8 3z`,key:`otkl63`}]]),mt=k(`network`,[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]),ht=k(`octagon-alert`,[[`path`,{d:`M12 16h.01`,key:`1drbdi`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z`,key:`1fd625`}]]),gt=k(`octagon-x`,[[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z`,key:`2d38gg`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),_t=k(`orbit`,[[`path`,{d:`M20.341 6.484A10 10 0 0 1 10.266 21.85`,key:`1enhxb`}],[`path`,{d:`M3.659 17.516A10 10 0 0 1 13.74 2.152`,key:`1crzgf`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`circle`,{cx:`19`,cy:`5`,r:`2`,key:`mhkx31`}],[`circle`,{cx:`5`,cy:`19`,r:`2`,key:`v8kfzx`}]]),vt=k(`package`,[[`path`,{d:`M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z`,key:`1a0edw`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}]]),yt=k(`panel-left-close`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m16 15-3-3 3-3`,key:`14y99z`}]]),bt=k(`panel-left-open`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m14 9 3 3-3 3`,key:`8010ee`}]]),xt=k(`pause`,[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]),St=k(`pen-tool`,[[`path`,{d:`M15.707 21.293a1 1 0 0 1-1.414 0l-1.586-1.586a1 1 0 0 1 0-1.414l5.586-5.586a1 1 0 0 1 1.414 0l1.586 1.586a1 1 0 0 1 0 1.414z`,key:`nt11vn`}],[`path`,{d:`m18 13-1.375-6.874a1 1 0 0 0-.746-.776L3.235 2.028a1 1 0 0 0-1.207 1.207L5.35 15.879a1 1 0 0 0 .776.746L13 18`,key:`15qc1e`}],[`path`,{d:`m2.3 2.3 7.286 7.286`,key:`1wuzzi`}],[`circle`,{cx:`11`,cy:`11`,r:`2`,key:`xmgehs`}]]),Ct=k(`pen-line`,[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),wt=k(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),Tt=k(`pin`,[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`,key:`1nkz8b`}]]),Et=k(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),Dt=k(`plug`,[[`path`,{d:`M12 22v-5`,key:`1ega77`}],[`path`,{d:`M15 8V2`,key:`18g5xt`}],[`path`,{d:`M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z`,key:`1xoxul`}],[`path`,{d:`M9 8V2`,key:`14iosj`}]]),Ot=k(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),kt=k(`power`,[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]),At=k(`puzzle`,[[`path`,{d:`M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z`,key:`w46dr5`}]]),jt=k(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),Mt=k(`rocket`,[[`path`,{d:`M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5`,key:`qeys4`}],[`path`,{d:`M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09`,key:`u4xsad`}],[`path`,{d:`M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z`,key:`676m9`}],[`path`,{d:`M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05`,key:`92ym6u`}]]),Nt=k(`rotate-ccw-clock`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),Pt=k(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),Ft=k(`rotate-cw`,[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]),It=k(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),Lt=k(`server`,[[`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`}]]),Rt=k(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),zt=k(`shield`,[[`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`}]]),Bt=k(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),Vt=k(`square-check-big`,[[`path`,{d:`M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344`,key:`2acyp4`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),Ht=k(`square-terminal`,[[`path`,{d:`m7 11 2-2-2-2`,key:`1lz0vl`}],[`path`,{d:`M11 13h4`,key:`1p7l4v`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}]]),Ut=k(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),Wt=k(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),Gt=k(`tags`,[[`path`,{d:`M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1z`,key:`16rjxf`}],[`path`,{d:`M2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193`,key:`178nd4`}],[`circle`,{cx:`10.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`12ikhr`}]]),Kt=k(`target`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`6`,key:`1vlfrh`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]),qt=k(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),Jt=k(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),Yt=k(`trash`,[[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),Xt=k(`triangle-alert`,[[`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`}]]),Zt=k(`undo-2`,[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]),Qt=k(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),$t=k(`user-x`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`line`,{x1:`17`,x2:`22`,y1:`8`,y2:`13`,key:`3nzzx3`}],[`line`,{x1:`22`,x2:`17`,y1:`8`,y2:`13`,key:`1swrse`}]]),en=k(`user`,[[`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`,key:`975kel`}],[`circle`,{cx:`12`,cy:`7`,r:`4`,key:`17ys0d`}]]),tn=k(`wand-sparkles`,[[`path`,{d:`m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72`,key:`ul74o6`}],[`path`,{d:`m14 7 3 3`,key:`1r5n42`}],[`path`,{d:`M5 6v4`,key:`ilb8ba`}],[`path`,{d:`M19 14v4`,key:`blhpug`}],[`path`,{d:`M10 2v2`,key:`7u0qdc`}],[`path`,{d:`M7 8H3`,key:`zfb6yr`}],[`path`,{d:`M21 16h-4`,key:`1cnmox`}],[`path`,{d:`M11 3H9`,key:`1obp7u`}]]),nn=k(`workflow`,[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]),rn=k(`wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]),an=k(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),on=k(`zap`,[[`path`,{d:`M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z`,key:`1v7up4`}]]);function sn(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=sn(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function cn(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=sn(e))&&(r&&(r+=` `),r+=t);return r}var ln=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},un=(e,t)=>({classGroupId:e,validator:t}),dn=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),fn=`-`,pn=[],mn=`arbitrary..`,hn=e=>{let t=vn(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return _n(e);let n=e.split(fn);return gn(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?ln(i,t):t:i||pn}return n[e]||pn}}},gn=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=gn(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(fn):e.slice(t).join(fn),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},_n=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?mn+r:void 0})(),vn=e=>{let{theme:t,classGroups:n}=e;return yn(n,t)},yn=(e,t)=>{let n=dn();for(let r in e){let i=e[r];bn(i,n,r,t)}return n},bn=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];xn(i,t,n,r)}},xn=(e,t,n,r)=>{if(typeof e==`string`){Sn(e,t,n);return}if(typeof e==`function`){Cn(e,t,n,r);return}wn(e,t,n,r)},Sn=(e,t,n)=>{let r=e===``?t:Tn(t,e);r.classGroupId=n},Cn=(e,t,n,r)=>{if(En(e)){bn(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(un(n,e))},wn=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];bn(o,Tn(t,a),n,r)}},Tn=(e,t)=>{let n=e,r=t.split(fn),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=dn(),n.nextPart.set(t,i)),n=i}return n},En=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,Dn=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},On=`!`,kn=`:`,An=[],jn=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Mn=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===kn){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(On)?(c=s.slice(0,-1),l=!0):s.startsWith(On)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return jn(t,l,c,u)};if(t){let e=t+kn,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):jn(An,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},Nn=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},Pn=e=>({cache:Dn(e.cacheSize),parseClassName:Mn(e),sortModifiers:Nn(e),postfixLookupClassGroupIds:Fn(e),...hn(e)}),Fn=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},In=/\s+/,Ln=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(In),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+On:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},Rn=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=zn(n))&&(i&&(i+=` `),i+=r);return i},zn=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=zn(e[r]))&&(n&&(n+=` `),n+=t);return n},Bn=(e,...t)=>{let n,r,i,a,o=o=>(n=Pn(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=Ln(e,n);return i(e,a),a};return a=o,(...e)=>a(Rn(...e))},Vn=[],Hn=e=>{let t=t=>t[e]||Vn;return t.isThemeGetter=!0,t},Un=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Wn=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Gn=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Kn=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,qn=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Jn=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Yn=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Xn=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Zn=e=>Gn.test(e),Qn=e=>!!e&&!Number.isNaN(Number(e)),$n=e=>!!e&&Number.isInteger(Number(e)),er=e=>e.endsWith(`%`)&&Qn(e.slice(0,-1)),tr=e=>Kn.test(e),nr=()=>!0,rr=e=>qn.test(e)&&!Jn.test(e),ir=()=>!1,ar=e=>Yn.test(e),or=e=>Xn.test(e),sr=e=>!z(e)&&!B(e),cr=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),lr=e=>wr(e,Or,ir),z=e=>Un.test(e),ur=e=>wr(e,kr,rr),dr=e=>wr(e,Ar,Qn),fr=e=>wr(e,Mr,nr),pr=e=>wr(e,jr,ir),mr=e=>wr(e,Er,ir),hr=e=>wr(e,Dr,or),gr=e=>wr(e,Nr,ar),B=e=>Wn.test(e),_r=e=>Tr(e,kr),vr=e=>Tr(e,jr),yr=e=>Tr(e,Er),br=e=>Tr(e,Or),xr=e=>Tr(e,Dr),Sr=e=>Tr(e,Nr,!0),Cr=e=>Tr(e,Mr,!0),wr=(e,t,n)=>{let r=Un.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Tr=(e,t,n=!1)=>{let r=Wn.exec(e);return r?r[1]?t(r[1]):n:!1},Er=e=>e===`position`||e===`percentage`,Dr=e=>e===`image`||e===`url`,Or=e=>e===`length`||e===`size`||e===`bg-size`,kr=e=>e===`length`,Ar=e=>e===`number`,jr=e=>e===`family-name`,Mr=e=>e===`number`||e===`weight`,Nr=e=>e===`shadow`,Pr=Bn(()=>{let e=Hn(`color`),t=Hn(`font`),n=Hn(`text`),r=Hn(`font-weight`),i=Hn(`tracking`),a=Hn(`leading`),o=Hn(`breakpoint`),s=Hn(`container`),c=Hn(`spacing`),l=Hn(`radius`),u=Hn(`shadow`),d=Hn(`inset-shadow`),f=Hn(`text-shadow`),p=Hn(`drop-shadow`),m=Hn(`blur`),h=Hn(`perspective`),g=Hn(`aspect`),_=Hn(`ease`),v=Hn(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),B,z],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[B,z,c],T=()=>[Zn,`full`,`auto`,...w()],E=()=>[$n,`none`,`subgrid`,B,z],D=()=>[`auto`,{span:[`full`,$n,B,z]},$n,B,z],O=()=>[$n,`auto`,B,z],k=()=>[`auto`,`min`,`max`,`fr`,B,z],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],j=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],M=()=>[`auto`,...w()],N=()=>[Zn,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[Zn,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],ee=()=>[Zn,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],F=()=>[e,B,z],I=()=>[...b(),yr,mr,{position:[B,z]}],te=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],L=()=>[`auto`,`cover`,`contain`,br,lr,{size:[B,z]}],ne=()=>[er,_r,ur],re=()=>[``,`none`,`full`,l,B,z],R=()=>[``,Qn,_r,ur],ie=()=>[`solid`,`dashed`,`dotted`,`double`],ae=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],oe=()=>[Qn,er,yr,mr],se=()=>[``,`none`,m,B,z],ce=()=>[`none`,Qn,B,z],le=()=>[`none`,Qn,B,z],ue=()=>[Qn,B,z],de=()=>[Zn,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[tr],breakpoint:[tr],color:[nr],container:[tr],"drop-shadow":[tr],ease:[`in`,`out`,`in-out`],font:[sr],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[tr],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[tr],shadow:[tr],spacing:[`px`,Qn],text:[tr],"text-shadow":[tr],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,Zn,z,B,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,B,z]}],"container-named":[cr],columns:[{columns:[Qn,z,B,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[$n,`auto`,B,z]}],basis:[{basis:[Zn,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[Qn,Zn,`auto`,`initial`,`none`,z]}],grow:[{grow:[``,Qn,B,z]}],shrink:[{shrink:[``,Qn,B,z]}],order:[{order:[$n,`first`,`last`,`none`,B,z]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...A(),`normal`]}],"justify-items":[{"justify-items":[...j(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...j()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...j(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...j(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...j(),`baseline`]}],"place-self":[{"place-self":[`auto`,...j()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:N()}],"inline-size":[{inline:[`auto`,...P()]}],"min-inline-size":[{"min-inline":[`auto`,...P()]}],"max-inline-size":[{"max-inline":[`none`,...P()]}],"block-size":[{block:[`auto`,...ee()]}],"min-block-size":[{"min-block":[`auto`,...ee()]}],"max-block-size":[{"max-block":[`none`,...ee()]}],w:[{w:[s,`screen`,...N()]}],"min-w":[{"min-w":[s,`screen`,`none`,...N()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...N()]}],h:[{h:[`screen`,`lh`,...N()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...N()]}],"max-h":[{"max-h":[`screen`,`lh`,...N()]}],"font-size":[{text:[`base`,n,_r,ur]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Cr,fr]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,er,z]}],"font-family":[{font:[vr,pr,t]}],"font-features":[{"font-features":[z]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,B,z]}],"line-clamp":[{"line-clamp":[Qn,`none`,B,dr]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,B,z]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,B,z]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:F()}],"text-color":[{text:F()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...ie(),`wavy`]}],"text-decoration-thickness":[{decoration:[Qn,`from-font`,`auto`,B,ur]}],"text-decoration-color":[{decoration:F()}],"underline-offset":[{"underline-offset":[Qn,`auto`,B,z]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[$n,B,z]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,B,z]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,B,z]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:I()}],"bg-repeat":[{bg:te()}],"bg-size":[{bg:L()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},$n,B,z],radial:[``,B,z],conic:[$n,B,z]},xr,hr]}],"bg-color":[{bg:F()}],"gradient-from-pos":[{from:ne()}],"gradient-via-pos":[{via:ne()}],"gradient-to-pos":[{to:ne()}],"gradient-from":[{from:F()}],"gradient-via":[{via:F()}],"gradient-to":[{to:F()}],rounded:[{rounded:re()}],"rounded-s":[{"rounded-s":re()}],"rounded-e":[{"rounded-e":re()}],"rounded-t":[{"rounded-t":re()}],"rounded-r":[{"rounded-r":re()}],"rounded-b":[{"rounded-b":re()}],"rounded-l":[{"rounded-l":re()}],"rounded-ss":[{"rounded-ss":re()}],"rounded-se":[{"rounded-se":re()}],"rounded-ee":[{"rounded-ee":re()}],"rounded-es":[{"rounded-es":re()}],"rounded-tl":[{"rounded-tl":re()}],"rounded-tr":[{"rounded-tr":re()}],"rounded-br":[{"rounded-br":re()}],"rounded-bl":[{"rounded-bl":re()}],"border-w":[{border:R()}],"border-w-x":[{"border-x":R()}],"border-w-y":[{"border-y":R()}],"border-w-s":[{"border-s":R()}],"border-w-e":[{"border-e":R()}],"border-w-bs":[{"border-bs":R()}],"border-w-be":[{"border-be":R()}],"border-w-t":[{"border-t":R()}],"border-w-r":[{"border-r":R()}],"border-w-b":[{"border-b":R()}],"border-w-l":[{"border-l":R()}],"divide-x":[{"divide-x":R()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":R()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...ie(),`hidden`,`none`]}],"divide-style":[{divide:[...ie(),`hidden`,`none`]}],"border-color":[{border:F()}],"border-color-x":[{"border-x":F()}],"border-color-y":[{"border-y":F()}],"border-color-s":[{"border-s":F()}],"border-color-e":[{"border-e":F()}],"border-color-bs":[{"border-bs":F()}],"border-color-be":[{"border-be":F()}],"border-color-t":[{"border-t":F()}],"border-color-r":[{"border-r":F()}],"border-color-b":[{"border-b":F()}],"border-color-l":[{"border-l":F()}],"divide-color":[{divide:F()}],"outline-style":[{outline:[...ie(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[Qn,B,z]}],"outline-w":[{outline:[``,Qn,_r,ur]}],"outline-color":[{outline:F()}],shadow:[{shadow:[``,`none`,u,Sr,gr]}],"shadow-color":[{shadow:F()}],"inset-shadow":[{"inset-shadow":[`none`,d,Sr,gr]}],"inset-shadow-color":[{"inset-shadow":F()}],"ring-w":[{ring:R()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:F()}],"ring-offset-w":[{"ring-offset":[Qn,ur]}],"ring-offset-color":[{"ring-offset":F()}],"inset-ring-w":[{"inset-ring":R()}],"inset-ring-color":[{"inset-ring":F()}],"text-shadow":[{"text-shadow":[`none`,f,Sr,gr]}],"text-shadow-color":[{"text-shadow":F()}],opacity:[{opacity:[Qn,B,z]}],"mix-blend":[{"mix-blend":[...ae(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":ae()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[Qn]}],"mask-image-linear-from-pos":[{"mask-linear-from":oe()}],"mask-image-linear-to-pos":[{"mask-linear-to":oe()}],"mask-image-linear-from-color":[{"mask-linear-from":F()}],"mask-image-linear-to-color":[{"mask-linear-to":F()}],"mask-image-t-from-pos":[{"mask-t-from":oe()}],"mask-image-t-to-pos":[{"mask-t-to":oe()}],"mask-image-t-from-color":[{"mask-t-from":F()}],"mask-image-t-to-color":[{"mask-t-to":F()}],"mask-image-r-from-pos":[{"mask-r-from":oe()}],"mask-image-r-to-pos":[{"mask-r-to":oe()}],"mask-image-r-from-color":[{"mask-r-from":F()}],"mask-image-r-to-color":[{"mask-r-to":F()}],"mask-image-b-from-pos":[{"mask-b-from":oe()}],"mask-image-b-to-pos":[{"mask-b-to":oe()}],"mask-image-b-from-color":[{"mask-b-from":F()}],"mask-image-b-to-color":[{"mask-b-to":F()}],"mask-image-l-from-pos":[{"mask-l-from":oe()}],"mask-image-l-to-pos":[{"mask-l-to":oe()}],"mask-image-l-from-color":[{"mask-l-from":F()}],"mask-image-l-to-color":[{"mask-l-to":F()}],"mask-image-x-from-pos":[{"mask-x-from":oe()}],"mask-image-x-to-pos":[{"mask-x-to":oe()}],"mask-image-x-from-color":[{"mask-x-from":F()}],"mask-image-x-to-color":[{"mask-x-to":F()}],"mask-image-y-from-pos":[{"mask-y-from":oe()}],"mask-image-y-to-pos":[{"mask-y-to":oe()}],"mask-image-y-from-color":[{"mask-y-from":F()}],"mask-image-y-to-color":[{"mask-y-to":F()}],"mask-image-radial":[{"mask-radial":[B,z]}],"mask-image-radial-from-pos":[{"mask-radial-from":oe()}],"mask-image-radial-to-pos":[{"mask-radial-to":oe()}],"mask-image-radial-from-color":[{"mask-radial-from":F()}],"mask-image-radial-to-color":[{"mask-radial-to":F()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[Qn]}],"mask-image-conic-from-pos":[{"mask-conic-from":oe()}],"mask-image-conic-to-pos":[{"mask-conic-to":oe()}],"mask-image-conic-from-color":[{"mask-conic-from":F()}],"mask-image-conic-to-color":[{"mask-conic-to":F()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:I()}],"mask-repeat":[{mask:te()}],"mask-size":[{mask:L()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,B,z]}],filter:[{filter:[``,`none`,B,z]}],blur:[{blur:se()}],brightness:[{brightness:[Qn,B,z]}],contrast:[{contrast:[Qn,B,z]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Sr,gr]}],"drop-shadow-color":[{"drop-shadow":F()}],grayscale:[{grayscale:[``,Qn,B,z]}],"hue-rotate":[{"hue-rotate":[Qn,B,z]}],invert:[{invert:[``,Qn,B,z]}],saturate:[{saturate:[Qn,B,z]}],sepia:[{sepia:[``,Qn,B,z]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,B,z]}],"backdrop-blur":[{"backdrop-blur":se()}],"backdrop-brightness":[{"backdrop-brightness":[Qn,B,z]}],"backdrop-contrast":[{"backdrop-contrast":[Qn,B,z]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,Qn,B,z]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Qn,B,z]}],"backdrop-invert":[{"backdrop-invert":[``,Qn,B,z]}],"backdrop-opacity":[{"backdrop-opacity":[Qn,B,z]}],"backdrop-saturate":[{"backdrop-saturate":[Qn,B,z]}],"backdrop-sepia":[{"backdrop-sepia":[``,Qn,B,z]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,B,z]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[Qn,`initial`,B,z]}],ease:[{ease:[`linear`,`initial`,_,B,z]}],delay:[{delay:[Qn,B,z]}],animate:[{animate:[`none`,v,B,z]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,B,z]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:ce()}],"rotate-x":[{"rotate-x":ce()}],"rotate-y":[{"rotate-y":ce()}],"rotate-z":[{"rotate-z":ce()}],scale:[{scale:le()}],"scale-x":[{"scale-x":le()}],"scale-y":[{"scale-y":le()}],"scale-z":[{"scale-z":le()}],"scale-3d":[`scale-3d`],skew:[{skew:ue()}],"skew-x":[{"skew-x":ue()}],"skew-y":[{"skew-y":ue()}],transform:[{transform:[B,z,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:de()}],"translate-x":[{"translate-x":de()}],"translate-y":[{"translate-y":de()}],"translate-z":[{"translate-z":de()}],"translate-none":[`translate-none`],zoom:[{zoom:[$n,B,z]}],accent:[{accent:F()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:F()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,B,z]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":F()}],"scrollbar-track-color":[{"scrollbar-track":F()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,B,z]}],fill:[{fill:[`none`,...F()]}],"stroke-w":[{stroke:[Qn,_r,ur,dr]}],stroke:[{stroke:[`none`,...F()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function V(...e){return Pr(cn(e))}var Fr=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),H=o(((e,t)=>{t.exports=Fr()}))();function Ir(e){let t=[];return v.Children.forEach(e,e=>{if(!v.isValidElement(e))return;if(e.type===v.Fragment){t.push(...Ir(e.props.children));return}if(e.type!==`option`)return;let n=e.props;t.push({value:String(n.value??``),label:n.children,disabled:!!n.disabled})}),t}var Lr=`w-72 max-w-full`;function Rr({id:e,className:t,value:n,onChange:r,required:i,disabled:a,"aria-label":o,children:s}){let c=Ir(s),l=String(n),u=c.find(e=>e.value===l),[d,f]=v.useState(!1),[p,m]=v.useState(-1),h=v.useRef(null),g=v.useRef(null),_=v.useRef(null),y=v.useId();v.useEffect(()=>{if(!d)return;let e=e=>{h.current?.contains(e.target)||f(!1)};return document.addEventListener(`pointerdown`,e),()=>document.removeEventListener(`pointerdown`,e)},[d]),v.useEffect(()=>{!d||p<0||_.current?.children[p]?.scrollIntoView({block:`nearest`})},[d,p]),v.useEffect(()=>{let e=_.current;if(!d||!e)return;let t=t=>{t.preventDefault(),Math.abs(t.deltaX)>Math.abs(t.deltaY)?e.scrollLeft+=t.deltaX:e.scrollTop+=t.shiftKey&&!t.deltaX?0:t.deltaY,t.shiftKey&&!t.deltaX&&(e.scrollLeft+=t.deltaY)};return e.addEventListener(`wheel`,t,{passive:!1}),()=>e.removeEventListener(`wheel`,t)},[d]);let b=()=>{a||(m(Math.max(0,c.findIndex(e=>e.value===l))),f(!0))},x=e=>{e.disabled||(f(!1),g.current?.focus(),e.value!==l&&r({target:{value:e.value},currentTarget:{value:e.value}}))},S=(e,t)=>{for(let n=e+t;n>=0&&n<c.length;n+=t)if(!c[n].disabled)return n;return e};return(0,H.jsxs)(`div`,{ref:h,className:V(`relative min-w-0 max-w-full`,t?.includes(`w-full`)&&`w-full`),children:[(0,H.jsxs)(`button`,{ref:g,id:e,type:`button`,role:`combobox`,"aria-label":o,"aria-haspopup":`listbox`,"aria-expanded":d,"aria-controls":y,"aria-required":i,"aria-activedescendant":d&&p>=0?`${y}-${p}`:void 0,disabled:a,onClick:()=>d?f(!1):b(),onKeyDown:e=>{if(!d){[`ArrowDown`,`ArrowUp`,`Enter`,` `].includes(e.key)&&(e.preventDefault(),b());return}switch(e.key){case`ArrowDown`:e.preventDefault(),m(e=>S(e,1));break;case`ArrowUp`:e.preventDefault(),m(e=>S(e,-1));break;case`Home`:e.preventDefault(),m(S(-1,1));break;case`End`:e.preventDefault(),m(S(c.length,-1));break;case`Enter`:case` `:e.preventDefault(),c[p]&&x(c[p]);break;case`Escape`:e.preventDefault(),f(!1);break;case`Tab`:f(!1)}},className:V(`flex h-9 max-w-full items-center justify-between gap-2 rounded-[10px] border border-input bg-card px-2.5 text-ui text-foreground text-start transition-colors duration-150 hover:bg-interactive-hover focus-visible:border-ring focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50`,t,`flex h-9 rounded-[10px] border-input bg-card text-ui`),children:[(0,H.jsx)(`span`,{className:`min-w-0 truncate`,children:u?.label??``}),(0,H.jsx)(ue,{className:V(`size-4 shrink-0 text-muted-foreground transition-transform duration-200`,d&&`rotate-180`)})]}),d?(0,H.jsx)(`ul`,{ref:_,id:y,role:`listbox`,"aria-label":o,className:`absolute start-0 top-full z-20 mt-1 max-h-64 w-max min-w-full max-w-[min(40rem,calc(100vw-2rem))] overflow-auto overscroll-contain rounded-[10px] border border-input bg-card p-1 shadow-sm`,children:c.map((e,t)=>(0,H.jsxs)(`li`,{id:`${y}-${t}`,role:`option`,"aria-selected":e.value===l,"aria-disabled":e.disabled||void 0,onPointerMove:()=>!e.disabled&&m(t),onPointerDown:e=>e.preventDefault(),onClick:()=>x(e),className:V(`flex w-max min-w-full cursor-pointer items-center justify-between gap-3 whitespace-nowrap rounded-md px-2.5 py-1.5 text-sm text-card-foreground transition-colors`,t===p&&`bg-selection text-foreground`,e.value===l&&`font-medium`,e.disabled&&`cursor-not-allowed opacity-50`),children:[(0,H.jsx)(`span`,{className:`shrink-0`,title:typeof e.label==`string`?e.label:void 0,children:e.label}),e.value===l?(0,H.jsx)(le,{className:`size-3.5 shrink-0 text-primary`}):null]},`${e.value}-${t}`))}):null]})}var zr=l(h(),1);function Br(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var Vr=e=>{switch(e){case`success`:return Wr;case`info`:return Kr;case`warning`:return Gr;case`error`:return qr;default:return null}},Hr=Array(12).fill(0),Ur=({visible:e,className:t})=>v.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},v.createElement(`div`,{className:`sonner-spinner`},Hr.map((e,t)=>v.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),Wr=v.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},v.createElement(`path`,{fillRule:`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,clipRule:`evenodd`})),Gr=v.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},v.createElement(`path`,{fillRule:`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,clipRule:`evenodd`})),Kr=v.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},v.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,clipRule:`evenodd`})),qr=v.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},v.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,clipRule:`evenodd`})),Jr=v.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`},v.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),v.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),Yr=()=>{let[e,t]=v.useState(document.hidden);return v.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[]),e},Xr=1,Zr=100,Qr=e=>typeof e?.id==`number`||e?.id?.length>0?e.id:Xr++,$r=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),this.getActiveToasts().forEach(t=>e(t)),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e],this.trimHistory()},this.trimHistory=()=>{let e=this.toasts.length-Zr;e<=0||(this.toasts=this.toasts.filter(t=>e>0&&this.dismissedToasts.has(t.id)?(this.dismissedToasts.delete(t.id),e--,!1):!0))},this.create=e=>{let{message:t,...n}=e,r=Qr(e),i=this.pendingDismissals.get(r);i!==void 0&&(cancelAnimationFrame(i),this.pendingDismissals.delete(r),this.dismissedToasts.delete(r));let a=this.dismissedToasts.has(r),o=e.dismissible===void 0||e.dismissible;return a&&(this.dismissedToasts.delete(r),this.toasts=this.toasts.filter(e=>e.id!==r)),!a&&this.toasts.find(e=>e.id===r)?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:o,title:t}):n):this.addToast({title:t,...n,dismissible:o,id:r}),r},this.dismiss=e=>{if(e==null)return this.getActiveToasts().forEach(e=>{this.dismissedToasts.add(e.id),this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e;this.dismissedToasts.add(e);let t=this.pendingDismissals.get(e);return t!==void 0&&cancelAnimationFrame(t),this.pendingDismissals.set(e,requestAnimationFrame(()=>{this.pendingDismissals.delete(e),this.subscribers.forEach(t=>t({id:e,dismiss:!0}))})),e},this.message=(e,t)=>this.create({...t,message:e,type:void 0}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],v.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(ti(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,o=typeof r==`object`&&!v.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!v.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!v.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:a,...o})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!v.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=Qr(t);return this.create({...t,jsx:e(n),id:n,type:void 0}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}},ei=(e,t)=>$r.message(e,t),ti=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,U=Object.assign(ei,{success:$r.success,info:$r.info,warning:$r.warning,error:$r.error,custom:$r.custom,message:$r.message,promise:$r.promise,dismiss:$r.dismiss,loading:$r.loading},{getHistory:()=>$r.toasts,getToasts:()=>$r.getActiveToasts()});Br(`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}`);function ni(e){return e.label!==void 0}var ri=3,ii=`24px`,ai=`16px`,oi=4e3,si=356,ci=14,li=45,ui=200;function di(...e){return e.filter(Boolean).join(` `)}function fi(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var pi=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:a,visibleToasts:o,heights:s,index:c,toasts:l,expanded:u,removeToast:d,defaultRichColors:f,closeButton:p,style:m,cancelButtonStyle:h,actionButtonStyle:g,className:_=``,descriptionClassName:y=``,duration:b,position:x,gap:S,expandByDefault:C,classNames:w,icons:T,closeButtonAriaLabel:E=`Close toast`}=e,[D,O]=v.useState(null),[k,A]=v.useState(null),[j,M]=v.useState(!1),[N,P]=v.useState(!1),[ee,F]=v.useState(!1),[I,te]=v.useState(!1),[L,ne]=v.useState(!1),[re,R]=v.useState(0),[ie,ae]=v.useState(0),oe=v.useRef(n.duration||b||oi),se=v.useRef(null),ce=v.useRef(null),le=c===0,ue=c+1<=o,de=n.type,fe=de??`default`,pe=n.dismissible!==!1,me=n.className||``,he=n.descriptionClassName||``,ge=v.useMemo(()=>s.findIndex(e=>e.toastId===n.id)||0,[s,n.id]),_e=v.useMemo(()=>n.closeButton??p,[n.closeButton,p]),ve=v.useMemo(()=>n.duration||b||oi,[n.duration,b]),ye=v.useRef(0),be=v.useRef(0),xe=v.useRef(0),Se=v.useRef(null),[Ce,we]=x.split(`-`),Te=v.useMemo(()=>s.reduce((e,t,n)=>n>=ge?e:e+t.height,0),[s,ge]),Ee=Yr(),De=v.useMemo(()=>e.swipeDirections??fi(x),[e.swipeDirections,x]),Oe=n.invert||t,ke=de===`loading`;be.current=v.useMemo(()=>ge*S+Te,[ge,Te]),v.useEffect(()=>{oe.current=ve},[ve]),v.useEffect(()=>{M(!0)},[]),v.useEffect(()=>{let e=ce.current;if(e){let t=e.getBoundingClientRect().height;return ae(t),a(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>a(e=>e.filter(e=>e.toastId!==n.id))}},[a,n.id]),v.useLayoutEffect(()=>{if(!j)return;let e=ce.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,ae(r),a(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[j,n.title,n.description,a,n.id,n.jsx,n.action,n.cancel]);let Ae=v.useCallback(()=>{P(!0),R(be.current),a(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{d(n)},ui)},[n,d,a,be]);v.useEffect(()=>{if(n.promise&&de===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return u||i||Ee?(()=>{if(xe.current<ye.current){let e=new Date().getTime()-ye.current;oe.current-=e}xe.current=new Date().getTime()})():oe.current!==1/0&&(ye.current=new Date().getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),Ae()},oe.current)),()=>clearTimeout(e)},[u,i,n,de,Ee,Ae]),v.useEffect(()=>{n.delete&&(Ae(),n.onDismiss==null||n.onDismiss.call(n,n))},[Ae,n.delete]);function je(){return T?.loading?v.createElement(`div`,{className:di(w?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":de===`loading`},T.loading):v.createElement(Ur,{className:di(w?.loader,n?.classNames?.loader),visible:de===`loading`})}let Me=n.icon||T?.[de]||Vr(de);return v.createElement(`li`,{tabIndex:0,ref:ce,className:di(_,me,w?.toast,n?.classNames?.toast,w?.[fe],n?.classNames?.[fe]),"data-sonner-toast":``,"data-rich-colors":n.richColors??f,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":j,"data-promise":!!n.promise,"data-swiped":L,"data-removed":N,"data-visible":ue,"data-y-position":Ce,"data-x-position":we,"data-index":c,"data-front":le,"data-swiping":ee,"data-dismissible":pe,"data-type":de,"data-invert":Oe,"data-swipe-out":I,"data-swipe-direction":k,"data-expanded":!!(u||C&&j),"data-testid":n.testId,style:{"--index":c,"--toasts-before":c,"--z-index":l.length-c,"--offset":`${N?re:be.current}px`,"--initial-height":C?`auto`:`${ie}px`,...m,...n.style},onDragEnd:()=>{F(!1),O(null),Se.current=null},onPointerDown:e=>{e.button!==2&&(ke||!pe||(se.current=new Date,R(be.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(F(!0),Se.current={x:e.clientX,y:e.clientY})))},onPointerUp:()=>{if(I||!pe)return;Se.current=null;let e=Number(ce.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(ce.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-se.current?.getTime(),i=D===`x`?e:t,a=Math.abs(i)/r;if((D===`x`?De.includes(e>0?`right`:`left`):De.includes(t>0?`bottom`:`top`))&&(Math.abs(i)>=li||a>.11)){R(be.current),n.onDismiss==null||n.onDismiss.call(n,n),A(D===`x`?e>0?`right`:`left`:t>0?`down`:`up`),Ae(),te(!0);return}var o,s;(o=ce.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=ce.current)==null||s.style.setProperty(`--swipe-amount-y`,`0px`),ne(!1),F(!1),O(null)},onPointerMove:e=>{var t,n;if(!Se.current||!pe||window.getSelection()?.toString().length>0)return;let r=e.clientY-Se.current.y,i=e.clientX-Se.current.x;!D&&(Math.abs(i)>1||Math.abs(r)>1)&&O(Math.abs(i)>Math.abs(r)?`x`:`y`);let a={x:0,y:0},o=e=>1/(1.5+Math.abs(e)/20);if(D===`y`){if(De.includes(`top`)||De.includes(`bottom`)){if(De.includes(`top`)&&r<0||De.includes(`bottom`)&&r>0)a.y=r;else{let e=r*o(r);a.y=Math.abs(e)<Math.abs(r)?e:r}}}else if(D===`x`&&(De.includes(`left`)||De.includes(`right`))){if(De.includes(`left`)&&i<0||De.includes(`right`)&&i>0)a.x=i;else{let e=i*o(i);a.x=Math.abs(e)<Math.abs(i)?e:i}}(Math.abs(a.x)>0||Math.abs(a.y)>0)&&ne(!0),(t=ce.current)==null||t.style.setProperty(`--swipe-amount-x`,`${a.x}px`),(n=ce.current)==null||n.style.setProperty(`--swipe-amount-y`,`${a.y}px`)}},_e&&!n.jsx&&de!==`loading`?v.createElement(`button`,{"aria-label":E,"data-disabled":ke,"data-close-button":!0,onClick:ke||!pe?()=>{}:()=>{Ae(),n.onDismiss==null||n.onDismiss.call(n,n)},className:di(w?.closeButton,n?.classNames?.closeButton)},T?.close??Jr):null,(de||n.icon||n.promise)&&n.icon!==null&&(T?.[de]!==null||n.icon)?v.createElement(`div`,{"data-icon":``,className:di(w?.icon,n?.classNames?.icon)},de===`loading`?n.icon||je():n.promise?je():null,de===`loading`?null:Me):null,v.createElement(`div`,{"data-content":``,className:di(w?.content,n?.classNames?.content)},v.createElement(`div`,{"data-title":``,className:di(w?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title),n.description?v.createElement(`div`,{"data-description":``,className:di(y,he,w?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),v.isValidElement(n.cancel)?n.cancel:n.cancel&&ni(n.cancel)?v.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||h,onClick:e=>{ni(n.cancel)&&pe&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),Ae())},className:di(w?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,v.isValidElement(n.action)?n.action:n.action&&ni(n.action)?v.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||g,onClick:e=>{ni(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),!e.defaultPrevented&&Ae())},className:di(w?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function mi(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}function hi(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?ai:ii;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var gi=v.forwardRef(function(e,t){let{id:n,invert:r,position:i=`bottom-right`,hotkey:a=[`altKey`,`KeyT`],expand:o,closeButton:s,className:c,offset:l,mobileOffset:u,theme:d=`light`,richColors:f,duration:p,style:m,visibleToasts:h=ri,toastOptions:g,dir:_=mi(),gap:y=ci,icons:b,customAriaLabel:x,containerAriaLabel:S=`Notifications`}=e,[C,w]=v.useState([]),T=v.useMemo(()=>n?C.filter(e=>e.toasterId===n):C.filter(e=>!e.toasterId),[C,n]),E=v.useMemo(()=>Array.from(new Set([i].concat(T.filter(e=>e.position).map(e=>e.position)))),[T,i]),[D,O]=v.useState([]),[k,A]=v.useState(!1),[j,M]=v.useState(!1),[N,P]=v.useState(d===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:d),ee=v.useRef(null),F=a.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),I=v.useRef(null),te=v.useRef(!1),L=v.useCallback(e=>{w(t=>(t.find(t=>t.id===e.id)?.delete||$r.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return v.useEffect(()=>$r.subscribe(e=>{if(e.dismiss){requestAnimationFrame(()=>{w(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))});return}setTimeout(()=>{zr.flushSync(()=>{w(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[]),v.useEffect(()=>{if(d!==`system`){P(d);return}if(d===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?P(`dark`):P(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{P(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{P(e?`dark`:`light`)}catch(e){console.error(e)}})}},[d]),v.useEffect(()=>{C.length<=1&&A(!1)},[C]),v.useEffect(()=>{let e=e=>{if(a.length>0&&a.every(t=>e[t]||e.code===t)){var t;A(!0),(t=ee.current)==null||t.focus()}e.code===`Escape`&&(document.activeElement===ee.current||ee.current?.contains(document.activeElement))&&A(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]),v.useEffect(()=>{if(ee.current)return()=>{I.current&&(I.current.focus({preventScroll:!0}),I.current=null,te.current=!1)}},[ee.current]),v.createElement(`section`,{ref:t,"aria-label":x??`${S} ${F}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},E.map((t,n)=>{let[i,a]=t.split(`-`);return T.length?v.createElement(`ol`,{key:t,dir:_===`auto`?mi():_,tabIndex:-1,ref:ee,className:c,"data-sonner-toaster":!0,"data-sonner-theme":N,"data-y-position":i,"data-x-position":a,style:{"--front-toast-height":`${D[0]?.height||0}px`,"--width":`${si}px`,"--gap":`${y}px`,...m,...hi(l,u)},onBlur:e=>{te.current&&!e.currentTarget.contains(e.relatedTarget)&&(te.current=!1,I.current&&=(I.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||te.current||(te.current=!0,I.current=e.relatedTarget)},onMouseEnter:()=>A(!0),onMouseMove:()=>A(!0),onMouseLeave:()=>{j||A(!1)},onDragEnd:()=>A(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||M(!0)},onPointerUp:()=>M(!1)},T.filter(e=>!e.position&&n===0||e.position===t).map((n,i)=>v.createElement(pi,{key:n.id,icons:b,index:i,toast:n,defaultRichColors:f,duration:g?.duration??p,className:g?.className,descriptionClassName:g?.descriptionClassName,invert:r,visibleToasts:h,closeButton:g?.closeButton??s,interacting:j,position:t,style:g?.style,unstyled:g?.unstyled,classNames:g?.classNames,cancelButtonStyle:g?.cancelButtonStyle,actionButtonStyle:g?.actionButtonStyle,closeButtonAriaLabel:g?.closeButtonAriaLabel,removeToast:L,toasts:T.filter(e=>e.position==n.position),heights:D.filter(e=>e.position==n.position),setHeights:O,expandByDefault:o,gap:y,expanded:k,swipeDirections:e.swipeDirections}))):null}))});async function W(e,t={}){try{let n=new AbortController,r=t.timeout||6e4,{timeout:i,headers:a,...o}=t,s=setTimeout(()=>n.abort(),r),c=await fetch(e,{...o,headers:{...a,"x-omms-token":window.__OMMS_TOKEN__||``},signal:n.signal});return clearTimeout(s),await c.json()}catch(e){return console.error(`API Error:`,e),{success:!1,error:e instanceof Error?e.message:String(e)}}}var _i=`/api/user-profile/ai-cleanup`,vi={"Content-Type":`application/json`},yi={start:(e,t)=>W(_i,{method:`POST`,headers:vi,body:JSON.stringify({includeIds:e,profileVersion:t})}),status:()=>W(_i),stop:()=>W(_i,{method:`DELETE`}),apply:(e,t)=>W(`${_i}/apply`,{method:`POST`,headers:vi,body:JSON.stringify({acceptedMerged:e,acceptedRemoved:t})})},bi=`/api/user-profile/auto-cleanup`,xi={status:()=>W(bi),undo:()=>W(`${bi}/undo`,{method:`POST`,headers:vi,body:JSON.stringify({})})};function Si(e,t){try{let n=localStorage.getItem(e);if(n!==null)return n;let r=localStorage.getItem(t);return r!==null&&wi(e,r),r}catch{return null}}function Ci(e){try{localStorage.removeItem(e)}catch{}}function wi(e,t){try{localStorage.setItem(e,t)}catch{}}var Ti=`omms-tag-migration-closed-count`;function Ei(e){if(e<=0)return!1;let t=Number(Si(Ti,Ti)??0);return!(Number.isFinite(t)&&e<=t)}function Di(e){wi(Ti,String(e))}function Oi(){wi(Ti,`0`)}var ki=[`auto`,`dmy`,`mdy`,`iso`],Ai=[`auto`,`h23`,`h12`],ji=`omms-date-format`,Mi=`omms-time-format`;function Ni(e){return ki.includes(e??``)?e:`auto`}function Pi(e){return Ai.includes(e??``)?e:`auto`}function Fi(e,t){return e===`zh`?`zh-CN`:e===`ar`?`ar-SA`:t?.toLowerCase().startsWith(`en`)?t:`en-US`}var Ii=e=>String(e).padStart(2,`0`);function Li(e,t,n,r){if(t===`iso`)return`${e.getFullYear()}-${Ii(e.getMonth()+1)}-${Ii(e.getDate())}`;let i={day:`numeric`,month:`short`};r&&(i.year=`numeric`);let a=t===`dmy`?`en-GB`:t===`mdy`?`en-US`:n;return new Intl.DateTimeFormat(a,i).format(e)}function Ri(e,t,n){return t.time===`h23`?new Intl.DateTimeFormat(`en-GB`,{hour:`2-digit`,minute:`2-digit`,hourCycle:`h23`}).format(e):t.time===`h12`?new Intl.DateTimeFormat(`en-US`,{hour:`numeric`,minute:`2-digit`,hourCycle:`h12`}).format(e):new Intl.DateTimeFormat(n,{hour:`2-digit`,minute:`2-digit`}).format(e)}function zi(e,t,n){return Li(e,t.date,n,t.date===`iso`)}function Bi(e,t,n){return Li(e,t.date,n,!0)}function Vi(e,t,n){return t.date===`auto`&&t.time===`auto`?e.toLocaleString(n,{year:`numeric`,month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`}):`${Li(e,t.date,n,!0)}, ${Ri(e,t,n)}`}function Hi(e,t){let n=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime(),r=Math.round((n(t)-n(e))/864e5);return r===0?`today`:r===1?`yesterday`:`earlier`}var Ui=Gi(),Wi=new Set;function Gi(){return typeof window>`u`?{date:`auto`,time:`auto`}:{date:Ni(Si(ji,ji)),time:Pi(Si(Mi,Mi))}}function Ki(){return Ui}function qi(e){Ui={...Ui,...e},wi(ji,Ui.date),wi(Mi,Ui.time);for(let e of Wi)e()}function Ji(e){return Wi.add(e),()=>{Wi.delete(e)}}var Yi={dark:`#120f0e`,light:`#fdfcfa`},Xi={en:`en-GB`,zh:`zh-Hans`,ar:`ar`};function Zi(e){return Xi[e]}function Qi(e){return Yi[e]}function $i(e,t,n){let r=n??Qi(t);e.querySelector(`meta[name="theme-color"]`)?.setAttribute(`content`,r)}var ea={en:{"nav-memorisation":`Memorisation`,"memorisation-intro":`A memorisation is an exact note that you save on purpose. Each one has an ID such as ms-4k7q2p. Recall it later by its ID or by words from the note.`,"memorisation-loading":`Loading memorisations…`,"memorisation-load-failed":`Could not load the memorisations. Reload the page to try again.`,"memorisation-empty-title":`No memorisations yet`,"memorisation-empty-body":`Ask your agent to memorise this session, or run this command in a terminal. Saved records appear here.`,"memorisation-search-title":`Recall`,"memorisation-search-label":`Recall by ID or words`,"memorisation-search-placeholder":`ms-4k7q2p, words, or label:name`,"memorisation-search-button":`Recall`,"memorisation-search-clear":`Clear search`,"memorisation-searching":`Searching…`,"memorisation-results-title":`Results for {query}`,"memorisation-no-match":`No memorisation matched. Try other words, or recall by ID.`,"memorisation-no-id":`No memorisation has the ID {id}.`,"memorisation-recall-failed":`The search did not run. Try again.`,"memorisation-confidence":`Confidence {score}%`,"memorisation-list-title":`Saved memorisations`,"memorisation-list-label":`Memorisations`,"memorisation-total":`Memorisations: {count}`,"memorisation-kind-snapshot":`Session snapshot`,"memorisation-kind-explicit":`Explicit note`,"memorisation-id-label":`ID`,"memorisation-saved-at":`Saved {date}`,"memorisation-linked-in":`In {space}`,"memorisation-open":`Show full text`,"memorisation-close":`Hide full text`,"memorisation-text-label":`Stored text of {id}`,"memorisation-copy":`Copy ID`,"memorisation-copied":`Copied {id} to the clipboard.`,"memorisation-copy-failed":`The browser did not allow copying. Select the ID and copy it.`,"memorisation-delete":`Delete`,"memorisation-delete-title":`Delete {id}?`,"memorisation-delete-body":`This removes the record for good. To get a record back, memorise it again.`,"memorisation-delete-cancel":`Cancel`,"memorisation-deleting":`Deleting {id}…`,"memorisation-deleted":`Deleted {id}.`,"memorisation-delete-failed":`Could not delete {id}. Try again.`,"memorisation-delete-linked":`This record is in the linked space {space}, which is read-only. Switch to that space to delete it.`,"memorisation-settings-title":`Settings`,"memorisation-settings-loading":`Loading settings…`,"memorisation-settings-saving":`Saving…`,"memorisation-settings-load-failed":`The settings could not be loaded. Reload the page to try again.`,"memorisation-settings-stale":`The config file changed. Reload the page and save again.`,"memorisation-settings-failed":`The setting could not be saved. Reload the page to try again.`,"memorisation-repeat-title":`When you memorise a session again`,"memorisation-repeat-intro":`Choose what happens when an agent memorises the same session a second time.`,"memorisation-repeat-label":`Repeat memorisation`,"memorisation-repeat-add":`Add a new memorisation`,"memorisation-repeat-add-detail":`Each snapshot gets its own ID. Earlier snapshots stay.`,"memorisation-repeat-replace":`Replace the earlier one`,"memorisation-repeat-replace-detail":`The new snapshot takes the ID of the earlier one from the same session, so an ID you already shared keeps working.`,"memorisation-repeat-saved":`Saved. The next snapshot follows this choice.`,"memorisation-rerank-label":`Rerank text recall (experimental)`,"memorisation-rerank-intro":`The reranker server reorders the matches of a text recall. This setting is experimental.`,"memorisation-rerank-saved":`Saved. The next text recall follows this choice.`,"memorisation-rerank-disabled":`Set the reranker server URL and model on the Memory settings page first.`,"memorisation-size-title":`Size cap`,"memorisation-size-intro":`A memorisation above the cap is refused, so a recall stays small. Lowering the cap does not change records you already saved.`,"memorisation-size-label":`Largest size`,"memorisation-unit-label":`Unit`,"memorisation-unit-characters":`Characters`,"memorisation-unit-tokens":`Tokens`,"memorisation-size-note":`Tokens are an estimate: about one token for every four bytes of text.`,"memorisation-size-save":`Save`,"memorisation-size-saved":`Saved. The next memorisation uses this cap.`,"memorisation-range-characters":`Enter a whole number from {min} to {max} characters.`,"memorisation-range-tokens":`Enter a whole number from {min} to {max} tokens.`,"memorisation-search-help":`Add label:name to narrow the results by label. Use quotes for a label with spaces, such as label:"two words". You can repeat label: for more labels.`,"memorisation-label-add":`Filter by label {label}`,"memorisation-filter-active":`Showing records with all of these labels:`,"memorisation-filter-remove":`Remove label {label}`,"memorisation-filter-clear":`Clear labels`,"memorisation-filter-empty":`No memorisation has all of these labels.`,"memorisation-select":`Select`,"memorisation-select-all":`Select all`,"memorisation-selected":`{count} selected`,"memorisation-delete-selected":`Delete selected`,"memorisation-select-cancel":`Cancel`,"memorisation-select-row":`Select {id}`,"memorisation-bulk-title":`Delete the selected memorisations?`,"memorisation-bulk-body":`Memorisations to delete: {count}. This removes them for good. To get a record back, memorise it again.`,"memorisation-bulk-deleting":`Deleting the selected memorisations…`,"memorisation-bulk-failed":`Could not delete the selected memorisations. Try again.`,"memorisation-bulk-deleted":`Deleted {count}.`,"memorisation-skipped":`Skipped {id}: {reason}`,"memorisation-skipped-not-found":`it no longer exists`,"memorisation-skipped-linked":`it is in a linked space, which is read-only`,"memorisation-skipped-not-memorisation":`it is not a memorisation`},zh:{"nav-memorisation":`记忆存档`,"memorisation-intro":`存档是你有意保存的一条原文笔记。每条存档都有一个编号,例如 ms-4k7q2p。之后可以用编号或笔记中的词语找回。`,"memorisation-loading":`正在加载存档…`,"memorisation-load-failed":`无法加载存档。请刷新页面后重试。`,"memorisation-empty-title":`还没有存档`,"memorisation-empty-body":`请让智能体存档当前会话,或在终端运行下面的命令。保存的记录会显示在这里。`,"memorisation-search-title":`找回`,"memorisation-search-label":`用编号或词语找回`,"memorisation-search-placeholder":`ms-4k7q2p、词语或 label:名称`,"memorisation-search-button":`找回`,"memorisation-search-clear":`清除搜索`,"memorisation-searching":`正在搜索…`,"memorisation-results-title":`“{query}”的结果`,"memorisation-no-match":`没有匹配的存档。请换其他词语,或用编号找回。`,"memorisation-no-id":`没有编号为 {id} 的存档。`,"memorisation-recall-failed":`搜索未能运行。请重试。`,"memorisation-confidence":`置信度 {score}%`,"memorisation-list-title":`已保存的存档`,"memorisation-list-label":`存档`,"memorisation-total":`存档数:{count}`,"memorisation-kind-snapshot":`会话快照`,"memorisation-kind-explicit":`明确笔记`,"memorisation-id-label":`编号`,"memorisation-saved-at":`保存于 {date}`,"memorisation-linked-in":`位于 {space}`,"memorisation-open":`显示完整文本`,"memorisation-close":`隐藏完整文本`,"memorisation-text-label":`{id} 的已存文本`,"memorisation-copy":`复制编号`,"memorisation-copied":`已将 {id} 复制到剪贴板。`,"memorisation-copy-failed":`浏览器不允许复制。请选中编号后手动复制。`,"memorisation-delete":`删除`,"memorisation-delete-title":`删除 {id}?`,"memorisation-delete-body":`这会永久删除该记录。如需恢复,请重新存档。`,"memorisation-delete-cancel":`取消`,"memorisation-deleting":`正在删除 {id}…`,"memorisation-deleted":`已删除 {id}。`,"memorisation-delete-failed":`无法删除 {id}。请重试。`,"memorisation-delete-linked":`该记录位于关联空间 {space},该空间是只读的。请切换到该空间后再删除。`,"memorisation-settings-title":`设置`,"memorisation-settings-loading":`正在加载设置…`,"memorisation-settings-saving":`正在保存…`,"memorisation-settings-load-failed":`无法加载设置。请刷新页面后重试。`,"memorisation-settings-stale":`配置文件已更改。请刷新页面后重新保存。`,"memorisation-settings-failed":`无法保存该设置。请刷新页面后重试。`,"memorisation-repeat-title":`再次存档同一会话时`,"memorisation-repeat-intro":`选择智能体第二次存档同一会话时的处理方式。`,"memorisation-repeat-label":`重复存档`,"memorisation-repeat-add":`新增一条存档`,"memorisation-repeat-add-detail":`每个快照都有自己的编号,之前的快照保留。`,"memorisation-repeat-replace":`替换之前的存档`,"memorisation-repeat-replace-detail":`新快照沿用同一会话中上一个快照的编号,所以已分享的编号仍然有效。`,"memorisation-repeat-saved":`已保存。下一个快照将按此选择处理。`,"memorisation-rerank-label":`文本找回重排序(实验性)`,"memorisation-rerank-intro":`重排序服务器会调整文本找回的匹配顺序。此设置为实验性。`,"memorisation-rerank-saved":`已保存。下一次文本找回将按此选择处理。`,"memorisation-rerank-disabled":`请先在“记忆”设置页填写重排序服务器的网址和模型。`,"memorisation-size-title":`大小上限`,"memorisation-size-intro":`超过上限的存档会被拒绝,使找回的内容保持精简。降低上限不会改变已保存的记录。`,"memorisation-size-label":`最大大小`,"memorisation-unit-label":`单位`,"memorisation-unit-characters":`字符`,"memorisation-unit-tokens":`词元`,"memorisation-size-note":`词元数为估算值:每四个字节的文本约合一个词元。`,"memorisation-size-save":`保存`,"memorisation-size-saved":`已保存。下一条存档将使用此上限。`,"memorisation-range-characters":`请输入 {min} 到 {max} 之间的整数(字符)。`,"memorisation-range-tokens":`请输入 {min} 到 {max} 之间的整数(词元)。`,"memorisation-search-help":`在词语后加 label:名称,可按标签缩小结果。标签含空格时加引号,例如 label:"两个词"。可重复使用 label: 添加更多标签。`,"memorisation-label-add":`按标签 {label} 筛选`,"memorisation-filter-active":`显示同时带有以下所有标签的记录:`,"memorisation-filter-remove":`移除标签 {label}`,"memorisation-filter-clear":`清除标签`,"memorisation-filter-empty":`没有存档同时带有这些标签。`,"memorisation-select":`选择`,"memorisation-select-all":`全选`,"memorisation-selected":`已选 {count} 条`,"memorisation-delete-selected":`删除所选`,"memorisation-select-cancel":`取消`,"memorisation-select-row":`选择 {id}`,"memorisation-bulk-title":`删除所选存档?`,"memorisation-bulk-body":`要删除的存档数:{count}。这会永久删除这些记录。如需恢复,请重新存档。`,"memorisation-bulk-deleting":`正在删除所选存档…`,"memorisation-bulk-failed":`无法删除所选存档。请重试。`,"memorisation-bulk-deleted":`已删除 {count} 条。`,"memorisation-skipped":`已跳过 {id}:{reason}`,"memorisation-skipped-not-found":`它已不存在`,"memorisation-skipped-linked":`它位于只读的关联空间`,"memorisation-skipped-not-memorisation":`它不是存档`},ar:{"nav-memorisation":`الحفظ`,"memorisation-intro":`العنصر المحفوظ هو ملاحظة حرفية تحفظها عن قصد. لكل عنصر معرّف مثل ms-4k7q2p. يمكنك استرجاعه لاحقاً بمعرّفه أو بكلمات من الملاحظة.`,"memorisation-loading":`جارٍ تحميل العناصر المحفوظة…`,"memorisation-load-failed":`تعذّر تحميل العناصر المحفوظة. أعد تحميل الصفحة وحاول مرة أخرى.`,"memorisation-empty-title":`لا توجد عناصر محفوظة بعد`,"memorisation-empty-body":`اطلب من الوكيل حفظ هذه الجلسة، أو شغّل الأمر التالي في الطرفية. تظهر السجلات المحفوظة هنا.`,"memorisation-search-title":`الاسترجاع`,"memorisation-search-label":`استرجع بالمعرّف أو بالكلمات`,"memorisation-search-placeholder":`ms-4k7q2p أو كلمات أو label:الاسم`,"memorisation-search-button":`استرجاع`,"memorisation-search-clear":`مسح البحث`,"memorisation-searching":`جارٍ البحث…`,"memorisation-results-title":`نتائج {query}`,"memorisation-no-match":`لا يوجد عنصر محفوظ مطابق. جرّب كلمات أخرى أو استرجع بالمعرّف.`,"memorisation-no-id":`لا يوجد عنصر محفوظ بالمعرّف {id}.`,"memorisation-recall-failed":`لم يعمل البحث. حاول مرة أخرى.`,"memorisation-confidence":`الثقة {score}%`,"memorisation-list-title":`العناصر المحفوظة`,"memorisation-list-label":`العناصر المحفوظة`,"memorisation-total":`العناصر المحفوظة: {count}`,"memorisation-kind-snapshot":`لقطة جلسة`,"memorisation-kind-explicit":`ملاحظة صريحة`,"memorisation-id-label":`المعرّف`,"memorisation-saved-at":`حُفظ في {date}`,"memorisation-linked-in":`في {space}`,"memorisation-open":`عرض النص الكامل`,"memorisation-close":`إخفاء النص الكامل`,"memorisation-text-label":`النص المخزّن لـ {id}`,"memorisation-copy":`نسخ المعرّف`,"memorisation-copied":`تم نسخ {id} إلى الحافظة.`,"memorisation-copy-failed":`لم يسمح المتصفح بالنسخ. حدّد المعرّف وانسخه يدوياً.`,"memorisation-delete":`حذف`,"memorisation-delete-title":`حذف {id}؟`,"memorisation-delete-body":`يزيل هذا السجل نهائياً. لاستعادته، احفظه مرة أخرى.`,"memorisation-delete-cancel":`إلغاء`,"memorisation-deleting":`جارٍ حذف {id}…`,"memorisation-deleted":`تم حذف {id}.`,"memorisation-delete-failed":`تعذّر حذف {id}. حاول مرة أخرى.`,"memorisation-delete-linked":`هذا السجل في المساحة المرتبطة {space}، وهي للقراءة فقط. انتقل إلى تلك المساحة لحذفه.`,"memorisation-settings-title":`الإعدادات`,"memorisation-settings-loading":`جارٍ تحميل الإعدادات…`,"memorisation-settings-saving":`جارٍ الحفظ…`,"memorisation-settings-load-failed":`تعذّر تحميل الإعدادات. أعد تحميل الصفحة وحاول مرة أخرى.`,"memorisation-settings-stale":`تغيّر ملف الإعداد. أعد تحميل الصفحة واحفظ مرة أخرى.`,"memorisation-settings-failed":`تعذّر حفظ الإعداد. أعد تحميل الصفحة وحاول مرة أخرى.`,"memorisation-repeat-title":`عند حفظ الجلسة مرة أخرى`,"memorisation-repeat-intro":`اختر ما يحدث عندما يحفظ الوكيل الجلسة نفسها للمرة الثانية.`,"memorisation-repeat-label":`تكرار الحفظ`,"memorisation-repeat-add":`إضافة عنصر محفوظ جديد`,"memorisation-repeat-add-detail":`تحصل كل لقطة على معرّف خاص بها. تبقى اللقطات السابقة.`,"memorisation-repeat-replace":`استبدال العنصر السابق`,"memorisation-repeat-replace-detail":`تأخذ اللقطة الجديدة معرّف اللقطة السابقة من الجلسة نفسها، فيبقى أي معرّف شاركته صالحاً.`,"memorisation-repeat-saved":`تم الحفظ. ستتبع اللقطة التالية هذا الاختيار.`,"memorisation-rerank-label":`إعادة ترتيب الاسترجاع النصي (تجريبي)`,"memorisation-rerank-intro":`يعيد خادم إعادة الترتيب ترتيب نتائج الاسترجاع النصي. هذا الإعداد تجريبي.`,"memorisation-rerank-saved":`تم الحفظ. سيتبع الاسترجاع النصي التالي هذا الاختيار.`,"memorisation-rerank-disabled":`عيّن أولاً عنوان خادم إعادة الترتيب ونموذجه في صفحة إعدادات الذاكرة.`,"memorisation-size-title":`الحد الأقصى للحجم`,"memorisation-size-intro":`يُرفض أي عنصر محفوظ يتجاوز الحد، فيبقى الاسترجاع صغيراً. خفض الحد لا يغيّر السجلات المحفوظة سابقاً.`,"memorisation-size-label":`أكبر حجم`,"memorisation-unit-label":`الوحدة`,"memorisation-unit-characters":`أحرف`,"memorisation-unit-tokens":`رموز`,"memorisation-size-note":`عدد الرموز تقدير: نحو رمز واحد لكل أربعة بايتات من النص.`,"memorisation-size-save":`حفظ`,"memorisation-size-saved":`تم الحفظ. سيستخدم العنصر المحفوظ التالي هذا الحد.`,"memorisation-range-characters":`أدخل عدداً صحيحاً من {min} إلى {max} حرفاً.`,"memorisation-range-tokens":`أدخل عدداً صحيحاً من {min} إلى {max} رمزاً.`,"memorisation-search-help":`أضف label:الاسم لتضييق النتائج حسب الوسم. استخدم علامات الاقتباس لوسم يحتوي مسافات، مثل label:"كلمتان". يمكنك تكرار label: لإضافة وسوم أخرى.`,"memorisation-label-add":`تصفية حسب الوسم {label}`,"memorisation-filter-active":`عرض السجلات التي تحمل كل هذه الوسوم:`,"memorisation-filter-remove":`إزالة الوسم {label}`,"memorisation-filter-clear":`مسح الوسوم`,"memorisation-filter-empty":`لا يوجد عنصر محفوظ يحمل كل هذه الوسوم.`,"memorisation-select":`تحديد`,"memorisation-select-all":`تحديد الكل`,"memorisation-selected":`تم تحديد {count}`,"memorisation-delete-selected":`حذف المحدد`,"memorisation-select-cancel":`إلغاء`,"memorisation-select-row":`تحديد {id}`,"memorisation-bulk-title":`حذف العناصر المحفوظة المحددة؟`,"memorisation-bulk-body":`العناصر المراد حذفها: {count}. سيؤدي هذا إلى إزالتها نهائياً. لاستعادة سجل، احفظه من جديد.`,"memorisation-bulk-deleting":`جارٍ حذف العناصر المحددة…`,"memorisation-bulk-failed":`تعذّر حذف العناصر المحددة. حاول مرة أخرى.`,"memorisation-bulk-deleted":`تم حذف {count}.`,"memorisation-skipped":`تم تخطي {id}: {reason}`,"memorisation-skipped-not-found":`لم يعد موجوداً`,"memorisation-skipped-linked":`هو في مساحة مرتبطة للقراءة فقط`,"memorisation-skipped-not-memorisation":`ليس عنصراً محفوظاً`}},ta={en:{"nav-spaces":`Spaces`,"spaces-nav-hover":`Spaces. Active space: {name}`,"spaces-nav-hover-custom":`Spaces. Active space: {name}. A custom storage folder is in use.`,"spaces-nav-custom":`Custom storage folder`,"spaces-custom-note":`A config file sets a custom storage folder for this project. It overrides the active space.`,"spaces-active-mark":`Active space`,"spaces-loading":`Loading spaces…`,"spaces-load-failed":`Could not load the spaces.`,"spaces-switching":`Switching to {name}…`,"spaces-switch-failed":`The space did not change.`,"spaces-switched":`{name} is now the active space.`,"spaces-intro":`A space is a separate store of memories. One space is active at a time, and every host follows it.`,"spaces-problem":`Problem with the spaces file`,"spaces-list-title":`All spaces`,"spaces-list-label":`Memory spaces`,"spaces-view-label":`View`,"spaces-view-grid":`Grid view`,"spaces-view-list":`List view`,"spaces-status-active":`Active`,"spaces-status-available":`Available`,"spaces-size":`Size: {size}`,"spaces-created":`Created: {date}`,"spaces-created-none":`Created: not recorded`,"spaces-action-switch":`Activate`,"spaces-state":`State: {state}`,"spaces-action-archive":`Archive`,"spaces-action-backup":`Back up`,"spaces-action-delete":`Delete`,"spaces-action-open-folder":`Open folder`,"spaces-why-default-archive":`The Default space cannot be archived.`,"spaces-why-default-delete":`The Default space cannot be deleted.`,"spaces-why-active-switch":`This space is already active.`,"spaces-why-active-archive":`The active space cannot be archived. Switch to another space first.`,"spaces-why-active-delete":`The active space cannot be deleted. Switch to another space first.`,"spaces-why-archived-switch":`An archived space cannot be active. Unarchive it first.`,"spaces-why-other":`The server does not allow this action for this space.`,"spaces-create-title":`Create a space`,"spaces-create-label":`Space name`,"spaces-create-placeholder":`For example, Client work`,"spaces-create-button":`Create space`,"spaces-creating":`Creating {name}…`,"spaces-created-done":`Created {name}.`,"spaces-created-switch":`Switch to {name}`,"spaces-archiving":`Archiving {name}…`,"spaces-archived":`Archived {name}. It is now in the Archive.`,"spaces-unarchived":`{name} is available again.`,"spaces-backing-up":`Backing up {name}…`,"spaces-backed-up":`Backup saved to {path}`,"spaces-restoring":`Restoring {name}…`,"spaces-restored":`Restored as {name}.`,"spaces-cancel":`Cancel`,"spaces-close":`Close`,"spaces-delete-title":`Delete {name}?`,"spaces-delete-warning":`OMMS makes a backup of this space first. Then it removes the space and its folder.`,"spaces-delete-confirm-label":`Type {name} to confirm`,"spaces-delete-button":`Delete space`,"spaces-deleting":`Backing up and deleting {name}…`,"spaces-deleted-title":`{name} is deleted`,"spaces-delete-backup":`Backup saved to:`,"spaces-delete-leftover":`OMMS could not remove all of the space folder. Remove it by hand:`,"spaces-delete-restore":`To get the space back, use Restore as new space in the Backups list.`,"spaces-backups-title":`Backups`,"spaces-backups-intro":`OMMS backs up a space before it deletes the space. You can also back up a space yourself.`,"spaces-backups-empty":`No backups yet.`,"spaces-backups-list-label":`Space backups`,"spaces-backups-total":`Backups: {count}`,"spaces-backup-date":`Backed up: {date}`,"spaces-restore":`Restore as new space`,"spaces-edit-title":`Edit space: {name}`,"spaces-edit":`Edit`,"spaces-edit-name":`Name`,"spaces-saving":`Saving {name}…`,"spaces-saved":`Saved {name}.`,"spaces-confirm-switch-title":`Activate {name}?`,"spaces-confirm-switch-body":`Every host (Pi, OpenCode and Claude Code) and the web app will use this space from their next turn. Nothing is moved or deleted.`,"spaces-confirm-archive-title":`Archive {name}?`,"spaces-confirm-archive-body":`The space leaves the sidebar tree and cannot be activated. Its memories stay on disk. You can restore it from the Archive at any time.`,"spaces-confirm-backup-title":`Back up {name}?`,"spaces-confirm-backup-body":`OMMS copies the space to a backup folder and checks the copy. The space itself does not change.`,"nav-spaces-archive":`Archive`,"spaces-archive-intro":`Archived spaces stay on disk but cannot be activated. Restore a space to use it again.`,"spaces-archive-empty":`No space is archived.`,"spaces-archive-list-label":`Archived spaces`,"spaces-archive-total":`Archived spaces: {count}`,"spaces-archived-at":`Archived: {date}`,"spaces-archived-none":`Archived: not recorded`,"spaces-action-restore":`Restore`,"spaces-confirm-restore-title":`Restore {name}?`,"spaces-confirm-restore-body":`The space returns to the sidebar tree and can be activated again. Its memories are unchanged.`,"spaces-restored-space":`Restored {name}. It is back in the sidebar tree.`,"spaces-archive-open":`Open the Archive`},zh:{"nav-spaces":`空间`,"spaces-nav-hover":`空间。当前空间:{name}`,"spaces-nav-hover-custom":`空间。当前空间:{name}。正在使用自定义存储文件夹。`,"spaces-nav-custom":`自定义存储文件夹`,"spaces-custom-note":`配置文件为此项目设置了自定义存储文件夹,它优先于当前空间。`,"spaces-active-mark":`当前空间`,"spaces-loading":`正在加载空间…`,"spaces-load-failed":`无法加载空间。`,"spaces-switching":`正在切换到 {name}…`,"spaces-switch-failed":`空间没有切换。`,"spaces-switched":`{name} 现在是当前空间。`,"spaces-intro":`空间是一个独立的记忆存储。同一时间只有一个空间处于使用状态,所有宿主都会跟随它。`,"spaces-problem":`空间文件有问题`,"spaces-list-title":`全部空间`,"spaces-list-label":`记忆空间`,"spaces-view-label":`视图`,"spaces-view-grid":`网格视图`,"spaces-view-list":`列表视图`,"spaces-status-active":`当前`,"spaces-status-available":`可用`,"spaces-size":`大小:{size}`,"spaces-created":`创建时间:{date}`,"spaces-created-none":`创建时间:未记录`,"spaces-action-switch":`启用`,"spaces-state":`状态:{state}`,"spaces-action-archive":`归档`,"spaces-action-backup":`备份`,"spaces-action-delete":`删除`,"spaces-action-open-folder":`打开文件夹`,"spaces-why-default-archive":`默认空间不能归档。`,"spaces-why-default-delete":`默认空间不能删除。`,"spaces-why-active-switch":`此空间已是当前空间。`,"spaces-why-active-archive":`当前空间不能归档。请先切换到其他空间。`,"spaces-why-active-delete":`当前空间不能删除。请先切换到其他空间。`,"spaces-why-archived-switch":`已归档的空间不能设为当前空间。请先取消归档。`,"spaces-why-other":`服务器不允许对此空间执行此操作。`,"spaces-create-title":`创建空间`,"spaces-create-label":`空间名称`,"spaces-create-placeholder":`例如:客户项目`,"spaces-create-button":`创建空间`,"spaces-creating":`正在创建 {name}…`,"spaces-created-done":`已创建 {name}。`,"spaces-created-switch":`切换到 {name}`,"spaces-archiving":`正在归档 {name}…`,"spaces-archived":`已归档 {name}。它现在位于归档中。`,"spaces-unarchived":`{name} 可以再次使用。`,"spaces-backing-up":`正在备份 {name}…`,"spaces-backed-up":`备份已保存到 {path}`,"spaces-restoring":`正在恢复 {name}…`,"spaces-restored":`已恢复为 {name}。`,"spaces-cancel":`取消`,"spaces-close":`关闭`,"spaces-delete-title":`删除 {name}?`,"spaces-delete-warning":`OMMS 会先为此空间制作备份,然后删除该空间及其文件夹。`,"spaces-delete-confirm-label":`输入 {name} 以确认`,"spaces-delete-button":`删除空间`,"spaces-deleting":`正在备份并删除 {name}…`,"spaces-deleted-title":`{name} 已删除`,"spaces-delete-backup":`备份已保存到:`,"spaces-delete-leftover":`OMMS 无法删除空间文件夹的全部内容。请手动删除:`,"spaces-delete-restore":`若要找回此空间,请在备份列表中使用“恢复为新空间”。`,"spaces-backups-title":`备份`,"spaces-backups-intro":`OMMS 会在删除空间之前先备份该空间。你也可以自己备份空间。`,"spaces-backups-empty":`还没有备份。`,"spaces-backups-list-label":`空间备份`,"spaces-backups-total":`备份:{count}`,"spaces-backup-date":`备份时间:{date}`,"spaces-restore":`恢复为新空间`,"spaces-edit-title":`编辑空间:{name}`,"spaces-edit":`编辑`,"spaces-edit-name":`名称`,"spaces-saving":`正在保存 {name}…`,"spaces-saved":`已保存 {name}。`,"spaces-confirm-switch-title":`启用 {name}?`,"spaces-confirm-switch-body":`所有宿主(Pi、OpenCode 和 Claude Code)和网页应用将从下一轮起使用此空间。不会移动或删除任何内容。`,"spaces-confirm-archive-title":`归档 {name}?`,"spaces-confirm-archive-body":`该空间会从侧边栏树中移除,且无法启用。其记忆仍保留在磁盘上。你可以随时从归档中恢复它。`,"spaces-confirm-backup-title":`备份 {name}?`,"spaces-confirm-backup-body":`OMMS 会把该空间复制到备份文件夹并检查副本。空间本身不会改变。`,"nav-spaces-archive":`归档`,"spaces-archive-intro":`已归档的空间保留在磁盘上,但无法启用。恢复空间即可再次使用。`,"spaces-archive-empty":`没有已归档的空间。`,"spaces-archive-list-label":`已归档的空间`,"spaces-archive-total":`已归档的空间:{count}`,"spaces-archived-at":`归档时间:{date}`,"spaces-archived-none":`归档时间:未记录`,"spaces-action-restore":`恢复`,"spaces-confirm-restore-title":`恢复 {name}?`,"spaces-confirm-restore-body":`该空间会回到侧边栏树中,并可再次启用。其记忆保持不变。`,"spaces-restored-space":`已恢复 {name}。它已回到侧边栏树中。`,"spaces-archive-open":`打开归档`},ar:{"nav-spaces":`المساحات`,"spaces-nav-hover":`المساحات. المساحة النشطة: {name}`,"spaces-nav-hover-custom":`المساحات. المساحة النشطة: {name}. يُستخدم مجلد تخزين مخصص.`,"spaces-nav-custom":`مجلد تخزين مخصص`,"spaces-custom-note":`يحدد ملف إعداد مجلد تخزين مخصصًا لهذا المشروع. وهو يتقدم على المساحة النشطة.`,"spaces-active-mark":`المساحة النشطة`,"spaces-loading":`جارٍ تحميل المساحات…`,"spaces-load-failed":`تعذّر تحميل المساحات.`,"spaces-switching":`جارٍ التبديل إلى {name}…`,"spaces-switch-failed":`لم تتغير المساحة.`,"spaces-switched":`أصبحت {name} المساحة النشطة.`,"spaces-intro":`المساحة مخزن منفصل للذكريات. تكون مساحة واحدة نشطة في كل مرة، وتتبعها كل التطبيقات المضيفة.`,"spaces-problem":`مشكلة في ملف المساحات`,"spaces-list-title":`كل المساحات`,"spaces-list-label":`مساحات الذاكرة`,"spaces-view-label":`العرض`,"spaces-view-grid":`عرض الشبكة`,"spaces-view-list":`عرض القائمة`,"spaces-status-active":`نشطة`,"spaces-status-available":`متاحة`,"spaces-size":`الحجم: {size}`,"spaces-created":`تاريخ الإنشاء: {date}`,"spaces-created-none":`تاريخ الإنشاء: غير مسجل`,"spaces-action-switch":`تفعيل`,"spaces-state":`الحالة: {state}`,"spaces-action-archive":`أرشفة`,"spaces-action-backup":`نسخ احتياطي`,"spaces-action-delete":`حذف`,"spaces-action-open-folder":`فتح المجلد`,"spaces-why-default-archive":`لا يمكن أرشفة المساحة الافتراضية.`,"spaces-why-default-delete":`لا يمكن حذف المساحة الافتراضية.`,"spaces-why-active-switch":`هذه المساحة نشطة بالفعل.`,"spaces-why-active-archive":`لا يمكن أرشفة المساحة النشطة. بدّل إلى مساحة أخرى أولًا.`,"spaces-why-active-delete":`لا يمكن حذف المساحة النشطة. بدّل إلى مساحة أخرى أولًا.`,"spaces-why-archived-switch":`لا يمكن تفعيل مساحة مؤرشفة. ألغِ أرشفتها أولًا.`,"spaces-why-other":`لا يسمح الخادم بهذا الإجراء لهذه المساحة.`,"spaces-create-title":`إنشاء مساحة`,"spaces-create-label":`اسم المساحة`,"spaces-create-placeholder":`مثلًا: عمل العملاء`,"spaces-create-button":`إنشاء مساحة`,"spaces-creating":`جارٍ إنشاء {name}…`,"spaces-created-done":`تم إنشاء {name}.`,"spaces-created-switch":`التبديل إلى {name}`,"spaces-archiving":`جارٍ أرشفة {name}…`,"spaces-archived":`تمت أرشفة {name}. أصبحت الآن في الأرشيف.`,"spaces-unarchived":`أصبحت {name} متاحة من جديد.`,"spaces-backing-up":`جارٍ عمل نسخة احتياطية لـ {name}…`,"spaces-backed-up":`حُفظت النسخة الاحتياطية في {path}`,"spaces-restoring":`جارٍ استعادة {name}…`,"spaces-restored":`تمت الاستعادة باسم {name}.`,"spaces-cancel":`إلغاء`,"spaces-close":`إغلاق`,"spaces-delete-title":`حذف {name}؟`,"spaces-delete-warning":`ينشئ OMMS نسخة احتياطية من هذه المساحة أولًا. ثم يزيل المساحة ومجلدها.`,"spaces-delete-confirm-label":`اكتب {name} للتأكيد`,"spaces-delete-button":`حذف المساحة`,"spaces-deleting":`جارٍ النسخ الاحتياطي وحذف {name}…`,"spaces-deleted-title":`تم حذف {name}`,"spaces-delete-backup":`حُفظت النسخة الاحتياطية في:`,"spaces-delete-leftover":`تعذّر على OMMS إزالة كل محتويات مجلد المساحة. أزله يدويًا:`,"spaces-delete-restore":`لاستعادة المساحة، استخدم «استعادة كمساحة جديدة» في قائمة النسخ الاحتياطية.`,"spaces-backups-title":`النسخ الاحتياطية`,"spaces-backups-intro":`ينشئ OMMS نسخة احتياطية من المساحة قبل حذفها. ويمكنك أيضًا نسخ مساحة احتياطيًا بنفسك.`,"spaces-backups-empty":`لا توجد نسخ احتياطية بعد.`,"spaces-backups-list-label":`النسخ الاحتياطية للمساحات`,"spaces-backups-total":`النسخ الاحتياطية: {count}`,"spaces-backup-date":`تاريخ النسخ: {date}`,"spaces-restore":`استعادة كمساحة جديدة`,"spaces-edit-title":`تعديل المساحة: {name}`,"spaces-edit":`تعديل`,"spaces-edit-name":`الاسم`,"spaces-saving":`جارٍ حفظ {name}…`,"spaces-saved":`تم حفظ {name}.`,"spaces-confirm-switch-title":`تفعيل {name}؟`,"spaces-confirm-switch-body":`ستستخدم كل التطبيقات المضيفة (Pi وOpenCode وClaude Code) وتطبيق الويب هذه المساحة ابتداءً من دورتها التالية. لا يُنقل أي شيء ولا يُحذف.`,"spaces-confirm-archive-title":`أرشفة {name}؟`,"spaces-confirm-archive-body":`تخرج المساحة من شجرة الشريط الجانبي ولا يمكن تفعيلها. تبقى ذكرياتها على القرص. يمكنك استعادتها من الأرشيف في أي وقت.`,"spaces-confirm-backup-title":`نسخ {name} احتياطيًا؟`,"spaces-confirm-backup-body":`ينسخ OMMS المساحة إلى مجلد النسخ الاحتياطية ويفحص النسخة. لا تتغير المساحة نفسها.`,"nav-spaces-archive":`الأرشيف`,"spaces-archive-intro":`المساحات المؤرشفة تبقى على القرص لكن لا يمكن تفعيلها. استعد المساحة لاستخدامها من جديد.`,"spaces-archive-empty":`لا توجد مساحة مؤرشفة.`,"spaces-archive-list-label":`المساحات المؤرشفة`,"spaces-archive-total":`المساحات المؤرشفة: {count}`,"spaces-archived-at":`الأرشفة: {date}`,"spaces-archived-none":`الأرشفة: غير مسجل`,"spaces-action-restore":`استعادة`,"spaces-confirm-restore-title":`استعادة {name}؟`,"spaces-confirm-restore-body":`تعود المساحة إلى شجرة الشريط الجانبي ويمكن تفعيلها من جديد. تبقى ذكرياتها كما هي.`,"spaces-restored-space":`تمت استعادة {name}. عادت إلى شجرة الشريط الجانبي.`,"spaces-archive-open":`افتح الأرشيف`}},na={Largest:[`最大`,`الأكبر`],"Newest archived":[`最近归档`,`الأحدث أرشفةً`]},ra={en:{"spaces-transfer-title":`Transfer memories`,"spaces-transfer-intro":`Copy or move memories to another space. Nothing changes until you choose Apply.`,"spaces-transfer-source":`Source space`,"spaces-transfer-target":`Target space`,"spaces-transfer-mode":`Mode`,"spaces-transfer-mode-copy":`Copy`,"spaces-transfer-mode-move":`Move`,"spaces-transfer-from":`From`,"spaces-transfer-to":`To`,"spaces-transfer-project":`Project`,"spaces-transfer-preview":`Preview`,"spaces-transfer-previewing":`Checking what matches…`,"spaces-transfer-preview-count":`{count} memories match the filter.`,"spaces-transfer-preview-projects-label":`Projects in the result:`,"spaces-transfer-preview-project-count":`{project}: {count}`,"spaces-transfer-preview-examples-label":`Examples:`,"spaces-transfer-preview-duplicates":`Exact duplicates already in the target will be skipped: {count}.`,"spaces-transfer-preview-empty":`No memory matches the filter.`,"spaces-transfer-preview-cleared":`The filter changed, so the preview was cleared. Run Preview again.`,"spaces-transfer-why-disabled":`Run Preview first. Apply turns on after a preview.`,"spaces-transfer-apply":`Apply`,"spaces-transfer-applying":`Applying the transfer…`,"spaces-transfer-busy":`Another transfer is running. The preview is kept. Try again.`,"spaces-transfer-confirm-move-title":`Move {count} memories?`,"spaces-transfer-confirm-move-body":`OMMS copies {count} memories from {source} to {target} and checks the copy. The memories leave {source} only after the check passes.`,"spaces-transfer-confirm-move-button":`Move memories`,"spaces-transfer-confirm-copy-title":`Copy {count} memories?`,"spaces-transfer-confirm-copy-body":`OMMS copies {count} memories from {source} to {target}.`,"spaces-transfer-confirm-copy-button":`Copy memories`,"spaces-transfer-result-moved":`Moved {count} memories. {skipped} exact duplicates were skipped and stay in {source}.`,"spaces-transfer-result-copied":`Copied {count} memories. {skipped} exact duplicates were skipped and stay in {source}.`,"spaces-export-title":`Export {name}`,"spaces-export-from":`From`,"spaces-export-to":`To`,"spaces-export-profile-label":`Include the profile and personal memories`,"spaces-export-profile-note":`Ticking this box adds personal data to the export file.`,"spaces-export-replaced":`Replaced in the file: {paths} home paths and {emails} email addresses.`,"spaces-export-names-note":`Names typed inside memory text are not detected. Check the file before you share it.`,"spaces-export-download":`Download`,"spaces-export-running":`Writing the export file…`,"spaces-export-empty":`This space has no memories in the chosen range.`,"spaces-import-title":`Import a space`,"spaces-import-file":`Export file`,"spaces-import-choose-file":`Choose a file`,"spaces-import-name":`New space name`,"spaces-import-project":`Project folder (optional)`,"spaces-import-projects-kept":`The project labels of the file are kept.`,"spaces-import-projects-merge":`All {count} projects of the file will merge into the one project {folder}.`,"spaces-import-model-warning":`The file uses the embedding model {fileModel} ({fileDimensions}D), but the settings use {currentModel} ({currentDimensions}D). Search may miss the imported memories until they are embedded again.`,"spaces-import-confirm-title":`Import into {name}?`,"spaces-import-confirm-body":`OMMS creates the space {name} and writes the memories of the file into it. The active space does not change.`,"spaces-import-confirm":`Import`,"spaces-import-running":`Importing the file…`,"spaces-import-done":`Imported {count} memories into {name}.`,"spaces-import-name-taken":`A space with the name {name} already exists. Choose another name.`,"spaces-import-folder-missing":`The project folder does not exist. Check the path.`,"spaces-import-error-not-json":`The file is not valid JSON. Choose an OMMS export file.`,"spaces-import-error-too-large":`The file is larger than the limit of {limit}. Export a smaller range and try again.`,"spaces-import-error-newer-schema":`The file was written by a newer OMMS (format version {version}).`,"spaces-import-error-upgrade":`Upgrade OMMS to the latest release, then import the file again.`,"spaces-links-title":`Linked spaces`,"spaces-links-list-label":`Linked spaces of this card`,"spaces-links-none":`No linked spaces yet.`,"spaces-links-unavailable":`Unavailable`,"spaces-links-add":`Link a space`,"spaces-links-confirm-link-title":`Link {name} to {space}?`,"spaces-links-confirm-link-body":`Searches in {space} can then also read the memories of {name}. Nothing is copied, moved or deleted.`,"spaces-links-confirm-link-button":`Link`,"spaces-links-unlink":`Unlink`,"spaces-links-unlink-label":`Unlink {name}`,"spaces-links-confirm-unlink-title":`Unlink {name}?`,"spaces-links-confirm-unlink-body":`The link is removed. The memories of both spaces stay as they are.`,"spaces-links-unlinked":`Unlinked {name}. No memory was deleted.`,"spaces-action-transfer":`Transfer`,"spaces-action-export":`Export`,"spaces-action-import":`Import`},zh:{"spaces-transfer-title":`转移记忆`,"spaces-transfer-intro":`将记忆复制或移动到另一个空间。选择「应用」之前不会有任何更改。`,"spaces-transfer-source":`源空间`,"spaces-transfer-target":`目标空间`,"spaces-transfer-mode":`模式`,"spaces-transfer-mode-copy":`复制`,"spaces-transfer-mode-move":`移动`,"spaces-transfer-from":`开始日期`,"spaces-transfer-to":`结束日期`,"spaces-transfer-project":`项目`,"spaces-transfer-preview":`预览`,"spaces-transfer-previewing":`正在检查符合筛选条件的记忆…`,"spaces-transfer-preview-count":`{count} 条记忆符合筛选条件。`,"spaces-transfer-preview-projects-label":`结果中的项目:`,"spaces-transfer-preview-project-count":`{project}:{count} 条`,"spaces-transfer-preview-examples-label":`示例:`,"spaces-transfer-preview-duplicates":`目标空间中已存在的完全重复记忆将跳过 {count} 条。`,"spaces-transfer-preview-empty":`没有符合筛选条件的记忆。`,"spaces-transfer-preview-cleared":`筛选条件已更改,预览已清除。请重新预览。`,"spaces-transfer-why-disabled":`请先运行预览,预览后才能应用。`,"spaces-transfer-apply":`应用`,"spaces-transfer-applying":`正在执行转移…`,"spaces-transfer-busy":`另一个转移正在进行。预览已保留,请重试。`,"spaces-transfer-confirm-move-title":`移动 {count} 条记忆?`,"spaces-transfer-confirm-move-body":`OMMS 会把 {count} 条记忆从 {source} 复制到 {target} 并检查副本。只有检查通过后,这些记忆才会离开 {source}。`,"spaces-transfer-confirm-move-button":`移动记忆`,"spaces-transfer-confirm-copy-title":`复制 {count} 条记忆?`,"spaces-transfer-confirm-copy-body":`OMMS 会把 {count} 条记忆从 {source} 复制到 {target}。`,"spaces-transfer-confirm-copy-button":`复制记忆`,"spaces-transfer-result-moved":`已移动 {count} 条记忆。{skipped} 条完全重复的记忆已跳过,仍保留在 {source}。`,"spaces-transfer-result-copied":`已复制 {count} 条记忆。{skipped} 条完全重复的记忆已跳过,仍保留在 {source}。`,"spaces-export-title":`导出 {name}`,"spaces-export-from":`开始日期`,"spaces-export-to":`结束日期`,"spaces-export-profile-label":`包含画像和个人记忆`,"spaces-export-profile-note":`勾选后会把个人数据加入导出文件。`,"spaces-export-replaced":`文件中已替换 {paths} 个主目录路径和 {emails} 个电子邮件地址。`,"spaces-export-names-note":`无法检测记忆正文中手写的名称。分享文件前请先检查。`,"spaces-export-download":`下载`,"spaces-export-running":`正在写入导出文件…`,"spaces-export-empty":`此空间在所选范围内没有记忆。`,"spaces-import-title":`导入空间`,"spaces-import-file":`导出文件`,"spaces-import-choose-file":`选择文件`,"spaces-import-name":`新空间名称`,"spaces-import-project":`项目文件夹(可选)`,"spaces-import-projects-kept":`文件中的项目标签将保留。`,"spaces-import-projects-merge":`文件中的全部 {count} 个项目将合并为 {folder} 这一个项目。`,"spaces-import-model-warning":`文件使用的嵌入模型是 {fileModel}({fileDimensions}D),而当前设置使用 {currentModel}({currentDimensions}D)。在重新向量化之前,搜索可能找不到导入的记忆。`,"spaces-import-confirm-title":`导入到 {name}?`,"spaces-import-confirm-body":`OMMS 会创建空间 {name} 并把文件中的记忆写入其中。当前活跃空间不会改变。`,"spaces-import-confirm":`导入`,"spaces-import-running":`正在导入文件…`,"spaces-import-done":`已将 {count} 条记忆导入 {name}。`,"spaces-import-name-taken":`名为 {name} 的空间已存在。请换一个名称。`,"spaces-import-folder-missing":`项目文件夹不存在。请检查路径。`,"spaces-import-error-not-json":`文件不是有效的 JSON。请选择 OMMS 导出文件。`,"spaces-import-error-too-large":`文件超过 {limit} 的大小限制。请导出较小的范围后重试。`,"spaces-import-error-newer-schema":`文件由更新版本的 OMMS 写入(格式版本 {version})。`,"spaces-import-error-upgrade":`请先将 OMMS 升级到最新版本,再导入此文件。`,"spaces-links-title":`链接的空间`,"spaces-links-list-label":`此卡片的链接空间`,"spaces-links-none":`还没有链接的空间。`,"spaces-links-unavailable":`不可用`,"spaces-links-add":`链接一个空间`,"spaces-links-confirm-link-title":`将 {name} 链接到 {space}?`,"spaces-links-confirm-link-body":`之后在 {space} 中搜索时也能读取 {name} 的记忆。不会复制、移动或删除任何内容。`,"spaces-links-confirm-link-button":`链接`,"spaces-links-unlink":`取消链接`,"spaces-links-unlink-label":`取消链接 {name}`,"spaces-links-confirm-unlink-title":`取消链接 {name}?`,"spaces-links-confirm-unlink-body":`链接会被移除。两个空间的记忆都保持不变。`,"spaces-links-unlinked":`已取消链接 {name}。没有删除任何记忆。`,"spaces-action-transfer":`转移`,"spaces-action-export":`导出`,"spaces-action-import":`导入`},ar:{"spaces-transfer-title":`نقل الذكريات`,"spaces-transfer-intro":`انسخ الذكريات أو انقلها إلى مساحة أخرى. لا يتغير أي شيء قبل أن تختار «تطبيق».`,"spaces-transfer-source":`المساحة المصدر`,"spaces-transfer-target":`المساحة الهدف`,"spaces-transfer-mode":`الوضع`,"spaces-transfer-mode-copy":`نسخ`,"spaces-transfer-mode-move":`نقل`,"spaces-transfer-from":`من تاريخ`,"spaces-transfer-to":`إلى تاريخ`,"spaces-transfer-project":`المشروع`,"spaces-transfer-preview":`معاينة`,"spaces-transfer-previewing":`جارٍ فحص الذكريات المطابقة…`,"spaces-transfer-preview-count":`{count} من الذكريات تطابق التصفية.`,"spaces-transfer-preview-projects-label":`المشاريع في النتيجة:`,"spaces-transfer-preview-project-count":`{project}: {count} ذكرى`,"spaces-transfer-preview-examples-label":`أمثلة:`,"spaces-transfer-preview-duplicates":`ستُتخطى النسخ المكررة المطابقة الموجودة في المساحة الهدف: {count}.`,"spaces-transfer-preview-empty":`لا توجد ذكرى تطابق التصفية.`,"spaces-transfer-preview-cleared":`تغيّرت التصفية، فحُذفت المعاينة. شغّل المعاينة من جديد.`,"spaces-transfer-why-disabled":`شغّل المعاينة أولًا. يُفعَّل «تطبيق» بعد المعاينة.`,"spaces-transfer-apply":`تطبيق`,"spaces-transfer-applying":`جارٍ تنفيذ النقل…`,"spaces-transfer-busy":`عملية نقل أخرى جارية. بقيت المعاينة كما هي. حاول مرة أخرى.`,"spaces-transfer-confirm-move-title":`نقل {count} من الذكريات؟`,"spaces-transfer-confirm-move-body":`ينسخ OMMS {count} من الذكريات من {source} إلى {target} ويفحص النسخة. لا تغادر الذكريات {source} إلا بعد نجاح الفحص.`,"spaces-transfer-confirm-move-button":`نقل الذكريات`,"spaces-transfer-confirm-copy-title":`نسخ {count} من الذكريات؟`,"spaces-transfer-confirm-copy-body":`ينسخ OMMS {count} من الذكريات من {source} إلى {target}.`,"spaces-transfer-confirm-copy-button":`نسخ الذكريات`,"spaces-transfer-result-moved":`تم نقل {count} من الذكريات. تُخطّيت {skipped} نسخة مكررة مطابقة وبقيت في {source}.`,"spaces-transfer-result-copied":`تم نسخ {count} من الذكريات. تُخطّيت {skipped} نسخة مكررة مطابقة وبقيت في {source}.`,"spaces-export-title":`تصدير {name}`,"spaces-export-from":`من تاريخ`,"spaces-export-to":`إلى تاريخ`,"spaces-export-profile-label":`تضمين الملف الشخصي والذكريات الشخصية`,"spaces-export-profile-note":`تحديد هذا الخيار يضيف بيانات شخصية إلى ملف التصدير.`,"spaces-export-replaced":`استُبدل في الملف: {paths} من مسارات المجلد المنزلي و{emails} من عناوين البريد الإلكتروني.`,"spaces-export-names-note":`لا تُكتشف الأسماء المكتوبة داخل نص الذكريات. راجع الملف قبل مشاركته.`,"spaces-export-download":`تنزيل`,"spaces-export-running":`جارٍ كتابة ملف التصدير…`,"spaces-export-empty":`لا توجد ذكريات في هذه المساحة ضمن النطاق المختار.`,"spaces-import-title":`استيراد مساحة`,"spaces-import-file":`ملف التصدير`,"spaces-import-choose-file":`اختر ملفًا`,"spaces-import-name":`اسم المساحة الجديدة`,"spaces-import-project":`مجلد المشروع (اختياري)`,"spaces-import-projects-kept":`تُحافَظ وسوم مشاريع الملف كما هي.`,"spaces-import-projects-merge":`ستُدمج مشاريع الملف البالغة {count} في مشروع واحد هو {folder}.`,"spaces-import-model-warning":`يستخدم الملف نموذج التضمين {fileModel} ({fileDimensions}D)، بينما تستخدم الإعدادات الحالية {currentModel} ({currentDimensions}D). قد لا يجد البحث الذكريات المستوردة حتى تُعاد فهرستها.`,"spaces-import-confirm-title":`الاستيراد إلى {name}؟`,"spaces-import-confirm-body":`ينشئ OMMS المساحة {name} ويكتب ذكريات الملف فيها. لا تتغير المساحة النشطة.`,"spaces-import-confirm":`استيراد`,"spaces-import-running":`جارٍ استيراد الملف…`,"spaces-import-done":`تم استيراد {count} من الذكريات إلى {name}.`,"spaces-import-name-taken":`توجد مساحة بالاسم {name} بالفعل. اختر اسمًا آخر.`,"spaces-import-folder-missing":`مجلد المشروع غير موجود. تحقّق من المسار.`,"spaces-import-error-not-json":`الملف ليس JSON صالحًا. اختر ملف تصدير من OMMS.`,"spaces-import-error-too-large":`حجم الملف يتجاوز الحد {limit}. صدّر نطاقًا أصغر ثم حاول مجددًا.`,"spaces-import-error-newer-schema":`كُتب الملف بإصدار أحدث من OMMS (إصدار التنسيق {version}).`,"spaces-import-error-upgrade":`حدّث OMMS إلى أحدث إصدار ثم استورد الملف من جديد.`,"spaces-links-title":`المساحات المرتبطة`,"spaces-links-list-label":`المساحات المرتبطة بهذه البطاقة`,"spaces-links-none":`لا توجد مساحات مرتبطة بعد.`,"spaces-links-unavailable":`غير متاحة`,"spaces-links-add":`ربط مساحة`,"spaces-links-confirm-link-title":`ربط {name} بـ {space}؟`,"spaces-links-confirm-link-body":`يمكن للبحث في {space} بعد ذلك قراءة ذكريات {name} أيضًا. لا يُنسخ أي شيء ولا يُنقل ولا يُحذف.`,"spaces-links-confirm-link-button":`ربط`,"spaces-links-unlink":`إلغاء الربط`,"spaces-links-unlink-label":`إلغاء ربط {name}`,"spaces-links-confirm-unlink-title":`إلغاء ربط {name}؟`,"spaces-links-confirm-unlink-body":`يُزال الربط. تبقى ذكريات المساحتين كما هي.`,"spaces-links-unlinked":`أُلغي ربط {name}. لم تُحذف أي ذكرى.`,"spaces-action-transfer":`نقل`,"spaces-action-export":`تصدير`,"spaces-action-import":`استيراد`}},ia={en:{"tag-migration-cost":`OMMS asks your memory model (Settings > External API) to suggest tags for each memory. Each memory is one call to that API, which may use paid credit.`,"tag-migration-no-credit":`Your memory model account has no credit left, so tagging stopped. {tagged} of {total} memories were tagged. Top up the account, or choose another model in Settings > External API, then click Try again.`,"tag-migration-auth":`Your memory model did not accept the API key, so tagging stopped. {tagged} of {total} memories were tagged. Check the key in Settings > External API, then click Try again.`,"tag-migration-partial":`{failed} of {total} memories could not be tagged. {tagged} were tagged. Click Try again to retry the rest.`,"tag-migration-reason":`Reply from the model: {error}`,"tag-migration-retry":`Try again`},zh:{"tag-migration-cost":`OMMS 会请您的记忆模型(设置 > 外部 API)为每条记忆生成标签。每条记忆调用一次该 API,可能消耗付费额度。`,"tag-migration-no-credit":`您的记忆模型账户余额不足,标签生成已停止。已为 {total} 条中的 {tagged} 条记忆生成标签。请为账户充值,或在设置 > 外部 API 中选择其他模型,然后点击“重试”。`,"tag-migration-auth":`您的记忆模型不接受该 API 密钥,标签生成已停止。已为 {total} 条中的 {tagged} 条记忆生成标签。请在设置 > 外部 API 中检查密钥,然后点击“重试”。`,"tag-migration-partial":`{total} 条记忆中有 {failed} 条无法生成标签,{tagged} 条已生成。点击“重试”处理其余记忆。`,"tag-migration-reason":`模型的回复:{error}`,"tag-migration-retry":`重试`},ar:{"tag-migration-cost":`يطلب OMMS من نموذج الذاكرة (الإعدادات > واجهة API الخارجية) اقتراح وسوم لكل ذكرى. كل ذكرى هي طلب واحد إلى تلك الواجهة، وقد يستهلك رصيدًا مدفوعًا.`,"tag-migration-no-credit":`لا يوجد رصيد كافٍ في حساب نموذج الذاكرة، لذلك توقف إضافة الوسوم. تمت إضافة وسوم إلى {tagged} من {total} ذكرى. اشحن الحساب، أو اختر نموذجًا آخر في الإعدادات > واجهة API الخارجية، ثم انقر على إعادة المحاولة.`,"tag-migration-auth":`لم يقبل نموذج الذاكرة مفتاح API، لذلك توقف إضافة الوسوم. تمت إضافة وسوم إلى {tagged} من {total} ذكرى. تحقق من المفتاح في الإعدادات > واجهة API الخارجية، ثم انقر على إعادة المحاولة.`,"tag-migration-partial":`تعذر إضافة وسوم إلى {failed} من {total} ذكرى، وتمت إضافة وسوم إلى {tagged}. انقر على إعادة المحاولة لمعالجة الباقي.`,"tag-migration-reason":`رد النموذج: {error}`,"tag-migration-retry":`إعادة المحاولة`}},aa={en:{brand:`OMMS`,"tab-project":`Project memories`,"tab-profile":`User profile`,"nav-menu":`Menu`,"nav-close":`Close menu`,"nav-collapse":`Collapse sidebar`,"nav-expand":`Expand sidebar`,"nav-language":`Language`,"nav-theme":`Theme`,"nav-settings":`Settings`,"nav-chat":`Chat`,"nav-skills":`Skills`,"chat-new":`New chat`,"chat-new-folder":`New folder`,"chat-conversations":`Chats`,"chat-no-folder":`No folder`,"chat-empty-list":`No chats yet. Ask a question to start one.`,"chat-legend-memory":`memory (a note saved from your sessions)`,"chat-legend-profile":`profile item (a preference, pattern or workflow)`,"chat-legend-skill":`skill (usage and change history)`,"chat-source-skill":`Skill`,"chat-skill-uses":`Uses`,"chat-skill-failed":`Failed turns`,"chat-skill-attention":`Attention`,"chat-skill-modified":`Modified`,"chat-skill-modified-yes":`Yes, last applied {date}`,"chat-skill-modified-no":`No`,"chat-skill-modified-note":`Yes means an applied proposal is in place for this skill.`,"chat-skill-window":`Counts cover the last 30 days in all projects.`,"chat-skill-history":`Recent changes`,"chat-skill-history-empty":`No changes recorded.`,"chat-skill-missing":`This skill is no longer listed. OMMS saved these facts with the answer.`,"chat-skill-kind-created":`Created`,"chat-skill-kind-applied":`Applied`,"chat-skill-kind-rejected":`Rejected`,"chat-skill-kind-undone":`Undone`,"chat-skill-kind-stale":`Out of date`,"chat-skill-by-person":`by a person`,"chat-skill-by-agent":`by an agent`,"chat-skill-by-automatic":`automatically`,"chat-search-skills":`Skills`,"chat-search-skill-intent":`Skill question`,"chat-intent-none":`none`,"chat-intent-needs-work":`skills that need work`,"chat-intent-most-used":`most used skills`,"chat-skill-facts-unavailable":`OMMS could not read the skill facts, so this answer uses memories only.`,"chat-skill-privacy":`Skill counts and short change summaries are sent too, because skill learning is on.`,"chat-select":`Select`,"chat-select-done":`Done`,"chat-select-all-folder":`Select all in folder`,"chat-selected-count":`{count} selected`,"chat-delete-selected":`Delete selected`,"chat-rename":`Rename`,"chat-move":`Move to folder`,"chat-delete":`Delete`,"chat-folder-name":`Folder name`,"chat-chat-title":`Chat title`,"chat-folder-create-title":`New folder`,"chat-folder-rename-title":`Rename folder`,"chat-chat-rename-title":`Rename chat`,"chat-save":`Save`,"chat-cancel":`Cancel`,"chat-create":`Create`,"chat-delete-chats-title":`Delete chats?`,"chat-delete-chats-body":`{count} chats will be deleted. This cannot be undone.`,"chat-delete-chats-body-one":`{count} chat will be deleted. This cannot be undone.`,"chat-delete-folder-title":`Delete folder?`,"chat-delete-folder-body":`The folder "{name}" and its {count} chats will be deleted. This cannot be undone.`,"chat-delete-folder-body-one":`The folder "{name}" and its {count} chat will be deleted. This cannot be undone.`,"chat-delete-confirm":`Delete`,"chat-folder-exists":`A folder with this name exists.`,"chat-scope-label":`Search in`,"chat-scope-all":`All projects`,"chat-scope-missing":`Project not on this computer`,"chat-scope-choose":`Choose where to search before you ask.`,"chat-input-placeholder":`Ask about your memories…`,"chat-send":`Ask`,"chat-thinking":`Searching your memories and writing an answer…`,"chat-you":`You`,"chat-omms":`OMMS`,"chat-sources":`Sources`,"chat-how-searched":`How I searched`,"chat-search-phrases":`Search phrases`,"chat-search-tags":`Tags`,"chat-search-categories":`Profile categories`,"chat-none":`none`,"chat-plan-skipped":`The search plan was skipped, so OMMS searched with your question alone.`,"chat-no-sources":`OMMS found nothing relevant in this scope.`,"chat-insufficient":`The sources found do not answer this question.`,"chat-uncited":`This answer cites no source. Check it before you rely on it.`,"chat-error":`The answer failed ({code}).`,"chat-retry":`Retry`,"chat-setup-title":`Chat needs the memory model`,"chat-setup-body":`Set these settings to use chat: {names}.`,"chat-setup-link":`Open Settings`,"chat-provider-note":`Questions and memory text are sent to {host}.`,"chat-read-only":`These chats come from a newer OMMS. Upgrade OMMS to continue them.`,"chat-source-memory":`Memory`,"chat-source-profile":`Profile item`,"chat-source-deleted":`This memory no longer exists. OMMS saved this text with the answer.`,"chat-source-project":`Project`,"chat-source-date":`Date`,"chat-source-tags":`Tags`,"chat-source-evidence":`Evidence`,"chat-source-open-project":`Open Project memories`,"chat-source-note":`A model wrote the answer. Check the source before you rely on it.`,"chat-empty-thread":`Ask a question about your memories and profile. Answers cite their sources.`,"chat-show-list":`Chats`,"chat-folder-count":`{count} chats`,"chat-folder-count-one":`{count} chat`,"chat-cite-label":`Open source {label}`,"chat-select-chat":`Select {title}`,"chat-folder-actions":`Folder actions`,"chat-chat-actions":`Chat actions`,"power-button":`Web app power`,"power-dialog-title":`Restart or stop the web app`,"power-dialog-body":`Restart starts a fresh copy of the web app and reloads this page. Stop turns the web app off.`,"power-restart":`Restart`,"power-stop":`Stop`,"power-cancel":`Cancel`,"power-note":`A stop lasts until the next OpenCode start, Pi start, Claude Code prompt, om-memory-system web install, or login. Then the web app starts again.`,"power-restarting":`Restarting the web app…`,"power-stopped-title":`The web app has stopped`,"power-stopped-command":`To start it again, run this command in a terminal:`,"power-restart-timeout":`The web app did not answer after the restart.`,"power-restart-failed":`The restart failed. The web app still runs.`,"power-request-failed":`The request failed. The web app may still be running.`,"update-button":`Update available: {version}`,"update-label":`Update`,"update-dialog-title":`Update OMMS`,"update-versions":`Running: {running}. Newer release: {available}.`,"update-hosts-intro":`Update each host you use with its command:`,"update-host-claude":`Claude Code`,"update-host-opencode":`OpenCode`,"update-host-pi":`Pi`,"update-host-global":`Global command and web app`,"update-hosts-note":`OpenCode and Pi need their own update command and a restart.`,"update-copy":`Copy`,"update-copied":`Copied`,"update-install":`Update web app`,"update-install-note":`Installs the release globally with npm, then restarts the web app on it.`,"update-cannot-install":`This web app has no npm beside its Node.js. The commands above still work.`,"update-installing":`Installing the new release…`,"update-failed":`The update failed ({code}). The web app still runs.`,"update-request-failed":`The request failed. The web app still runs.`,"update-timeout":`The web app did not answer after the update.`,"update-close":`Close`,"theme-dark":`Dark`,"theme-light":`Light`,"label-tag":`Project:`,"label-type":`Type:`,"label-tags":`Tags:`,"label-content":`Content:`,"btn-cleanup":`Cleanup`,"btn-deduplicate":`Deduplicate`,"tooltip-filter-keyword":`Show all memories with this keyword`,"tooltip-memory-type":`Memory type`,"tooltip-tags":`Tags`,"label-label-filter":`Label:`,"opt-all-labels":`All labels`,"tooltip-cleanup":`Delete memories and prompts not updated in the retention period (30 days by default). Pinned memories are kept.`,"tooltip-deduplicate":`Delete exact duplicate memories in each project and keep the newest copy. Similar memories are only reported, not deleted.`,"btn-delete-selected":`Delete Selected`,"btn-select-all":`Select Page`,"btn-deselect-all":`Deselect All`,"btn-add-memory":`Add Memory`,"section-project":`Project Memories ({count})`,"section-profile":`User Profile`,"section-add":`Add New Memory`,"opt-all-tags":`All Projects`,"opt-select-tag":`Select project`,"opt-other":`other`,"opt-feature":`feature`,"opt-bug-fix":`bug-fix`,"opt-refactor":`refactor`,"opt-architecture":`architecture`,"opt-rule":`rule`,"opt-documentation":`documentation`,"opt-discussion":`discussion`,"opt-analysis":`analysis`,"opt-configuration":`configuration`,"modal-edit-title":`Edit Memory`,"dialog-close":`Close`,"dialog-minimise":`Minimise`,"modal-migration-title":`Memory Tagging Migration`,"modal-changelog-title":`Profile Version History`,"btn-cancel":`Cancel`,"btn-save":`Save Changes`,"btn-start-migration":`Start Migration`,"loading-init":`Initializing...`,"loading-profile":`Loading profile...`,"loading-changelog":`Loading changelog...`,"migration-mismatch":`Model dimension mismatch detected!`,"migration-understand":`I understand this operation is irreversible and will affect all stored memories`,"btn-fresh-start":`Fresh Start (Delete All)`,"btn-reembed":`Re-embed (Preserve Data)`,"migration-note":`Please don't close the browser. This will re-vectorize your memories with technical tags to improve search accuracy.`,"placeholder-search":`Search memories...`,"placeholder-tags":`react, hooks, auth (comma separated)`,"placeholder-content":`Enter memory content...`,"toast-add-success":`Memory added successfully`,"toast-add-error":`Content and tag are required`,"toast-add-failed":`Failed to add memory`,"toast-delete-success":`Memory deleted successfully`,"toast-delete-failed":`Failed to delete memory`,"toast-update-success":`Memory updated successfully`,"toast-update-failed":`Failed to update memory`,"toast-cleanup-success":`Cleanup completed successfully`,"toast-cleanup-failed":`Cleanup failed`,"toast-dedup-success":`Deduplication completed successfully`,"toast-dedup-failed":`Deduplication failed`,"toast-bulk-delete-success":`Selected memories deleted successfully`,"toast-bulk-delete-failed":`Failed to delete selected memories`,"toast-migration-success":`Migration completed successfully`,"toast-migration-failed":`Migration failed`,"toast-fresh-start-success":`Fresh start completed successfully`,"toast-fresh-start-failed":`Fresh start failed`,"confirm-delete":`Delete this memory?`,"confirm-delete-title":`Confirm Delete`,"confirm-delete-pair":`Delete this memory AND its linked prompt?`,"confirm-delete-prompt":`Delete this prompt AND its linked memory?`,"confirm-bulk-delete":`Delete {count} selected memories?`,"confirm-cleanup":`This deletes memories and prompts not updated in the retention period. Pinned memories are kept. Continue?`,"confirm-dedup":`This deletes exact duplicate memories and keeps the newest copy. Similar memories are only reported. Continue?`,"text-selected":`{count} selected`,"text-page":`Page {current} of {total}`,"text-total":`Total: {count}`,"empty-memories":`No memories found`,"empty-changelog":`No changelog available`,"status-cleanup":`Running cleanup...`,"status-dedup":`Running deduplication...`,"status-migration-init":`Initializing migration...`,"status-migration-progress":`Migrating... {current}/{total}`,"profile-version":`VERSION`,"profile-prompts":`PROMPTS`,"profile-updated":`LAST UPDATED`,"profile-preferences":`Preferences`,"profile-type-pref":`Pref`,"profile-type-pat":`Pat`,"profile-type-wf":`Wf`,"profile-patterns":`Patterns`,"profile-workflows":`Workflows`,"label-evidence-tooltip":`AI analysis hit {count} times`,"evidence-count":`{count} evidence`,"evidence-open-label":`Show evidence ({count})`,"evidence-dialog-title":`Evidence`,"evidence-hit-count":`Profile analysis matched this item {count} times.`,"evidence-note":`Evidence is what the profile analysis noted from your prompts. The model wrote it, so it may not be an exact quote.`,"evidence-manual-write":`Added by a manual memory save`,"label-confidence":`Confidence`,"badge-prompt":`USER PROMPT`,"badge-memory":`MEMORY`,"badge-pinned":`PINNED`,"badge-linked":`LINKED`,"date-created":`Created:`,"date-updated":`Updated:`,"empty-preferences":`No preferences learned yet`,"empty-patterns":`No patterns detected yet`,"empty-workflows":`No workflows identified yet`,"btn-delete-pair":`Delete Pair`,"tooltip-delete-pair":`Delete this memory AND its linked prompt`,"tooltip-delete-prompt-pair":`Delete this prompt AND its linked memory`,"btn-edit":`Edit`,"btn-delete":`Delete`,"label-category":`Category`,"label-description":`Description`,"label-steps":`Steps`,"btn-add-step":`+ Add Step`,"btn-see-more":`See more`,"btn-see-less":`See less`,"label-pasted-content":`Pasted content`,"text-generated-above":`Generated memory above`,"text-from-below":`From prompt below`,"btn-refresh":`Refresh`,"btn-ai-cleanup":`AI Cleanup`,"btn-category-cleanup":`Clean up categories`,"label-category-count-title":`Number of categories`,"label-category-cleanup-title":`Clean up categories`,"label-category-cleanup-loading":`Grouping category names by meaning…`,"label-category-cleanup-counts":`Categories now: {before}. After cleanup: {after}.`,"label-category-cleanup-note":`Applying only renames categories. After a cleanup more memories share a category, so later learning merges near-duplicate memories more readily.`,"label-category-cleanup-empty":`No category names to group.`,"label-category-cleanup-selected":`Selected groups: {selected} of {total}`,"label-category-cleanup-accept":`Use this group`,"label-category-cleanup-name":`Group name`,"label-category-cleanup-unchecked":`Not checked by the AI`,"btn-category-cleanup-apply":`Apply selected`,"btn-category-cleanup-undo":`Undo last cleanup`,"label-category-cleanup-progress":`Checking groups with the AI: batch {done} of {total}.`,"label-category-cleanup-background":`This runs in the background and can take several minutes. You can close this window and come back.`,"btn-category-cleanup-rebuild":`Build a new preview`,"label-category-cleanup-banner-ready":`A cleanup preview is ready ({groups} groups).`,"label-category-cleanup-banner-failed":`The cleanup preview failed:`,"btn-category-cleanup-banner-open":`Open review`,"toast-category-cleanup-applied":`Items renamed: {count}`,"toast-category-cleanup-undone":`Items restored: {restored}. Not found: {notFound}.`,"btn-auto-cleanup-undo":`Undo last automatic cleanup`,"btn-auto-cleanup-undo-confirm":`Undo cleanup`,"title-auto-cleanup-undo":`Undo the last automatic cleanup?`,"label-auto-cleanup-undo-body":`The automatic cleanup on {when} merged {merged} groups of memories and removed {removed}. Undo puts the original memories back. Other memories learned since stay. A later update to a merged memory is lost.`,"toast-auto-cleanup-undone":`Restored {restored} changes.`,"toast-auto-cleanup-undone-partial":`Restored {restored} changes. {notFound} not found, because the memories changed since.`,"toast-auto-cleanup-undo-failed":`Could not undo the automatic cleanup.`,"toast-category-cleanup-failed":`Category cleanup failed`,"label-ai-cleanup-title":`AI Profile Cleanup`,"label-ai-cleanup-loading":`AI is analyzing profile...`,"label-ai-cleanup-merged":`Merged`,"label-ai-cleanup-removed":`Removed`,"label-ai-cleanup-kept":`Remaining`,"label-ai-cleanup-none":`None`,"label-ai-cleanup-select-all":`Select All`,"label-ai-cleanup-deselect-all":`Deselect All`,"label-ai-cleanup-apply":`Apply Changes`,"label-ai-cleanup-merge-check":`Merge`,"label-ai-cleanup-remove-check":`Remove`,"label-ai-cleanup-changes-selected":`{selected}/{total} changes selected`,"label-ai-cleanup-merged-header":`Merged ({count} groups)`,"label-ai-cleanup-removed-header":`Removed ({count} items)`,"btn-apply":`Apply`,"toast-ai-cleanup-success":`Profile cleanup completed`,"toast-ai-cleanup-failed":`AI cleanup failed`,"label-ai-cleanup-progress":`Batch {done} of {total}`,"label-ai-cleanup-running-hint":`You can close this dialog. The cleanup keeps running.`,"label-ai-cleanup-pill":`AI Cleanup`,"label-ai-cleanup-pill-running":`AI Cleanup is running`,"label-ai-cleanup-pill-progress":`AI Cleanup · Batch {done} of {total}`,"label-ai-cleanup-pill-ready":`AI Cleanup is ready to review`,"label-ai-cleanup-pill-failed":`AI Cleanup failed`,"label-ai-cleanup-failed-batches":`{batches} batch(es) failed. Their {items} items are unchanged.`,"btn-ai-cleanup-stop":`Stop`,"btn-ai-cleanup-retry":`Retry`,"btn-ai-cleanup-back":`Back`,"toast-ai-cleanup-skipped":`{applied} changes applied. {skipped} skipped because learning changed their items.`,"toast-cleanup-apply-failed":`Apply cleanup failed`,"label-ai-cleanup-select":`Select items for cleanup analysis`,"label-ai-cleanup-select-low":`Low Freq (≤3)`,"label-ai-cleanup-select-same-cat":`Same Category (3+)`,"label-ai-cleanup-analyze":`Analyze Selected`,"label-ai-cleanup-selected":`{count} selected`,"label-ai-cleanup-hint-low":`Picks memories seen 3 times or fewer. These are the most likely to be one-off notes or copies of another memory. Memories you repeat often stay out.`,"label-ai-cleanup-hint-same-cat":`Picks every memory whose category holds 3 or more memories. Memories under one category name are the most likely to be copies of each other. Names must match exactly, so run Clean up categories first to catch more. Memories with no category are left out.`,"label-more-info":`What does this do?`,"help-ai-cleanup":`Asks the AI to find memories that say the same thing and merge them. It can also remove memories that are too vague to help. You choose which memories it checks, then review every change. Nothing is saved until you press Apply Changes.`,"help-category-cleanup":`Finds category names that mean the same thing, such as "Execution" and "Direct execution", and gives each group one name. It only renames categories. No memory is merged or removed. You review the groups first, and you can undo the last cleanup.`,"migration-found-tags":`Found {count} memories needing technical tags.`,"migration-stopped":`Migration stopped: maximum attempts reached`,"migration-shards-mismatch":`{count} shard(s) have different dimensions`,"migration-dimension-mismatch":`dimension mismatch detected`,"migration-mismatch-details":`Model mismatch: Config uses {configDimensions}D ({configModel}), but {shardInfo}.`,"auth-warning-text":`Cross-origin editing disabled. Set webServerAuthPassword to enable.`,...ta.en,...ra.en,...ea.en,...ia.en},zh:{brand:`OMMS`,"tab-project":`项目记忆`,"tab-profile":`用户画像`,"nav-menu":`菜单`,"nav-close":`关闭菜单`,"nav-collapse":`收起侧边栏`,"nav-expand":`展开侧边栏`,"nav-language":`语言`,"nav-theme":`主题`,"nav-settings":`设置`,"nav-chat":`聊天`,"nav-skills":`技能`,"chat-new":`新聊天`,"chat-new-folder":`新建文件夹`,"chat-conversations":`聊天`,"chat-no-folder":`未分类`,"chat-empty-list":`还没有聊天。提一个问题即可开始。`,"chat-legend-memory":`记忆(从你的会话保存的笔记)`,"chat-legend-profile":`画像条目(偏好、模式或工作流程)`,"chat-legend-skill":`技能(使用情况和更改历史)`,"chat-source-skill":`技能`,"chat-skill-uses":`使用次数`,"chat-skill-failed":`失败回合`,"chat-skill-attention":`关注度`,"chat-skill-modified":`已修改`,"chat-skill-modified-yes":`是,最近应用于 {date}`,"chat-skill-modified-no":`否`,"chat-skill-modified-note":`“是”表示此技能已有一个已应用的提案生效。`,"chat-skill-window":`计数涵盖所有项目最近 30 天。`,"chat-skill-history":`最近的更改`,"chat-skill-history-empty":`没有已记录的更改。`,"chat-skill-missing":`此技能已不在列表中。OMMS 随回答保存了这些信息。`,"chat-skill-kind-created":`已创建`,"chat-skill-kind-applied":`已应用`,"chat-skill-kind-rejected":`已拒绝`,"chat-skill-kind-undone":`已撤销`,"chat-skill-kind-stale":`已过期`,"chat-skill-by-person":`由用户`,"chat-skill-by-agent":`由智能体`,"chat-skill-by-automatic":`自动`,"chat-search-skills":`技能`,"chat-search-skill-intent":`技能问题`,"chat-intent-none":`无`,"chat-intent-needs-work":`需要改进的技能`,"chat-intent-most-used":`使用最多的技能`,"chat-skill-facts-unavailable":`OMMS 无法读取技能信息,因此此回答只使用记忆。`,"chat-skill-privacy":`由于已开启技能学习,技能计数和简短的更改摘要也会一并发送。`,"chat-select":`选择`,"chat-select-done":`完成`,"chat-select-all-folder":`全选此文件夹`,"chat-selected-count":`已选 {count} 个`,"chat-delete-selected":`删除所选`,"chat-rename":`重命名`,"chat-move":`移到文件夹`,"chat-delete":`删除`,"chat-folder-name":`文件夹名称`,"chat-chat-title":`聊天标题`,"chat-folder-create-title":`新建文件夹`,"chat-folder-rename-title":`重命名文件夹`,"chat-chat-rename-title":`重命名聊天`,"chat-save":`保存`,"chat-cancel":`取消`,"chat-create":`创建`,"chat-delete-chats-title":`删除聊天?`,"chat-delete-chats-body":`将删除 {count} 个聊天。此操作无法撤销。`,"chat-delete-chats-body-one":`将删除 {count} 个聊天。此操作无法撤销。`,"chat-delete-folder-title":`删除文件夹?`,"chat-delete-folder-body":`将删除文件夹“{name}”及其中的 {count} 个聊天。此操作无法撤销。`,"chat-delete-folder-body-one":`将删除文件夹“{name}”及其中的 {count} 个聊天。此操作无法撤销。`,"chat-delete-confirm":`删除`,"chat-folder-exists":`已有同名文件夹。`,"chat-scope-label":`搜索范围`,"chat-scope-all":`所有项目`,"chat-scope-missing":`此电脑上没有该项目`,"chat-scope-choose":`提问前请选择搜索范围。`,"chat-input-placeholder":`询问你的记忆…`,"chat-send":`提问`,"chat-thinking":`正在搜索记忆并撰写回答…`,"chat-you":`你`,"chat-omms":`OMMS`,"chat-sources":`来源`,"chat-how-searched":`搜索方式`,"chat-search-phrases":`搜索短语`,"chat-search-tags":`标签`,"chat-search-categories":`画像类别`,"chat-none":`无`,"chat-plan-skipped":`已跳过搜索计划,OMMS 仅用你的问题进行搜索。`,"chat-no-sources":`OMMS 在此范围内没有找到相关内容。`,"chat-insufficient":`找到的来源无法回答这个问题。`,"chat-uncited":`此回答没有引用来源。使用前请核实。`,"chat-error":`回答失败({code})。`,"chat-retry":`重试`,"chat-setup-title":`聊天需要记忆模型`,"chat-setup-body":`请设置以下项目以使用聊天:{names}。`,"chat-setup-link":`打开设置`,"chat-provider-note":`问题和记忆文本将发送到 {host}。`,"chat-read-only":`这些聊天来自更新版本的 OMMS。请升级 OMMS 后继续。`,"chat-source-memory":`记忆`,"chat-source-profile":`画像条目`,"chat-source-deleted":`此记忆已不存在。OMMS 随回答保存了这段文本。`,"chat-source-project":`项目`,"chat-source-date":`日期`,"chat-source-tags":`标签`,"chat-source-evidence":`证据`,"chat-source-open-project":`打开项目记忆`,"chat-source-note":`回答由模型撰写。使用前请核对来源。`,"chat-empty-thread":`就你的记忆和画像提问。回答会引用来源。`,"chat-show-list":`聊天`,"chat-folder-count":`{count} 个聊天`,"chat-folder-count-one":`{count} 个聊天`,"chat-cite-label":`打开来源 {label}`,"chat-select-chat":`选择 {title}`,"chat-folder-actions":`文件夹操作`,"chat-chat-actions":`聊天操作`,"power-button":`网页应用电源`,"power-dialog-title":`重启或停止网页应用`,"power-dialog-body":`重启会启动网页应用的新副本并重新加载此页面。停止会关闭网页应用。`,"power-restart":`重启`,"power-stop":`停止`,"power-cancel":`取消`,"power-note":`停止会一直持续到下一次启动 OpenCode、启动 Pi、在 Claude Code 中发送提示、运行 om-memory-system web install 或登录。之后网页应用会再次启动。`,"power-restarting":`正在重启网页应用…`,"power-stopped-title":`网页应用已停止`,"power-stopped-command":`要再次启动,请在终端中运行此命令:`,"power-restart-timeout":`重启后网页应用没有响应。`,"power-restart-failed":`重启失败。网页应用仍在运行。`,"power-request-failed":`请求失败。网页应用可能仍在运行。`,"update-button":`有可用更新:{version}`,"update-label":`更新`,"update-dialog-title":`更新 OMMS`,"update-versions":`当前运行:{running}。较新版本:{available}。`,"update-hosts-intro":`使用对应命令更新你使用的每个宿主:`,"update-host-claude":`Claude Code`,"update-host-opencode":`OpenCode`,"update-host-pi":`Pi`,"update-host-global":`全局命令和网页应用`,"update-hosts-note":`OpenCode 和 Pi 需要各自运行更新命令并重启。`,"update-copy":`复制`,"update-copied":`已复制`,"update-install":`更新网页应用`,"update-install-note":`使用 npm 全局安装该版本,然后在新版本上重启网页应用。`,"update-cannot-install":`此网页应用的 Node.js 旁没有 npm。上面的命令仍然可用。`,"update-installing":`正在安装新版本…`,"update-failed":`更新失败({code})。网页应用仍在运行。`,"update-request-failed":`请求失败。网页应用仍在运行。`,"update-timeout":`更新后网页应用没有响应。`,"update-close":`关闭`,"theme-dark":`深色`,"theme-light":`浅色`,"label-tag":`项目:`,"label-type":`类型:`,"label-tags":`标签:`,"label-content":`内容:`,"btn-cleanup":`清理`,"btn-deduplicate":`去重`,"tooltip-filter-keyword":`显示带有此关键词的所有记忆`,"tooltip-memory-type":`记忆类型`,"tooltip-tags":`标签`,"label-label-filter":`标签:`,"opt-all-labels":`所有标签`,"tooltip-cleanup":`删除在保留期内(默认 30 天)未更新的记忆和提示词。已置顶的记忆会保留。`,"tooltip-deduplicate":`删除每个项目中完全重复的记忆,只保留最新的一条。相似的记忆只会报告,不会删除。`,"btn-delete-selected":`删除选中`,"btn-select-all":`全选当前页`,"btn-deselect-all":`取消全选`,"btn-add-memory":`添加记忆`,"section-project":`项目记忆 ({count})`,"section-profile":`用户画像`,"section-add":`添加新记忆`,"opt-all-tags":`所有项目`,"opt-select-tag":`选择项目`,"opt-other":`其他 (other)`,"opt-feature":`功能 (feature)`,"opt-bug-fix":`修复 (bug-fix)`,"opt-refactor":`重构 (refactor)`,"opt-architecture":`架构 (architecture)`,"opt-rule":`规则 (rule)`,"opt-documentation":`文档 (documentation)`,"opt-discussion":`讨论 (discussion)`,"opt-analysis":`分析 (analysis)`,"opt-configuration":`配置 (configuration)`,"modal-edit-title":`编辑记忆`,"dialog-close":`关闭`,"dialog-minimise":`最小化`,"modal-migration-title":`记忆标签迁移`,"modal-changelog-title":`画像版本历史`,"btn-cancel":`取消`,"btn-save":`保存更改`,"btn-start-migration":`开始迁移`,"loading-init":`初始化中...`,"loading-profile":`加载画像中...`,"loading-changelog":`加载更新日志中...`,"migration-mismatch":`检测到模型维度不匹配!`,"migration-understand":`我了解此操作不可逆,并将影响所有存储的记忆`,"btn-fresh-start":`重新开始 (删除所有)`,"btn-reembed":`重新向量化 (保留数据)`,"migration-note":`请不要关闭浏览器。这将使用技术标签重新向量化您的记忆,以提高搜索准确性。`,"placeholder-search":`搜索记忆...`,"placeholder-tags":`react, hooks, auth (逗号分隔)`,"placeholder-content":`输入记忆内容...`,"toast-add-success":`记忆添加成功`,"toast-add-error":`内容和标签为必填项`,"toast-add-failed":`添加记忆失败`,"toast-delete-success":`记忆删除成功`,"toast-delete-failed":`删除记忆失败`,"toast-update-success":`记忆更新成功`,"toast-update-failed":`更新记忆失败`,"toast-cleanup-success":`清理完成`,"toast-cleanup-failed":`清理失败`,"toast-dedup-success":`去重完成`,"toast-dedup-failed":`去重失败`,"toast-bulk-delete-success":`选中的记忆删除成功`,"toast-bulk-delete-failed":`删除选中的记忆失败`,"toast-migration-success":`迁移完成`,"toast-migration-failed":`迁移失败`,"toast-fresh-start-success":`重新开始完成`,"toast-fresh-start-failed":`重新开始失败`,"confirm-delete":`删除这条记忆?`,"confirm-delete-title":`确认删除`,"confirm-delete-pair":`删除这条记忆及其关联的提示词?`,"confirm-delete-prompt":`删除这条提示词及其关联的记忆?`,"confirm-bulk-delete":`删除选中的 {count} 条记忆?`,"confirm-cleanup":`这将删除在保留期内未更新的记忆和提示词。已置顶的记忆会保留。是否继续?`,"confirm-dedup":`这将删除完全重复的记忆,只保留最新的一条。相似的记忆只会报告。是否继续?`,"text-selected":`已选择 {count} 条`,"text-page":`第 {current} 页,共 {total} 页`,"text-total":`总计: {count}`,"empty-memories":`未找到记忆`,"empty-changelog":`暂无更新日志`,"status-cleanup":`正在运行清理...`,"status-dedup":`正在运行去重...`,"status-migration-init":`正在初始化迁移...`,"status-migration-progress":`迁移中... {current}/{total}`,"profile-version":`版本`,"profile-prompts":`提示词数`,"profile-updated":`最后更新`,"profile-preferences":`偏好设置`,"profile-type-pref":`偏好`,"profile-type-pat":`模式`,"profile-type-wf":`流程`,"profile-patterns":`行为模式`,"profile-workflows":`工作流程`,"label-evidence-tooltip":`AI 分析命中 {count} 次`,"evidence-count":`{count} 条证据`,"evidence-open-label":`查看证据({count})`,"evidence-dialog-title":`证据`,"evidence-hit-count":`画像分析匹配此项 {count} 次。`,"evidence-note":`证据是画像分析从你的提示中记录的内容。由模型撰写,可能不是原话。`,"evidence-manual-write":`通过手动保存记忆添加`,"label-confidence":`置信度`,"badge-prompt":`用户提示词`,"badge-memory":`记忆`,"badge-pinned":`已置顶`,"badge-linked":`已关联`,"date-created":`创建于:`,"date-updated":`更新于:`,"empty-preferences":`尚未学习到偏好设置`,"empty-patterns":`尚未检测到行为模式`,"empty-workflows":`尚未识别出工作流程`,"btn-delete-pair":`删除组合`,"tooltip-delete-pair":`删除这条记忆及其关联的提示词`,"tooltip-delete-prompt-pair":`删除这条提示词及其关联的记忆`,"btn-edit":`编辑`,"btn-delete":`删除`,"label-category":`类别`,"label-description":`描述`,"label-steps":`步骤`,"btn-add-step":`+ 添加步骤`,"btn-see-more":`查看更多`,"btn-see-less":`收起`,"label-pasted-content":`粘贴内容`,"text-generated-above":`由上方记忆生成`,"text-from-below":`来自下方提示词`,"btn-refresh":`刷新`,"btn-ai-cleanup":`AI 清理`,"btn-category-cleanup":`整理分类`,"label-category-count-title":`分类数量`,"label-category-cleanup-title":`整理分类`,"label-category-cleanup-loading":`正在按含义归类分类名称…`,"label-category-cleanup-counts":`当前分类:{before}。整理后:{after}。`,"label-category-cleanup-note":`应用只会重命名分类。整理后更多记忆共享同一分类,之后的学习会更容易合并几乎重复的记忆。`,"label-category-cleanup-empty":`没有可归类的分类名称。`,"label-category-cleanup-selected":`已选分组:{selected}/{total}`,"label-category-cleanup-accept":`采用此组`,"label-category-cleanup-name":`分组名称`,"label-category-cleanup-unchecked":`未经 AI 检查`,"btn-category-cleanup-apply":`应用所选`,"btn-category-cleanup-undo":`撤销上次整理`,"label-category-cleanup-progress":`正在用 AI 检查分组:第 {done} 批,共 {total} 批。`,"label-category-cleanup-background":`此任务在后台运行,可能需要几分钟。你可以关闭此窗口,稍后再回来。`,"btn-category-cleanup-rebuild":`重新生成预览`,"label-category-cleanup-banner-ready":`整理预览已就绪({groups} 组)。`,"label-category-cleanup-banner-failed":`整理预览失败:`,"btn-category-cleanup-banner-open":`打开审阅`,"toast-category-cleanup-applied":`已重命名的条目:{count}`,"toast-category-cleanup-undone":`已恢复:{restored}。未找到:{notFound}。`,"btn-auto-cleanup-undo":`撤销上次自动整理`,"btn-auto-cleanup-undo-confirm":`撤销整理`,"title-auto-cleanup-undo":`撤销上次自动整理?`,"label-auto-cleanup-undo-body":`{when} 的自动整理合并了 {merged} 组记忆,并删除了 {removed} 条。撤销会恢复原来的记忆。之后学到的其他记忆会保留。合并后记忆上的更新会丢失。`,"toast-auto-cleanup-undone":`已恢复 {restored} 项更改。`,"toast-auto-cleanup-undone-partial":`已恢复 {restored} 项更改。有 {notFound} 项未找到,因为记忆已发生变化。`,"toast-auto-cleanup-undo-failed":`无法撤销自动整理。`,"toast-category-cleanup-failed":`分类整理失败`,"label-ai-cleanup-title":`AI 画像清理`,"label-ai-cleanup-loading":`AI 正在分析画像...`,"label-ai-cleanup-merged":`合并项`,"label-ai-cleanup-removed":`删除项`,"label-ai-cleanup-kept":`保留`,"label-ai-cleanup-none":`无`,"label-ai-cleanup-select-all":`全选`,"label-ai-cleanup-deselect-all":`清空`,"label-ai-cleanup-apply":`应用变更`,"label-ai-cleanup-merge-check":`合并`,"label-ai-cleanup-remove-check":`删除`,"label-ai-cleanup-changes-selected":`已选 {selected}/{total} 项`,"label-ai-cleanup-merged-header":`合并 ({count} 组)`,"label-ai-cleanup-removed-header":`删除 ({count} 项)`,"btn-apply":`确认替换`,"toast-ai-cleanup-success":`画像清理完成`,"toast-ai-cleanup-failed":`AI 清理失败`,"label-ai-cleanup-progress":`第 {done} 批,共 {total} 批`,"label-ai-cleanup-running-hint":`可以关闭此对话框,清理会继续进行。`,"label-ai-cleanup-pill":`AI 清理`,"label-ai-cleanup-pill-running":`AI 清理进行中`,"label-ai-cleanup-pill-progress":`AI 清理 · 第 {done} 批,共 {total} 批`,"label-ai-cleanup-pill-ready":`AI 清理已完成,可以审阅`,"label-ai-cleanup-pill-failed":`AI 清理失败`,"label-ai-cleanup-failed-batches":`{batches} 批失败,其中 {items} 项保持不变。`,"btn-ai-cleanup-stop":`停止`,"btn-ai-cleanup-retry":`重试`,"btn-ai-cleanup-back":`返回`,"toast-ai-cleanup-skipped":`已应用 {applied} 项更改,{skipped} 项因学习改动了相关条目而跳过。`,"toast-cleanup-apply-failed":`应用清理失败`,"label-ai-cleanup-select":`选择需要清理分析的条目`,"label-ai-cleanup-select-low":`低频 (≤3)`,"label-ai-cleanup-select-same-cat":`同分类 (3+)`,"label-ai-cleanup-analyze":`分析选中项`,"label-ai-cleanup-selected":`已选 {count} 项`,"label-ai-cleanup-hint-low":`选出出现 3 次或更少的记忆。它们最可能是一次性的记录,或是其他记忆的重复。经常出现的记忆不会被选中。`,"label-ai-cleanup-hint-same-cat":`选出所在分类包含 3 条或更多记忆的所有记忆。同一分类名下的记忆最可能互相重复。分类名必须完全一致,所以先运行“整理分类”可以选中更多。没有分类的记忆不会被选中。`,"label-more-info":`这是做什么的?`,"help-ai-cleanup":`让 AI 找出意思相同的记忆并合并。它也可以删除过于模糊、没有帮助的记忆。你先选择要检查的记忆,再逐项查看每个变更。点击“应用变更”之前不会保存任何内容。`,"help-category-cleanup":`找出意思相同的分类名称,例如“Execution”和“Direct execution”,并为每组选定一个名称。它只重命名分类,不合并或删除任何记忆。你可以先查看各组,并可撤销上次整理。`,"profile-actions":`操作`,"migration-found-tags":`发现 {count} 条需要技术标签的记忆。`,"migration-stopped":`迁移已停止:达到最大尝试次数`,"migration-shards-mismatch":`{count} 个分片具有不同的维度`,"migration-dimension-mismatch":`检测到维度不匹配`,"migration-mismatch-details":`模型不匹配:配置使用 {configDimensions}D ({configModel}),但{shardInfo}。`,"auth-warning-text":`跨源编辑已禁用. 设置 webServerAuthPassword 即可启用.`,...ta.zh,...ra.zh,...ea.zh,...ia.zh},ar:{brand:`OMMS`,"tab-project":`ذكريات المشروع`,"tab-profile":`ملف المستخدم`,"nav-menu":`القائمة`,"nav-close":`إغلاق القائمة`,"nav-collapse":`طي الشريط الجانبي`,"nav-expand":`توسيع الشريط الجانبي`,"nav-language":`اللغة`,"nav-theme":`المظهر`,"nav-settings":`الإعدادات`,"nav-chat":`الدردشة`,"nav-skills":`المهارات`,"chat-new":`دردشة جديدة`,"chat-new-folder":`مجلد جديد`,"chat-conversations":`الدردشات`,"chat-no-folder":`بدون مجلد`,"chat-empty-list":`لا توجد دردشات بعد. اطرح سؤالًا للبدء.`,"chat-legend-memory":`ذاكرة (ملاحظة محفوظة من جلساتك)`,"chat-legend-profile":`عنصر من الملف الشخصي (تفضيل أو نمط أو سير عمل)`,"chat-legend-skill":`مهارة (الاستخدام وسجل التغييرات)`,"chat-source-skill":`مهارة`,"chat-skill-uses":`مرات الاستخدام`,"chat-skill-failed":`الأدوار الفاشلة`,"chat-skill-attention":`الاهتمام`,"chat-skill-modified":`معدَّلة`,"chat-skill-modified-yes":`نعم، آخر تطبيق في {date}`,"chat-skill-modified-no":`لا`,"chat-skill-modified-note":`تعني «نعم» وجود مقترح مطبَّق على هذه المهارة.`,"chat-skill-window":`تشمل الأعداد آخر 30 يوماً في كل المشاريع.`,"chat-skill-history":`التغييرات الأخيرة`,"chat-skill-history-empty":`لا توجد تغييرات مسجلة.`,"chat-skill-missing":`لم تعد هذه المهارة مدرجة. حفظ OMMS هذه المعلومات مع الإجابة.`,"chat-skill-kind-created":`أُنشئ`,"chat-skill-kind-applied":`طُبِّق`,"chat-skill-kind-rejected":`رُفض`,"chat-skill-kind-undone":`تم التراجع`,"chat-skill-kind-stale":`قديم`,"chat-skill-by-person":`بواسطة شخص`,"chat-skill-by-agent":`بواسطة وكيل`,"chat-skill-by-automatic":`تلقائياً`,"chat-search-skills":`المهارات`,"chat-search-skill-intent":`سؤال عن المهارات`,"chat-intent-none":`لا شيء`,"chat-intent-needs-work":`المهارات التي تحتاج إلى عناية`,"chat-intent-most-used":`المهارات الأكثر استخداماً`,"chat-skill-facts-unavailable":`تعذّر على OMMS قراءة معلومات المهارات، لذا تعتمد هذه الإجابة على الذاكرة فقط.`,"chat-skill-privacy":`تُرسَل أيضاً أعداد المهارات وملخصات التغييرات القصيرة لأن تعلّم المهارات مفعّل.`,"chat-select":`تحديد`,"chat-select-done":`تم`,"chat-select-all-folder":`تحديد الكل في المجلد`,"chat-selected-count":`تم تحديد {count}`,"chat-delete-selected":`حذف المحدد`,"chat-rename":`إعادة تسمية`,"chat-move":`نقل إلى مجلد`,"chat-delete":`حذف`,"chat-folder-name":`اسم المجلد`,"chat-chat-title":`عنوان الدردشة`,"chat-folder-create-title":`مجلد جديد`,"chat-folder-rename-title":`إعادة تسمية المجلد`,"chat-chat-rename-title":`إعادة تسمية الدردشة`,"chat-save":`حفظ`,"chat-cancel":`إلغاء`,"chat-create":`إنشاء`,"chat-delete-chats-title":`حذف الدردشات؟`,"chat-delete-chats-body":`سيتم حذف {count} دردشة. لا يمكن التراجع عن ذلك.`,"chat-delete-chats-body-one":`سيتم حذف {count} دردشة. لا يمكن التراجع عن ذلك.`,"chat-delete-folder-title":`حذف المجلد؟`,"chat-delete-folder-body":`سيتم حذف المجلد "{name}" و{count} دردشة فيه. لا يمكن التراجع عن ذلك.`,"chat-delete-folder-body-one":`سيتم حذف المجلد "{name}" و{count} دردشة فيه. لا يمكن التراجع عن ذلك.`,"chat-delete-confirm":`حذف`,"chat-folder-exists":`يوجد مجلد بهذا الاسم.`,"chat-scope-label":`البحث في`,"chat-scope-all":`كل المشاريع`,"chat-scope-missing":`المشروع غير موجود على هذا الحاسوب`,"chat-scope-choose":`اختر مكان البحث قبل أن تسأل.`,"chat-input-placeholder":`اسأل عن ذاكرتك…`,"chat-send":`اسأل`,"chat-thinking":`جارٍ البحث في الذاكرة وكتابة الإجابة…`,"chat-you":`أنت`,"chat-omms":`OMMS`,"chat-sources":`المصادر`,"chat-how-searched":`كيف بحثت`,"chat-search-phrases":`عبارات البحث`,"chat-search-tags":`الوسوم`,"chat-search-categories":`فئات الملف الشخصي`,"chat-none":`لا شيء`,"chat-plan-skipped":`تم تخطي خطة البحث، لذلك بحث OMMS بسؤالك فقط.`,"chat-no-sources":`لم يجد OMMS شيئًا ذا صلة في هذا النطاق.`,"chat-insufficient":`المصادر التي وُجدت لا تجيب عن هذا السؤال.`,"chat-uncited":`هذه الإجابة لا تستشهد بأي مصدر. تحقّق منها قبل الاعتماد عليها.`,"chat-error":`فشلت الإجابة ({code}).`,"chat-retry":`إعادة المحاولة`,"chat-setup-title":`تحتاج الدردشة إلى نموذج الذاكرة`,"chat-setup-body":`اضبط هذه الإعدادات لاستخدام الدردشة: {names}.`,"chat-setup-link":`فتح الإعدادات`,"chat-provider-note":`تُرسل الأسئلة ونصوص الذاكرة إلى {host}.`,"chat-read-only":`هذه الدردشات من إصدار أحدث من OMMS. حدّث OMMS لمتابعتها.`,"chat-source-memory":`ذاكرة`,"chat-source-profile":`عنصر في الملف الشخصي`,"chat-source-deleted":`هذه الذاكرة لم تعد موجودة. حفظ OMMS هذا النص مع الإجابة.`,"chat-source-project":`المشروع`,"chat-source-date":`التاريخ`,"chat-source-tags":`الوسوم`,"chat-source-evidence":`الأدلة`,"chat-source-open-project":`فتح ذاكرة المشروع`,"chat-source-note":`كتب نموذج هذه الإجابة. تحقّق من المصدر قبل الاعتماد عليه.`,"chat-empty-thread":`اطرح سؤالًا عن ذاكرتك وملفك الشخصي. تستشهد الإجابات بمصادرها.`,"chat-show-list":`الدردشات`,"chat-folder-count":`{count} دردشة`,"chat-folder-count-one":`{count} دردشة`,"chat-cite-label":`فتح المصدر {label}`,"chat-select-chat":`تحديد {title}`,"chat-folder-actions":`إجراءات المجلد`,"chat-chat-actions":`إجراءات الدردشة`,"power-button":`تشغيل تطبيق الويب`,"power-dialog-title":`إعادة تشغيل تطبيق الويب أو إيقافه`,"power-dialog-body":`تبدأ إعادة التشغيل نسخة جديدة من تطبيق الويب وتعيد تحميل هذه الصفحة. ويطفئ الإيقاف تطبيق الويب.`,"power-restart":`إعادة التشغيل`,"power-stop":`إيقاف`,"power-cancel":`إلغاء`,"power-note":`يستمر الإيقاف حتى البدء التالي لـ OpenCode أو Pi، أو الرسالة التالية في Claude Code، أو تشغيل om-memory-system web install، أو تسجيل الدخول. بعد ذلك يبدأ تطبيق الويب من جديد.`,"power-restarting":`جارٍ إعادة تشغيل تطبيق الويب…`,"power-stopped-title":`توقف تطبيق الويب`,"power-stopped-command":`لبدئه من جديد، شغّل هذا الأمر في الطرفية:`,"power-restart-timeout":`لم يستجب تطبيق الويب بعد إعادة التشغيل.`,"power-restart-failed":`فشلت إعادة التشغيل. تطبيق الويب ما زال يعمل.`,"power-request-failed":`فشل الطلب. قد يكون تطبيق الويب ما زال يعمل.`,"update-button":`يتوفر تحديث: {version}`,"update-label":`تحديث`,"update-dialog-title":`تحديث OMMS`,"update-versions":`الإصدار الحالي: {running}. إصدار أحدث: {available}.`,"update-hosts-intro":`حدّث كل مضيف تستخدمه بالأمر الخاص به:`,"update-host-claude":`Claude Code`,"update-host-opencode":`OpenCode`,"update-host-pi":`Pi`,"update-host-global":`الأمر العام وتطبيق الويب`,"update-hosts-note":`يحتاج OpenCode وPi إلى أمر التحديث الخاص بكل منهما وإعادة التشغيل.`,"update-copy":`نسخ`,"update-copied":`تم النسخ`,"update-install":`تحديث تطبيق الويب`,"update-install-note":`يثبّت الإصدار عامًا عبر npm، ثم يعيد تشغيل تطبيق الويب عليه.`,"update-cannot-install":`لا يوجد npm بجانب Node.js الخاص بتطبيق الويب هذا. ما زالت الأوامر أعلاه تعمل.`,"update-installing":`جارٍ تثبيت الإصدار الجديد…`,"update-failed":`فشل التحديث ({code}). ما زال تطبيق الويب يعمل.`,"update-request-failed":`فشل الطلب. ما زال تطبيق الويب يعمل.`,"update-timeout":`لم يستجب تطبيق الويب بعد التحديث.`,"update-close":`إغلاق`,"theme-dark":`داكن`,"theme-light":`فاتح`,"label-tag":`المشروع:`,"label-type":`النوع:`,"label-tags":`الوسوم:`,"label-content":`المحتوى:`,"btn-cleanup":`تنظيف`,"btn-deduplicate":`إزالة التكرار`,"tooltip-filter-keyword":`عرض كل الذكريات التي تحمل هذه الكلمة المفتاحية`,"tooltip-memory-type":`نوع الذاكرة`,"tooltip-tags":`الوسوم`,"label-label-filter":`الوسم:`,"opt-all-labels":`جميع الوسوم`,"tooltip-cleanup":`حذف الذكريات والموجهات التي لم تُحدَّث خلال فترة الاحتفاظ (30 يومًا افتراضيًا). تبقى الذكريات المثبتة.`,"tooltip-deduplicate":`حذف الذكريات المكررة تمامًا في كل مشروع مع الإبقاء على أحدث نسخة. الذكريات المتشابهة يتم الإبلاغ عنها فقط ولا تُحذف.`,"btn-delete-selected":`حذف المحدد`,"btn-select-all":`تحديد الصفحة`,"btn-deselect-all":`إلغاء التحديد`,"btn-add-memory":`إضافة ذكرى`,"section-project":`ذكريات المشروع ({count})`,"section-profile":`ملف المستخدم`,"section-add":`إضافة ذكرى جديدة`,"opt-all-tags":`جميع المشاريع`,"opt-select-tag":`اختر مشروعًا`,"opt-other":`أخرى`,"opt-feature":`ميزة`,"opt-bug-fix":`إصلاح خطأ`,"opt-refactor":`إعادة هيكلة`,"opt-architecture":`معمارية`,"opt-rule":`قاعدة`,"opt-documentation":`توثيق`,"opt-discussion":`نقاش`,"opt-analysis":`تحليل`,"opt-configuration":`إعدادات`,"modal-edit-title":`تعديل الذكرى`,"dialog-close":`إغلاق`,"dialog-minimise":`تصغير`,"modal-migration-title":`ترحيل وسوم الذكريات`,"modal-changelog-title":`سجل إصدارات الملف الشخصي`,"btn-cancel":`إلغاء`,"btn-save":`حفظ التغييرات`,"btn-start-migration":`بدء الترحيل`,"loading-init":`جاري التهيئة...`,"loading-profile":`جاري تحميل الملف الشخصي...`,"loading-changelog":`جاري تحميل السجل...`,"migration-mismatch":`تم اكتشاف عدم تطابق في أبعاد النموذج!`,"migration-understand":`أفهم أن هذه العملية غير قابلة للتراجع وستؤثر على جميع الذكريات المخزنة`,"btn-fresh-start":`بداية جديدة (حذف الكل)`,"btn-reembed":`إعادة إنشاء المتجهات (مع الاحتفاظ بالبيانات)`,"migration-note":`يرجى عدم إغلاق المتصفح. سيتم إعادة فهرسة الذكريات باستخدام وسوم تقنية لتحسين دقة البحث.`,"placeholder-search":`ابحث في الذكريات...`,"placeholder-tags":`react, hooks, auth (مفصولة بفواصل)`,"placeholder-content":`أدخل محتوى الذكرى...`,"toast-add-success":`تمت إضافة الذكرى بنجاح`,"toast-add-error":`المحتوى والوسم مطلوبان`,"toast-add-failed":`فشلت إضافة الذكرى`,"toast-delete-success":`تم حذف الذكرى بنجاح`,"toast-delete-failed":`فشل حذف الذكرى`,"toast-update-success":`تم تحديث الذكرى بنجاح`,"toast-update-failed":`فشل تحديث الذكرى`,"toast-cleanup-success":`اكتملت عملية التنظيف بنجاح`,"toast-cleanup-failed":`فشلت عملية التنظيف`,"toast-dedup-success":`اكتملت إزالة التكرار بنجاح`,"toast-dedup-failed":`فشلت إزالة التكرار`,"toast-bulk-delete-success":`تم حذف الذكريات المحددة بنجاح`,"toast-bulk-delete-failed":`فشل حذف الذكريات المحددة`,"toast-migration-success":`اكتملت عملية الترحيل بنجاح`,"toast-migration-failed":`فشلت عملية الترحيل`,"toast-fresh-start-success":`تمت البداية الجديدة بنجاح`,"toast-fresh-start-failed":`فشلت البداية الجديدة`,"confirm-delete":`هل تريد حذف هذه الذكرى؟`,"confirm-delete-title":`تأكيد الحذف`,"confirm-delete-pair":`هل تريد حذف هذه الذكرى والموجه المرتبط بها؟`,"confirm-delete-prompt":`هل تريد حذف هذا الموجه والذكرى المرتبطة به؟`,"confirm-bulk-delete":`هل تريد حذف {count} من الذكريات المحددة؟`,"confirm-cleanup":`سيؤدي هذا إلى حذف الذكريات والموجهات التي لم تُحدَّث خلال فترة الاحتفاظ. تبقى الذكريات المثبتة. هل تريد المتابعة؟`,"confirm-dedup":`سيؤدي هذا إلى حذف الذكريات المكررة تمامًا مع الإبقاء على أحدث نسخة. الذكريات المتشابهة يتم الإبلاغ عنها فقط. هل تريد المتابعة؟`,"text-selected":`تم تحديد {count}`,"text-page":`الصفحة {current} من {total}`,"text-total":`الإجمالي: {count}`,"empty-memories":`لم يتم العثور على ذكريات`,"empty-changelog":`لا يوجد سجل تغييرات`,"status-cleanup":`جاري التنظيف...`,"status-dedup":`جاري إزالة التكرار...`,"status-migration-init":`جاري تهيئة الترحيل...`,"status-migration-progress":`جاري الترحيل... {current}/{total}`,"profile-version":`الإصدار`,"profile-prompts":`الموجهات`,"profile-updated":`آخر تحديث`,"profile-preferences":`التفضيلات`,"profile-type-pref":`تفضيل`,"profile-type-pat":`نمط`,"profile-type-wf":`سير`,"profile-patterns":`الأنماط`,"profile-workflows":`سير العمل`,"label-evidence-tooltip":`الذكاء الاصطناعي حدد هذا {count} مرات`,"evidence-count":`{count} دليل`,"evidence-open-label":`عرض الأدلة ({count})`,"evidence-dialog-title":`الأدلة`,"evidence-hit-count":`طابق تحليل الملف الشخصي هذا العنصر {count} مرة.`,"evidence-note":`الأدلة هي ما سجّله تحليل الملف الشخصي من مطالباتك. كتبها النموذج، لذلك قد لا تكون اقتباسًا حرفيًا.`,"evidence-manual-write":`أُضيف عبر حفظ يدوي للذاكرة`,"label-confidence":`درجة الثقة`,"badge-prompt":`موجه المستخدم`,"badge-memory":`ذكرى`,"badge-pinned":`مثبتة`,"badge-linked":`مرتبطة`,"date-created":`تاريخ الإنشاء:`,"date-updated":`تاريخ التحديث:`,"empty-preferences":`لم يتم تعلم أي تفضيلات بعد`,"empty-patterns":`لم يتم اكتشاف أي أنماط بعد`,"empty-workflows":`لم يتم التعرف على أي سير عمل بعد`,"btn-delete-pair":`حذف الزوج`,"tooltip-delete-pair":`حذف هذه الذكرى والموجه المرتبط بها`,"tooltip-delete-prompt-pair":`حذف هذا الموجه والذكرى المرتبطة به`,"btn-edit":`تعديل`,"btn-delete":`حذف`,"label-category":`الفئة`,"label-description":`الوصف`,"label-steps":`الخطوات`,"btn-add-step":`+ أضف خطوة`,"btn-see-more":`عرض المزيد`,"btn-see-less":`عرض أقل`,"label-pasted-content":`المحتوى الملصق`,"text-generated-above":`تم إنشاء الذكرى أعلاه`,"text-from-below":`من الموجه أدناه`,"btn-refresh":`تحديث`,"btn-ai-cleanup":`تنظيف بالذكاء الاصطناعي`,"btn-category-cleanup":`تنظيف الفئات`,"label-category-count-title":`عدد الفئات`,"label-category-cleanup-title":`تنظيف الفئات`,"label-category-cleanup-loading":`جارٍ تجميع أسماء الفئات حسب المعنى…`,"label-category-cleanup-counts":`الفئات الآن: {before}. بعد التنظيف: {after}.`,"label-category-cleanup-note":`التطبيق يغيّر أسماء الفئات فقط. بعد التنظيف تشترك ذكريات أكثر في فئة واحدة، لذلك يدمج التعلّم اللاحق الذكريات شبه المكررة بسهولة أكبر.`,"label-category-cleanup-empty":`لا توجد أسماء فئات لتجميعها.`,"label-category-cleanup-selected":`المجموعات المحددة: {selected} من {total}`,"label-category-cleanup-accept":`استخدم هذه المجموعة`,"label-category-cleanup-name":`اسم المجموعة`,"label-category-cleanup-unchecked":`لم يتحقق منها الذكاء الاصطناعي`,"btn-category-cleanup-apply":`تطبيق المحدد`,"btn-category-cleanup-undo":`تراجع عن آخر تنظيف`,"label-category-cleanup-progress":`جارٍ فحص المجموعات بالذكاء الاصطناعي: الدفعة {done} من {total}.`,"label-category-cleanup-background":`يعمل هذا في الخلفية وقد يستغرق عدة دقائق. يمكنك إغلاق هذه النافذة والعودة لاحقًا.`,"btn-category-cleanup-rebuild":`إنشاء معاينة جديدة`,"label-category-cleanup-banner-ready":`معاينة التنظيف جاهزة ({groups} مجموعة).`,"label-category-cleanup-banner-failed":`فشلت معاينة التنظيف:`,"btn-category-cleanup-banner-open":`فتح المراجعة`,"toast-category-cleanup-applied":`العناصر المعاد تسميتها: {count}`,"toast-category-cleanup-undone":`المستعادة: {restored}. غير الموجودة: {notFound}.`,"btn-auto-cleanup-undo":`تراجع عن آخر تنظيف تلقائي`,"btn-auto-cleanup-undo-confirm":`تراجع عن التنظيف`,"title-auto-cleanup-undo":`هل تريد التراجع عن آخر تنظيف تلقائي؟`,"label-auto-cleanup-undo-body":`دمج التنظيف التلقائي في {when} عدد {merged} من مجموعات الذكريات وحذف {removed}. يعيد التراجع الذكريات الأصلية. تبقى الذكريات الأخرى التي تم تعلمها بعد ذلك. يُفقد أي تحديث لاحق على ذاكرة مدموجة.`,"toast-auto-cleanup-undone":`تمت استعادة {restored} من التغييرات.`,"toast-auto-cleanup-undone-partial":`تمت استعادة {restored} من التغييرات. لم يتم العثور على {notFound} لأن الذكريات تغيرت بعد ذلك.`,"toast-auto-cleanup-undo-failed":`تعذر التراجع عن التنظيف التلقائي.`,"toast-category-cleanup-failed":`فشل تنظيف الفئات`,"label-ai-cleanup-title":`تنظيف الملف الشخصي`,"label-ai-cleanup-loading":`الذكاء الاصطناعي يحلل الملف الشخصي...`,"label-ai-cleanup-merged":`مدموجة`,"label-ai-cleanup-removed":`محذوفة`,"label-ai-cleanup-kept":`متبقية`,"label-ai-cleanup-none":`لا يوجد`,"label-ai-cleanup-select-all":`تحديد الكل`,"label-ai-cleanup-deselect-all":`إلغاء الكل`,"label-ai-cleanup-apply":`تطبيق التغييرات`,"label-ai-cleanup-merge-check":`دمج`,"label-ai-cleanup-remove-check":`حذف`,"label-ai-cleanup-changes-selected":`تم تحديد {selected}/{total}`,"label-ai-cleanup-merged-header":`دمج ({count} مجموعة)`,"label-ai-cleanup-removed-header":`حذف ({count} عنصر)`,"btn-apply":`تأكيد الاستبدال`,"toast-ai-cleanup-success":`اكتمل تنظيف الملف الشخصي`,"toast-ai-cleanup-failed":`فشل تنظيف الملف الشخصي`,"label-ai-cleanup-progress":`الدفعة {done} من {total}`,"label-ai-cleanup-running-hint":`يمكنك إغلاق هذه النافذة، وسيستمر التنظيف.`,"label-ai-cleanup-pill":`تنظيف بالذكاء الاصطناعي`,"label-ai-cleanup-pill-running":`التنظيف بالذكاء الاصطناعي قيد التشغيل`,"label-ai-cleanup-pill-progress":`تنظيف بالذكاء الاصطناعي · الدفعة {done} من {total}`,"label-ai-cleanup-pill-ready":`التنظيف بالذكاء الاصطناعي جاهز للمراجعة`,"label-ai-cleanup-pill-failed":`فشل التنظيف بالذكاء الاصطناعي`,"label-ai-cleanup-failed-batches":`فشلت {batches} دفعة، وبقيت عناصرها البالغ عددها {items} دون تغيير.`,"btn-ai-cleanup-stop":`إيقاف`,"btn-ai-cleanup-retry":`إعادة المحاولة`,"btn-ai-cleanup-back":`رجوع`,"toast-ai-cleanup-skipped":`تم تطبيق {applied} تغيير، وتم تخطي {skipped} لأن التعلّم غيّر عناصرها.`,"toast-cleanup-apply-failed":`فشل تطبيق التنظيف`,"label-ai-cleanup-select":`حدد العناصر للتحليل`,"label-ai-cleanup-select-low":`تردد منخفض (≤3)`,"label-ai-cleanup-select-same-cat":`نفس الفئة (3+)`,"label-ai-cleanup-analyze":`تحليل المحدد`,"label-ai-cleanup-selected":`{count} محدد`,"label-ai-cleanup-hint-low":`يحدد الذكريات التي ظهرت 3 مرات أو أقل. هذه الذكريات هي الأكثر احتمالًا أن تكون ملاحظات لمرة واحدة أو نسخًا من ذكريات أخرى. الذكريات التي تتكرر كثيرًا تبقى خارج التحديد.`,"label-ai-cleanup-hint-same-cat":`يحدد كل ذكرى تنتمي إلى فئة فيها 3 ذكريات أو أكثر. الذكريات تحت اسم فئة واحد هي الأكثر احتمالًا أن تكون نسخًا من بعضها. يجب أن تتطابق الأسماء تمامًا، لذلك شغّل «تنظيف الفئات» أولًا لتحديد المزيد. الذكريات التي بلا فئة تُستبعد.`,"label-more-info":`ما وظيفة هذا؟`,"help-ai-cleanup":`يطلب من الذكاء الاصطناعي إيجاد الذكريات التي تقول الشيء نفسه ودمجها. ويمكنه أيضًا حذف الذكريات الغامضة جدًا بحيث لا تفيد. أنت تختار الذكريات التي يفحصها، ثم تراجع كل تغيير. لا يُحفظ شيء حتى تضغط «تطبيق التغييرات».`,"help-category-cleanup":`يجد أسماء الفئات التي لها المعنى نفسه، مثل «Execution» و«Direct execution»، ويعطي كل مجموعة اسمًا واحدًا. يعيد تسمية الفئات فقط، ولا يدمج أو يحذف أي ذكرى. تراجع المجموعات أولًا، ويمكنك التراجع عن آخر تنظيف.`,"migration-found-tags":`تم العثور على {count} من الذكريات التي تحتاج إلى وسوم تقنية.`,"migration-stopped":`تم إيقاف الترحيل: تم الوصول إلى الحد الأقصى للمحاولات`,"migration-shards-mismatch":`{count} من الأجزاء تحتوي على أبعاد مختلفة`,"migration-dimension-mismatch":`تم اكتشاف عدم تطابق في الأبعاد`,"migration-mismatch-details":`عدم تطابق النموذج: يستخدم الإعداد {configDimensions}D ({configModel}) بينما {shardInfo}.`,"auth-warning-text":`التحرير عبر المصادر معطّل. قم بتعيين webServerAuthPassword لتفعيله.`,...ta.ar,...ra.ar,...ea.ar,...ia.ar}},oa=`omms-lang`,sa=`opencode-mem-lang`;function ca(){if(typeof window>`u`)return`en`;let e=Si(oa,sa);return e===`en`||e===`zh`||e===`ar`?e:`en`}var la=ca(),ua=new Set;function da(){for(let e of ua)e()}function fa(e){la=e,typeof document<`u`&&(wi(oa,e),document.documentElement.dir=e===`ar`?`rtl`:`ltr`,document.documentElement.lang=Zi(e)),da()}function pa(e){return ua.add(e),()=>{ua.delete(e)}}function ma(){return la}function ha(){return`en`}function ga(){return la}function _a(e){fa(e)}function va(e,t={},n=ga()){let r=aa[n][e]||aa.en[e]||e;for(let[e,n]of Object.entries(t))r=r.replace(RegExp(`\\{${e}\\}`,`g`),String(n));return r}var ya=(0,v.createContext)(null);function ba(){return(0,v.useSyncExternalStore)(pa,ma,ha)}function xa(){return(0,v.useSyncExternalStore)(Ji,Ki,Ki)}function Sa({children:e}){let t=ba(),n=xa(),r=(0,v.useMemo)(()=>({language:t,t:(e,n={})=>va(e,n,t),dateFormat:n}),[t,n]);return(0,v.createElement)(ya.Provider,{value:r},e)}function G(){let e=(0,v.useContext)(ya),t=ba(),n=xa();return(0,v.useMemo)(()=>e??{language:t,t:(e,n={})=>va(e,n,t),dateFormat:n},[e,t,n])}typeof document<`u`&&(document.documentElement.dir=la===`ar`?`rtl`:`ltr`,document.documentElement.lang=Zi(la));function Ca(){let[e,t]=(0,v.useState)([]),[n,r]=(0,v.useState)([]),[i,a]=(0,v.useState)([]),[o,s]=(0,v.useState)(new Set),[c,l]=(0,v.useState)(``),[u,d]=(0,v.useState)(``),[f,p]=(0,v.useState)(``),[m,h]=(0,v.useState)(``),[g,_]=(0,v.useState)(!1),[y,b]=(0,v.useState)(1),[x,S]=(0,v.useState)(1),[C,w]=(0,v.useState)(0),[T,E]=(0,v.useState)(0),[D,O]=(0,v.useState)(!0),[k,A]=(0,v.useState)(null),[j,M]=(0,v.useState)(!1),[N,P]=(0,v.useState)(!1),[ee,F]=(0,v.useState)(!1),[I,te]=(0,v.useState)(``),[L,ne]=(0,v.useState)(!1),[re,R]=(0,v.useState)(!1),[ie,ae]=(0,v.useState)(0),[oe,se]=(0,v.useState)(!1),[ce,le]=(0,v.useState)(``),[ue,de]=(0,v.useState)(``),[fe,pe]=(0,v.useState)(``),[me,he]=(0,v.useState)(``),[ge,_e]=(0,v.useState)(``),[ve,ye]=(0,v.useState)(``),be=(0,v.useRef)({currentPage:y,isSearching:g,searchQuery:f,selectedTag:c,selectedKeyword:u});be.current={currentPage:y,isSearching:g,searchQuery:f,selectedTag:c,selectedKeyword:u};let xe=(0,v.useCallback)(e=>{s(new Set(e))},[]),Se=(0,v.useCallback)(async()=>{let e=await W(`/api/tags`);e.success&&e.data&&t(e.data.project||[])},[]),Ce=(0,v.useCallback)(async e=>{let t=await W(e?`/api/keywords?tag=${encodeURIComponent(e)}`:`/api/keywords`);t.success&&t.data&&r(t.data.keywords||[])},[]),we=(0,v.useCallback)(async()=>{let e=await W(`/api/stats`);e.success&&e.data&&E(e.data.total)},[]),Te=(0,v.useCallback)(async e=>{let{currentPage:t,isSearching:n,searchQuery:r,selectedTag:i,selectedKeyword:o}={...be.current,...e,currentPage:e?.page??be.current.currentPage};M(!0),A(null),Ce(i);let s=`/api/memories?page=${t}&pageSize=20&includePrompts=true`;n?(s=`/api/search?q=${encodeURIComponent(r)}&page=${t}&pageSize=20`,i&&(s+=`&tag=${encodeURIComponent(i)}`)):(i&&(s+=`&tag=${encodeURIComponent(i)}`),o&&(s+=`&keyword=${encodeURIComponent(o)}`));let c=await W(s);M(!1),O(!1),c.success&&c.data?(a(c.data.items),S(c.data.totalPages),w(c.data.total),b(c.data.page)):A(c.error||va(`toast-update-failed`))},[Ce]),Ee=(0,v.useCallback)(async()=>{let e=await W(`/api/migration/detect`);if(e.success&&e.data?.needsMigration){let t=e.data.shardMismatches.length>0?va(`migration-shards-mismatch`,{count:e.data.shardMismatches.length}):va(`migration-dimension-mismatch`);te(va(`migration-mismatch-details`,{configDimensions:e.data.configDimensions,configModel:e.data.configModel,shardInfo:t})),F(!0)}let t=await W(`/api/migration/tags/detect`);t.success&&t.data?.needsMigration&&Ei(t.data.count)&&(ae(t.data.count),R(!0))},[]),De=(0,v.useCallback)(async()=>{try{let e=await fetch(`/api/health`,{credentials:`same-origin`});if(!e.ok)return;if((await e.json())?.authEnabled===!0){P(!1);return}let t=window.location.hostname.toLowerCase(),n=t===`localhost`||t===`127.0.0.1`||t===`[::1]`||t===`::1`||t.startsWith(`::ffff:`)&&t.endsWith(`127.0.0.1`);P(!n)}catch{}},[]);function Oe(){let e=m.trim();if(!e){ke();return}p(e),_(!0),b(1),d(``),Te({page:1,isSearching:!0,searchQuery:e,selectedKeyword:``})}function ke(){p(``),h(``),_(!1),b(1),Te({page:1,isSearching:!1,searchQuery:``})}function Ae(e){l(e),b(1),_(!1),p(``),h(``),Te({page:1,isSearching:!1,searchQuery:``,selectedTag:e})}function je(e){d(e),b(1),_(!1),p(``),h(``),Te({page:1,isSearching:!1,searchQuery:``,selectedKeyword:e})}function Me(e,t){let n=new Set(o);t?n.add(e):n.delete(e),xe(n)}function Ne(){let e=new Set(o);for(let t of i)e.add(t.id);xe(e)}function Pe(){xe(new Set)}async function Fe(e){e.preventDefault();let t=ve.trim();if(!t||!fe){U.error(va(`toast-add-error`));return}let n=ge.split(`,`).map(e=>e.trim()).filter(Boolean),r=await W(`/api/memories`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({content:t,containerTag:fe,type:me||void 0,tags:n})});r.success?(U.success(va(`toast-add-success`)),ye(``),_e(``),he(``),await Te(),await we()):U.error(r.error||va(`toast-add-failed`))}function Ie(e){let t=i.find(t=>t.id===e&&t.type===`memory`);t&&(le(e),de(t.content),se(!0))}async function Le(e){let t=await W(`/api/memories/${ce}`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({content:e})});t.success?(U.success(va(`toast-update-success`)),se(!1),await Te()):U.error(t.error||va(`toast-update-failed`))}async function Re(e,t){if(!confirm(va(t?`confirm-delete-pair`:`confirm-delete`)))return;let n=await W(`/api/memories/${e}?cascade=true`,{method:`DELETE`});if(n.success){U.success(va(`toast-delete-success`));let t=new Set(o);t.delete(e),xe(t),await Te(),await we()}else U.error(n.error||va(`toast-delete-failed`))}async function ze(e,t){if(!confirm(va(t?`confirm-delete-prompt`:`confirm-delete`)))return;let n=await W(`/api/prompts/${e}?cascade=true`,{method:`DELETE`});if(n.success){U.success(va(`toast-delete-success`));let t=new Set(o);t.delete(e),xe(t),await Te(),await we()}else U.error(n.error||va(`toast-delete-failed`))}async function Be(){if(o.size===0||!confirm(va(`confirm-bulk-delete`,{count:o.size})))return;let e=Array.from(o),t=e.filter(e=>e.startsWith(`prompt_`)),n=e.filter(e=>!e.startsWith(`prompt_`));t.length>0&&await W(`/api/prompts/bulk-delete`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({ids:t,cascade:!0})}),n.length>0&&await W(`/api/memories/bulk-delete`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({ids:n,cascade:!0})}),U.success(va(`toast-bulk-delete-success`)),xe(new Set),await Te(),await we()}async function Ve(e){let t=await W(`/api/memories/${e}/pin`,{method:`POST`});t.success?(U.success(va(`toast-update-success`)),await Te()):U.error(t.error||va(`toast-update-failed`))}async function He(e){let t=await W(`/api/memories/${e}/unpin`,{method:`POST`});t.success?(U.success(va(`toast-update-success`)),await Te()):U.error(t.error||va(`toast-update-failed`))}async function Ue(){if(!confirm(va(`confirm-cleanup`)))return;U.info(va(`status-cleanup`));let e=await W(`/api/cleanup`,{method:`POST`});e.success?(U.success(va(`toast-cleanup-success`)),await Te(),await we()):U.error(e.error||va(`toast-cleanup-failed`))}async function We(){if(!confirm(va(`confirm-dedup`)))return;U.info(va(`status-dedup`));let e=await W(`/api/deduplicate`,{method:`POST`});e.success?(U.success(va(`toast-dedup-success`)),await Te(),await we()):U.error(e.error||va(`toast-dedup-failed`))}async function Ge(e){if(!L){U.error(va(`toast-migration-failed`));return}if(!confirm(`Run ${e===`fresh-start`?`Fresh Start (Delete All)`:`Re-embed (Preserve Data)`} migration?\n\nThis operation is IRREVERSIBLE.\n\nContinue?`))return;U.info(va(`status-migration-init`));let t=await W(`/api/migration/run`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({strategy:e})});t.success?(U.success(va(`toast-migration-success`)),F(!1),ne(!1),await Te(),await we()):U.error(t.error||va(`toast-migration-failed`))}return{tags:e,memories:i,selectedIds:o,selectedTag:c,selectedKeyword:u,onKeywordFilterChange:je,searchInput:m,setSearchInput:h,isSearching:g,currentPage:y,setCurrentPage:b,totalPages:x,totalItems:C,statsTotal:T,loadingMemories:D,memoriesError:k,refreshing:j,showAuthWarning:N,migrationNeeded:ee,migrationMessage:I,migrationConfirmed:L,setMigrationConfirmed:ne,tagMigrationOpen:re,setTagMigrationOpen:R,tagMigrationCount:ie,editOpen:oe,setEditOpen:se,editContent:ue,addTag:fe,setAddTag:pe,addType:me,setAddType:he,addTags:ge,setAddTags:_e,addContent:ve,setAddContent:ye,loadTags:Se,keywords:n,loadStats:we,loadMemories:Te,checkMigrationStatus:Ee,checkAuthWarning:De,performSearch:Oe,clearSearch:ke,onTagFilterChange:Ae,onSelect:Me,selectAllCurrentPage:Ne,deselectAll:Pe,addMemory:Fe,openEdit:Ie,saveEdit:Le,deleteMemory:Re,deletePrompt:ze,bulkDelete:Be,pinMemory:Ve,unpinMemory:He,runCleanup:Ue,runDeduplication:We,runMigration:Ge}}var wa=15e3,Ta=5e3,Ea=500,Da=3e4,Oa=2e3,ka=42e4,Aa=new Set([`idle`,`installing`,`restarting`,`failed`]);function ja(e){if(!e||typeof e!=`object`)return;let t=e;if(!(typeof t.state!=`string`||!Aa.has(t.state)))return{available:typeof t.available==`string`?t.available:null,state:t.state,code:typeof t.code==`string`?t.code:null,canInstall:t.canInstall===!0}}function Ma(e){if(!e||typeof e!=`object`)return;let t=e;if(typeof t.id==`string`&&typeof t.name==`string`)return{id:t.id,name:t.name,customStoragePath:t.customStoragePath===!0,...typeof t.problem==`string`?{problem:t.problem}:{}}}var Na=()=>({"x-omms-token":window.__OMMS_TOKEN__??``});async function Pa(){try{let e=await fetch(`/api/web/status`,{headers:Na(),signal:AbortSignal.timeout(Ta)});if(!e.ok)return null;let t=await e.json();if(typeof t.version!=`string`||typeof t.canControl!=`boolean`)return null;let n=ja(t.update),r=Ma(t.activeSpace);return{version:t.version,canControl:t.canControl,...typeof t.instance==`string`?{instance:t.instance}:{},...n?{update:n}:{},...r?{activeSpace:r}:{}}}catch{return null}}async function Fa(e){try{return(await fetch(`/api/web/${e}`,{method:`POST`,headers:{...Na(),"Content-Type":`application/json`},body:`{}`,signal:AbortSignal.timeout(Ta)})).status===202}catch{return!1}}async function Ia(e,t={}){let n=t.sleep??(e=>new Promise(t=>setTimeout(t,e))),r;for(let t=0;;t+=Ea){if(r=await Pa(),r&&r.instance!==e)return`restarted`;if(t>=Da)break;await n(Ea)}return r?`unchanged`:`down`}async function La(){try{return(await fetch(`/api/web/update`,{method:`POST`,headers:{...Na(),"Content-Type":`application/json`},body:`{}`,signal:AbortSignal.timeout(Ta)})).status===202}catch{return!1}}async function Ra(e,t={}){let n=t.sleep??(e=>new Promise(t=>setTimeout(t,e)));for(let t=0;t<=ka;t+=Oa){let t=await Pa();if(t&&t.instance!==e)return{kind:`restarted`};if(t?.update?.state===`failed`)return{kind:`failed`,code:t.update.code??`unknown`};await n(Oa)}return{kind:`timeout`}}var za={ok:!0,status:null},Ba=new Set,Va=null,Ha=0,Ua=0,Wa=null;async function Ga(){let e=++Ha,t=await Pa();if(!(e<Ua)){Ua=e,za=t?{ok:!0,status:t}:{...za,ok:!1},t&&Ka(t.instance);for(let e of Ba)e(za)}}function Ka(e){if(e===void 0)return;let t=Wa!==null&&e!==Wa;Wa=e,t&&globalThis.window?.location?.reload?.()}function qa(e){return Ba.add(e),e(za),Ga(),Va??=setInterval(()=>void Ga(),wa),()=>{Ba.delete(e),Ba.size===0&&Va!==null&&(clearInterval(Va),Va=null)}}var Ja=()=>za;function Ya(){return(0,v.useSyncExternalStore)(qa,Ja,Ja)}function Xa(e,t){let n=Ya().status?.activeSpace?.id,[r,i]=(0,v.useState)(void 0),[a,o]=(0,v.useState)(0);return(0,v.useEffect)(()=>{n!==void 0&&n!==r&&(i(n),r!==void 0&&(o(e=>e+1),e.loadTags(),e.loadStats(),e.checkMigrationStatus(),e.onTagFilterChange(``),t.userProfile&&t.loadUserProfile()))},[n]),a}function Za(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(!1),[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(!1),u=(0,v.useCallback)(e=>{a(e),e&&l(!1)},[]),d=(0,v.useCallback)(()=>{a(!1),l(!0)},[]),f=(0,v.useCallback)(()=>l(!1),[]),p=(0,v.useCallback)(async()=>{r(!0);let e=await W(`/api/user-profile`);r(!1),e.success&&e.data?t(e.data):U.error(e.error||va(`toast-update-failed`))},[]);return{userProfile:e,loadingProfile:n,aiCleanupOpen:i,setAiCleanupOpen:u,aiCleanupMinimised:c,minimiseAiCleanup:d,dismissAiCleanupPill:f,categoryCleanupOpen:o,setCategoryCleanupOpen:s,loadUserProfile:p,refreshProfile:(0,v.useCallback)(async()=>{U.info(va(`loading-profile`));let e=await W(`/api/user-profile/refresh`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({})});e.success?(U.success(e.data?.message||va(`toast-update-success`)),await p()):U.error(e.error||va(`toast-update-failed`))},[p])}}function Qa(e,t){if(!e)return t?{phase:`failed`,error:t}:{phase:`select`};let n=e.status;switch(n.state){case`running`:return{phase:`running`,done:n.done,total:n.total};case`done`:{let{failedBatches:e,failedItems:t}=n.result,r=e>0?{batches:e,items:t}:null;return{phase:`review`,result:n.result,notice:r}}case`failed`:return{phase:`failed`,error:n.error}}}function $a(e,t){if(!e)return t?null:{kind:`checking`};let n=e.status;switch(n.state){case`running`:return{kind:`running`,done:n.done,total:n.total};case`done`:return{kind:`ready`};case`failed`:return{kind:`failed`}}}function eo(e,t){return t&&e?.status.state===`running`}function to(e,t,n=!1){let r=t.success?t.data??null:e;return{job:r,poll:n||eo(r,!0)}}function no(e,t){return e?new Set(e.selection):t}function ro(e,t){return e?e.selection:[...t]}var io=2e3;function ao(e,t=!1){let[n,r]=(0,v.useState)(null),i=(0,v.useRef)(null),a=(0,v.useCallback)(e=>{i.current=e,r(e)},[]),[o,s]=(0,v.useState)(),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(0),f=(0,v.useRef)(0);return(0,v.useEffect)(()=>{if(!e)return;let n=!1,r,o=f.current,s=async()=>{let e=await yi.status();if(n||f.current!==o)return;let c=to(i.current,e,t);a(c.job),e.success&&l(!0),c.poll&&(r=setTimeout(()=>void s(),io))};return s(),()=>{n=!0,clearTimeout(r)}},[e,t,u,a]),(0,v.useEffect)(()=>{e||(s(void 0),l(!1))},[e]),{job:n,checked:c,startError:o,start:(0,v.useCallback)(async(e,t,n)=>{s(void 0);let r=await yi.start(e,t);if(!r.success||!r.data){a(null),s(r.error||n);return}a(r.data),d(e=>e+1)},[a]),discard:(0,v.useCallback)(async()=>{f.current++,a(null),s(void 0),await yi.stop()},[a]),clear:()=>a(null)}}var oo=Object.defineProperty,K=(e,t)=>oo(e,`name`,{value:t,configurable:!0});function so(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}K(so,`setRef`);function co(...e){return t=>{let n=!1,r=e.map(e=>{let r=so(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():so(e[t],null)}}}}K(co,`composeRefs`);function lo(...e){return v.useCallback(co(...e),e)}K(lo,`useComposedRefs`);var uo=Object.defineProperty,fo=(e,t)=>uo(e,`name`,{value:t,configurable:!0});function po(e){let t=v.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];So(r)&&typeof Eo==`function`&&(r=Eo(r._payload)),v.Children.forEach(r,e=>{if(bo(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;So(n)&&typeof Eo==`function`&&(n=Eo(n._payload)),a=_o(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=v.cloneElement(a,void 0,s):!o&&v.Children.count(r)===1&&v.isValidElement(r)&&(a=r);let c=a?yo(a):void 0,l=lo(n,c);if(!a){if(r||r===0)throw Error(o?To(e):wo(e));return r}let u=vo(i,a.props??{});return a.type!==v.Fragment&&(u.ref=n?l:c),v.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}fo(po,`createSlot`);var mo=po(`Slot`),ho=Symbol.for(`radix.slottable`);function go(e){let t=fo(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=ho,t}fo(go,`createSlottable`);var _o=fo((e,t)=>{if(`child`in e.props){let t=e.props.child;return v.isValidElement(t)?v.cloneElement(t,void 0,e.props.children(t.props.children)):null}return v.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function vo(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}fo(vo,`mergeProps`);function yo(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}fo(yo,`getElementRef`);function bo(e){return v.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===ho}fo(bo,`isSlottable`);var xo=Symbol.for(`react.lazy`);function So(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===xo&&`_payload`in e&&Co(e._payload)}fo(So,`isLazyComponent`);function Co(e){return typeof e==`object`&&!!e&&`then`in e}fo(Co,`isPromiseLike`);var wo=fo(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),To=fo(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),Eo=v.use,Do=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,Oo=cn,ko=(e,t)=>n=>{if(t?.variants==null)return Oo(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=Do(t)||Do(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return Oo(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},Ao=ko(`focus-visible:border-ring focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background aria-invalid:border-destructive aria-invalid:ring-destructive border border-transparent bg-clip-padding text-ui font-medium focus-visible:ring-2 aria-invalid:ring-1 [&_svg:not([class*='size-'])]:size-4 group/button inline-flex max-w-full shrink-0 cursor-pointer items-center justify-center whitespace-nowrap transition-colors duration-150 outline-none select-none disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0`,{variants:{variant:{default:`bg-primary/10 border-primary/25 text-primary-label hover:bg-primary/16 active:bg-primary/22 dark:bg-primary/16 dark:hover:bg-primary/22 dark:active:bg-primary/30`,outline:`border-input bg-card text-foreground hover:bg-interactive-hover active:bg-interactive-active aria-expanded:bg-selection`,secondary:`border-border bg-secondary text-secondary-foreground hover:bg-interactive-hover active:bg-interactive-active aria-expanded:bg-selection`,ghost:`text-foreground hover:bg-interactive-hover active:bg-interactive-active aria-expanded:bg-selection`,destructive:`bg-destructive/10 border-destructive/25 text-destructive-label hover:bg-destructive/16 active:bg-destructive/22 dark:bg-destructive/16 dark:hover:bg-destructive/22 dark:active:bg-destructive/30`,link:`text-primary-label underline-offset-4 hover:underline`},size:{default:`h-9 rounded-[10px] gap-1.5 px-3 has-data-[icon=inline-end]:pe-2.5 has-data-[icon=inline-start]:ps-2.5`,xs:`h-6 rounded-[7px] gap-1 px-2.5 text-xs has-data-[icon=inline-end]:pe-2 has-data-[icon=inline-start]:ps-2 [&_svg:not([class*='size-'])]:size-3`,sm:`h-8 rounded-[9px] gap-1 px-3 has-data-[icon=inline-end]:pe-2 has-data-[icon=inline-start]:ps-2`,lg:`h-10 rounded-[12px] gap-1.5 px-4 has-data-[icon=inline-end]:pe-3 has-data-[icon=inline-start]:ps-3`,icon:`size-9 rounded-[10px]`,"icon-xs":`size-6 rounded-[7px] [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-8 rounded-[9px]`,"icon-lg":`size-10 rounded-[12px]`}},defaultVariants:{variant:`default`,size:`default`}});function q({className:e,variant:t,size:n,asChild:r=!1,...i}){return(0,H.jsx)(r?mo:`button`,{"data-slot":`button`,className:V(Ao({variant:t,size:n,className:e})),...i})}function jo({onSelectAll:e,onSelectNone:t,onSelectLow:n,onSelectSameCat:r}){let{t:i}=G(),[a,o]=(0,v.useState)(null),s=(e,t)=>()=>{t(),o(e)};return(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[(0,H.jsx)(q,{variant:`secondary`,size:`xs`,onClick:s(null,e),children:i(`label-ai-cleanup-select-all`)}),(0,H.jsx)(q,{variant:`secondary`,size:`xs`,onClick:s(null,t),children:i(`label-ai-cleanup-deselect-all`)}),(0,H.jsx)(q,{variant:`secondary`,size:`xs`,"aria-pressed":a===`low`,onClick:s(`low`,n),children:i(`label-ai-cleanup-select-low`)}),(0,H.jsx)(q,{variant:`secondary`,size:`xs`,"aria-pressed":a===`same-cat`,onClick:s(`same-cat`,r),children:i(`label-ai-cleanup-select-same-cat`)})]}),a?(0,H.jsx)(`p`,{role:`status`,className:`rounded-lg border border-border bg-muted px-3 py-2 text-xs text-muted-foreground`,children:i(a===`low`?`label-ai-cleanup-hint-low`:`label-ai-cleanup-hint-same-cat`)}):null]})}function Mo({steps:e}){return e?.length?(0,H.jsx)(`div`,{className:`flex flex-wrap gap-1 text-xs text-muted-foreground`,children:e.map((t,n)=>(0,H.jsxs)(`span`,{className:`contents`,children:[(0,H.jsxs)(`span`,{children:[n+1,`. `,t]}),n<e.length-1?(0,H.jsx)(I,{className:`size-3 inline`}):null]},n))}):null}var No=Object.defineProperty,Po=(e,t)=>No(e,`name`,{value:t,configurable:!0});function Fo(e,t){let n=v.createContext(t);n.displayName=e+`Context`;let r=Po(e=>{let{children:t,...r}=e,i=v.useMemo(()=>r,Object.values(r));return(0,H.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=v.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return Po(i,`useContext`),[r,i]}Po(Fo,`createContext`);function Io(e,t=[]){let n=[];function r(t,r){let i=v.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=Po(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=v.useMemo(()=>o,Object.values(o));return(0,H.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=v.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return Po(s,`useContext`),[o,s]}Po(r,`createContext`);let i=Po(()=>{let t=n.map(e=>v.createContext(e));return Po(function(n){let r=n?.[e]||t;return v.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,Lo(i,...t)]}Po(Io,`createContextScope`);function Lo(...e){let t=e[0];if(e.length===1)return t;let n=Po(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return Po(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return v.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}Po(Lo,`composeContextScopes`);var Ro=Object.defineProperty,zo=(e,t)=>Ro(e,`name`,{value:t,configurable:!0}),Bo=!!(typeof window<`u`&&window.document&&window.document.createElement);function Vo(e,t,{checkForDefaultPrevented:n=!0}={}){return zo(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}zo(Vo,`composeEventHandlers`);function Ho(e){if(!Bo)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}zo(Ho,`getOwnerWindow`);function Uo(e){if(!Bo)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}zo(Uo,`getOwnerDocument`);function Wo(e,t=!1){let{activeElement:n}=Uo(e);if(!n?.nodeName)return null;if(Go(n)&&n.contentDocument)return Wo(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=Uo(n).getElementById(e);if(t)return t}}return n}zo(Wo,`getActiveElement`);function Go(e){return e.tagName===`IFRAME`}zo(Go,`isFrame`);var Ko=globalThis?.document?v.useLayoutEffect:()=>{},qo=Object.defineProperty,Jo=(e,t)=>qo(e,`name`,{value:t,configurable:!0}),Yo=v.useEffectEvent,Xo=v.useInsertionEffect;function Zo(e){if(typeof Yo==`function`)return Yo(e);let t=v.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof Xo==`function`?Xo(()=>{t.current=e}):Ko(()=>{t.current=e}),v.useMemo(()=>((...e)=>t.current?.(...e)),[])}Jo(Zo,`useEffectEvent`);var Qo=Object.defineProperty,$o=(e,t)=>Qo(e,`name`,{value:t,configurable:!0}),es=v.useInsertionEffect||Ko;function ts({prop:e,defaultProp:t,onChange:n=$o(()=>{},`onChange`),caller:r}){let[i,a,o]=ns({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,v.useCallback(t=>{if(s){let n=rs(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}$o(ts,`useControllableState`);function ns({defaultProp:e,onChange:t}){let[n,r]=v.useState(e),i=v.useRef(n),a=v.useRef(t);return es(()=>{a.current=t},[t]),v.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}$o(ns,`useUncontrolledState`);function rs(e){return typeof e==`function`}$o(rs,`isFunction`);var is=Symbol(`RADIX:SYNC_STATE`);function as(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=Zo(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=v.useReducer((t,n)=>{if(n.type===is)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=v.useRef(p);v.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=v.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return v.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:is,state:i})},[i,d.state,c]),[h,f]}$o(as,`useControllableStateReducer`);var os=Object.defineProperty,ss=(e,t)=>os(e,`name`,{value:t,configurable:!0});function cs(e){let[t,n]=v.useState(void 0);return Ko(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}n(void 0)},[e]),t}ss(cs,`useSize`);var ls=Object.defineProperty,us=(e,t)=>ls(e,`name`,{value:t,configurable:!0});function ds(e,t){return v.useReducer((e,n)=>t[e][n]??e,e)}us(ds,`useStateMachine`);var fs=us(e=>{let{present:t,children:n}=e,r=ps(t),i=typeof n==`function`?n({present:r.isPresent}):v.Children.only(n),a=hs(r.ref,_s(i));return typeof n==`function`||r.isPresent?v.cloneElement(i,{ref:a}):null},`Presence`);function ps(e){let[t,n]=v.useState(),r=v.useRef(null),i=v.useRef(e),a=v.useRef(`none`),o=v.useRef(void 0),[s,c]=ds(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return v.useEffect(()=>{s===`mounted`?(a.current=o.current??gs(r.current),o.current=void 0):a.current=`none`},[s]),Ko(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=gs(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),Ko(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=us(a=>{let o=gs(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=us(e=>{e.target===t&&(a.current=gs(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:v.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=gs(t)}else r.current=null;n(e)},[])}}us(ps,`usePresence`);function ms(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}us(ms,`setRef`);function hs(...e){let t=v.useRef(e);return t.current=e,v.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=ms(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():ms(n[e],null)}}},[])}us(hs,`useStableComposedRefs`);function gs(e){return e?.animationName||`none`}us(gs,`getAnimationName`);function _s(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}us(_s,`getElementRef`);var vs=Object.defineProperty,ys=(e,t)=>vs(e,`name`,{value:t,configurable:!0}),bs=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=po(`Primitive.${t}`),r=v.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,H.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function xs(e,t){e&&zr.flushSync(()=>e.dispatchEvent(t))}ys(xs,`dispatchDiscreteCustomEvent`);var Ss=Object.defineProperty,Cs=(e,t)=>Ss(e,`name`,{value:t,configurable:!0}),ws=`Checkbox`,[Ts,Es]=Io(ws),[Ds,Os]=Ts(ws);function ks(e){let{__scopeCheckbox:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:l,value:u=`on`,internal_do_not_use_render:d}=e,[f,p]=ts({prop:n,defaultProp:i??!1,onChange:c,caller:ws}),[m,h]=v.useState(null),[g,_]=v.useState(null),y=v.useRef(!1),[b,x]=v.useReducer(e=>e+1,0),S=!m||!!o||!!m.closest(`form`),C={checked:f,disabled:a,setChecked:p,control:m,setControl:h,name:s,form:o,value:u,hasConsumerStoppedPropagationRef:y,userInteractionCount:b,onUserInteraction:x,required:l,defaultChecked:!Rs(i)&&i,isFormControl:S,bubbleInput:g,setBubbleInput:_};return(0,H.jsx)(Ds,{scope:t,...C,children:Ls(d)?d(C):r})}Cs(ks,`CheckboxProvider`);var As=`CheckboxTrigger`,js=v.forwardRef(Cs(function({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},i){let{control:a,value:o,disabled:s,checked:c,required:l,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,onUserInteraction:p,isFormControl:m,bubbleInput:h}=Os(As,e),g=lo(i,u),_=v.useRef(c);return v.useEffect(()=>{let e=a?.form;if(e){let t=Cs(()=>d(_.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[a,d]),(0,H.jsx)(bs.button,{type:`button`,role:`checkbox`,"aria-checked":Rs(c)?`mixed`:c,"aria-required":l,"data-state":zs(c),"data-disabled":s?``:void 0,disabled:s,value:o,...r,ref:g,onKeyDown:Vo(t,e=>{e.key===`Enter`&&e.preventDefault()}),onClick:Vo(n,e=>{p(),d(e=>Rs(e)?!0:!e),h&&m&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})})},`CheckboxTrigger`)),Ms=v.forwardRef(Cs(function(e,t){let{__scopeCheckbox:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,H.jsx)(ks,{__scopeCheckbox:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(js,{...d,ref:t,__scopeCheckbox:n}),e&&(0,H.jsx)(Is,{__scopeCheckbox:n})]})})},`Checkbox`)),Ns=`CheckboxIndicator`,Ps=v.forwardRef(Cs(function(e,t){let{__scopeCheckbox:n,forceMount:r,...i}=e,a=Os(Ns,n);return(0,H.jsx)(fs,{present:r||Rs(a.checked)||a.checked===!0,children:(0,H.jsx)(bs.span,{"data-state":zs(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t,style:{pointerEvents:`none`,...e.style}})})},`CheckboxIndicator`)),Fs=`CheckboxBubbleInput`,Is=v.forwardRef(Cs(function({__scopeCheckbox:e,onClick:t,...n},r){let{control:i,hasConsumerStoppedPropagationRef:a,userInteractionCount:o,checked:s,defaultChecked:c,required:l,disabled:u,name:d,value:f,form:p,bubbleInput:m,setBubbleInput:h}=Os(Fs,e),g=lo(r,h),_=cs(i),y=v.useRef(!1),b=v.useRef(s),x=v.useRef(o);v.useEffect(()=>{let e=m;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=o!==x.current;x.current=o;let i=b.current!==s;b.current=s;let c=!(r&&a.current);if(i&&n){y.current=!r;let t=new Event(`click`,{bubbles:c});e.indeterminate=Rs(s),n.call(e,!Rs(s)&&s),e.dispatchEvent(t),y.current=!1}},[m,s,a,o]);let S=v.useRef(!Rs(s)&&s);return(0,H.jsx)(bs.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:c??S.current,required:l,disabled:u,name:d,value:f,form:p,...n,tabIndex:-1,ref:g,onClick:Vo(t,e=>{y.current&&e.stopPropagation()}),style:{...n.style,..._,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`CheckboxBubbleInput`));function Ls(e){return typeof e==`function`}Cs(Ls,`isFunction`);function Rs(e){return e===`indeterminate`}Cs(Rs,`isIndeterminate`);function zs(e){return Rs(e)?`indeterminate`:e?`checked`:`unchecked`}Cs(zs,`getState`);function Bs({className:e,...t}){return(0,H.jsx)(Ms,{"data-slot":`checkbox`,className:V(`border-input bg-card data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background aria-invalid:ring-destructive aria-invalid:border-destructive peer size-4 shrink-0 rounded-[4px] border transition-colors duration-150 outline-none focus-visible:ring-2 disabled:cursor-not-allowed disabled:opacity-50`,e),...t,children:(0,H.jsx)(Ps,{"data-slot":`checkbox-indicator`,className:`grid place-content-center text-current`,children:(0,H.jsx)(le,{className:`size-3.5`})})})}var Vs=Object.defineProperty,Hs=(e,t)=>Vs(e,`name`,{value:t,configurable:!0}),Us=v.useId||(()=>void 0),Ws=0;function Gs(e){let[t,n]=v.useState(Us());return Ko(()=>{e||n(e=>e??String(Ws++))},[e]),e||(t?`radix-${t}`:``)}Hs(Gs,`useId`);var Ks=Object.defineProperty,qs=(e,t)=>Ks(e,`name`,{value:t,configurable:!0});function Js(e){let t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>((...e)=>t.current?.(...e)),[])}qs(Js,`useCallbackRef`);var Ys=Object.defineProperty,Xs=(e,t)=>Ys(e,`name`,{value:t,configurable:!0}),Zs=`dismissableLayer.update`,Qs=`dismissableLayer.pointerDownOutside`,$s=`dismissableLayer.focusOutside`,ec,tc=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),nc=v.forwardRef(Xs(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=v.useContext(tc),[d,f]=v.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=v.useState({}),h=lo(t,f),g=Array.from(u.layers),[_]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=_?g.indexOf(_):-1,b=d?g.indexOf(d):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,S=b>=y,C=v.useRef(!1),w=ac(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:v.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return S&&!t},[u.branches,S])}),T=oc(e=>{if(r&&C.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),E=d?b===g.length-1:!1,D=Js(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return v.useEffect(()=>{if(E)return p.addEventListener(`keydown`,D,{capture:!0}),()=>p.removeEventListener(`keydown`,D,{capture:!0})},[p,E,D]),v.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(ec=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),sc(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=ec))}},[d,p,n,u]),v.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),sc())},[d,u]),v.useEffect(()=>{let e=Xs(()=>m({}),`handleUpdate`);return document.addEventListener(Zs,e),()=>document.removeEventListener(Zs,e)},[]),(0,H.jsx)(bs.div,{...l,ref:h,style:{pointerEvents:x?S?`auto`:`none`:void 0,...e.style},onFocusCapture:Vo(e.onFocusCapture,T.onFocusCapture),onBlurCapture:Vo(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:Vo(e.onPointerDownCapture,w.onPointerDownCapture)})},`DismissableLayer`));function rc(){let e=v.useContext(tc),[t,n]=v.useState(null);return v.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Xs(rc,`useDismissableLayerSurface`);var ic=Xs(()=>!0,`IS_TRUE`);function ac(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=ic}=t,s=Js(e),c=v.useRef(!1),l=v.useRef(!1),u=v.useRef(new Map),d=v.useRef(()=>{});return v.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}Xs(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}Xs(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}Xs(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}Xs(p,`handleInteractionBubble`);let m=Xs(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||cc(Qs,s,p,{discrete:!0})};if(Xs(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:Xs(()=>c.current=!0,`onPointerDownCapture`)}}Xs(ac,`usePointerDownOutside`);function oc(e,t=globalThis?.document){let n=Js(e),r=v.useRef(!1);return v.useEffect(()=>{let e=Xs(e=>{e.target&&!r.current&&cc($s,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:Xs(()=>r.current=!0,`onFocusCapture`),onBlurCapture:Xs(()=>r.current=!1,`onBlurCapture`)}}Xs(oc,`useFocusOutside`);function sc(){let e=new CustomEvent(Zs);document.dispatchEvent(e)}Xs(sc,`dispatchUpdate`);function cc(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?xs(i,a):i.dispatchEvent(a)}Xs(cc,`handleAndDispatchCustomEvent`);var lc=Object.defineProperty,uc=(e,t)=>lc(e,`name`,{value:t,configurable:!0}),dc=`focusScope.autoFocusOnMount`,fc=`focusScope.autoFocusOnUnmount`,pc={bubbles:!1,cancelable:!0},mc=v.forwardRef(uc(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=v.useState(null),l=Js(i),u=Js(a),d=v.useRef(null),f=lo(t,c),p=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:xc(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||xc(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&xc(s)};uc(e,`handleFocusIn`),uc(t,`handleFocusOut`),uc(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),v.useEffect(()=>{if(s){Sc.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(dc,pc);s.addEventListener(dc,l),s.dispatchEvent(t),t.defaultPrevented||(hc(Tc(_c(s)),{select:!0}),document.activeElement===e&&xc(s))}return()=>{s.removeEventListener(dc,l),setTimeout(()=>{let t=new CustomEvent(fc,pc);s.addEventListener(fc,u),s.dispatchEvent(t),t.defaultPrevented||xc(e??document.body,{select:!0}),s.removeEventListener(fc,u),Sc.remove(p)},0)}}},[s,l,u,p]);let m=v.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=gc(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&xc(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&xc(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,H.jsx)(bs.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})},`FocusScope`));function hc(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(xc(r,{select:t}),document.activeElement!==n)return}uc(hc,`focusFirst`);function gc(e){let t=_c(e);return[vc(t,e),vc(t.reverse(),e)]}uc(gc,`getTabbableEdges`);function _c(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:uc(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}uc(_c,`getTabbableCandidates`);function vc(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):yc(r,{upTo:t})))return r}uc(vc,`findVisible`);function yc(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}uc(yc,`isHidden`);function bc(e){return e instanceof HTMLInputElement&&`select`in e}uc(bc,`isSelectableInput`);function xc(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&bc(e)&&t&&e.select()}}uc(xc,`focus`);var Sc=Cc();function Cc(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=wc(e,t),e.unshift(t)},remove(t){e=wc(e,t),e[0]?.resume()}}}uc(Cc,`createFocusScopesStack`);function wc(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}uc(wc,`arrayRemove`);function Tc(e){return e.filter(e=>e.tagName!==`A`)}uc(Tc,`removeLinks`);var Ec=Object.defineProperty,Dc=v.forwardRef(((e,t)=>Ec(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=v.useState(!1);Ko(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?zr.createPortal((0,H.jsx)(bs.div,{...r,ref:t}),o):null},`Portal`)),Oc=Object.defineProperty,kc=(e,t)=>Oc(e,`name`,{value:t,configurable:!0}),Ac=0,jc=null;function Mc(e){return Nc(),e.children}kc(Mc,`FocusGuards`);function Nc(){v.useEffect(()=>{jc||={start:Pc(),end:Pc()};let{start:e,end:t}=jc;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),Ac++,()=>{Ac===1&&(jc?.start.remove(),jc?.end.remove(),jc=null),Ac=Math.max(0,Ac-1)}},[])}kc(Nc,`useFocusGuards`);function Pc(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}kc(Pc,`createFocusGuard`);var Fc=function(){return Fc=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Fc.apply(this,arguments)};function Ic(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Lc(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Rc=`right-scroll-bar-position`,zc=`width-before-scroll-bar`,Bc=`with-scroll-bars-hidden`,Vc=`--removed-body-scroll-bar-size`;function Hc(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Uc(e,t){var n=(0,v.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Wc=typeof window<`u`?v.useLayoutEffect:v.useEffect,Gc=new WeakMap;function Kc(e,t){var n=Uc(t||null,function(t){return e.forEach(function(e){return Hc(e,t)})});return Wc(function(){var t=Gc.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Hc(e,null)}),i.forEach(function(e){r.has(e)||Hc(e,a)})}Gc.set(n,e)},[e]),n}function qc(e){return e}function Jc(e,t){t===void 0&&(t=qc);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Yc(e){e===void 0&&(e={});var t=Jc(null);return t.options=Fc({async:!0,ssr:!1},e),t}var Xc=function(e){var t=e.sideCar,n=Ic(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return v.createElement(r,Fc({},n))};Xc.isSideCarExport=!0;function Zc(e,t){return e.useMedium(t),Xc}var Qc=Yc(),$c=function(){},el=v.forwardRef(function(e,t){var n=v.useRef(null),r=v.useState({onScrollCapture:$c,onWheelCapture:$c,onTouchMoveCapture:$c}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,y=_===void 0?`div`:_,b=e.gapMode,x=Ic(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=f,C=Kc([n,t]),w=Fc(Fc({},x),i);return v.createElement(v.Fragment,null,u&&v.createElement(S,{sideCar:Qc,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:b}),o?v.cloneElement(v.Children.only(s),Fc(Fc({},w),{ref:C})):v.createElement(y,Fc({},w,{className:c,ref:C}),s))});el.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},el.classNames={fullWidth:zc,zeroRight:Rc};var tl,nl=function(){if(tl)return tl;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function rl(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=nl();return t&&e.setAttribute(`nonce`,t),e}function il(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function al(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var ol=function(){var e=0,t=null;return{add:function(n){e==0&&(t=rl())&&(il(t,n),al(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},sl=function(){var e=ol();return function(t,n){v.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},cl=function(){var e=sl();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},ll={left:0,top:0,right:0,gap:0},ul=function(e){return parseInt(e||``,10)||0},dl=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[ul(n),ul(r),ul(i)]},fl=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return ll;var t=dl(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},pl=cl(),ml=`data-scroll-locked`,hl=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
10
|
-
.${Bc} {
|
|
11
|
-
overflow: hidden ${r};
|
|
12
|
-
padding-right: ${s}px ${r};
|
|
13
|
-
}
|
|
14
|
-
body[${ml}] {
|
|
15
|
-
overflow: hidden ${r};
|
|
16
|
-
overscroll-behavior: contain;
|
|
17
|
-
${[t&&`position: relative ${r};`,n===`margin`&&`
|
|
18
|
-
padding-left: ${i}px;
|
|
19
|
-
padding-top: ${a}px;
|
|
20
|
-
padding-right: ${o}px;
|
|
21
|
-
margin-left:0;
|
|
22
|
-
margin-top:0;
|
|
23
|
-
margin-right: ${s}px ${r};
|
|
24
|
-
`,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.${Rc} {
|
|
28
|
-
right: ${s}px ${r};
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.${zc} {
|
|
32
|
-
margin-right: ${s}px ${r};
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.${Rc} .${Rc} {
|
|
36
|
-
right: 0 ${r};
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.${zc} .${zc} {
|
|
40
|
-
margin-right: 0 ${r};
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
body[${ml}] {
|
|
44
|
-
${Vc}: ${s}px;
|
|
45
|
-
}
|
|
46
|
-
`},gl=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},_l=function(){v.useEffect(function(){return document.body.setAttribute(ml,(gl()+1).toString()),function(){var e=gl()-1;e<=0?document.body.removeAttribute(ml):document.body.setAttribute(ml,e.toString())}},[])},vl=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;_l();var a=v.useMemo(function(){return fl(i)},[i]);return v.createElement(pl,{styles:hl(a,!t,i,n?``:`!important`)})},yl=!1;if(typeof window<`u`)try{var bl=Object.defineProperty({},"passive",{get:function(){return yl=!0,!0}});window.addEventListener(`test`,bl,bl),window.removeEventListener(`test`,bl,bl)}catch{yl=!1}var xl=yl?{passive:!1}:!1,Sl=function(e){return e.tagName===`TEXTAREA`},Cl=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!Sl(e)&&n[t]===`visible`)},wl=function(e){return Cl(e,`overflowY`)},Tl=function(e){return Cl(e,`overflowX`)},El=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),kl(e,r)){var i=Al(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Dl=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Ol=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},kl=function(e,t){return e===`v`?wl(t):Tl(t)},Al=function(e,t){return e===`v`?Dl(t):Ol(t)},jl=function(e,t){return e===`h`&&t===`rtl`?-1:1},Ml=function(e,t,n,r,i){var a=jl(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=Al(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&kl(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},Nl=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Pl=function(e){return[e.deltaX,e.deltaY]},Fl=function(e){return e&&`current`in e?e.current:e},Il=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Ll=function(e){return`
|
|
47
|
-
.block-interactivity-${e} {pointer-events: none;}
|
|
48
|
-
.allow-interactivity-${e} {pointer-events: all;}
|
|
49
|
-
`},Rl=0,zl=[];function Bl(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),i=v.useState(Rl++)[0],a=v.useState(cl)[0],o=v.useRef(e);v.useEffect(function(){o.current=e},[e]),v.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Lc([e.lockRef.current],(e.shards||[]).map(Fl),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=v.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Nl(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=El(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=El(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return Ml(h,t,e,h===`h`?s:c,!0)},[]),c=v.useCallback(function(e){var n=e;if(!(!zl.length||zl[zl.length-1]!==a)){var r=`deltaY`in n?Pl(n):Nl(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Il(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(Fl).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=v.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Vl(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=v.useCallback(function(e){n.current=Nl(e),r.current=void 0},[]),d=v.useCallback(function(t){l(t.type,Pl(t),t.target,s(t,e.lockRef.current))},[]),f=v.useCallback(function(t){l(t.type,Nl(t),t.target,s(t,e.lockRef.current))},[]);v.useEffect(function(){return zl.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,xl),document.addEventListener(`touchmove`,c,xl),document.addEventListener(`touchstart`,u,xl),function(){zl=zl.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,xl),document.removeEventListener(`touchmove`,c,xl),document.removeEventListener(`touchstart`,u,xl)}},[]);var p=e.removeScrollBar,m=e.inert;return v.createElement(v.Fragment,null,m?v.createElement(a,{styles:Ll(i)}):null,p?v.createElement(vl,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Vl(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Hl=Zc(Qc,Bl),Ul=v.forwardRef(function(e,t){return v.createElement(el,Fc({},e,{ref:t,sideCar:Hl}))});Ul.classNames=el.classNames;var Wl=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Gl=new WeakMap,Kl=new WeakMap,ql={},Jl=0,Yl=function(e){return e&&(e.host||Yl(e.parentNode))},Xl=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Yl(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},Zl=function(e,t,n,r){var i=Xl(t,Array.isArray(e)?e:[e]);ql[n]||(ql[n]=new WeakMap);var a=ql[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(Gl.get(e)||0)+1,l=(a.get(e)||0)+1;Gl.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Kl.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),Jl++,function(){o.forEach(function(e){var t=Gl.get(e)-1,i=a.get(e)-1;Gl.set(e,t),a.set(e,i),t||(Kl.has(e)||e.removeAttribute(r),Kl.delete(e)),i||e.removeAttribute(n)}),Jl--,Jl||(Gl=new WeakMap,Gl=new WeakMap,Kl=new WeakMap,ql={})}},Ql=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Wl(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Zl(r,i,n,`aria-hidden`)):function(){return null}},$l=Object.defineProperty,eu=(e,t)=>$l(e,`name`,{value:t,configurable:!0}),tu=`Dialog`,[nu,ru]=Io(tu),[iu,au]=nu(tu),ou=eu(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=v.useRef(null),c=v.useRef(null),[l,u]=ts({prop:r,defaultProp:i??!1,onChange:a,caller:tu}),[d,f]=v.useState(0),[p,m]=v.useState(0);return(0,H.jsx)(iu,{scope:t,triggerRef:s,contentRef:c,contentId:Gs(),titleId:Gs(),descriptionId:Gs(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:m,open:l,onOpenChange:u,onOpenToggle:v.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})},`Dialog`),su=`DialogPortal`,[cu,lu]=nu(su,{forceMount:void 0}),uu=eu(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=au(su,t);return(0,H.jsx)(cu,{scope:t,forceMount:n,children:v.Children.map(r,e=>(0,H.jsx)(fs,{present:n||a.open,children:(0,H.jsx)(Dc,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),du=`DialogOverlay`,fu=v.forwardRef(eu(function(e,t){let n=lu(du,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=au(du,e.__scopeDialog);return a.modal?(0,H.jsx)(fs,{present:r||a.open,children:(0,H.jsx)(mu,{...i,ref:t})}):null},`DialogOverlay`)),pu=po(`DialogOverlay.RemoveScroll`),mu=v.forwardRef(eu(function(e,t){let{__scopeDialog:n,...r}=e,i=au(du,n),a=lo(t,rc());return(0,H.jsx)(Ul,{as:pu,allowPinchZoom:!0,shards:[i.contentRef],children:(0,H.jsx)(bs.div,{"data-state":Eu(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),hu=`DialogContent`,gu=v.forwardRef(eu(function(e,t){let n=lu(hu,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=au(hu,e.__scopeDialog);return(0,H.jsx)(fs,{present:r||a.open,children:a.modal?(0,H.jsx)(_u,{...i,ref:t}):(0,H.jsx)(vu,{...i,ref:t})})},`DialogContent`)),_u=v.forwardRef(eu(function(e,t){let n=au(hu,e.__scopeDialog),r=v.useRef(null),i=lo(t,n.contentRef,r);return v.useEffect(()=>{let e=r.current;if(e)return Ql(e)},[]),(0,H.jsx)(yu,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:Vo(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Vo(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:Vo(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),vu=v.forwardRef(eu(function(e,t){let n=au(hu,e.__scopeDialog),r=v.useRef(!1),i=v.useRef(!1);return(0,H.jsx)(yu,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),yu=v.forwardRef(eu(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=au(hu,n);return Nc(),(0,H.jsx)(H.Fragment,{children:(0,H.jsx)(mc,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,H.jsx)(nc,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionPresent?s.descriptionId:void 0,"aria-labelledby":s.titlePresent?s.titleId:void 0,"data-state":Eu(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})},`DialogContentImpl`)),bu=`DialogTitle`,xu=v.forwardRef(eu(function(e,t){let{__scopeDialog:n,...r}=e,i=au(bu,n),{setTitleCount:a}=i;return Ko(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,H.jsx)(bs.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),Su=`DialogDescription`,Cu=v.forwardRef(eu(function(e,t){let{__scopeDialog:n,...r}=e,i=au(Su,n),{setDescriptionCount:a}=i;return Ko(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,H.jsx)(bs.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),wu=`DialogClose`,Tu=v.forwardRef(eu(function(e,t){let{__scopeDialog:n,...r}=e,i=au(wu,n);return(0,H.jsx)(bs.button,{type:`button`,...r,ref:t,onClick:Vo(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function Eu(e){return e?`open`:`closed`}eu(Eu,`getState`);function Du({...e}){return(0,H.jsx)(ou,{"data-slot":`dialog`,...e})}function Ou({...e}){return(0,H.jsx)(uu,{"data-slot":`dialog-portal`,...e})}function ku({className:e,...t}){return(0,H.jsx)(fu,{"data-slot":`dialog-overlay`,className:V(`data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50`,e),...t})}function Au({className:e,children:t,showCloseButton:n=!0,onMinimise:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}){let{t:s}=G(),c=v.useRef(null);return(0,H.jsxs)(Ou,{children:[(0,H.jsx)(ku,{}),(0,H.jsxs)(gu,{"data-slot":`dialog-content`,className:V(`bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 grid max-h-[calc(100dvh-2rem)] max-w-[calc(100%-2rem)] overflow-y-auto gap-6 rounded-xl border border-border p-6 text-sm shadow-lg duration-150 sm:max-w-md fixed top-1/2 left-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2 outline-none`,e),...o,onOpenAutoFocus:e=>{c.current=document.activeElement instanceof HTMLElement?document.activeElement:null,i?.(e)},onCloseAutoFocus:e=>{a?.(e),!(e.defaultPrevented||!c.current?.isConnected)&&(e.preventDefault(),c.current.focus())},children:[t,r?(0,H.jsxs)(q,{type:`button`,variant:`ghost`,className:`bg-secondary absolute top-4 end-14`,size:`icon-sm`,onClick:r,children:[(0,H.jsx)(ut,{"aria-hidden":`true`}),(0,H.jsx)(`span`,{className:`sr-only`,children:s(`dialog-minimise`)})]}):null,n?(0,H.jsx)(Tu,{"data-slot":`dialog-close`,asChild:!0,children:(0,H.jsxs)(q,{variant:`ghost`,className:`bg-secondary absolute top-4 end-4`,size:`icon-sm`,children:[(0,H.jsx)(an,{}),(0,H.jsx)(`span`,{className:`sr-only`,children:s(`dialog-close`)})]})}):null]})]})}function ju({className:e,...t}){return(0,H.jsx)(`div`,{"data-slot":`dialog-header`,className:V(`flex flex-col gap-2 pe-10 text-start`,e),...t})}function Mu({className:e,...t}){return(0,H.jsx)(`div`,{"data-slot":`dialog-footer`,className:V(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...t})}function Nu({className:e,...t}){return(0,H.jsx)(xu,{"data-slot":`dialog-title`,className:V(`text-section-title font-semibold`,e),...t})}function Pu({className:e,...t}){return(0,H.jsx)(Cu,{"data-slot":`dialog-description`,className:V(`text-muted-foreground text-sm`,e),...t})}function Fu(e,t=3){let n=new Map;for(let t of e)t.category?.trim()&&n.set(t.category,[...n.get(t.category)??[],t._id]);let r=new Set;for(let e of n.values())if(e.length>=t)for(let t of e)r.add(t);return r}function Iu(e,t,n){let r=new Set(e);return n?r.add(t):r.delete(t),r}var Lu=class extends Error{constructor(e,t){super(`${e} at position ${t}`),this.position=t}},Ru=32,zu=10,Bu=9,Vu=13,Hu=160,Uu=6158,Wu=8192,Gu=8203,Ku=8239,qu=8287,Ju=12288,Yu=65279;function Xu(e){return/^[0-9A-Fa-f]$/.test(e)}function Zu(e){return e>=`0`&&e<=`9`}function Qu(e){return e>=` `}function $u(e){return`,:[]/{}()
|
|
50
|
-
+`.includes(e)}function ed(e){return e>=`a`&&e<=`z`||e>=`A`&&e<=`Z`||e===`_`||e===`$`}function td(e){return e>=`a`&&e<=`z`||e>=`A`&&e<=`Z`||e===`_`||e===`$`||e>=`0`&&e<=`9`}var nd=/^(http|https|ftp|mailto|file|data|irc):\/\/$/,rd=/^[A-Za-z0-9-._~:/?#@!$&'()*+;=]$/;function id(e){return`,[]/{}
|
|
51
|
-
+`.includes(e)}function ad(e){return dd(e)||od.test(e)}var od=/^[[{\w-]$/;function sd(e){return e===`
|
|
52
|
-
`||e===`\r`||e===` `||e===`\b`||e===`\f`}function cd(e,t){let n=e.charCodeAt(t);return n===Ru||n===zu||n===Bu||n===Vu}function ld(e,t){let n=e.charCodeAt(t);return n===Ru||n===Bu||n===Vu}function ud(e,t){let n=e.charCodeAt(t);return n===Hu||n===Uu||n>=Wu&&n<=Gu||n===Ku||n===qu||n===Ju||n===Yu}function dd(e){return fd(e)||md(e)}function fd(e){return e===`"`||e===`“`||e===`”`}function pd(e){return e===`"`}function md(e){return e===`'`||e===`‘`||e===`’`||e==="`"||e===`´`}function hd(e){return e===`'`}function gd(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=e.lastIndexOf(t);return r===-1?e:e.substring(0,r)+(n?``:e.substring(r+1))}function _d(e,t){let n=e.length;if(!cd(e,n-1))return e+t;for(;cd(e,n-1);)n--;return e.substring(0,n)+t+e.substring(n)}function vd(e,t,n){return e.substring(0,t)+e.substring(t+n)}function yd(e){return/[,\n][ \t\r]*$/.test(e)}var bd={""":`"`,"&":`&`,"<":`<`,">":`>`,"'":`'`};function xd(e){if(e.charAt(0)!==`&`)return null;let t=e.indexOf(`;`);if(t===-1)return null;let n=e.substring(0,t+1),r=bd[n];if(r!==void 0)return{char:r,length:n.length};if(e.charAt(1)===`#`){let r=e.substring(2,t),i=r.charAt(0)===`x`||r.charAt(0)===`X`,a=i?r.substring(1):r;if(a.length>0){let e=Number.parseInt(a,i?16:10);if(!Number.isNaN(e)&&e>=0&&e<=1114111)return{char:String.fromCodePoint(e),length:n.length}}}return null}function Sd(e){return e!==null&&e.char===`"`}function Cd(e){return e!==null&&e.char===`'`}function wd(e,t){let n=0;for(let r=0;r<e.length;r++)e.charAt(r)===t&&n++;return n}function Td(e,t){switch(t){case`)`:return wd(e,`(`)>wd(e,`)`);case`]`:return wd(e,`[`)>wd(e,`]`);case`}`:return wd(e,`{`)>wd(e,`}`);default:return!1}}var Ed={"\b":`\\b`,"\f":`\\f`,"\n":`\\n`,"\r":`\\r`," ":`\\t`},Dd={'"':`"`,"\\":`\\`,"/":`/`,b:`\b`,f:`\f`,n:`
|
|
53
|
-
`,r:`\r`,t:` `};function Od(e){let t=0,n=``;c(["```","[```","{```"]),i()||k(),c(["```","```]","```}"]);let r=u(`,`);for(r&&a(),ad(e[t])&&yd(n)?(r||(n=_d(n,`,`)),g()):r&&(n=gd(n,`,`));e[t]===`}`||e[t]===`]`;)t++,a();if(t>=e.length)return n;O();function i(){a();let e=m()||h()||_()||y()||b()||S(!1)||C();return a(),e}function a(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,n=t,r=o(e);do r=s(),r&&=o(e);while(r);return t>n}function o(r){let i=r?cd:ld,a=``;for(;;)if(i(e,t))a+=e[t],t++;else if(ud(e,t))a+=` `,t++;else break;return a.length>0&&(n+=a,!0)}function s(){if(e[t]===`/`&&e[t+1]===`*`){for(;t<e.length&&!kd(e,t);)t++;return t+=2,!0}if(e[t]===`/`&&e[t+1]===`/`){for(;t<e.length&&e[t]!==`
|
|
54
|
-
`;)t++;return!0}return!1}function c(n){if(l(n)){if(ed(e[t]))for(;t<e.length&&td(e[t]);)t++;return a(),!0}return!1}function l(n){o(!0);for(let r of n){let n=t+r.length;if(e.slice(t,n)===r)return t=n,!0}return!1}function u(r){return e[t]===r&&(n+=e[t],t++,!0)}function d(n){return e[t]===n&&(t++,!0)}function f(){return d(`\\`)}function p(){return a(),e[t]===`.`&&e[t+1]===`.`&&e[t+2]===`.`&&(t+=3,a(),d(`,`),!0)}function m(){if(e[t]===`{`){n+=`{`,t++,a(),d(`,`)&&a();let r=!0;for(;t<e.length&&e[t]!==`}`;){let o;if(r?o=!0:(o=u(`,`),o||(n=_d(n,`,`)),a()),p(),!(_()||S(!0))){e[t]===`}`||e[t]===`{`||e[t]===`]`||e[t]===`[`||e[t]===void 0?r||(n=gd(n,`,`)):A();break}a();let s=u(`:`),c=t>=e.length;s||(ad(e[t])||c?n=_d(n,`:`):j()),i()||(s||c?n+=`null`:j()),r=!1}return e[t]===`}`?(n+=`}`,t++):n=_d(n,`}`),!0}return!1}function h(){if(e[t]===`[`){n+=`[`,t++,a(),d(`,`)&&a();let r=!0;for(;t<e.length&&e[t]!==`]`;){if(r||u(`,`)||(n=_d(n,`,`)),p(),!i()){r||(n=gd(n,`,`));break}r=!1}return e[t]===`]`?(n+=`]`,t++):n=_d(n,`]`),!0}return!1}function g(){let e=!0,t=!0;for(;t;)e?e=!1:u(`,`)||(n=_d(n,`,`)),t=i();t||(n=gd(n,`,`)),n=`[\n${n}\n]`}function _(){let r=arguments.length>0&&arguments[0]!==void 0&&arguments[0],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1,o=e[t]===`\\`;o&&(t++,dd(e[t])||O());let s=e[t]===`&`?xd(e.slice(t,t+12)):null,c=Sd(s)||Cd(s);if(dd(e[t])||c){let l=pd(e[t])?pd:hd(e[t])?hd:md(e[t])?md:fd,u=t,d=n.length,p=`"`;for(t+=c&&s?s.length:1;;){if(t>=e.length){let i=w(t-1);return!r&&$u(e.charAt(i))?(t=u,n=n.substring(0,d),_(!0)):(p=_d(p,`"`),n+=p,!0)}if(t===i)return p=_d(p,`"`),n+=p,!0;let m=c&&e[t]===`&`?xd(e.slice(t,t+12)):null;if(m&&s?m.char===s.char:l(e[t])){let i=t,o=p.length;if(p+=`"`,t+=m?m.length:1,n+=p,a(!1),r||t>=e.length||$u(e[t])&&!Td(p,e[t])||dd(e[t])&&!T(t)||Zu(e[t]))return v(),!0;e[t]===`\\`&&O();let s=w(i-1),c=e.charAt(s);if(c===`,`)return t=u,n=n.substring(0,d),_(!1,s);if($u(c))return t=u,n=n.substring(0,d),_(!0);n=n.substring(0,d),t=i+(m?m.length:1),p=`${p.substring(0,o)}\\${p.substring(o)}`}else if(r&&id(e[t])){if(e[t-1]===`:`&&nd.test(e.substring(u+1,t+2)))for(;t<e.length&&rd.test(e[t]);)p+=e[t],t++;return p=_d(p,`"`),n+=p,v(),!0}else if(m){let e=m.char;e===`"`?p+=`\\"`:sd(e)?p+=Ed[e]:p+=e,t+=m.length}else if(e[t]===`\\`){let n=e.charAt(t+1);if(Dd[n]!==void 0)p+=e.slice(t,t+2),t+=2;else if(n===`u`){let n=2;for(;n<6&&Xu(e[t+n]);)n++;n===6?(p+=e.slice(t,t+6),t+=6):t+n>=e.length?t=e.length:M()}else n===`
|
|
55
|
-
`?(p+=`\\n`,t+=2):(p+=n,t+=2)}else{let n=e.charAt(t);n===`"`&&e[t-1]!==`\\`?(p+=`\\${n}`,t++):sd(n)?(p+=Ed[n],t++):(Qu(n)||D(n),p+=n,t++)}o&&f()}}return!1}function v(){let r=!1;for(a();e[t]===`+`;){r=!0,t++,a(),n=gd(n,`"`,!0);let e=n.length;n=_()?vd(n,e,1):_d(n,`"`)}return r}function y(){let r=t,i=``,a=!1;for(e[t]===`-`&&(i+=e[t],t++,!Zu(e[t])&&E()&&(i+=`0`)),e[t]===`0`&&Zu(e[t+1])&&(a=!0);Zu(e[t]);)i+=e[t],t++;if(e[t]===`.`)for((i===``||i===`-`)&&(i+=`0`),i+=e[t],t++,Zu(e[t])||(i+=`0`);Zu(e[t]);)i+=e[t],t++;if(t>r){if(e[t]===`e`||e[t]===`E`)for(i===`-`&&(a=!0),i+=e[t],t++,(e[t]===`-`||e[t]===`+`)&&(i+=e[t],t++),Zu(e[t])||(i+=`0`);Zu(e[t]);)i+=e[t],t++;return E()?(n+=a?`"${e.substring(r,t)}"`:i,!0):(t=r,!1)}return!1}function b(){return x(`true`,`true`)||x(`false`,`false`)||x(`null`,`null`)||x(`True`,`true`)||x(`False`,`false`)||x(`None`,`null`)}function x(r,i){return e.slice(t,t+r.length)===r&&!td(e[t+r.length])&&(n+=i,t+=r.length,!0)}function S(r){let a=t;if(ed(e[t])){for(;t<e.length&&td(e[t]);)t++;let n=t;for(;cd(e,n);)n++;if(e[n]===`(`)return t=n+1,i(),e[t]===`)`&&(t++,e[t]===`;`&&t++),!0}for(;t<e.length&&!id(e[t])&&!dd(e[t])&&(!r||e[t]!==`:`);)t++;if(e[t-1]===`:`&&nd.test(e.substring(a,t+2)))for(;t<e.length&&rd.test(e[t]);)t++;if(t>a){for(;cd(e,t-1)&&t>0;)t--;let r=e.slice(a,t);return n+=r===`undefined`?`null`:JSON.stringify(r),e[t]===`"`&&t++,!0}}function C(){if(e[t]===`/`){let r=t;for(t++;t<e.length&&(e[t]!==`/`||e[t-1]===`\\`);)t++;return t++,n+=JSON.stringify(e.substring(r,t)),!0}}function w(t){let n=t;for(;n>0&&cd(e,n);)n--;return n}function T(t){let n=t+1;for(;n<e.length&&cd(e,n);)n++;return n>=e.length||$u(e[n])}function E(){return t>=e.length||$u(e[t])||cd(e,t)}function D(e){throw new Lu(`Invalid character ${JSON.stringify(e)}`,t)}function O(){throw new Lu(`Unexpected character ${JSON.stringify(e[t])}`,t)}function k(){throw new Lu(`Unexpected end of json string`,e.length)}function A(){throw new Lu(`Object key expected`,t)}function j(){throw new Lu(`Colon expected`,t)}function M(){throw new Lu(`Invalid unicode character "${e.slice(t,t+6)}"`,t)}}function kd(e,t){return e[t]===`*`&&e[t+1]===`/`}function Ad(e){if(!e)return[];let t=e,n=null;for(;typeof t==`string`&&t!==n;){n=t;try{t=JSON.parse(Od(t))}catch{break}}if(!Array.isArray(t))return[];let r=[],i=e=>{Array.isArray(e)?e.forEach(i):e&&typeof e==`object`&&r.push(e)};return i(t),r}function jd(e,t){if(!t||!e.includes(`_`))return null;let[n,r]=e.split(`_`),i=parseInt(r,10);return Number.isNaN(i)?null:n===`pref`?t.preferences?.[i]?.description??null:n===`pat`?t.patterns?.[i]?.description??null:n===`wf`?t.workflows?.[i]?.description??null:null}function Md(e,t){if(!t||!e.includes(`_`))return null;let[n,r]=e.split(`_`),i=parseInt(r,10);return Number.isNaN(i)||n!==`wf`?null:t.workflows?.[i]?.steps||null}var Nd=`manual-write`;function Pd(e){let t=e.evidence;return(Array.isArray(t)?t:t?[t]:[]).filter(e=>e.trim().length>0).map(e=>({kind:e.trim()===Nd?`manual-write`:`text`,text:e}))}function Fd(e){return e>=80?`high`:e>=60?`medium`:e>=40?`low`:`poor`}var Id={high:`border-green-600/40 bg-green-500/15 text-green-700 dark:text-green-400`,medium:`border-blue-600/40 bg-blue-500/15 text-blue-700 dark:text-blue-400`,low:`border-orange-600/40 bg-orange-500/15 text-orange-700 dark:text-orange-400`,poor:`border-red-600/40 bg-red-500/15 text-red-700 dark:text-red-400`};function Ld(e,t){return e.length>t?e.substring(0,t)+`...`:e}function Rd(e){let{open:t=!1,profile:n=null,onOpenChange:r,onApplied:i,onMinimise:a}=e,{t:o}=G(),s=ao(t),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)([]),[f,p]=(0,v.useState)(new Set),[m,h]=(0,v.useState)(new Set),[g,_]=(0,v.useState)(new Set),[y,b]=(0,v.useState)(!1),[x,S]=(0,v.useState)(!1),C=(0,v.useRef)(!1),w=s.job,T=Qa(w,s.startError),E=c||!!w&&!s.checked,D=E?{phase:`running`,done:0,total:0}:T,O=D.phase===`review`?D.result:null,k=(0,v.useMemo)(()=>{let e={};for(let t of u){let n=t.category||`(none)`;e[n]||(e[n]={pref:[],pat:[],wf:[]}),e[n][t._type].push(t)}return e},[u]),A=(0,v.useMemo)(()=>Object.keys(k).sort(),[k]),j=f.size,M=m.size+g.size,N=(O?.changes.merged?.length||0)+(O?.changes.removed?.length||0);function P(){let e=n?.profileData;if(!e){U.error(`No profile data loaded`),F(!1);return}let t=(e.preferences||[]).map((e,t)=>({...e,_id:`pref_${t}`,_type:`pref`})),r=(e.patterns||[]).map((e,t)=>({...e,_id:`pat_${t}`,_type:`pat`})),i=(e.workflows||[]).map((e,t)=>({...e,_id:`wf_${t}`,_type:`wf`})),a=[...t,...r,...i];d(a),p(new Set(a.filter(e=>(e.frequency||0)<=3).map(e=>e._id))),b(!1)}(0,v.useEffect)(()=>{t&&!C.current?P():!t&&C.current&&S(!1),C.current=t},[t]);let ee=w?.status.state===`done`?w.id:null;(0,v.useEffect)(()=>{if(w?.status.state!==`done`)return;let{changes:e}=w.status.result;h(new Set((e.merged||[]).map((e,t)=>t))),_(new Set((e.removed||[]).map((e,t)=>t)))},[ee]);function F(e){r?.(e)}function I(e,t){p(n=>Iu(n,e,t))}function te(){p(new Set(u.map(e=>e._id)))}function L(){p(new Set)}function ne(){p(new Set(u.filter(e=>(e.frequency||0)<=3).map(e=>e._id)))}function re(){p(Fu(u))}async function R(e){if(e.length===0){U.warning(`No items selected`);return}l(!0),await s.start(e,n?.version,o(`toast-ai-cleanup-failed`)),l(!1)}function ie(){p(no(w,f)),s.discard()}function ae(e){if(!e.includes(`_`))return`?`;let t=e.split(`_`)[0];return t===`pref`?o(`profile-type-pref`)||`Pref`:t===`pat`?o(`profile-type-pat`)||`Pat`:t===`wf`?o(`profile-type-wf`)||`Wf`:`?`}function oe(e,t){h(n=>Iu(n,e,t))}function se(e,t){_(n=>Iu(n,e,t))}function ce(){h(new Set((O?.changes.merged||[]).map((e,t)=>t))),_(new Set((O?.changes.removed||[]).map((e,t)=>t)))}function le(){h(new Set),_(new Set)}async function de(){if(!O||M===0)return;S(!0);let e=[...m].map(e=>O.changes.merged?.[e]?.ids).filter(e=>!!e),t=[...g].map(e=>O.changes.removed?.[e]?.id).filter(e=>!!e),n=await yi.apply(e,t);if(S(!1),n.success){let{applied:e=0,skipped:t=0}=n.data??{};U.success(t>0?o(`toast-ai-cleanup-skipped`,{applied:e,skipped:t}):o(`toast-ai-cleanup-success`)),s.clear(),F(!1),i?.()}else U.error(n.error||o(`toast-cleanup-apply-failed`))}return(0,H.jsx)(Du,{open:t,onOpenChange:F,children:(0,H.jsxs)(Au,{className:`grid! sm:max-w-2xl max-h-[90vh] grid-rows-[auto_minmax(0,1fr)_auto] overflow-hidden gap-4`,onMinimise:D.phase===`running`&&!E?a:void 0,children:[(0,H.jsx)(ju,{className:`pe-20`,children:(0,H.jsx)(Nu,{children:o(`label-ai-cleanup-title`)})}),D.phase===`running`?(0,H.jsxs)(`div`,{className:`flex flex-col items-center gap-3 py-10 text-muted-foreground`,children:[(0,H.jsx)(at,{className:`size-6 animate-spin`}),(0,H.jsx)(`span`,{className:`text-sm`,children:o(`label-ai-cleanup-loading`)}),D.total>0?(0,H.jsx)(`span`,{className:`text-sm font-medium text-foreground`,"aria-live":`polite`,children:o(`label-ai-cleanup-progress`,{done:D.done,total:D.total})}):null,(0,H.jsx)(`span`,{className:`text-xs`,children:o(`label-ai-cleanup-running-hint`)})]}):D.phase===`failed`?(0,H.jsxs)(`div`,{className:`flex flex-col items-center gap-2 py-10 text-center`,role:`alert`,children:[(0,H.jsx)(`span`,{className:`text-sm font-medium text-destructive`,children:o(`toast-ai-cleanup-failed`)}),(0,H.jsx)(`span`,{className:`text-sm text-muted-foreground break-words`,children:D.error})]}):D.phase===`select`?(0,H.jsxs)(`div`,{className:`flex min-h-0 flex-col gap-3 overflow-hidden`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,H.jsx)(`h3`,{className:`text-subsection-title font-semibold`,children:o(`label-ai-cleanup-select`)}),(0,H.jsx)(jo,{onSelectAll:te,onSelectNone:L,onSelectLow:ne,onSelectSameCat:re})]}),(0,H.jsx)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto pr-1`,children:A.map(e=>{let t=[...k[e].pref,...k[e].pat,...k[e].wf];return(0,H.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`text-xs rounded-full bg-muted px-2 py-0.5`,children:e}),(0,H.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[t.length,` items`]})]}),t.map(e=>{let t=f.has(e._id);return(0,H.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border border-border/60 px-2 py-1.5 text-sm cursor-pointer hover:bg-muted/40`,role:`checkbox`,"aria-checked":t,tabIndex:0,onClick:()=>I(e._id,!t),onKeyDown:n=>{(n.key===`Enter`||n.key===` `)&&(n.preventDefault(),I(e._id,!t))},children:[(0,H.jsx)(`span`,{className:`pointer-events-none inline-flex`,children:(0,H.jsx)(Bs,{checked:t,tabIndex:-1})}),(0,H.jsx)(`span`,{className:`text-[10px] font-medium text-muted-foreground w-4`,children:e._type===`pref`?`P`:e._type===`pat`?`T`:`W`}),(0,H.jsx)(`span`,{className:`flex-1 truncate`,children:(e.description||``).substring(0,80)}),(0,H.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-xs text-muted-foreground shrink-0`,children:[(0,H.jsx)(Kt,{className:`size-3`}),e.frequency||0,e.confidence==null?``:` | ${Math.round(e.confidence*100)}%`]})]},e._id)})]},e)})}),(0,H.jsxs)(`div`,{className:`flex items-center justify-between gap-2 pt-1`,children:[(0,H.jsx)(`span`,{className:`rounded-md border border-status-success/30 bg-status-success/10 px-2 py-0.5 text-xs font-medium text-status-success`,children:o(`label-ai-cleanup-selected`,{count:j})}),(0,H.jsx)(q,{onClick:()=>R([...f]),children:o(`label-ai-cleanup-analyze`)})]})]}):D.phase===`review`&&O?(0,H.jsxs)(`div`,{className:`flex min-h-0 flex-col gap-3 overflow-hidden`,children:[D.notice?(0,H.jsx)(`div`,{className:`rounded-lg border border-status-warning/30 bg-status-warning/10 px-3 py-2 text-xs text-status-warning`,children:o(`label-ai-cleanup-failed-batches`,D.notice)}):null,(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,H.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:o(`label-ai-cleanup-changes-selected`,{selected:M,total:N})}),(0,H.jsxs)(`div`,{className:`flex gap-2`,children:[(0,H.jsx)(q,{variant:`link`,size:`xs`,onClick:ce,children:o(`label-ai-cleanup-select-all`)}),(0,H.jsx)(q,{variant:`link`,size:`xs`,onClick:le,children:o(`label-ai-cleanup-deselect-all`)})]})]}),(0,H.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto pr-1`,children:[(O.changes.merged||[]).length>0?(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsxs)(`h3`,{className:`flex items-center gap-1.5 text-subsection-title font-semibold`,children:[(0,H.jsx)(Ve,{className:`size-3.5`}),o(`label-ai-cleanup-merged-header`,{count:O.changes.merged?.length||0})]}),(O.changes.merged||[]).map((e,t)=>{let n=e.ids.slice(1),r=e.result||``,i=m.has(t);return(0,H.jsxs)(`div`,{className:`rounded-xl border border-border p-3 space-y-2`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2 text-sm cursor-pointer`,role:`checkbox`,"aria-checked":i,tabIndex:0,onClick:()=>oe(t,!i),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),oe(t,!i))},children:[(0,H.jsx)(`span`,{className:`pointer-events-none inline-flex`,children:(0,H.jsx)(Bs,{checked:i,tabIndex:-1})}),(0,H.jsx)(`span`,{children:o(`label-ai-cleanup-merge-check`)})]}),(0,H.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-[1fr_auto_1fr] items-start text-sm`,children:[(0,H.jsx)(`div`,{className:`space-y-1.5`,children:n.map(e=>{let t=jd(e,O.old);return t?(0,H.jsxs)(`div`,{className:`rounded-lg bg-muted/50 p-2 space-y-1`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`span`,{className:`text-[10px] rounded bg-muted px-1.5 py-0.5`,children:ae(e)}),` `,Ld(t,80)]}),(0,H.jsx)(Mo,{steps:Md(e,O.old)})]},e):null})}),(0,H.jsx)(`div`,{className:`text-muted-foreground self-center grid place-items-center`,children:(0,H.jsx)(fe,{className:`size-4`})}),(0,H.jsxs)(`div`,{className:`rounded-lg bg-primary/10 p-2 space-y-1`,children:[(0,H.jsx)(`div`,{children:Ld(r,120)}),(0,H.jsx)(Mo,{steps:Md(e.ids[0],O.old)})]})]})]},t)})]}):null,(O.changes.removed||[]).length>0?(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsxs)(`h3`,{className:`flex items-center gap-1.5 text-subsection-title font-semibold`,children:[(0,H.jsx)(Jt,{className:`size-3.5`}),o(`label-ai-cleanup-removed-header`,{count:O.changes.removed?.length||0})]}),(O.changes.removed||[]).map((e,t)=>{let n=jd(e.id,O.old),r=g.has(t);return(0,H.jsxs)(`div`,{className:`rounded-xl border border-border p-3 space-y-2`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2 text-sm cursor-pointer`,role:`checkbox`,"aria-checked":r,tabIndex:0,onClick:()=>se(t,!r),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),se(t,!r))},children:[(0,H.jsx)(`span`,{className:`pointer-events-none inline-flex`,children:(0,H.jsx)(Bs,{checked:r,tabIndex:-1})}),(0,H.jsx)(`span`,{children:o(`label-ai-cleanup-remove-check`)})]}),(0,H.jsx)(`div`,{className:`text-sm`,children:n||e.id}),(0,H.jsx)(Mo,{steps:Md(e.id,O.old)}),(0,H.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:e.reason})]},t)})]}):null,(O.changes.kept||[]).length>0?(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsxs)(`button`,{type:`button`,className:`flex items-center gap-1.5 text-sm font-medium`,onClick:()=>b(e=>!e),children:[o(`label-ai-cleanup-kept`),(0,H.jsxs)(`span`,{className:`text-muted-foreground`,children:[`(`,O.changes.kept?.length||0,`)`]}),y?(0,H.jsx)(pe,{className:`size-3.5`}):(0,H.jsx)(ue,{className:`size-3.5`})]}),y?(0,H.jsx)(`div`,{className:`space-y-1`,children:(O.changes.kept||[]).map((e,t)=>(0,H.jsx)(`div`,{className:`text-xs text-muted-foreground rounded bg-muted/40 px-2 py-1`,children:e},t))}):null]}):null]})]}):null,(0,H.jsxs)(Mu,{children:[(0,H.jsx)(q,{variant:`secondary`,onClick:()=>F(!1),children:o(`btn-cancel`)}),D.phase===`running`&&!E?(0,H.jsx)(q,{variant:`outline`,onClick:ie,children:o(`btn-ai-cleanup-stop`)}):null,D.phase===`failed`||D.phase===`review`?(0,H.jsx)(q,{variant:`outline`,onClick:ie,children:o(`btn-ai-cleanup-back`)}):null,D.phase===`failed`?(0,H.jsx)(q,{onClick:()=>R(ro(w,f)),children:o(`btn-ai-cleanup-retry`)}):null,D.phase===`review`?(0,H.jsx)(q,{disabled:M===0||x,onClick:de,children:M>0?`${o(`label-ai-cleanup-apply`)} (${M})`:o(`label-ai-cleanup-apply`)||`Apply`}):null]})]})})}function zd({onOpen:e,onGone:t}){let{t:n}=G(),r=ao(!0,!0),i=$a(r.job,r.checked),a=i===null;if((0,v.useEffect)(()=>{a&&t()},[a,t]),!i)return null;let o=i.kind===`failed`,s=i.kind===`running`?i.total>0?n(`label-ai-cleanup-pill-progress`,{done:i.done,total:i.total}):n(`label-ai-cleanup-pill-running`):i.kind===`ready`?n(`label-ai-cleanup-pill-ready`):n(o?`label-ai-cleanup-pill-failed`:`label-ai-cleanup-pill`);return(0,H.jsx)(`div`,{className:`fixed top-3 end-3 z-40 max-w-[calc(100%-1.5rem)]`,role:`status`,children:(0,H.jsxs)(q,{type:`button`,variant:`outline`,size:`sm`,onClick:e,className:V(`max-w-full bg-popover shadow-md`,o&&`border-destructive text-destructive hover:text-destructive`),children:[i.kind===`ready`?(0,H.jsx)(ge,{"aria-hidden":`true`}):o?(0,H.jsx)(me,{"aria-hidden":`true`}):(0,H.jsx)(at,{"aria-hidden":`true`,className:`animate-spin`}),(0,H.jsx)(`span`,{className:`truncate`,children:s})]})})}function Bd(e){let t=new Set;return e.forEach((e,n)=>{e.checked&&t.add(n)}),t}function Vd(e,t){let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n}function Hd(e,t,n){return t.reduce((e,t,r)=>e-(n.has(r)?t.labels.length-1:0),e)}function Ud(e,t,n){return[...t].map(t=>({labels:e[t].labels.map(e=>e.label),name:n[t].trim()}))}function Wd(e){let t=0;for(let n of e.trim().toLowerCase())t=t*31+n.codePointAt(0)|0;return Math.abs(t)%360}function Gd({keyword:e,active:t=!1,title:n,onClick:r,"aria-describedby":i,"aria-label":a}){let o=Wd(e);return(0,H.jsx)(`button`,{type:`button`,title:n,"aria-describedby":i,"aria-label":a,"aria-pressed":t,onClick:()=>r?.(e),className:V(`inline-flex min-h-6 max-w-full cursor-pointer items-center rounded-[7px] border px-2 text-xs break-words transition-colors duration-150 focus-visible:outline-2 focus-visible:outline-ring focus-visible:outline-offset-2`,`[color:oklch(0.42_0.13_var(--keyword-hue))] dark:[color:oklch(0.8_0.13_var(--keyword-hue))]`,t&&`ring-2 ring-offset-1 ring-offset-background`),style:{backgroundColor:`oklch(0.72 0.14 ${o} / 0.18)`,borderColor:`oklch(0.72 0.14 ${o} / 0.45)`,"--keyword-hue":String(o),"--tw-ring-color":`oklch(0.72 0.14 ${o} / 0.7)`},children:e})}var Kd=ko(`h-5 gap-1 rounded-2xl border border-transparent px-2 py-0.5 text-xs font-medium transition-all has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:size-3! focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive group/badge inline-flex w-fit shrink-0 items-center justify-center overflow-hidden whitespace-nowrap transition-colors focus-visible:ring-[3px] [&>svg]:pointer-events-none`,{variants:{variant:{default:`bg-primary/10 border-primary/25 text-primary-label [a]:hover:bg-primary/16`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`bg-destructive/10 border-destructive/25 [a]:hover:bg-destructive/16 text-destructive-label`,info:`bg-status-info/10 border-status-info/25 text-status-info [a]:hover:bg-status-info/16`,warning:`bg-status-warning/10 border-status-warning/25 text-status-warning [a]:hover:bg-status-warning/16`,outline:`border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`}},defaultVariants:{variant:`default`}});function qd({className:e,variant:t,asChild:n=!1,...r}){return(0,H.jsx)(n?mo:`span`,{"data-slot":`badge`,className:V(Kd({variant:t}),e),...r})}function Jd({className:e,type:t,...n}){return(0,H.jsx)(`input`,{type:t,"data-slot":`input`,className:V(`border-input file:text-foreground placeholder:text-muted-foreground selection:bg-selection selection:text-foreground flex h-9 w-full min-w-0 rounded-[10px] border bg-card px-2.5 py-1 text-ui transition-colors duration-150 outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-ui file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50`,`focus-visible:border-ring focus-visible:ring-ring focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-background`,`aria-invalid:ring-destructive aria-invalid:ring-1 aria-invalid:border-destructive`,e),...n})}var Yd=3e3;function Xd({label:e,count:t}){return(0,H.jsxs)(qd,{variant:`outline`,className:`bg-transparent border-current [color:oklch(0.42_0.13_var(--category-hue))] dark:[color:oklch(0.8_0.13_var(--category-hue))]`,style:{"--category-hue":String(Wd(e))},children:[(0,H.jsx)(`bdi`,{children:e}),(0,H.jsx)(`span`,{className:`ms-1 font-mono opacity-70`,children:t})]})}function Zd({open:e=!1,onOpenChange:t,onApplied:n}){let{t:r}=G(),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(new Set),[c,l]=(0,v.useState)([]),[u,d]=(0,v.useState)(!1),[f,p]=(0,v.useState)(null),[m,h]=(0,v.useState)(null),g=(0,v.useRef)(!1),_=(0,v.useRef)(0);(0,v.useEffect)(()=>{e&&!g.current&&b(!1),e||_.current++,g.current=e},[e]);function y(e){a(e),s(Bd(e.groups)),l(e.groups.map(e=>e.name))}async function b(e){let t=++_.current;a(null),p(null),h(null);let n=null;if(!e){let e=await W(`/api/user-profile/category-cleanup`);n=e.success?e.data??null:null}if(!n||n.status.state===`failed`){let e=await W(`/api/user-profile/category-cleanup`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({})});if(!e.success||!e.data){h(e.error||r(`toast-category-cleanup-failed`));return}n=e.data}for(;t===_.current;){let e=n.status;if(e.state===`done`)return y(e.preview);if(e.state===`failed`)return h(e.error);p(e.state===`checking`&&e.total>0?{done:e.done,total:e.total}:null),await new Promise(e=>setTimeout(e,Yd));let t=await W(`/api/user-profile/category-cleanup`);if(!t.success||!t.data)return h(t.error||r(`toast-category-cleanup-failed`));n=t.data}}function x(e){s(t=>Vd(t,e))}let S=i?Hd(i.before,i.groups,o):0,C=[...o].every(e=>(c[e]??``).trim().length>0);async function w(){if(!i||o.size===0||!C)return;d(!0);let e=Ud(i.groups,o,c),a=await W(`/api/user-profile/category-cleanup/apply`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({groups:e})});if(d(!1),!a.success||!a.data){U.error(a.error||r(`toast-category-cleanup-failed`));return}U.success(r(`toast-category-cleanup-applied`,{count:a.data.renamed})),t?.(!1),n?.()}async function T(){d(!0);let e=await W(`/api/user-profile/category-cleanup/undo`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({})});if(d(!1),!e.success||!e.data){U.info(e.error||r(`toast-category-cleanup-failed`));return}U.success(r(`toast-category-cleanup-undone`,e.data)),t?.(!1),n?.()}return(0,H.jsx)(Du,{open:e,onOpenChange:t,children:(0,H.jsxs)(Au,{className:`grid! sm:max-w-2xl max-h-[90vh] grid-rows-[auto_minmax(0,1fr)_auto] overflow-hidden gap-4`,children:[(0,H.jsx)(ju,{children:(0,H.jsx)(Nu,{children:r(`label-category-cleanup-title`)})}),m?(0,H.jsxs)(`div`,{className:`flex flex-col items-center gap-3 py-10 text-sm`,children:[(0,H.jsx)(`span`,{className:`text-destructive`,children:m}),(0,H.jsx)(q,{variant:`secondary`,size:`sm`,onClick:()=>void b(!0),children:r(`btn-category-cleanup-rebuild`)})]}):i?(0,H.jsxs)(`div`,{className:`flex min-h-0 flex-col gap-3 overflow-hidden`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,H.jsx)(`p`,{className:`text-sm`,children:r(`label-category-cleanup-counts`,{before:i.before,after:S})}),(0,H.jsx)(q,{variant:`link`,size:`xs`,onClick:()=>void b(!0),children:r(`btn-category-cleanup-rebuild`)})]}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:r(`label-category-cleanup-note`)}),i.groups.length===0?(0,H.jsx)(`p`,{className:`py-6 text-center text-sm text-muted-foreground`,children:r(`label-category-cleanup-empty`)}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:r(`label-category-cleanup-selected`,{selected:o.size,total:i.groups.length})}),(0,H.jsx)(`div`,{className:`min-h-0 flex-1 space-y-2 overflow-y-auto pe-1`,children:i.groups.map((e,t)=>(0,H.jsxs)(`div`,{className:`rounded-xl border border-border p-3 space-y-2`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,H.jsx)(Bs,{checked:o.has(t),onCheckedChange:()=>x(t),"aria-label":r(`label-category-cleanup-accept`)}),(0,H.jsx)(Jd,{dir:`auto`,className:`h-8 min-w-0 flex-1 sm:max-w-64`,value:c[t]??``,"aria-label":r(`label-category-cleanup-name`),disabled:!o.has(t),onChange:e=>l(n=>n.map((n,r)=>r===t?e.target.value:n))}),e.checked?null:(0,H.jsx)(`span`,{className:`basis-full text-xs text-muted-foreground sm:basis-auto`,children:r(`label-category-cleanup-unchecked`)})]}),(0,H.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:e.labels.map(e=>(0,H.jsx)(Xd,{label:e.label,count:e.count},e.label))})]},e.id))})]})]}):(0,H.jsxs)(`div`,{className:`flex flex-col items-center gap-3 py-10 text-center text-muted-foreground`,children:[(0,H.jsx)(at,{className:`size-6 animate-spin`}),(0,H.jsx)(`span`,{className:`text-sm`,children:f?r(`label-category-cleanup-progress`,f):r(`label-category-cleanup-loading`)}),(0,H.jsx)(`span`,{className:`text-xs`,children:r(`label-category-cleanup-background`)})]}),(0,H.jsxs)(Mu,{className:`gap-2 sm:justify-between`,children:[(0,H.jsxs)(q,{variant:`secondary`,size:`sm`,disabled:u,onClick:()=>void T(),children:[(0,H.jsx)(Zt,{className:`size-3.5`}),r(`btn-category-cleanup-undo`)]}),(0,H.jsxs)(`div`,{className:`flex gap-2`,children:[(0,H.jsx)(q,{variant:`secondary`,size:`sm`,onClick:()=>t?.(!1),children:r(`btn-cancel`)}),(0,H.jsx)(q,{size:`sm`,disabled:u||!i||o.size===0||!C,onClick:()=>void w(),children:r(`btn-category-cleanup-apply`)})]})]})]})})}var J={home:`/`,project:`/project-memories`,profile:`/user-profile`,settings:`/settings`,memory:`/memory`,memorisation:`/memorisation`,chat:`/chat`,skills:`/skills`,spaces:`/spaces`,spacesArchive:`/spaces/archive`},Qd=[`pi`,`opencode`,`claude-code`,`shared`];function $d(e){return`${J.memory}/${e}`}var ef=e=>e===J.memory||e.startsWith(`${J.memory}/`);function tf(e){let t=/^\/memory\/([^/]+)$/.exec(nf(e))?.[1];return Qd.includes(t??``)?t:null}function nf(e){let t=e.replace(/\/+$/,``)||`/`;return t.startsWith(`/`)?t:`/${t}`}function rf(e){let t=nf(e);return ef(t)?`memory`:t===J.settings?`settings`:t===J.memorisation?`memorisation`:t===J.chat?`chat`:t===J.skills?`skills`:t===J.spaces?`spaces`:t===J.spacesArchive?`spaces-archive`:t===J.profile?`profile`:`project`}function af(e){let t=nf(e);return t===J.home||t===J.project||t===J.profile||t===J.settings||t===J.memorisation||ef(t)||t===J.chat||t===J.skills||t===J.spaces||t===J.spacesArchive}function of(e){let t=nf(e);return t===J.home?J.project:ef(t)?tf(t)?t:J.memory:af(t)?t:J.project}function sf(e,t){let[n,r]=(0,v.useState)(()=>{try{let t=localStorage.getItem(e);return t===null?null:t===`1`}catch{return null}}),i=n??t;return[i,()=>{let t=!i;r(t);try{localStorage.setItem(e,t?`1`:`0`)}catch{}}]}function cf({link:e,sections:t,open:n,onToggle:r,label:i,hideWhenCollapsed:a,onSectionClick:o,id:s=`sidebar-profile-tree`,base:c=J.profile}){return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-0.5`,children:[e,t.length>0&&(0,H.jsx)(`button`,{type:`button`,className:V(`inline-flex min-h-11 min-w-11 md:min-h-7 md:min-w-7 shrink-0 cursor-pointer items-center justify-center rounded-lg p-1.5 text-muted-foreground hover:bg-interactive-hover focus-visible:outline-2 focus-visible:outline-ring`,a),onClick:r,"aria-expanded":n,"aria-controls":s,"aria-label":i,title:i,children:(0,H.jsx)(fe,{className:V(`size-4 transition-transform rtl:-scale-x-100`,n&&`rotate-90 rtl:rotate-90`)})})]}),n&&t.length>0&&(0,H.jsx)(`ul`,{id:s,className:V(`ms-5 space-y-0.5 border-s border-sidebar-border ps-2`,a),children:t.map(e=>(0,H.jsx)(`li`,{children:(0,H.jsx)(`a`,{href:e.href??`${c}#${e.id}`,title:e.title,"aria-current":e.current?`page`:void 0,className:`flex min-h-11 md:min-h-7 items-center gap-2 break-words rounded-lg px-2.5 py-1 text-xs text-muted-foreground transition-colors duration-150 hover:bg-interactive-hover hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring focus-visible:outline-offset-2 aria-[current=page]:bg-sidebar-accent aria-[current=page]:text-sidebar-accent-foreground`,onClick:t=>o(t,e.id),children:e.leading||e.trailing?(0,H.jsxs)(H.Fragment,{children:[e.leading,(0,H.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.label}),e.trailing]}):e.label})},e.id))})]})}function lf({sections:e,currentView:t,memoryViewId:n,warningLabel:r,className:i,onSectionClick:a}){return(0,H.jsx)(`ul`,{id:`sidebar-memory-tree`,className:i,children:e.map(e=>(0,H.jsxs)(`li`,{children:[(0,H.jsxs)(`a`,{href:`${J.memory}/${e.id}`,"aria-current":t===`memory`&&n===e.id?`page`:void 0,className:`flex min-h-11 md:min-h-7 items-center gap-2 break-words rounded-lg px-2.5 py-1 text-xs text-muted-foreground hover:bg-interactive-hover focus-visible:outline-2 focus-visible:outline-ring aria-[current=page]:bg-sidebar-accent aria-[current=page]:text-sidebar-accent-foreground`,onClick:t=>a(t,e.id,`memory`),children:[e.avatar,e.label,e.warning&&(0,H.jsx)(`span`,{role:`img`,"aria-label":r,title:r,className:`ms-auto size-2 shrink-0 rounded-full bg-[var(--status-warning)]`})]}),e.items&&e.items.length>0&&(0,H.jsx)(`ul`,{"aria-label":e.label,className:`ms-4 mt-0.5 space-y-0.5 border-s border-sidebar-border ps-2`,children:e.items.map(t=>(0,H.jsx)(`li`,{children:(0,H.jsx)(`a`,{href:`${J.memory}/${e.id}#${t.id}`,className:`flex min-h-11 md:min-h-7 items-center break-words rounded-lg px-2.5 py-1 text-xs text-muted-foreground hover:bg-interactive-hover hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring`,onClick:n=>a(n,`${e.id}#${t.id}`,`memory`),children:t.label})},t.id))})]},e.id))})}function uf({className:e,...t}){return(0,H.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,className:V(`size-4 shrink-0`,e),...t,children:(0,H.jsx)(`path`,{d:`M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12`})})}var df=`om-memory-system web`;function ff(){let{t:e}=G(),{ok:t,status:n}=Ya(),r=n?.canControl??!1,i=n?.instance??null,[a,o]=(0,v.useState)(!1),[s,c]=(0,v.useState)(`idle`),[l,u]=(0,v.useState)(``);async function d(e){if(s!==`idle`)return;if(c(`working`),u(``),!await Fa(e)){c(`idle`),u(`power-request-failed`);return}if(o(!1),e===`stop`){c(`stopped`);return}c(`restarting`);let t=await Ia(i);if(t===`restarted`){window.location.reload();return}if(t===`unchanged`){u(`power-restart-failed`),c(`idle`),o(!0);return}u(`power-restart-timeout`),c(`stopped`)}return!r&&s===`idle`?null:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`button`,{type:`button`,"data-power":t?`on`:`off`,className:`inline-flex min-h-11 min-w-11 md:min-h-8 md:min-w-7 items-center justify-center self-stretch border-s border-sidebar-border px-1.5 text-muted-foreground transition-colors duration-150 hover:bg-interactive-hover hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring`,onClick:()=>{u(``),o(!0)},"aria-label":e(`power-button`),title:e(`power-button`),children:(0,H.jsx)(kt,{className:V(`size-4`,t&&`text-emerald-500`)})}),(0,H.jsx)(Du,{open:a,onOpenChange:e=>s===`idle`&&o(e),children:(0,H.jsxs)(Au,{showCloseButton:!1,children:[(0,H.jsx)(ju,{children:(0,H.jsx)(Nu,{children:e(`power-dialog-title`)})}),(0,H.jsx)(`p`,{children:e(`power-dialog-body`)}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`power-note`)}),l?(0,H.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:e(l)}):null,(0,H.jsxs)(`div`,{className:`flex flex-wrap justify-end gap-2`,children:[(0,H.jsx)(q,{variant:`ghost`,disabled:s!==`idle`,onClick:()=>o(!1),children:e(`power-cancel`)}),(0,H.jsx)(q,{variant:`destructive`,disabled:s!==`idle`,onClick:()=>void d(`stop`),children:e(`power-stop`)}),(0,H.jsx)(q,{autoFocus:!0,disabled:s!==`idle`,onClick:()=>void d(`restart`),children:e(`power-restart`)})]})]})}),s===`restarting`||s===`stopped`?(0,H.jsx)(`div`,{role:`alert`,className:`fixed inset-0 z-[60] flex flex-col items-center justify-center gap-3 bg-background p-6 text-center`,children:s===`restarting`?(0,H.jsx)(`p`,{children:e(`power-restarting`)}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`h2`,{className:`text-section-title font-semibold`,children:e(`power-stopped-title`)}),l?(0,H.jsx)(`p`,{children:e(l)}):null,(0,H.jsx)(`p`,{children:e(`power-stopped-command`)}),(0,H.jsx)(`code`,{className:`rounded-md bg-muted px-2 py-1`,children:df}),(0,H.jsx)(`p`,{className:`max-w-md text-xs text-muted-foreground`,children:e(`power-note`)})]})}):null]})}function pf({brand:e,className:t}){let{status:n}=Ya();return(0,H.jsxs)(`span`,{className:V(`flex min-w-0 items-baseline gap-1.5`,t),children:[(0,H.jsx)(`span`,{className:`truncate text-ui font-medium tracking-wide text-brand-label`,children:e}),n?(0,H.jsxs)(`span`,{className:`shrink-0 text-xs text-foreground`,"data-testid":`sidebar-version`,children:[`v`,n.version]}):null]})}function mf({href:e,label:t,icon:n,active:r,collapsed:i,className:a,title:o,note:s,onNavigate:c}){return(0,H.jsxs)(`a`,{href:e,className:a,"aria-current":r?`page`:void 0,title:o??(i?t:void 0),onClick:t=>c(t,e),children:[(0,H.jsx)(n,{className:`size-4 shrink-0`,"aria-hidden":!0}),(0,H.jsxs)(`span`,{className:V(`min-w-0 break-words text-start`,i&&`md:sr-only`),children:[t,s?(0,H.jsx)(`span`,{className:`block text-xs text-muted-foreground`,children:s}):null]})]})}var hf=`min-w-0 space-y-2 rounded-xl border border-border bg-card p-3`,gf=`min-w-0 break-words text-subsection-title font-semibold text-foreground`,_f=8;function vf({centre:e,half:t,left:n,right:r,gap:i}){let a=n+i+t,o=r-i-t;return a>o?(n+r)/2-e:Math.min(Math.max(e,a),o)-e}function yf(e){return e.closest(`[data-tooltip-bounds]`)?.getBoundingClientRect()??null}function bf({content:e,children:t,className:n}){let r=v.useId(),i=v.useRef(null),[a,o]=v.useState(0),s=v.isValidElement(t)?v.cloneElement(t,{"aria-describedby":r}):t,c=()=>{let e=i.current;if(!e)return;let t=e.parentElement.getBoundingClientRect(),n=e.offsetWidth/2,r=t.left+t.width/2,a=yf(e),s=a?a.left:0,c=a?a.right:document.documentElement.clientWidth;o(vf({centre:r,half:n,left:s,right:c,gap:_f}))};return(0,H.jsxs)(`span`,{className:V(`group/tooltip relative inline-flex`,n),onPointerEnter:c,onFocus:c,children:[s,(0,H.jsxs)(`span`,{ref:i,id:r,role:`tooltip`,style:{transform:`translateX(calc(-50% + ${a}px))`},className:`pointer-events-none absolute bottom-full left-1/2 z-30 mb-2 w-max max-w-[min(24rem,calc(100vw-1rem))] rounded-md border border-border bg-card px-2 py-1 text-xs whitespace-normal text-card-foreground opacity-0 shadow-sm transition-opacity duration-150 ease-in group-focus-within/tooltip:opacity-100 group-hover/tooltip:opacity-100`,children:[e,(0,H.jsx)(`span`,{"aria-hidden":`true`,style:{left:`calc(50% - ${a}px)`},className:`absolute top-full -mt-1 size-2 -translate-x-1/2 rotate-45 border-e border-b border-border bg-card`})]})]})}function xf({label:e,reason:t,reasonId:n,busy:r,icon:i,iconOnly:a=!1,variant:o,onClick:s}){let c=t!==void 0,l=(0,H.jsxs)(q,{type:`button`,variant:o,size:a?`icon-sm`:`sm`,"aria-label":a?e:void 0,"aria-describedby":c?n:void 0,disabled:r||c,onClick:s,children:[(0,H.jsx)(i,{"aria-hidden":`true`}),a?null:e]});return c?(0,H.jsx)(bf,{content:t,children:(0,H.jsxs)(`span`,{tabIndex:0,className:`inline-flex rounded-[9px] focus-visible:outline-2 focus-visible:outline-ring`,children:[l,(0,H.jsx)(`span`,{id:n,className:`sr-only`,children:t})]})}):a?(0,H.jsx)(bf,{content:e,children:l}):l}var Sf={anchor:j,atom:L,bird:ne,"book-open":re,bot:R,braces:ae,brain:oe,bug:se,cat:ce,cloud:_e,code:ve,command:ye,compass:be,cpu:Se,database:we,dog:Te,feather:ke,"file-code":Ae,fish:Me,flame:Ne,flower:Pe,folder:Le,gem:Re,ghost:ze,"git-branch":Be,globe:He,hash:Ue,heart:We,infinity:Ke,key:Je,layers:Ye,leaf:Ze,library:Qe,lightbulb:$e,link:nt,"message-square":ct,moon:ft,mountain:pt,network:mt,orbit:_t,package:vt,"pen-tool":St,plug:Dt,puzzle:At,rocket:Mt,server:Lt,settings:Rt,shield:zt,sparkles:Bt,"square-terminal":Ht,star:Ut,sun:Wt,target:Kt,terminal:qt,"wand-sparkles":tn,wrench:rn,zap:on},Cf=Object.keys(Sf);function wf(e){let t=e.trim().split(/\s+/).filter(Boolean);return t.length===0?`?`:(t.length>1?[Array.from(t[0])[0],Array.from(t[1])[0]]:Array.from(t[0]).slice(0,2)).join(``).toLocaleUpperCase()}var Tf=e=>Wd(e),Ef=e=>`space-card-${e}`;function Df({name:e,look:t={kind:`default`},className:n,iconClassName:r=`size-5`}){let i=V(`grid size-10 shrink-0 place-items-center overflow-hidden rounded-[10px] border text-ui font-semibold`,n);if(t.kind===`image`)return(0,H.jsx)(`span`,{"aria-hidden":`true`,className:V(i,`border-border bg-muted`),children:(0,H.jsx)(`img`,{src:t.image,alt:``,className:`size-full object-cover`})});let a=t.kind===`icon`?Sf[t.icon]:void 0,o=Tf(e);return(0,H.jsx)(`span`,{"aria-hidden":`true`,className:V(i,`[color:oklch(0.42_0.13_var(--host-hue))] dark:[color:oklch(0.8_0.13_var(--host-hue))]`),style:{backgroundColor:`oklch(0.72 0.14 ${o} / 0.18)`,borderColor:`oklch(0.72 0.14 ${o} / 0.45)`,"--host-hue":String(o)},children:a?(0,H.jsx)(a,{className:r}):(0,H.jsx)(`bdi`,{children:wf(e)})})}function Of({className:e,...t}){return(0,H.jsx)(`nav`,{"data-slot":`pagination`,className:V(`mx-auto flex w-full justify-center`,e),...t})}function kf({className:e,...t}){return(0,H.jsx)(`ul`,{"data-slot":`pagination-content`,className:V(`flex flex-row flex-wrap items-center justify-center gap-1`,e),...t})}function Af({...e}){return(0,H.jsx)(`li`,{"data-slot":`pagination-item`,...e})}function jf({className:e,isActive:t,size:n=`icon-sm`,disabled:r,...i}){return(0,H.jsx)(`button`,{type:`button`,"aria-current":t?`page`:void 0,"aria-disabled":r||void 0,disabled:r,"data-slot":`pagination-button`,"data-active":t,className:V(Ao({variant:t?`outline`:`ghost`,size:n}),`tabular-nums`,t&&`border-primary/40 bg-selection`,e),...i})}function Mf({className:e,label:t,...n}){return(0,H.jsxs)(`span`,{"data-slot":`pagination-ellipsis`,className:V(`flex size-8 items-center justify-center`,e),...n,children:[(0,H.jsx)(De,{className:`size-4 text-muted-foreground`,"aria-hidden":`true`}),(0,H.jsx)(`span`,{className:`sr-only`,children:t})]})}var Nf={"(empty prompt)":[`(空提示)`,`(مطالبة فارغة)`],"<private> text, API keys and passwords will be stored as written and sent to the external API when drafting.":[`<private> 文本、API 密钥和密码将按原文存储,并在起草时发送到外部 API。`,`سيُخزَّن نص <private> ومفاتيح API وكلمات المرور كما كُتبت، وتُرسَل إلى واجهة API الخارجية عند الصياغة.`],"A project config turns recording off for this project.":[`项目配置已为此项目关闭记录。`,`يوقف إعداد المشروع التسجيل في هذا المشروع.`],Attention:[`关注度`,`الاهتمام`],"Add folder":[`添加文件夹`,`إضافة مجلد`],"All skills":[`所有技能`,`كل المهارات`],"Changes to SKILL.md":[`对 SKILL.md 的更改`,`التغييرات على SKILL.md`],"Delete recorded turns":[`删除已记录的回合`,`حذف الأدوار المسجلة`],"Delete {count} recorded turns? This cannot be undone.":[`删除 {count} 个已记录的回合?此操作无法撤销。`,`حذف {count} من الأدوار المسجلة؟ لا يمكن التراجع عن ذلك.`],"Deleted {count} recorded turns.":[`已删除 {count} 个已记录的回合。`,`تم حذف {count} من الأدوار المسجلة.`],"Draft improvement":[`起草改进`,`صياغة تحسين`],"Draft skill":[`起草技能`,`صياغة مهارة`],"Drafting needs the external API. Set it up first.":[`起草需要外部 API。请先设置。`,`تحتاج الصياغة إلى واجهة API الخارجية. أعدّها أولاً.`],"Drafting… This can take a few minutes.":[`正在起草…这可能需要几分钟。`,`جارٍ الصياغة… قد يستغرق ذلك بضع دقائق.`],"Evidence turns":[`证据回合`,`الأدوار الداعمة`],"Failed turns":[`失败的回合`,`الأدوار الفاشلة`],"File size":[`文件大小`,`حجم الملف`],"Finding past sessions…":[`正在查找过去的会话…`,`جارٍ البحث عن الجلسات السابقة…`],"Filter skills by name":[`按名称筛选技能`,`تصفية المهارات بالاسم`],"Find new skill ideas":[`查找新技能想法`,`البحث عن أفكار مهارات جديدة`],"Folder for the new skill":[`新技能的文件夹`,`مجلد المهارة الجديدة`],"Folder not found":[`未找到文件夹`,`المجلد غير موجود`],"Folder path":[`文件夹路径`,`مسار المجلد`],"Hide changes":[`隐藏更改`,`إخفاء التغييرات`],Improvement:[`改进`,`تحسين`],"Last seen":[`最近出现`,`آخر ظهور`],"Last use":[`上次使用`,`آخر استخدام`],"Loading…":[`加载中…`,`جارٍ التحميل…`],"Loading the proposal…":[`正在加载提案…`,`جارٍ تحميل المقترح…`],"The proposal could not be loaded. Select Show less, then Show more to try again.":[`无法加载该提案。选择“显示更少”,再选择“显示更多”即可重试。`,`تعذّر تحميل المقترح. اختر «عرض أقل» ثم «عرض المزيد» للمحاولة مرة أخرى.`],"Looking…":[`正在查找…`,`جارٍ البحث…`],Manual:[`手动`,`يدوي`],"Most calls":[`调用次数最多`,`الأكثر استدعاءً`],"Most used":[`最常用`,`الأكثر استخدامًا`],"Needs attention":[`需要关注`,`يحتاج إلى اهتمام`],"Sort skills":[`技能排序`,`ترتيب المهارات`],"New skill":[`新技能`,`مهارة جديدة`],"New skill ideas":[`新技能想法`,`أفكار مهارات جديدة`],"New turns will be stored as written.":[`新回合将按原文存储。`,`ستُخزَّن الأدوار الجديدة كما كُتبت.`],"No change proposed":[`没有建议更改`,`لم يُقترح أي تغيير`],"No content was saved.":[`没有保存内容。`,`لم يُحفظ أي محتوى.`],"No folders are watched.":[`没有监视的文件夹。`,`لا توجد مجلدات مراقبة.`],"No new skill ideas in the recorded turns.":[`已记录的回合中没有新的技能想法。`,`لا توجد أفكار مهارات جديدة في الأدوار المسجلة.`],"No proposals yet.":[`还没有提案。`,`لا توجد مقترحات بعد.`],"No recorded turns.":[`没有已记录的回合。`,`لا توجد أدوار مسجلة.`],"No skill matches this name.":[`没有技能匹配此名称。`,`لا توجد مهارة تطابق هذا الاسم.`],"No skills found in the watched folders.":[`在监视的文件夹中未找到技能。`,`لم يُعثر على مهارات في المجلدات المراقبة.`],"No turns are recorded yet.":[`还没有记录任何回合。`,`لم تُسجَّل أي أدوار بعد.`],"Not in a watched folder":[`不在监视的文件夹中`,`ليست في مجلد مراقب`],"Nothing is recorded yet. Agent turns are recorded only after you turn it on.":[`尚未记录任何内容。只有在你开启后才会记录智能体回合。`,`لم يُسجَّل شيء بعد. لا تُسجَّل أدوار الوكيل إلا بعد تشغيل ذلك.`],"OMMS stores full prompts, replies and tool calls in skills.db on this computer. Drafting sends recorded turns to the external API. The file holds whatever the turns hold.":[`OMMS 会把完整的提示、回复和工具调用存储在这台电脑上的 skills.db 中。起草时会把已记录的回合发送到外部 API。该文件包含回合中的所有内容。`,`يخزّن OMMS المطالبات والردود واستدعاءات الأدوات كاملةً في skills.db على هذا الجهاز. ترسل الصياغة الأدوار المسجلة إلى واجهة API الخارجية. يحتوي الملف على كل ما تحتويه الأدوار.`],"OMMS will change this SKILL.md file without asking. It drafts an improvement after 10 new uses and at least 24 hours, then applies it. Each change can be undone.":[`OMMS 会在不询问的情况下修改此 SKILL.md 文件。它在 10 次新使用且至少 24 小时后起草改进,然后直接应用。每次更改都可以撤销。`,`سيعدّل OMMS ملف SKILL.md هذا دون أن يسأل. يصوغ تحسيناً بعد 10 استخدامات جديدة و24 ساعة على الأقل، ثم يطبّقه. يمكن التراجع عن كل تغيير.`],"Skill learning watches how your agents use your skills on Pi, OpenCode and Claude Code. It ranks each skill by use and failed tool calls, and drafts better versions from real turns.":[`技能学习会观察你的智能体在 Pi、OpenCode 和 Claude Code 中如何使用你的技能。它按使用次数和失败的工具调用为每个技能排名,并根据真实回合起草更好的版本。`,`يراقب تعلّم المهارات كيف يستخدم وكلاؤك مهاراتك في Pi وOpenCode وClaude Code. يرتّب كل مهارة حسب الاستخدام واستدعاءات الأدوات الفاشلة، ويصوغ نسخاً أفضل من أدوار حقيقية.`],"Every draft is a proposal with a diff. Nothing changes a SKILL.md file until you apply it, unless you set that skill to Automatic. Undo restores the previous version.":[`每份草稿都是带差异对比的提案。在你应用之前,SKILL.md 文件不会改变,除非你把该技能设为“自动”。撤销会恢复之前的版本。`,`كل مسودة مقترح مع عرض للفروق. لا يتغيّر ملف SKILL.md حتى تطبّقه، إلا إذا ضبطت تلك المهارة على تلقائي. التراجع يعيد النسخة السابقة.`],"The memory chat sends skill counts and short change summaries to the external API, never turn text.":[`记忆聊天会把技能计数和简短的更改摘要发送到外部 API,绝不发送回合文本。`,`ترسل دردشة الذاكرة أعداد المهارات وملخصات التغييرات القصيرة إلى واجهة API الخارجية، ولا ترسل نص الأدوار أبداً.`],"Open the Skill learning card":[`打开“技能学习”卡片`,`افتح بطاقة تعلّم المهارات`],"No proposals are waiting.":[`没有等待处理的提案。`,`لا توجد مقترحات قيد الانتظار.`],"No proposals have been decided yet.":[`尚未处理任何提案。`,`لم يتم البتّ في أي مقترح بعد.`],"Pending proposals":[`待处理的提案`,`المقترحات المعلّقة`],Proposals:[`提案`,`المقترحات`],"Ranked skills":[`技能排名`,`المهارات مرتبةً`],"Recent turns":[`最近的回合`,`الأدوار الأخيرة`],"Recent proposals":[`最近的提案`,`المقترحات الأخيرة`],"Record agent turns":[`记录智能体回合`,`تسجيل أدوار الوكيل`],"Record agent turns so OMMS can rank your skills and draft improvements.":[`记录智能体回合,让 OMMS 为你的技能排名并起草改进。`,`سجّل أدوار الوكيل ليتمكن OMMS من ترتيب مهاراتك وصياغة التحسينات.`],"Record past turns":[`记录过去的回合`,`تسجيل الأدوار السابقة`],"Record past turns did not finish.":[`记录过去的回合未完成。`,`لم يكتمل تسجيل الأدوار السابقة.`],"Recorded turns":[`已记录的回合`,`الأدوار المسجلة`],"Recorded {count} past turns.":[`已记录 {count} 个过去的回合。`,`تم تسجيل {count} من الأدوار السابقة.`],Reject:[`拒绝`,`رفض`],"Remove folder":[`移除文件夹`,`إزالة المجلد`],"Remove folder {path}":[`移除文件夹 {path}`,`إزالة المجلد {path}`],"Remove private text and secrets":[`移除私密文本和机密`,`إزالة النص الخاص والأسرار`],"Reset default":[`恢复默认`,`استعادة الافتراضي`],"Saved.":[`已保存。`,`تم الحفظ.`],"Show changes":[`显示更改`,`عرض التغييرات`],"Skill learning":[`技能学习`,`تعلّم المهارات`],"Skill turns":[`技能回合`,`أدوار المهارات`],"Skill turns are recorded only while Record agent turns is on.":[`只有开启“记录智能体回合”时才会记录技能回合。`,`لا تُسجَّل أدوار المهارات إلا عند تشغيل تسجيل أدوار الوكيل.`],"Skill turns to record":[`待记录的技能回合`,`أدوار المهارات المراد تسجيلها`],"Skill turns already recorded":[`已记录的技能回合`,`أدوار المهارات المسجلة سابقاً`],"Skill turns recorded":[`本次记录的技能回合`,`أدوار المهارات المسجلة`],"Skill turns already present":[`已存在的技能回合`,`أدوار المهارات الموجودة مسبقاً`],Skills:[`技能`,`المهارات`],"Stale: the file changed since this draft":[`已过期:自起草以来文件已更改`,`قديم: تغيّر الملف منذ هذه المسودة`],"Stop removing private text and secrets?":[`停止移除私密文本和机密?`,`إيقاف إزالة النص الخاص والأسرار؟`],Suggested:[`建议`,`مقترحة`],"Turn off":[`关闭`,`إيقاف`],"Turn on Automatic":[`开启自动`,`تشغيل التلقائي`],"Turn on Automatic mode for this skill?":[`为此技能开启自动模式?`,`تشغيل الوضع التلقائي لهذه المهارة؟`],Undo:[`撤销`,`تراجع`],"Undo stopped because the file changed. This is the content OMMS saved:":[`撤销已停止,因为文件已更改。这是 OMMS 保存的内容:`,`توقف التراجع لأن الملف تغيّر. هذا هو المحتوى الذي حفظه OMMS:`],Uses:[`使用`,`الاستخدامات`],"Uses in 30 days":[`30 天内使用`,`الاستخدامات في 30 يوماً`],"Watched folders":[`监视的文件夹`,`المجلدات المراقبة`],applied:[`已应用`,`طُبّق`],"applied automatically":[`已自动应用`,`طُبّق تلقائياً`],rejected:[`已拒绝`,`مرفوض`],stale:[`已过期`,`قديم`],undone:[`已撤销`,`تم التراجع`],"{count} failed tool call":[`{count} 次工具调用失败`,`فشل استدعاء أداة واحد`],"{count} failed tool calls":[`{count} 次工具调用失败`,`فشل {count} من استدعاءات الأدوات`],"{count} skill":[`{count} 个技能`,`مهارة واحدة`],"{count} skills":[`{count} 个技能`,`المهارات: {count}`],Show:[`显示`,`عرض`],results:[`条结果`,`نتائج`],"Custom:":[`自定义:`,`مخصص:`],"Results per page":[`每页结果数`,`النتائج في كل صفحة`],"Custom results per page":[`自定义每页结果数`,`عدد مخصص للنتائج في كل صفحة`],"Sort by":[`排序方式`,`الترتيب حسب`],"Sort ascending":[`升序排列`,`ترتيب تصاعدي`],"Sort descending":[`降序排列`,`ترتيب تنازلي`],"Showing {from} to {to} of {total} results":[`显示第 {from} 到 {to} 条,共 {total} 条结果`,`عرض {from} إلى {to} من {total} نتيجة`],pagination:[`分页`,`ترقيم الصفحات`],"Go to previous page":[`转到上一页`,`الانتقال إلى الصفحة السابقة`],"Go to next page":[`转到下一页`,`الانتقال إلى الصفحة التالية`],"Go to page {page}":[`转到第 {page} 页`,`الانتقال إلى الصفحة {page}`],"More pages":[`更多页面`,`صفحات أخرى`],"Name (A–Z)":[`名称(A–Z)`,`الاسم (A–Z)`],Newest:[`最新`,`الأحدث`],Oldest:[`最早`,`الأقدم`],Skill:[`技能`,`المهارة`],Mode:[`模式`,`الوضع`],"Tool (A–Z)":[`工具(A–Z)`,`الأدوات (A–Z)`],Contents:[`目录`,`المحتويات`],"Show contents":[`显示目录`,`إظهار المحتويات`],"Hide contents":[`隐藏目录`,`إخفاء المحتويات`],"{count} proposal":[`{count} 个提案`,`مقترح واحد ({count})`],"{count} proposals":[`{count} 个提案`,`المقترحات: {count}`],"{count} turn":[`{count} 个回合`,`دور واحد ({count})`],"{count} turns":[`{count} 个回合`,`الأدوار: {count}`],"{count} failure group":[`{count} 个失败分组`,`مجموعة فشل واحدة ({count})`],"{count} failure groups":[`{count} 个失败分组`,`مجموعات فشل: {count}`],"{count} entry":[`{count} 条记录`,`إدخال واحد ({count})`],"{count} entries":[`{count} 条记录`,`الإدخالات: {count}`],"Created {date}":[`创建于 {date}`,`أُنشئ في {date}`],"Applied {date}":[`应用于 {date}`,`طُبّق في {date}`],"Rejected {date}":[`拒绝于 {date}`,`رُفض في {date}`],"Undone {date}":[`撤销于 {date}`,`تم التراجع في {date}`],"Stale since {date}":[`自 {date} 起已过期`,`قديم منذ {date}`],"Each card shows when the proposal was created and when it was last applied, rejected or undone.":[`每张卡片显示提案的创建时间,以及最近一次应用、拒绝或撤销的时间。`,`تعرض كل بطاقة وقت إنشاء المقترح ووقت آخر تطبيق أو رفض أو تراجع.`],History:[`历史记录`,`السجل`],created:[`已创建`,`أُنشئ`],"Each proposal, apply, reject and undo of this skill. Revert an applied change to restore SKILL.md as it was before it.":[`此技能的每个提案、应用、拒绝和撤销。还原已应用的更改可将 SKILL.md 恢复到该更改之前的状态。`,`كل مقترح وتطبيق ورفض وتراجع لهذه المهارة. أعِد تغييراً مطبّقاً لتستعيد SKILL.md كما كان قبله.`],"No history yet.":[`暂无历史记录。`,`لا يوجد سجل بعد.`],"{added} lines added, {removed} lines removed":[`新增 {added} 行,删除 {removed} 行`,`أُضيف {added} سطر، وحُذف {removed} سطر`],"Revert to before this change":[`还原到此更改之前`,`الرجوع إلى ما قبل هذا التغيير`],"Revert the newer change first.":[`请先还原较新的更改。`,`أعِد التغيير الأحدث أولاً.`],"Revert this change?":[`还原此更改?`,`هل تريد إعادة هذا التغيير؟`],"OMMS restores SKILL.md as it was before this change.":[`OMMS 会将 SKILL.md 恢复到此更改之前的状态。`,`يستعيد OMMS ملف SKILL.md كما كان قبل هذا التغيير.`],"Reverting this also removes {count} later change.":[`还原此更改也会移除之后的 {count} 个更改。`,`تؤدي إعادة هذا التغيير أيضاً إلى إزالة تغيير لاحق واحد ({count}).`],"Reverting this also removes {count} later changes.":[`还原此更改也会移除之后的 {count} 个更改。`,`تؤدي إعادة هذا التغيير أيضاً إلى إزالة {count} من التغييرات اللاحقة.`],Revert:[`还原`,`إعادة`],"Reverting…":[`正在还原…`,`جارٍ الإعادة…`],"Reverted. SKILL.md is back to the version before that change.":[`已还原。SKILL.md 已恢复到该更改之前的版本。`,`تمت الإعادة. عاد SKILL.md إلى النسخة السابقة لذلك التغيير.`],Activity:[`活动`,`النشاط`],"Activity could not load.":[`无法加载活动。`,`تعذّر تحميل النشاط.`],"Active skills":[`活跃技能`,`المهارات النشطة`],"Uses per day":[`每日使用`,`الاستخدامات يومياً`],"Uses in the last 30 days":[`最近 30 天的使用`,`الاستخدامات في آخر 30 يوماً`],"Most used skills":[`最常用的技能`,`المهارات الأكثر استخداماً`],"Proposal pipeline":[`提案进度`,`مسار المقترحات`],Successful:[`成功`,`ناجح`],Day:[`日期`,`اليوم`],"{uses} uses, {failed} with a failed tool call":[`使用 {uses} 次,其中 {failed} 次有工具调用失败`,`{uses} استخدام، منها {failed} مع استدعاء أداة فاشل`],"{name} leads with {uses} uses. Click a bar to open the skill.":[`{name} 以 {uses} 次使用领先。点击条形可打开该技能。`,`تتصدر {name} بعدد {uses} استخدام. انقر على شريط لفتح المهارة.`],"{total} proposals, {pending} waiting for a decision":[`共 {total} 个提案,{pending} 个等待决定`,`{total} مقترح، منها {pending} بانتظار قرار`],"No uses in the last 30 days. Bars appear after OMMS records turns.":[`最近 30 天没有使用。OMMS 记录回合后会显示条形图。`,`لا توجد استخدامات في آخر 30 يوماً. تظهر الأشرطة بعد أن يسجّل OMMS الأدوار.`],"No skill was used in the last 30 days.":[`最近 30 天没有使用任何技能。`,`لم تُستخدم أي مهارة في آخر 30 يوماً.`],"No skill uses are recorded in the last 30 days. The use charts appear after OMMS records agent turns that use a skill.":[`最近 30 天没有记录到技能使用。OMMS 记录使用技能的智能体回合后,会显示使用图表。`,`لا توجد استخدامات مسجلة للمهارات في آخر 30 يوماً. تظهر مخططات الاستخدام بعد أن يسجّل OMMS أدوار الوكلاء التي تستخدم مهارة.`],"Show uses by":[`使用次数显示方式`,`عرض الاستخدامات حسب`],Days:[`按天`,`الأيام`],Months:[`按月`,`الأشهر`],Years:[`按年`,`السنوات`],"Days to show":[`要显示的日期范围`,`الأيام المعروضة`],"Year to show":[`要显示的年份`,`السنة المعروضة`],"Last 30 days":[`最近 30 天`,`آخر 30 يوماً`],"Uses per month":[`每月使用`,`الاستخدامات شهرياً`],"Uses per year":[`每年使用`,`الاستخدامات سنوياً`],Month:[`月份`,`الشهر`],Year:[`年份`,`السنة`],"{from} to {to}":[`{from} 至 {to}`,`من {from} إلى {to}`],"Uses in {period}":[`{period} 的使用`,`الاستخدامات في {period}`],"{period}: {uses} uses, {failed} with a failed tool call":[`{period}:使用 {uses} 次,其中 {failed} 次有工具调用失败`,`{period}: {uses} استخدام، منها {failed} مع استدعاء أداة فاشل`],"No skill uses are recorded in {period}.":[`{period} 没有记录到技能使用。`,`لا توجد استخدامات مسجلة للمهارات في {period}.`],"No skill uses are recorded yet.":[`尚未记录到技能使用。`,`لا توجد استخدامات مسجلة للمهارات بعد.`],"The use charts appear after OMMS records agent turns that use a skill.":[`OMMS 记录使用技能的智能体回合后,会显示使用图表。`,`تظهر مخططات الاستخدام بعد أن يسجّل OMMS أدوار الوكلاء التي تستخدم مهارة.`],"No uses in this period. Bars appear after OMMS records turns.":[`此期间没有使用。OMMS 记录回合后会显示条形图。`,`لا توجد استخدامات في هذه الفترة. تظهر الأشرطة بعد أن يسجّل OMMS الأدوار.`],"Showing {shown} of {total}":[`显示 {shown} / {total}`,`عرض {shown} من {total}`],"Show more":[`显示更多`,`عرض المزيد`],"Show less":[`显示更少`,`عرض أقل`],lines:[`行`,`أسطر`],"Show {count} more":[`再显示 {count} 条`,`عرض {count} إضافية`],"Last modified":[`最近修改`,`آخر تعديل`],"Modified on {date}":[`修改于 {date}`,`تم التعديل في {date}`],"Show skills by modification":[`按是否修改显示技能`,`عرض المهارات حسب التعديل`],"All ({count})":[`全部({count})`,`الكل ({count})`],"Not modified ({count})":[`未修改({count})`,`غير معدّلة ({count})`],"Modified ({count})":[`已修改({count})`,`معدّلة ({count})`],"No skill has been modified yet.":[`尚未修改任何技能。`,`لم يتم تعديل أي مهارة بعد.`],"Every skill has been modified.":[`所有技能都已修改。`,`تم تعديل كل المهارات.`],"Suggested ({count})":[`建议({count})`,`مقترحة ({count})`],"No skill is suggested for a change yet.":[`尚无建议修改的技能。`,`لم تُقترح أي مهارة للتعديل بعد.`],"The state could not be saved, so SKILL.md is as it was. Try again.":[`无法保存状态,SKILL.md 保持原样。请重试。`,`تعذر حفظ الحالة، لذا بقي SKILL.md كما كان. حاول مرة أخرى.`],"No skill matches this name in this tab.":[`此标签页中没有技能匹配该名称。`,`لا توجد مهارة تطابق هذا الاسم في هذا التبويب.`],"No error text recorded":[`没有记录错误文本`,`لم يُسجَّل نص خطأ`],"Could not copy":[`无法复制`,`تعذّر النسخ`],"Show full input":[`显示完整输入`,`عرض الإدخال الكامل`],"Show less input":[`收起完整输入`,`إخفاء الإدخال الكامل`],"The server sent the first 20000 characters of this input.":[`服务器只发送了此输入的前 20000 个字符。`,`أرسل الخادم أول 20000 حرفاً من هذا الإدخال فقط.`],Copy:[`复制`,`نسخ`],Close:[`关闭`,`إغلاق`],"The failed calls could not be loaded.":[`无法加载失败的工具调用。`,`تعذّر تحميل الاستدعاءات الفاشلة.`],"Position {position}":[`位置 {position}`,`الموضع {position}`],Failures:[`失败记录`,`حالات الفشل`],"Failed calls that count against this skill, grouped by tool and first error line.":[`按工具和错误首行分组、计入此技能的失败调用。`,`الاستدعاءات الفاشلة التي تُحسب على هذه المهارة، مجمّعةً حسب الأداة وأول سطر في الخطأ.`],"No failed tool calls are recorded for this skill.":[`没有记录到计入此技能的失败工具调用。`,`لا توجد استدعاءات أدوات فاشلة مسجّلة لهذه المهارة.`],"no error text":[`无错误文本`,`بلا نص خطأ`],"{calls} call over {turns} turn":[`{calls} 次调用,涉及 {turns} 个回合`,`استدعاء واحد عبر دور واحد`],"{calls} call over {turns} turns":[`{calls} 次调用,涉及 {turns} 个回合`,`استدعاء واحد عبر {turns} أدوار`],"{calls} calls over {turns} turn":[`{calls} 次调用,涉及 {turns} 个回合`,`{calls} استدعاءات عبر دور واحد`],"{calls} calls over {turns} turns":[`{calls} 次调用,涉及 {turns} 个回合`,`{calls} استدعاءات عبر {turns} أدوار`],"{count} call is in this group; showing the latest {shown}.":[`此分组共有 {count} 次调用;显示最新的 {shown} 次。`,`هذه المجموعة تضم استدعاء واحداً؛ يُعرض آخر {shown} منه.`],"{count} calls are in this group; showing the latest {shown}.":[`此分组共有 {count} 次调用;显示最新的 {shown} 次。`,`هذه المجموعة تضم {count} استدعاء؛ يُعرض آخر {shown} منها.`],"Last seen {date}":[`最近出现于 {date}`,`آخر ظهور {date}`],"Explain failures":[`解释失败`,`شرح حالات الفشل`],"Explaining… This can take a few minutes.":[`正在解释…这可能需要几分钟。`,`جارٍ الشرح… قد يستغرق ذلك بضع دقائق.`],"Skill learning must be on to explain failures.":[`必须开启技能学习才能解释失败。`,`يجب تشغيل تعلّم المهارات لشرح حالات الفشل.`],"No failure groups to explain.":[`没有可解释的失败分组。`,`لا توجد مجموعات فشل لشرحها.`],"About Explain failures":[`关于“解释失败”`,`حول شرح حالات الفشل`],"Explaining needs the external API. Set it up first.":[`解释失败需要外部 API。请先设置。`,`يحتاج شرح الفشل إلى واجهة API الخارجية. أعدّها أولاً.`],"Send failures to the external API?":[`将失败记录发送到外部 API?`,`إرسال حالات الفشل إلى واجهة API الخارجية؟`],"Nothing is sent until you confirm. Nothing is saved.":[`确认之前不会发送任何内容,也不会保存任何内容。`,`لا يُرسَل شيء قبل التأكيد، ولا يُحفَظ شيء.`],"This sends the failure groups (tool names, error text and input excerpts of up to 500 characters) and this skill's SKILL.md to the external API model.":[`这会把失败分组(工具名称、错误文本和最多 500 字符的输入摘录)以及此技能的 SKILL.md 发送到外部 API 模型。`,`يرسل هذا مجموعات الفشل (أسماء الأدوات ونصوص الأخطاء ومقتطفات إدخال حتى 500 حرف) وملف SKILL.md لهذه المهارة إلى نموذج واجهة API الخارجية.`],"The text is sent as stored, after <private> removal and secret redaction.":[`文本按存储时的样子发送:已移除 <private> 内容并对机密进行脱敏。`,`يُرسَل النص كما خُزِّن: بعد إزالة <private> وإخفاء الأسرار.`],"Warning: redaction is off. The text may hold secrets that were not removed.":[`警告:脱敏已关闭。文本中可能含有未移除的机密。`,`تحذير: إخفاء الأسرار متوقف. قد يحمل النص أسراراً لم تُزَل.`],Cancel:[`取消`,`إلغاء`],"Skill fix":[`技能修复`,`إصلاح المهارة`],"Host or harness bug":[`宿主或框架缺陷`,`خلل في المضيف أو الإطار`],"Environment problem":[`环境问题`,`مشكلة في البيئة`],Unknown:[`未知`,`غير معروف`],"Suggested actions":[`建议操作`,`الإجراءات المقترحة`],"The labels and suggestions are leads from the error text only; the model cannot see the host's code.":[`标签和建议仅是来自错误文本的线索;模型看不到宿主的代码。`,`التسميات والاقتراحات مجرد مؤشرات من نص الخطأ فقط؛ لا يستطيع النموذج رؤية كود المضيف.`],"OpenRouter routing":[`OpenRouter 路由`,`توجيه OpenRouter`],"Block providers that may train on or store data":[`屏蔽可能用于训练或存储数据的提供商`,`حظر المزوّدين الذين قد يدرّبون على البيانات أو يخزّنونها`],"Zero data retention only":[`仅限零数据留存`,`الاحتفاظ الصفري بالبيانات فقط`],"Providers for this model":[`此模型的提供商`,`المزوّدون لهذا النموذج`],"Tick providers in the order OpenRouter should try them.":[`按 OpenRouter 应尝试的顺序勾选提供商。`,`حدّد المزوّدين بالترتيب الذي يجب أن يجرّبه OpenRouter.`],"Use only these providers":[`仅使用这些提供商`,`استخدام هؤلاء المزوّدين فقط`],"OpenRouter never falls back to other providers.":[`OpenRouter 不会回退到其他提供商。`,`لن يلجأ OpenRouter إلى مزوّدين آخرين.`],"No retention":[`不留存`,`بلا احتفاظ`],"Abuse checks only":[`仅用于滥用检查`,`فحص إساءة الاستخدام فقط`],"May keep or train on data":[`可能留存或用于训练数据`,`قد يحتفظ بالبيانات أو يدرّب عليها`],"Not available while Zero data retention only is on.":[`开启“仅限零数据留存”时不可用。`,`غير متاح أثناء تشغيل «الاحتفاظ الصفري بالبيانات فقط».`],"Try position":[`尝试顺序`,`ترتيب المحاولة`],"Loading the provider list…":[`正在加载提供商列表…`,`جارٍ تحميل قائمة المزوّدين…`],"Enter a model ID to see its providers.":[`输入模型 ID 以查看其提供商。`,`أدخل معرّف النموذج لعرض مزوّديه.`],"OpenRouter has no providers for this model.":[`OpenRouter 没有此模型的提供商。`,`ليس لدى OpenRouter مزوّدون لهذا النموذج.`],"The provider list is not available.":[`无法获取提供商列表。`,`قائمة المزوّدين غير متاحة.`],"Provider slug":[`提供商标识`,`معرّف المزوّد`],"Add provider":[`添加提供商`,`إضافة مزوّد`],"Remove provider":[`移除提供商`,`إزالة المزوّد`],"Not a valid provider slug.":[`提供商标识无效。`,`معرّف المزوّد غير صالح.`],"That provider is already in the list.":[`该提供商已在列表中。`,`هذا المزوّد موجود في القائمة.`],"Save routing":[`保存路由`,`حفظ التوجيه`],"Saving routing…":[`正在保存路由…`,`جارٍ حفظ التوجيه…`],"Routing saved.":[`路由已保存。`,`تم حفظ التوجيه.`],"Other routing fields are set in the config file and are kept.":[`其他路由字段在配置文件中设置,并会保留。`,`حقول التوجيه الأخرى مضبوطة في ملف الإعدادات وسيجري الاحتفاظ بها.`],"Save the endpoint first. Routing applies after the OpenRouter URL is saved.":[`请先保存端点。保存 OpenRouter 地址后,路由才会生效。`,`احفظ نقطة النهاية أولاً. يسري التوجيه بعد حفظ عنوان OpenRouter.`],"Save the endpoint first. The providers shown are for the model above, which is not saved yet.":[`请先保存端点。当前显示的提供商属于上方的模型,该模型尚未保存。`,`احفظ نقطة النهاية أولاً. المزوّدون المعروضون خاصون بالنموذج أعلاه، وهو غير محفوظ بعد.`],"OpenRouter can still use providers labelled Abuse checks only. For strict no retention, set ZDR only in your OpenRouter privacy settings.":[`OpenRouter 仍可能使用标注为“仅用于滥用检查”的提供商。如需严格不留存,请在 OpenRouter 隐私设置中选择“仅限 ZDR”。`,`قد يواصل OpenRouter استخدام المزوّدين الموسومين بـ«فحص إساءة الاستخدام فقط». للحصول على عدم احتفاظ صارم، اضبط «ZDR فقط» في إعدادات الخصوصية في OpenRouter.`],"OpenRouter routing is still saved and is sent with every request to this endpoint.":[`OpenRouter 路由仍处于保存状态,并会随发往此端点的每个请求一起发送。`,`لا يزال توجيه OpenRouter محفوظاً ويُرسل مع كل طلب إلى نقطة النهاية هذه.`],"Remove OpenRouter routing":[`移除 OpenRouter 路由`,`إزالة توجيه OpenRouter`],"Remove OpenRouter routing? Requests to this endpoint will no longer carry the routing choices.":[`移除 OpenRouter 路由?发往此端点的请求将不再带有这些路由选项。`,`هل تريد إزالة توجيه OpenRouter؟ لن تحمل الطلبات المرسلة إلى نقطة النهاية هذه خيارات التوجيه بعد الآن.`],"Removing OpenRouter routing…":[`正在移除 OpenRouter 路由…`,`جارٍ إزالة توجيه OpenRouter…`],"OpenRouter routing removed.":[`OpenRouter 路由已移除。`,`تمت إزالة توجيه OpenRouter.`],"Tick at least one provider first.":[`请先至少勾选一个提供商。`,`حدّد مزوّداً واحداً على الأقل أولاً.`],"OpenRouter did not answer within 10 seconds.":[`OpenRouter 在 10 秒内没有响应。`,`لم يردّ OpenRouter خلال 10 ثوانٍ.`],"OpenRouter could not be reached.":[`无法连接到 OpenRouter。`,`تعذّر الوصول إلى OpenRouter.`],...na,"Import chat history":[`导入聊天记录`,`استيراد سجل المحادثات`],"Memory limits":[`记忆限制`,`حدود الذاكرة`],"Resolve missing project folders":[`解析缺失的项目文件夹`,`حل مجلدات المشاريع المفقودة`],"Project memories":[`项目记忆`,`ذاكرة المشروع`],"User profile":[`用户画像`,`الملف الشخصي للمستخدم`],"(preferences, patterns, and workflows)":[`(偏好、模式和工作流程)`,`(التفضيلات والأنماط وسير العمل)`],"All hosts":[`所有宿主`,`جميع المضيفين`],"Selected hosts":[`已选宿主`,`المضيفون المحددون`],"Choose at least one output.":[`请至少选择一项输出。`,`اختر مخرجاً واحداً على الأقل.`],"Choose at least one host.":[`请至少选择一个宿主。`,`اختر مضيفاً واحداً على الأقل.`],"Re-analyse handled history":[`重新分析已处理的记录`,`إعادة تحليل السجل المعالج`],"Re-analysis applies to the selected outputs. Each profile prompt can be forcibly re-analysed once. Findings merge into the existing profile.":[`重新分析适用于所选输出。每条画像提示只能强制重新分析一次。结果合并到现有画像中。`,`تنطبق إعادة التحليل على المخرجات المحددة. يمكن إعادة تحليل كل مطالبة للملف الشخصي بالقوة مرة واحدة. تُدمج النتائج في الملف الحالي.`],"Preview the current selection before starting an import.":[`开始导入前,请预览当前选择。`,`عاين الاختيار الحالي قبل بدء الاستيراد.`],"This import makes model calls. Continue?":[`此次导入会调用模型。是否继续?`,`سيجري هذا الاستيراد اتصالات بالنموذج. هل تريد المتابعة؟`],"Conversations populate project facts. User prompts populate personal preferences, recurring patterns, and workflow steps.":[`对话生成项目事实。用户提示生成个人偏好、重复模式和工作流程步骤。`,`تضيف المحادثات حقائق المشروع. وتضيف مطالبات المستخدم التفضيلات الشخصية والأنماط المتكررة وخطوات سير العمل.`],"Profile identity in Settings":[`设置中的画像身份`,`هوية الملف الشخصي في الإعدادات`],"Hosts keep their existing user identities. All hosts does not merge profiles with different identities.":[`各宿主保留现有用户身份。选择所有宿主不会合并不同身份的画像。`,`يحتفظ المضيفون بهويات المستخدم الحالية. اختيار جميع المضيفين لا يدمج ملفات الهويات المختلفة.`],"Pi session reader is unavailable. Fix the reader or deselect Pi.":[`Pi 会话读取器不可用。请修复读取器或取消选择 Pi。`,`قارئ جلسات Pi غير متاح. أصلح القارئ أو ألغِ تحديد Pi.`],"Import results":[`导入结果`,`نتائج الاستيراد`],"Import successful 🎉":[`导入成功`,`تم الاستيراد بنجاح`],"Import failed":[`导入失败`,`فشل الاستيراد`],"Import cancelled":[`导入已取消`,`تم إلغاء الاستيراد`],"The import finished while you were away.":[`导入在你离开时已结束。`,`انتهى الاستيراد أثناء غيابك.`],"Could not reload the settings. Reload the page.":[`无法重新加载设置。请刷新页面。`,`تعذر إعادة تحميل الإعدادات. أعد تحميل الصفحة.`],OK:[`确定`,`حسناً`],Dismiss:[`关闭`,`إغلاق`],"Show handled sessions":[`显示已处理的会话`,`إظهار الجلسات المعالجة`],Handled:[`已处理`,`تمت معالجتها`],"Handled sessions hidden":[`已隐藏的已处理会话`,`الجلسات المعالجة المخفية`],"Some memory units failed. Completed work is saved. A new preview and import retries only the failed units.":[`部分记忆单元失败。已完成的工作已保存。重新预览并导入只会重试失败的单元。`,`فشلت بعض وحدات الذاكرة. العمل المكتمل محفوظ. المعاينة والاستيراد الجديدان يعيدان محاولة الوحدات الفاشلة فقط.`],"Profile learning failed. Completed memory work is saved.":[`画像学习失败。已完成的记忆处理已保存。`,`فشل تعلّم الملف الشخصي. عمل الذاكرة المكتمل محفوظ.`],"Import preparation failed.":[`导入准备失败。`,`فشل تحضير الاستيراد.`],"Refresh the preview and retry.":[`请刷新预览后重试。`,`حدّث المعاينة ثم أعد المحاولة.`],"The session list is out of date. Refresh the list and try again.":[`会话列表已过期。请刷新列表后重试。`,`قائمة الجلسات قديمة. حدّث القائمة ثم أعد المحاولة.`],"The history source changed. Choose it again.":[`历史记录来源已更改。请重新选择。`,`تغيّر مصدر السجل. اختره مجدداً.`],"The history source is no longer valid. Choose it again.":[`历史记录来源已失效。请重新选择。`,`لم يعد مصدر السجل صالحاً. اختره مجدداً.`],"A Pi import is already running":[`已有 Pi 导入正在运行`,`استيراد Pi قيد التشغيل بالفعل`],"An OpenCode import is already running":[`已有 OpenCode 导入正在运行`,`استيراد OpenCode قيد التشغيل بالفعل`],"A Claude Code import is already running":[`已有 Claude Code 导入正在运行`,`استيراد Claude Code قيد التشغيل بالفعل`],"Combined counts":[`合计数量`,`الأعداد المجمعة`],"Current host":[`当前宿主`,`المضيف الحالي`],"Memory extraction":[`提取记忆`,`استخراج الذاكرة`],"Memory units":[`记忆单元`,`وحدات الذاكرة`],"Pending memory units":[`待处理记忆单元`,`وحدات الذاكرة المعلقة`],"Imported memory units":[`已导入记忆单元`,`وحدات الذاكرة المستوردة`],"Already handled memory units":[`已处理记忆单元`,`وحدات الذاكرة المعالجة سابقاً`],"Skipped memory units":[`已跳过记忆单元`,`وحدات الذاكرة المتخطاة`],"Failed memory units":[`失败的记忆单元`,`وحدات الذاكرة التي فشلت`],"Held-back turns":[`暂缓处理的轮次`,`الرسائل المؤجلة`],"Untimed turns":[`无时间戳的轮次`,`الرسائل بلا طابع زمني`],"Load errors":[`加载错误`,`أخطاء التحميل`],"Already handled profile prompts":[`已处理画像提示`,`مطالبات الملف الشخصي المعالجة سابقاً`],"Profile prompts":[`画像提示`,`مطالبات الملف الشخصي`],"Profile batches":[`画像批次`,`دفعات الملف الشخصي`],"Estimated profile analysis calls":[`预计画像分析调用次数`,`اتصالات تحليل الملف الشخصي المقدّرة`],"Waiting prompts inside OMMS":[`OMMS 内等待处理的提示`,`المطالبات المنتظرة داخل OMMS`],"No work to process":[`没有待处理工作`,`لا يوجد عمل للمعالجة`],queued:[`排队中`,`في الانتظار`],preparing:[`准备中`,`جارٍ التحضير`],"not-run":[`未运行`,`لم يُشغّل`],"Automatic profile cleanup":[`自动整理画像`,`التنظيف التلقائي للملف الشخصي`],"After a learning pass, OMMS merges duplicate profile items and removes vague ones by itself, in the background. Each run makes about one model call for every 100 items and takes several minutes on a large profile. Undo last automatic cleanup on the Profile page puts the changes back.":[`学习完成后,OMMS 会在后台自动合并重复的画像条目,并删除含糊的条目。每次运行大约每 100 个条目调用一次模型,在大型画像上需要几分钟。在“用户画像”页面选择“撤销上次自动整理”可恢复这些更改。`,`بعد كل جولة تعلّم، يدمج OMMS عناصر الملف الشخصي المكررة ويحذف العناصر الغامضة تلقائياً في الخلفية. تجري كل عملية نحو اتصال واحد بالنموذج لكل 100 عنصر وتستغرق عدة دقائق على الملف الكبير. يعيد خيار «تراجع عن آخر تنظيف تلقائي» في صفحة الملف الشخصي التغييرات.`],"Clean up the profile automatically":[`自动整理画像`,`تنظيف الملف الشخصي تلقائياً`],"Run every this many analysed prompts":[`每隔多少条已分析的提示运行一次`,`التشغيل كل عدد من المطالبات المحللة`],"Save interval":[`保存间隔`,`حفظ الفاصل`],"Enter a whole number from 50 to 100000.":[`请输入 50 到 100000 之间的整数。`,`أدخل عدداً صحيحاً من 50 إلى 100000.`],"Saved. Changes apply at the next learning pass.":[`已保存。更改将在下一次学习时生效。`,`تم الحفظ. تنطبق التغييرات في جولة التعلّم التالية.`],"Analyse waiting prompts":[`分析等待处理的提示`,`تحليل المطالبات المنتظرة`],"Re-analyse chat history":[`重新分析聊天记录`,`إعادة تحليل سجل المحادثات`],"Analyse waiting prompts reads prompts already inside OMMS with the saved external API, 50 eligible prompts per analysis call. Completed history is not re-analysed. Preferences, patterns, and workflows are the outputs.":[`分析等待处理的提示使用已保存的外部 API,读取 OMMS 内已有的提示,每次分析调用处理 50 条符合条件的提示。不会重新分析已完成的历史记录。输出包括偏好、模式和工作流程。`,`يقرأ تحليل المطالبات المنتظرة المطالبات الموجودة داخل OMMS عبر واجهة API الخارجية المحفوظة، بمعدل 50 مطالبة مؤهلة لكل اتصال تحليل. لا يُعاد تحليل السجل المكتمل. المخرجات هي التفضيلات والأنماط وسير العمل.`],"Analysis calls are an estimate. Matching, deduplication, retries, and newly waiting prompts can add calls.":[`分析调用次数为估计值。匹配、去重、重试和新增的等待提示可能增加调用次数。`,`اتصالات التحليل تقديرية. قد تضيف المطابقة وإزالة التكرار وإعادة المحاولة والمطالبات المنتظرة الجديدة اتصالات أخرى.`],"Re-analyse chat history opens a forced profile-only import. It preserves your profile and project memories. Preview and confirmation are required. Each profile prompt can be forcibly re-analysed once.":[`重新分析聊天记录会打开强制仅导入画像的流程。现有画像和项目记忆将保留。必须先预览并确认。每条画像提示只能强制重新分析一次。`,`تفتح إعادة تحليل سجل المحادثات استيراداً قسرياً للملف الشخصي فقط. تُحفظ ذاكرة المشروع وملفك الشخصي. تلزم المعاينة والتأكيد. يمكن إعادة تحليل كل مطالبة للملف الشخصي بالقوة مرة واحدة.`],"Automatic import reads older conversations when a host starts. It populates project memories and user profile input. The first backfill fixes a cutoff; later turns use live capture.":[`自动导入在宿主启动时读取较早的对话,填充项目记忆和用户画像输入。首次回填固定截止时间,之后的轮次使用实时捕获。`,`يقرأ الاستيراد التلقائي المحادثات الأقدم عند بدء المضيف. ويضيف ذاكرة المشروع ومدخلات الملف الشخصي. يثبت أول استيراد تاريخاً فاصلاً؛ وتستخدم الرسائل اللاحقة الالتقاط المباشر.`],"A directory map links a recorded project folder to its current folder. Saved maps apply globally to every host at the next import or backfill run. Review changes before saving.":[`目录映射将记录的项目文件夹链接到当前文件夹。保存的映射在下次导入或回填时全局应用于所有宿主。保存前请检查更改。`,`تربط خريطة المجلدات مجلد المشروع المسجل بمجلده الحالي. تنطبق الخرائط المحفوظة على جميع المضيفين في الاستيراد التالي. راجع التغييرات قبل الحفظ.`],"Prompt date from must not be after Prompt date to.":[`提示开始日期不能晚于结束日期。`,`يجب ألا يأتي تاريخ بدء المطالبات بعد تاريخ انتهائها.`],"Profile batch size must be a positive integer.":[`画像批次大小必须为正整数。`,`يجب أن يكون حجم دفعة الملف الشخصي عدداً صحيحاً موجباً.`],Models:[`模型`,`النماذج`],"External API fallback":[`外部 API 备用模型`,`النموذج الاحتياطي عبر واجهة API الخارجية`],none:[`无`,`لا يوجد`],ready:[`就绪`,`جاهز`],"not ready":[`未就绪`,`غير جاهز`],"Credentials (values hidden)":[`凭据(不显示内容)`,`بيانات الاعتماد (القيم مخفية)`],set:[`已设置`,`مضبوط`],"not set":[`未设置`,`غير مضبوط`],"Effective model":[`当前使用模型`,`النموذج المستخدم`],session:[`会话`,`الجلسة`],"external API":[`外部 API`,`واجهة API الخارجية`],unavailable:[`不可用`,`غير متاح`],"Project override is active. Changes to the global file may not take effect here.":[`项目设置优先。全局文件的更改可能不会在此生效。`,`إعدادات المشروع لها الأولوية. قد لا تسري تغييرات الملف العام هنا.`],"Model choice":[`模型选择`,`اختيار النموذج`],"Session model":[`会话模型`,`نموذج الجلسة`],"Manual model":[`手动选择模型`,`اختيار النموذج يدوياً`],"Manual provider/model":[`手动输入提供商/模型`,`إدخال المزوّد/النموذج يدوياً`],"Model list unavailable. Enter provider/model manually.":[`模型列表不可用。请手动输入提供商/模型。`,`قائمة النماذج غير متاحة. أدخل المزوّد/النموذج يدوياً.`],"OpenCode model list unavailable":[`OpenCode 模型列表不可用`,`قائمة نماذج OpenCode غير متاحة`],"OMMS could not find OpenCode on this computer, so it cannot list OpenCode's models here. Type the model as provider/model, for example zai-coding-plan/glm-5.3. If OpenCode is installed, open an OpenCode session and reload this page.":[`OMMS 在这台电脑上找不到 OpenCode,因此无法在此列出 OpenCode 的模型。请按 提供商/模型 格式输入模型,例如 zai-coding-plan/glm-5.3。如果已安装 OpenCode,请打开一个 OpenCode 会话,然后重新加载此页面。`,`لم يعثر OMMS على OpenCode في هذا الحاسوب، لذا لا يمكنه عرض نماذج OpenCode هنا. أدخل النموذج بصيغة المزوّد/النموذج، مثل zai-coding-plan/glm-5.3. إذا كان OpenCode مثبتاً، فافتح جلسة OpenCode ثم أعد تحميل هذه الصفحة.`],"OpenCode took too long to send its model list. Reload this page to try again, or type the model as provider/model.":[`OpenCode 发送模型列表的时间过长。请重新加载此页面重试,或按 提供商/模型 格式输入模型。`,`استغرق OpenCode وقتاً طويلاً لإرسال قائمة نماذجه. أعد تحميل هذه الصفحة للمحاولة مرة أخرى، أو أدخل النموذج بصيغة المزوّد/النموذج.`],"OpenCode has no signed-in models. Run `opencode auth login`, then reload this page.":["OpenCode 没有已登录的模型。请运行 `opencode auth login`,然后重新加载此页面。","لا توجد في OpenCode نماذج مسجَّل الدخول إليها. شغّل `opencode auth login` ثم أعد تحميل هذه الصفحة."],"This OpenCode version sent a model list OMMS cannot read. Type the model as provider/model. Update OMMS if this continues.":[`此版本的 OpenCode 发送的模型列表 OMMS 无法读取。请按 提供商/模型 格式输入模型。如果问题持续,请更新 OMMS。`,`أرسل هذا الإصدار من OpenCode قائمة نماذج لا يستطيع OMMS قراءتها. أدخل النموذج بصيغة المزوّد/النموذج. حدّث OMMS إذا استمرت المشكلة.`],"OMMS could not read Pi's model list. Type the model as provider/model.":[`OMMS 无法读取 Pi 的模型列表。请按 提供商/模型 格式输入模型。`,`تعذّر على OMMS قراءة قائمة نماذج Pi. أدخل النموذج بصيغة المزوّد/النموذج.`],"Pi has no signed-in models. Sign in to a provider in Pi, then reload this page.":[`Pi 没有已登录的模型。请在 Pi 中登录一个提供商,然后重新加载此页面。`,`لا توجد في Pi نماذج مسجَّل الدخول إليها. سجّل الدخول إلى مزوّد في Pi ثم أعد تحميل هذه الصفحة.`],"Save model":[`保存模型`,`حفظ النموذج`],"Enter a model as provider/model.":[`按 提供商/模型 格式输入。`,`أدخل النموذج بصيغة المزوّد/النموذج.`],"Saved. New capture and profile work uses these settings.":[`已保存。下一次捕获和用户画像将使用这些设置。`,`تم الحفظ. ستستخدم عمليات الالتقاط والملف الشخصي الجديدة هذه الإعدادات.`],"Saved. OMMS now reads ~/.config/omms/omms.jsonc. The legacy config was kept.":[`已保存。OMMS 现在读取 ~/.config/omms/omms.jsonc,旧配置保留。`,`تم الحفظ. يقرأ OMMS الآن الملف ~/.config/omms/omms.jsonc مع الاحتفاظ بالإعدادات القديمة.`],"Current settings were reloaded; check the values and save again.":[`已重新加载当前设置;检查数值后再次保存。`,`أُعيد تحميل الإعدادات الحالية. راجع القيم ثم احفظ مجدداً.`],"Capture diagnostics":[`捕获诊断`,`تشخيص الالتقاط`],"Time range":[`时间范围`,`الفترة الزمنية`],"24 hours":[`24 小时`,`24 ساعة`],"7 days":[`7 天`,`7 أيام`],"30 days":[`30 天`,`30 يوماً`],"90 days":[`90 天`,`90 يوماً`],"Host / model":[`主机 / 模型`,`المضيف / النموذج`],Saved:[`已保存`,`محفوظ`],Skipped:[`已跳过`,`متجاوز`],Failed:[`失败`,`فشل`],Total:[`总数`,`المجموع`],"Failure reasons":[`失败原因`,`أسباب الفشل`],"Recent attempts":[`最近尝试`,`المحاولات الأخيرة`],Time:[`时间`,`الوقت`],Host:[`主机`,`المضيف`],Source:[`来源`,`المصدر`],Session:[`会话`,`الجلسة`],Path:[`路径`,`المسار`],Model:[`模型`,`النموذج`],Stop:[`结束原因`,`سبب التوقف`],Blocks:[`区块`,`الكتل`],Prompt:[`提示词长度`,`طول الطلب`],Reply:[`回复长度`,`طول الرد`],Duration:[`耗时`,`المدة`],Outcome:[`结果`,`النتيجة`],Reason:[`原因`,`السبب`],"Save capture traces":[`保存捕获追踪`,`حفظ تتبعات الالتقاط`],"Traces can contain conversation content after redaction. Keep tracing off unless you need it for debugging.":[`追踪文件在脱敏后仍可能包含对话内容。仅在调试时开启。`,`قد تحتوي التتبعات على محتوى المحادثة بعد التنقيح. فعّلها عند التصحيح فقط.`],"This project turns tracing off. The global switch cannot turn it on here.":[`此项目已关闭追踪。全局开关无法在此开启。`,`أوقف هذا المشروع التتبع. لا يمكن للمفتاح العام تفعيله هنا.`],"Trace retention (days)":[`追踪保留天数`,`مدة حفظ التتبعات (بالأيام)`],"Attempt retention (days)":[`尝试记录保留天数`,`مدة حفظ المحاولات (بالأيام)`],"Retry retention (hours)":[`重试保留小时数`,`مدة حفظ إعادة المحاولة (بالساعات)`],"When the capture model cannot be reached, OMMS keeps the turn and tries again later. Queued turns can hold conversation content after redaction. 0 turns the queue off and deletes waiting turns.":[`捕获模型无法访问时,OMMS 会保留该轮对话并稍后重试。排队的对话在脱敏后仍可能包含对话内容。设为 0 会关闭队列并删除等待中的对话。`,`عندما يتعذر الوصول إلى نموذج الالتقاط، يحتفظ OMMS بالجولة ويعيد المحاولة لاحقاً. قد تحتوي الجولات المنتظرة على محتوى المحادثة بعد التنقيح. القيمة 0 توقف قائمة الانتظار وتحذف الجولات المنتظرة.`],"Turns waiting for retry":[`等待重试的对话`,`الجولات المنتظرة لإعادة المحاولة`],"Retry now":[`立即重试`,`أعد المحاولة الآن`],"Retrying now.":[`正在重试。`,`تجري إعادة المحاولة الآن.`],"A retry is already running.":[`重试已在运行。`,`إعادة المحاولة قيد التشغيل بالفعل.`],"These turns retry at the next Pi session start.":[`这些对话将在下次启动 Pi 会话时重试。`,`ستُعاد محاولة هذه الجولات عند بدء جلسة Pi التالية.`],"These turns retry at the next OpenCode session start.":[`这些对话将在下次启动 OpenCode 会话时重试。`,`ستُعاد محاولة هذه الجولات عند بدء جلسة OpenCode التالية.`],"These turns retry at the next Claude Code session start.":[`这些对话将在下次启动 Claude Code 会话时重试。`,`ستُعاد محاولة هذه الجولات عند بدء جلسة Claude Code التالية.`],"Claude Code capture uses the external API.":[`Claude Code 捕获使用外部 API。`,`يستخدم التقاط Claude Code واجهة API الخارجية.`],"Claude Code capture is off. Complete the external API settings.":[`Claude Code 捕获已关闭。请完成外部 API 设置。`,`التقاط Claude Code متوقف. أكمل إعدادات واجهة API الخارجية.`],"Missing settings":[`缺少的设置`,`الإعدادات الناقصة`],"memoryModel is not configured":[`未配置 memoryModel`,`لم يُضبط memoryModel`],"memoryApiUrl is not configured":[`未配置 memoryApiUrl`,`لم يُضبط memoryApiUrl`],"memoryApiKey is not configured":[`未配置 memoryApiKey`,`لم يُضبط memoryApiKey`],"memoryApiKey contains a placeholder value":[`memoryApiKey 包含占位值`,`يحتوي memoryApiKey على قيمة نائبة`],"Claude Code backfill always uses the external API. It has no backfill model setting.":[`Claude Code 回填始终使用外部 API,没有回填模型设置。`,`يستخدم استيراد Claude Code دائماً واجهة API الخارجية، ولا يوجد له إعداد لنموذج الاستيراد.`],"Claude Code transcripts folder":[`Claude Code 对话记录文件夹`,`مجلد سجلات محادثات Claude Code`],"Claude Code transcripts":[`Claude Code 对话记录`,`سجلات محادثات Claude Code`],found:[`已找到`,`موجود`],"not found":[`未找到`,`غير موجود`],"Claude Code imports always use the external API.":[`Claude Code 导入始终使用外部 API。`,`يستخدم استيراد Claude Code دائماً واجهة API الخارجية.`],"Claude Code imports use the external API. Complete the external API settings.":[`Claude Code 导入使用外部 API。请完成外部 API 设置。`,`يستخدم استيراد Claude Code واجهة API الخارجية. أكمل إعدادات واجهة API الخارجية.`],"Trace files":[`追踪文件`,`ملفات التتبع`],View:[`查看`,`عرض`],Delete:[`删除`,`حذف`],Health:[`健康检查`,`فحص الحالة`],"Config files":[`配置文件`,`ملفات الإعدادات`],"Memory store":[`记忆存储`,`مخزن الذاكرة`],Embedding:[`嵌入模型`,`نموذج التضمين`],"Web binding":[`网页服务绑定`,`ربط خادم الويب`],"OpenCode model":[`OpenCode 模型`,`نموذج OpenCode`],"Pi model":[`Pi 模型`,`نموذج Pi`],"Capture failures (24 hours)":[`捕获失败(24 小时)`,`فشل الالتقاط (24 ساعة)`],"OpenCode model test":[`OpenCode 模型测试`,`اختبار نموذج OpenCode`],"Pi model test":[`Pi 模型测试`,`اختبار نموذج Pi`],"Run checks":[`运行检查`,`تشغيل الفحوصات`],"Run checks and test models":[`运行检查并测试模型`,`تشغيل الفحوصات واختبار النماذج`],"Checking…":[`正在检查…`,`جارٍ الفحص…`],pass:[`通过`,`نجاح`],warn:[`警告`,`تحذير`],fail:[`失败`,`فشل`],"Import and backfill":[`导入和回填`,`الاستيراد والاستكمال`],"Automatic import":[`自动导入`,`الاستيراد التلقائي`],"Automatic import makes model calls. Changes apply at the next host start. Turning it off stops a running import after the current exchange.":[`自动导入会调用模型。更改在下次启动主机时生效。关闭后,正在运行的导入将在当前轮次结束后停止。`,`يستدعي الاستيراد التلقائي النموذج. تسري التغييرات عند بدء المضيف التالي. يوقف التعطيل الاستيراد بعد التبادل الحالي.`],"Import past chats automatically":[`自动导入过去的对话`,`استيراد المحادثات السابقة تلقائياً`],"Backfill model":[`历史导入模型`,`نموذج استيراد السجل`],"Same as live capture":[`与实时捕获相同`,`مثل الالتقاط المباشر`],"Saved. Changes apply at the next host start.":[`已保存。更改在下次启动主机时生效。`,`تم الحفظ. تسري التغييرات عند بدء المضيف التالي.`],State:[`状态`,`الحالة`],"not started":[`尚未开始`,`لم يبدأ`],"not-started":[`尚未开始`,`لم يبدأ`],Imported:[`已导入`,`مستورَد`],Pending:[`待处理`,`معلّق`],"Unresolved sessions":[`目录未解析的会话`,`جلسات بمجلدات غير محددة`],Cutoff:[`截止时间`,`وقت القطع`],stopped:[`已停止`,`توقف`],"Web app":[`网页应用`,`تطبيق الويب`],"Start web app at login":[`登录时启动网页应用`,`بدء تطبيق الويب عند تسجيل الدخول`],"Login item":[`登录启动项`,`عنصر بدء تسجيل الدخول`],"not installed":[`未安装`,`غير مثبّت`],"not-installed":[`未安装`,`غير مثبّت`],installed:[`已安装`,`مثبّت`],unsupported:[`不受支持`,`غير مدعوم`],"no-runtime":[`缺少运行环境`,`بيئة التشغيل غير متاحة`],"no-package":[`缺少软件包`,`الحزمة غير متاحة`],"no-launcher":[`缺少启动器`,`المشغّل غير متاح`],"Login items are unsupported on this platform.":[`此平台不支持登录启动项。`,`عناصر بدء تسجيل الدخول غير مدعومة على هذا النظام.`],"Install Node or Bun to start the web app at login.":[`安装 Node 或 Bun 后,网页应用才能在登录时启动。`,`ثبّت Node أو Bun لبدء تطبيق الويب عند تسجيل الدخول.`],"Use these commands to apply the change now:":[`使用以下命令立即应用更改:`,`استخدم هذه الأوامر لتطبيق التغيير الآن:`],"Saved. The login item changes at the next Pi or OpenCode start.":[`已保存。登录启动项将在下次启动 Pi 或 OpenCode 时更新。`,`تم الحفظ. يتغير عنصر بدء التشغيل عند بدء Pi أو OpenCode التالي.`],"History host":[`历史记录主机`,`مضيف السجل`],Scope:[`范围`,`النطاق`],"Current project":[`当前项目`,`المشروع الحالي`],"All projects":[`所有项目`,`كل المشاريع`],"Project directory":[`项目目录`,`مجلد المشروع`],"Current directory":[`当前目录`,`المجلد الحالي`],"Profile batch size":[`用户画像批量大小`,`حجم دفعة الملف الشخصي`],"Directory maps (old=new, one per line)":[`目录映射(旧=新,每行一条)`,`تعيين المجلدات (قديم=جديد، واحد في كل سطر)`],"Force reimport":[`强制重新导入`,`فرض إعادة الاستيراد`],"Skip memories":[`跳过记忆`,`تجاوز الذكريات`],"Skip profile":[`跳过用户画像`,`تجاوز الملف الشخصي`],"Import model":[`导入模型`,`نموذج الاستيراد`],"Saved external API":[`已保存的外部 API`,`واجهة API الخارجية المحفوظة`],"Preview (dry run)":[`预览(不写入)`,`معاينة (تشغيل تجريبي)`],"Start import":[`开始导入`,`بدء الاستيراد`],"Cancel after current unit":[`完成当前单元后取消`,`الإلغاء بعد الوحدة الحالية`],"Directory maps must be old=new, one per line":[`目录映射须为 旧=新,每行一条`,`يجب أن يكون تعيين المجلدات بصيغة قديم=جديد، واحد في كل سطر`],running:[`运行中`,`جارٍ التشغيل`],cancelling:[`正在取消`,`جارٍ الإلغاء`],cancelled:[`已取消`,`أُلغي`],done:[`已完成`,`اكتمل`],failed:[`失败`,`فشل`],units:[`单元`,`وحدات`],"List sessions":[`列出会话`,`عرض الجلسات`],"Refresh list":[`刷新列表`,`تحديث القائمة`],"Advanced options":[`高级选项`,`خيارات متقدمة`],"Hide advanced options":[`隐藏高级选项`,`إخفاء الخيارات المتقدمة`],"default location":[`默认位置`,`الموقع الافتراضي`],"Prompt date from":[`提示日期起`,`تاريخ الطلب من`],"Prompt date to":[`提示日期止`,`تاريخ الطلب إلى`],"Prompt dates are inclusive, use your time zone, and filter the turns inside each session, not the list. Empty dates include every turn.":[`提示日期包含首尾两天,按你所在时区计算,只筛选每个会话中的对话轮次,不筛选列表。留空则包含所有轮次。`,`تواريخ الطلب شاملة لليومين، وتُحسب بمنطقتك الزمنية، وتُصفّي الأدوار داخل كل جلسة لا القائمة. تركها فارغة يشمل كل الأدوار.`],"Sessions with directories that no longer exist":[`目录已不存在的会话`,`جلسات لم تعد مجلداتها موجودة`],"Show them and add a directory map":[`显示它们并添加目录映射`,`اعرضها وأضف تعيين مجلد`],Selected:[`已选择`,`المحدد`],"Select all matching":[`选择所有匹配项`,`تحديد كل المطابق`],"Clear selection":[`清除选择`,`مسح التحديد`],Select:[`选择`,`تحديد`],Created:[`创建时间`,`تاريخ الإنشاء`],"Resolved by":[`解析方式`,`طريقة التحديد`],recorded:[`记录的目录`,`المجلد المسجّل`],mapped:[`目录映射`,`تعيين مجلد`],"project root":[`项目根目录`,`جذر المشروع`],missing:[`缺失`,`مفقود`],"No sessions match.":[`没有匹配的会话。`,`لا توجد جلسات مطابقة.`],Previous:[`上一页`,`السابق`],Next:[`下一页`,`التالي`],None:[`无`,`لا شيء`],"Configured, not tested.":[`已配置,未测试。`,`مُعدّ، لم يُختبر.`],"An import with an OpenCode signed-in model runs from the terminal or with /import in OpenCode.":[`使用 OpenCode 已登录模型的导入需在终端运行,或在 OpenCode 中使用 /import。`,`يتم الاستيراد بنموذج OpenCode المسجَّل الدخول من الطرفية أو بالأمر /import داخل OpenCode.`],"The chosen OpenCode model is not connected here. An import with an OpenCode signed-in model runs from the terminal or with /import in OpenCode. Choose the external API for a web import.":[`所选 OpenCode 模型在此处未连接。使用 OpenCode 已登录模型的导入需在终端运行,或在 OpenCode 中使用 /import。网页导入请选择外部 API。`,`نموذج OpenCode المختار غير متصل هنا. يتم الاستيراد بنموذج OpenCode المسجَّل الدخول من الطرفية أو بالأمر /import داخل OpenCode. اختر واجهة API الخارجية للاستيراد من الصفحة.`],"Test models in Health":[`在健康检查中测试模型`,`اختبر النماذج في قسم السلامة`],Import:[`导入`,`استيراد`],sessions:[`个会话`,`جلسات`],"1 session":[`1 个会话`,`جلسة واحدة`],"List sessions first.":[`请先列出会话。`,`اعرض الجلسات أولاً.`],"Options changed. Refresh the session list first.":[`选项已更改。请先刷新会话列表。`,`تغيّرت الخيارات. حدّث قائمة الجلسات أولاً.`],"Select at least one session.":[`请至少选择一个会话。`,`حدّد جلسة واحدة على الأقل.`],"Select at most 1000 sessions one by one, or use Select all matching.":[`逐个选择最多 1000 个会话,或使用“选择所有匹配项”。`,`حدّد 1000 جلسة كحد أقصى واحدة تلو الأخرى، أو استخدم «تحديد كل المطابق».`],"Model readiness is unknown. Reload the page.":[`无法确定模型是否就绪。请重新加载页面。`,`حالة جاهزية النموذج غير معروفة. أعد تحميل الصفحة.`],"No import model is ready. Connect a model in OpenCode or complete the external API settings.":[`没有可用的导入模型。请在 OpenCode 中连接模型,或补全外部 API 设置。`,`لا يوجد نموذج استيراد جاهز. اربط نموذجاً في OpenCode أو أكمل إعدادات واجهة API الخارجية.`],"The external API is not ready":[`外部 API 未就绪`,`واجهة API الخارجية غير جاهزة`],"The external API has no memoryModel in the global config":[`全局配置中缺少外部 API 的 memoryModel`,`لا يحتوي الإعداد العام على memoryModel لواجهة API الخارجية`],"The external API has no memoryApiUrl in the global config":[`全局配置中缺少外部 API 的 memoryApiUrl`,`لا يحتوي الإعداد العام على memoryApiUrl لواجهة API الخارجية`],"The external API key is missing in the OpenCode process; check memoryApiKey and its env:// or file:// source":[`OpenCode 进程中缺少外部 API 密钥;请检查 memoryApiKey 及其 env:// 或 file:// 来源`,`مفتاح واجهة API الخارجية غير موجود في عملية OpenCode؛ تحقّق من memoryApiKey ومصدره env:// أو file://`],"The memoryProvider in the global config is not supported for imports":[`全局配置中的 memoryProvider 不支持导入`,`مزوّد memoryProvider في الإعداد العام غير مدعوم للاستيراد`],"Pi sessions folder or one .jsonl session file":[`Pi 会话文件夹或单个 .jsonl 会话文件`,`مجلد جلسات Pi أو ملف جلسة .jsonl واحد`],"OpenCode database file":[`OpenCode 数据库文件`,`ملف قاعدة بيانات OpenCode`],"Absolute path, for example on a mounted volume":[`绝对路径,例如已挂载卷上的路径`,`مسار مطلق، مثلاً على وحدة تخزين مركّبة`],"Use this source":[`使用此来源`,`استخدم هذا المصدر`],Browse:[`浏览`,`استعراض`],"Use the default location":[`使用默认位置`,`استخدم الموقع الافتراضي`],"Chosen source":[`已选来源`,`المصدر المختار`],Choose:[`选择`,`اختيار`],"Only the first 500 entries are shown.":[`仅显示前 500 项。`,`تُعرض أول 500 عنصر فقط.`],"Reload the page before saving again.":[`再次保存前请重新加载页面。`,`أعد تحميل الصفحة قبل الحفظ مرة أخرى.`],"The current settings could not be reloaded. Reload the page.":[`无法重新加载当前设置。请重新加载页面。`,`تعذّر إعادة تحميل الإعدادات الحالية. أعد تحميل الصفحة.`],Log:[`日志`,`السجل`],"Capture attempts only":[`仅显示捕获尝试`,`محاولات الالتقاط فقط`],Refresh:[`刷新`,`تحديث`],"Copy log path":[`复制日志路径`,`نسخ مسار السجل`],"Log lines":[`日志行`,`أسطر السجل`],"No log has been written yet.":[`尚未写入日志。`,`لم يُكتب سجل بعد.`],"Loading log…":[`正在加载日志…`,`جارٍ تحميل السجل…`],Level:[`级别`,`المستوى`],Warning:[`警告`,`تحذير`],Error:[`错误`,`خطأ`],info:[`信息`,`معلومات`],error:[`错误`,`خطأ`],"Level guessed from the message":[`级别由消息内容推测`,`المستوى مُخمَّن من نص الرسالة`],"Copy visible records":[`复制可见记录`,`نسخ السجلات المعروضة`],Copied:[`已复制`,`تم النسخ`],"No matching log records.":[`没有匹配的日志记录。`,`لا توجد سجلات مطابقة.`],"External API":[`外部 API`,`واجهة API الخارجية`],"An OpenAI- or Anthropic-compatible endpoint that either host can use for capture and backfill.":[`兼容 OpenAI 或 Anthropic 的端点,两个宿主都可用于捕获和回填。`,`نقطة نهاية متوافقة مع OpenAI أو Anthropic يمكن لأي مضيف استخدامها للالتقاط والاستيراد.`],Provider:[`提供商`,`المزوّد`],"API URL":[`API 地址`,`عنوان API`],"API key":[`API 密钥`,`مفتاح API`],"Save endpoint":[`保存端点`,`حفظ نقطة النهاية`],"Nothing to save.":[`没有需要保存的内容。`,`لا يوجد ما يُحفظ.`],"Key source":[`密钥来源`,`مصدر المفتاح`],"environment variable":[`环境变量`,`متغير البيئة`],"key file":[`密钥文件`,`ملف المفتاح`],"set in the config file":[`在配置文件中设置`,`مضبوط في ملف الإعدادات`],"resolves in the web app":[`可在网页应用中解析`,`يُقرأ في تطبيق الويب`],"does not resolve in the web app":[`无法在网页应用中解析`,`لا يُقرأ في تطبيق الويب`],"A login web app does not see variables set only in a shell profile; a key file works everywhere.":[`登录时启动的网页应用看不到仅在 shell 配置文件中设置的变量;密钥文件在任何地方都可用。`,`تطبيق الويب الذي يبدأ عند تسجيل الدخول لا يرى المتغيرات المضبوطة في ملف الصدفة فقط؛ ملف المفتاح يعمل في كل مكان.`],"The key does not resolve in this web app. Save it to a key file instead.":[`此网页应用无法解析该密钥。请改为保存到密钥文件。`,`لا يُقرأ المفتاح في تطبيق الويب هذا. احفظه في ملف مفتاح بدلاً من ذلك.`],"Environment variable":[`环境变量`,`متغير البيئة`],"Key file":[`密钥文件`,`ملف المفتاح`],"Save key to a private file":[`将密钥保存到私有文件`,`حفظ المفتاح في ملف خاص`],"Variable name":[`变量名`,`اسم المتغير`],"Key file path":[`密钥文件路径`,`مسار ملف المفتاح`],"Key file name":[`密钥文件名`,`اسم ملف المفتاح`],"The key is written to ~/.config/omms/secrets/ readable only by you. It is never shown again.":[`密钥写入 ~/.config/omms/secrets/,仅你可读,之后不再显示。`,`يُكتب المفتاح في ~/.config/omms/secrets/ ولا يقرؤه غيرك، ولن يُعرض مرة أخرى.`],"Save key source":[`保存密钥来源`,`حفظ مصدر المفتاح`],"Key source saved.":[`密钥来源已保存。`,`تم حفظ مصدر المفتاح.`],"A key file with this name exists. Replace it?":[`已存在同名密钥文件。要替换吗?`,`يوجد ملف مفتاح بهذا الاسم. هل تريد استبداله؟`],"Enter a variable name such as ZAI_API_KEY":[`请输入变量名,例如 ZAI_API_KEY`,`أدخل اسم متغير مثل ZAI_API_KEY`],"Enter the path of a key file":[`请输入密钥文件路径`,`أدخل مسار ملف المفتاح`],"Name the key file with letters, digits, dashes, or underscores":[`密钥文件名只能包含字母、数字、短横线或下划线`,`سمِّ ملف المفتاح بحروف أو أرقام أو شرطات أو شرطات سفلية`],"Paste the key":[`请粘贴密钥`,`الصق المفتاح`],Test:[`测试`,`اختبار`],"Test call succeeded":[`测试调用成功`,`نجح استدعاء الاختبار`],"Test call failed":[`测试调用失败`,`فشل استدعاء الاختبار`],"External API needs":[`外部 API 缺少`,`تحتاج واجهة API الخارجية إلى`],"Automatic import makes model calls. A model change applies at the next run. Turning it off stops a running import after the current exchange.":[`自动导入会调用模型。模型更改在下次运行时生效。关闭后,正在进行的导入会在当前对话完成后停止。`,`يستدعي الاستيراد التلقائي النماذج. يسري تغيير النموذج في التشغيل التالي. إيقافه يوقف الاستيراد الجاري بعد المحادثة الحالية.`],"Saved. Changes apply at the next run.":[`已保存。更改在下次运行时生效。`,`تم الحفظ. تسري التغييرات في التشغيل التالي.`],paused:[`已暂停`,`متوقف مؤقتاً`],"started from auto":[`自动启动`,`بدأ تلقائياً`],"started from web":[`从网页启动`,`بدأ من الويب`],"started from cli":[`从终端启动`,`بدأ من الطرفية`],"started from slash":[`从斜杠命令启动`,`بدأ من أمر الشرطة المائلة`],"Minutes left":[`剩余分钟`,`الدقائق المتبقية`],unknown:[`未知`,`غير معروف`],about:[`约`,`حوالي`],Pause:[`暂停`,`إيقاف مؤقت`],Resume:[`继续`,`استئناف`],"Pausing after the current exchange.":[`将在当前对话完成后暂停。`,`سيتوقف مؤقتاً بعد المحادثة الحالية.`],"Backfill started.":[`回填已开始。`,`بدأ الاستيراد.`],"The list is still loading. Try again in a moment.":[`列表仍在加载。请稍后再试。`,`لا تزال القائمة قيد التحميل. حاول مرة أخرى بعد لحظة.`],"Paused. No import starts until you resume.":[`已暂停。恢复前不会开始导入。`,`تم الإيقاف مؤقتاً. لن يبدأ أي استيراد حتى تستأنفه.`],"Directory maps":[`目录映射`,`خرائط المجلدات`],"Map a directory that was moved or deleted to the project it belongs to. A change applies to the next import or backfill run.":[`将已移动或删除的目录映射到其所属项目。更改在下次导入或回填时生效。`,`اربط مجلداً نُقل أو حُذف بالمشروع الذي ينتمي إليه. يسري التغيير في الاستيراد التالي.`],"Saved maps":[`已保存的映射`,`الخرائط المحفوظة`],Keep:[`保留`,`إبقاء`],Remove:[`移除`,`إزالة`],"Unresolved directories":[`无法解析的目录`,`مجلدات غير محلولة`],"No unresolved directories in the latest run.":[`最近一次运行没有无法解析的目录。`,`لا توجد مجلدات غير محلولة في آخر تشغيل.`],"No suggestion found.":[`未找到建议。`,`لم يُعثر على اقتراح.`],"Target directory":[`目标目录`,`المجلد الهدف`],"Saved. Maps apply to the next import or backfill run.":[`已保存。映射在下次导入或回填时生效。`,`تم الحفظ. تسري الخرائط في الاستيراد التالي.`],"Memory language":[`记忆语言`,`لغة الذاكرة`],"The language that new memory summaries are written in. Automatic detects it from your prompt, but a Latin-script prompt under 100 characters counts as English.":[`新记忆摘要使用的语言。“自动”会根据你的提示检测语言,但少于 100 个字符的拉丁字母提示按英语处理。`,`اللغة التي تُكتب بها ملخصات الذاكرة الجديدة. يكتشفها الوضع التلقائي من موجّهك، لكن الموجّه بالأحرف اللاتينية الأقصر من 100 حرف يُعدّ إنجليزياً.`],"Summary language":[`摘要语言`,`لغة الملخص`],Appearance:[`外观`,`المظهر`],Theme:[`主题`,`السمة`],"Theme mode":[`主题模式`,`وضع السمة`],System:[`系统`,`النظام`],Light:[`浅色`,`فاتح`],Dark:[`深色`,`داكن`],"Light theme":[`浅色主题`,`السمة الفاتحة`],"Dark theme":[`深色主题`,`السمة الداكنة`],"On screen now":[`当前显示`,`معروضة الآن`],"No theme matches.":[`没有匹配的主题。`,`لا توجد سمة مطابقة.`],"Filter themes":[`筛选主题`,`تصفية السمات`],"System follows your operating system and switches between the light and the dark theme. The choice stays in this browser.":[`“系统”跟随操作系统,在浅色和深色主题之间切换。此选择只保存在此浏览器中。`,`يتبع «النظام» نظام التشغيل ويبدّل بين السمة الفاتحة والداكنة. يبقى الاختيار في هذا المتصفح.`],"Date and time":[`日期和时间`,`التاريخ والوقت`],"How dates and times show in this web app. The choice stays in this browser.":[`此网页应用中日期和时间的显示方式。此选择只保存在此浏览器中。`,`طريقة عرض التواريخ والأوقات في تطبيق الويب هذا. يبقى الاختيار في هذا المتصفح.`],"Date format":[`日期格式`,`تنسيق التاريخ`],"Time format":[`时间格式`,`تنسيق الوقت`],"Day month year":[`日 月 年`,`يوم شهر سنة`],"Month day year":[`月 日 年`,`شهر يوم سنة`],"Year-month-day":[`年-月-日`,`سنة-شهر-يوم`],"24-hour":[`24 小时制`,`24 ساعة`],"12-hour":[`12 小时制`,`12 ساعة`],Automatic:[`自动`,`تلقائي`],"Saved. New memories use this language.":[`已保存。新记忆将使用此语言。`,`تم الحفظ. ستستخدم الذكريات الجديدة هذه اللغة.`],"Claude Code folder":[`Claude Code 文件夹`,`مجلد Claude Code`],"Set this when Claude Code does not use ~/.claude, for example when you start it with CLAUDE_CONFIG_DIR. Leave it empty to use the default.":[`当 Claude Code 不使用 ~/.claude 时(例如用 CLAUDE_CONFIG_DIR 启动它),请设置此项。留空则使用默认文件夹。`,`اضبط هذا عندما لا يستخدم Claude Code المجلد ~/.claude، مثلاً عند تشغيله مع CLAUDE_CONFIG_DIR. اتركه فارغاً لاستخدام المجلد الافتراضي.`],"Save folder":[`保存文件夹`,`حفظ المجلد`],"Transcripts folder in use":[`正在使用的会话记录文件夹`,`مجلد سجلات الجلسات المستخدم`],From:[`来源`,`المصدر`],"this setting":[`此设置`,`هذا الإعداد`],"the CLAUDE_CONFIG_DIR variable of the web app":[`网页应用的 CLAUDE_CONFIG_DIR 变量`,`متغير CLAUDE_CONFIG_DIR لتطبيق الويب`],"the default folder":[`默认文件夹`,`المجلد الافتراضي`],"This folder does not exist. Claude Code capture and import will not work:":[`此文件夹不存在。Claude Code 的捕获和导入将无法工作:`,`هذا المجلد غير موجود. لن يعمل الالتقاط والاستيراد في Claude Code:`],"Enter a full path, or a path that starts with ~/.":[`请输入完整路径,或以 ~/ 开头的路径。`,`أدخل مساراً كاملاً، أو مساراً يبدأ بـ ~/.`],"Saved. Capture and import use this folder now.":[`已保存。捕获和导入现在使用此文件夹。`,`تم الحفظ. يستخدم الالتقاط والاستيراد هذا المجلد الآن.`],"Running version":[`运行版本`,`الإصدار الجاري`],"Global command":[`全局命令`,`الأمر العام`],"not installed globally":[`未全局安装`,`غير مثبت عمومياً`],"A newer OMMS copy runs in place of the global install. The global install is optional. To update it:":[`正在运行的是更新的 OMMS 副本,而不是全局安装。全局安装是可选的。更新方法:`,`تعمل نسخة OMMS أحدث بدلاً من التثبيت العام. التثبيت العام اختياري. لتحديثه:`],"The global install is newer than the running OMMS. The next Pi or OpenCode start replaces the web app.":[`全局安装比正在运行的 OMMS 更新。下次启动 Pi 或 OpenCode 时将替换网页应用。`,`التثبيت العام أحدث من OMMS الجاري. سيستبدل التشغيل التالي لـ Pi أو OpenCode تطبيق الويب.`],"OMMS is not installed globally. A global install is optional.":[`OMMS 未全局安装。全局安装是可选的。`,`OMMS غير مثبت عمومياً. التثبيت العام اختياري.`],"Keys and access":[`密钥与访问`,`المفاتيح والوصول`],"not needed":[`不需要`,`غير مطلوب`],"External API key":[`外部 API 密钥`,`مفتاح واجهة API الخارجية`],"Embedding server key":[`嵌入服务器密钥`,`مفتاح خادم التضمين`],"Capture and profile learning through the external API. Claude Code always uses it.":[`通过外部 API 进行捕获和用户画像学习。Claude Code 始终使用它。`,`الالتقاط وتعلّم الملف الشخصي عبر واجهة API الخارجية. يستخدمه Claude Code دائماً.`],"Sent to an embedding server on another machine.":[`发送给另一台机器上的嵌入服务器。`,`يُرسَل إلى خادم تضمين على جهاز آخر.`],"Let scripts and other computers call the web app's API.":[`允许脚本和其他电脑调用网页应用的 API。`,`تتيح للبرامج النصية والحواسيب الأخرى استدعاء واجهة API لتطبيق الويب.`],"Asks for a user name and password before the page opens.":[`打开页面前要求输入用户名和密码。`,`يطلب اسم مستخدم وكلمة مرور قبل فتح الصفحة.`],"External API card":[`外部 API 卡片`,`بطاقة واجهة API الخارجية`],"Embedding card":[`嵌入卡片`,`بطاقة التضمين`],"Table below":[`下方表格`,`الجدول أدناه`],"Form below":[`下方表单`,`النموذج أدناه`],"API tokens":[`API 令牌`,`رموز API`],"Browser password":[`浏览器密码`,`كلمة مرور المتصفح`],"The config file still sets webServerApiToken. OMMS imported it once as the token “from config file” and no longer reads the key. Use the token table instead.":[`配置文件仍设置了 webServerApiToken。OMMS 已将其导入一次,作为令牌“from config file”,之后不再读取该键。请改用令牌表。`,`لا يزال ملف الإعدادات يضبط webServerApiToken. استورده OMMS مرة واحدة كرمز باسم “from config file” ولم يعد يقرأ هذا المفتاح. استخدم جدول الرموز بدلاً منه.`],"Open this page on the computer that runs OMMS to manage tokens and the password.":[`请在运行 OMMS 的电脑上打开此页面,以管理令牌和密码。`,`افتح هذه الصفحة على الحاسوب الذي يشغّل OMMS لإدارة الرموز وكلمة المرور.`],"Revoke this token? Scripts that use it stop working.":[`撤销此令牌?使用它的脚本将停止工作。`,`إلغاء هذا الرمز؟ ستتوقف البرامج النصية التي تستخدمه عن العمل.`],"No browser password is set.":[`未设置浏览器密码。`,`لم تُضبط كلمة مرور للمتصفح.`],"A browser password is set for user":[`已为以下用户设置浏览器密码:`,`ضُبطت كلمة مرور المتصفح للمستخدم`],"A browser password is set for your computer user name.":[`已为你的电脑用户名设置浏览器密码。`,`ضُبطت كلمة مرور المتصفح لاسم مستخدم حاسوبك.`],"User name":[`用户名`,`اسم المستخدم`],Password:[`密码`,`كلمة المرور`],"Save password":[`保存密码`,`حفظ كلمة المرور`],"Clear password":[`清除密码`,`مسح كلمة المرور`],"Saved. Restart the web app to use the new browser password.":[`已保存。重启网页应用以使用新的浏览器密码。`,`تم الحفظ. أعد تشغيل تطبيق الويب لاستخدام كلمة مرور المتصفح الجديدة.`],Name:[`名称`,`الاسم`],Expires:[`过期时间`,`تاريخ الانتهاء`],"Last used":[`上次使用`,`آخر استخدام`],Never:[`永不`,`أبداً`],Revoke:[`撤销`,`إلغاء`],Copy:[`复制`,`نسخ`],"Copy this token now. It will not be shown again.":[`请立即复制此令牌。它不会再次显示。`,`انسخ هذا الرمز الآن. لن يُعرض مرة أخرى.`],"Token name":[`令牌名称`,`اسم الرمز`],"Expires after":[`有效期`,`ينتهي بعد`],"Generate token":[`生成令牌`,`إنشاء رمز`],All:[`全部`,`الكل`],Kind:[`类型`,`النوع`],"Built-in model":[`内置模型`,`النموذج المدمج`],"OpenAI-compatible server":[`OpenAI 兼容服务器`,`خادم متوافق مع OpenAI`],"Server URL":[`服务器 URL`,`عنوان URL للخادم`],"Vector size":[`向量维度`,`حجم المتجه`],"Stored memories":[`已存储的记忆`,`الذكريات المخزنة`],"Re-embedding":[`正在重新嵌入`,`جارٍ إعادة التضمين`],"Re-embed finished.":[`重新嵌入已完成。`,`اكتملت إعادة التضمين.`],"Re-embed failed":[`重新嵌入失败`,`فشلت إعادة التضمين`],Retry:[`重试`,`إعادة المحاولة`],Lock:[`锁定`,`قفل`],"Unlock to change":[`解锁以更改`,`افتح القفل للتغيير`],"The model that turns memory text into search vectors. A change re-embeds every memory.":[`将记忆文本转换为搜索向量的模型。更改后会重新嵌入所有记忆。`,`النموذج الذي يحوّل نص الذكريات إلى متجهات بحث. يؤدي تغييره إلى إعادة تضمين كل الذكريات.`],Preset:[`预设`,`إعداد مسبق`],Custom:[`自定义`,`مخصص`],"No key":[`无密钥`,`بلا مفتاح`],"Keep the saved key":[`保留已保存的密钥`,`الاحتفاظ بالمفتاح المحفوظ`],Apply:[`应用`,`تطبيق`],Cancel:[`取消`,`إلغاء الأمر`],"Test passed. Vector size":[`测试通过。向量维度`,`نجح الاختبار. حجم المتجه`],"Test failed":[`测试失败`,`فشل الاختبار`],"Every stored memory will be re-embedded":[`所有已存储的记忆都将重新嵌入`,`ستُعاد عملية تضمين كل الذكريات المخزنة`],"The hosted server is called once for each memory, which may cost money.":[`托管服务器会为每条记忆调用一次,可能产生费用。`,`يُستدعى الخادم المستضاف مرة لكل ذكرى، وقد يكلّف ذلك مالاً.`],"Search results are poor until the re-embed ends.":[`在重新嵌入结束前,搜索结果质量较差。`,`تكون نتائج البحث ضعيفة حتى تنتهي إعادة التضمين.`],"Restart open OpenCode and Pi sessions after the change.":[`更改后请重启已打开的 OpenCode 和 Pi 会话。`,`أعد تشغيل جلسات OpenCode وPi المفتوحة بعد التغيير.`],"Profile learning":[`用户画像学习`,`تعلّم الملف الشخصي`],"Catch up analyses every waiting prompt with the saved external API, 50 prompts for each model call.":[`补齐会使用已保存的外部 API 分析所有等待中的提示词,每次模型调用处理 50 条。`,`يحلّل اللحاق كل الطلبات المنتظرة عبر واجهة API الخارجية المحفوظة، 50 طلباً لكل استدعاء للنموذج.`],"Open this page on the computer that runs OMMS to start a catch-up run.":[`请在运行 OMMS 的电脑上打开此页面以开始补齐。`,`افتح هذه الصفحة على الحاسوب الذي يشغّل OMMS لبدء اللحاق.`],"Prompts waiting for profile learning":[`等待用户画像学习的提示词`,`الطلبات المنتظرة لتعلّم الملف الشخصي`],"Model calls":[`模型调用次数`,`استدعاءات النموذج`],"Batches done":[`已完成批次`,`الدفعات المكتملة`],"Prompts waiting":[`等待中的提示词`,`الطلبات المنتظرة`],Paused:[`已暂停`,`متوقف مؤقتاً`],Finished:[`已完成`,`اكتمل`],Stopped:[`已停止`,`توقّف`],"Catch up profile":[`补齐用户画像`,`اللحاق بالملف الشخصي`],"Start profile learning for the waiting prompts? Model calls":[`为等待中的提示词开始用户画像学习?模型调用次数`,`بدء تعلّم الملف الشخصي للطلبات المنتظرة؟ عدد استدعاءات النموذج`],"never used before":[`从未使用`,`لم يُستخدم من قبل`],"A newer catch-up run took over.":[`较新的补齐任务已接管。`,`تولّت عملية لحاق أحدث المهمة.`],"Browser password cleared. Restart the web app to turn it off.":[`浏览器密码已清除。重启网页应用以关闭它。`,`تم مسح كلمة مرور المتصفح. أعد تشغيل تطبيق الويب لإيقافها.`],Actions:[`操作`,`الإجراءات`],"All exchanges are done. Learning the profile from the imported prompts":[`所有对话已完成。正在从导入的提示中学习画像`,`اكتملت كل المحادثات. يجري تعلّم الملف الشخصي من المطالبات المستوردة`],batches:[`批`,`دفعات`],"Change it in":[`修改位置`,`مكان التغيير`],"Check them, then press Save maps.":[`请检查后点击保存映射。`,`راجعها ثم اضغط حفظ الخرائط.`],Credential:[`凭据`,`بيانات الاعتماد`],Email:[`邮箱`,`البريد الإلكتروني`],Filled:[`已填写`,`تم الملء`],"Finds the project each missing directory belongs to, mostly the main repository of a deleted worktree, and fills it in for you to check. Nothing is saved until you press Save maps.":[`为每个缺失的目录找到所属项目(多为已删除工作树的主仓库),并填入供你检查。点击保存映射之前不会保存任何内容。`,`يعثر على المشروع الذي ينتمي إليه كل مجلد مفقود، وغالباً المستودع الرئيسي لشجرة عمل محذوفة، ويملؤه لتراجعه. لا يُحفظ شيء حتى تضغط حفظ الخرائط.`],Hosts:[`主机`,`المضيفات`],"Import status":[`导入状态`,`حالة الاستيراد`],"in use":[`使用中`,`قيد الاستخدام`],"Last run":[`上次运行`,`آخر تشغيل`],"Last update":[`最后更新`,`آخر تحديث`],"Learning profile":[`正在学习画像`,`يجري تعلّم الملف الشخصي`],"Merge into":[`合并到`,`دمج في`],"Merge this profile into the other one? The source profile is turned off, not deleted.":[`将此画像合并到另一个画像?源画像会被停用,不会被删除。`,`دمج هذا الملف الشخصي في الآخر؟ يُوقَف الملف المصدر ولا يُحذف.`],"Merged.":[`已合并。`,`تم الدمج.`],"model not recorded":[`未记录模型`,`لم يُسجَّل نموذج`],model:[`个模型`,`نموذج`],models:[`个模型`,`نماذج`],"No directory recorded":[`未记录目录`,`لم يُسجَّل مجلد`],"No suggestion":[`无建议`,`لا اقتراح`],"Not started":[`未开始`,`لم يبدأ`],"OMMS keeps one profile for each git email. A folder whose repository has its own email starts a second profile. Choose the profile that is yours, or merge the extra one into it.":[`OMMS 为每个 git 邮箱保留一个画像。若某文件夹的仓库设置了自己的邮箱,就会产生第二个画像。请选择属于你的画像,或把多余的画像合并进去。`,`يحتفظ OMMS بملف شخصي لكل بريد git. المجلد الذي يملك مستودعه بريداً خاصاً يبدأ ملفاً شخصياً ثانياً. اختر ملفك الشخصي، أو ادمج الملف الزائد فيه.`],"Outcomes by host":[`各主机结果`,`النتائج حسب المضيف`],"Partly imported":[`部分已导入`,`مستورد جزئياً`],Patterns:[`模式`,`الأنماط`],pending:[`待处理`,`معلّق`],Preferences:[`偏好`,`التفضيلات`],Profiles:[`画像`,`الملفات الشخصية`],"Prompts analysed":[`已分析提示`,`المطالبات المحلَّلة`],Running:[`运行中`,`قيد التشغيل`],"Saved maps apply to every host.":[`已保存的映射适用于所有主机。`,`تنطبق الخرائط المحفوظة على كل المضيفات.`],"Saved: a memory was stored. Skipped: the model or a rule found nothing worth keeping, or the turn was private or trivial. Failed: the attempt hit an error. Total: the three added up. Each percentage is a share of its row's total.":[`已保存:存储了一条记忆。已跳过:模型或规则认为没有值得保留的内容,或该轮为私密或琐碎内容。失败:尝试出错。总计:三者之和。每个百分比是该行总计中的占比。`,`محفوظ: خُزّنت ذاكرة. متجاوز: لم يجد النموذج أو قاعدة ما يستحق الحفظ، أو كانت الجولة خاصة أو تافهة. فشل: واجهت المحاولة خطأ. الإجمالي: مجموع الثلاثة. كل نسبة هي حصة من إجمالي صفها.`],"Saved. OMMS now uses this profile in every folder.":[`已保存。OMMS 现在在所有文件夹中使用此画像。`,`تم الحفظ. يستخدم OMMS هذا الملف الشخصي الآن في كل المجلدات.`],Directories:[`目录数`,`عدد المجلدات`],"No target chosen":[`尚未选择目标`,`لم يُختر مجلد مستهدف`],"Smart resolve directories":[`智能解析目录`,`حلّ المجلدات تلقائياً`],Exact:[`精确`,`مطابقة تامة`],"Name match":[`名称匹配`,`مطابقة بالاسم`],Guess:[`猜测`,`تخمين`],Confidence:[`可信度`,`درجة الثقة`],"Temporary folder":[`临时文件夹`,`مجلد مؤقت`],"node_modules folder":[`node_modules 文件夹`,`مجلد node_modules`],"App data folder":[`应用数据文件夹`,`مجلد بيانات التطبيقات`],"Skills folder":[`技能文件夹`,`مجلد المهارات`],"Rows with a target":[`已有目标的行数`,`عدد الصفوف ذات المجلد المستهدف`],"Smart resolve shows each proposed map and ignore in a dialog. Tick the ones to keep, then press Confirm. Nothing is saved before that.":[`智能解析会在对话框中列出每个建议的映射和忽略项。勾选要保留的项,然后点击确认。在此之前不会保存任何内容。`,`يعرض الحلّ التلقائي كل خريطة مقترحة وكل تجاهل مقترح في مربع حوار. حدّد ما تريد الاحتفاظ به، ثم اضغط تأكيد. لا يُحفظ شيء قبل ذلك.`],"Suggested to ignore":[`建议忽略`,`مقترح للتجاهل`],Ignore:[`忽略`,`تجاهل`],Restore:[`恢复`,`استعادة`],"No target":[`无目标`,`بلا مجلد مستهدف`],"Save this map":[`保存此映射`,`حفظ هذه الخريطة`],"Tick the maps and ignores to keep, then press Confirm to save them. Saved maps apply to every host on the next import or backfill run.":[`勾选要保留的映射和忽略项,然后点击确认保存。保存的映射将在所有主机的下一次导入或回填时生效。`,`حدّد الخرائط وعناصر التجاهل التي تريد الاحتفاظ بها، ثم اضغط تأكيد لحفظها. تسري الخرائط المحفوظة على كل المضيفات في عملية الاستيراد أو الاستكمال التالية.`],"Nothing to save. Type a target in a row, or press Ignore for folders that are not projects.":[`没有可保存的内容。请在行中输入目标,或对不是项目的文件夹点击忽略。`,`لا يوجد ما يُحفظ. اكتب مجلداً مستهدفاً في صف، أو اضغط تجاهل للمجلدات التي ليست مشاريع.`],"Ignored directories":[`已忽略的目录`,`المجلدات المتجاهَلة`],"Ignored directories stay unimported and leave the unresolved counts.":[`已忽略的目录保持未导入,并且不计入未解析数量。`,`تبقى المجلدات المتجاهَلة دون استيراد، ولا تُحسب ضمن الأعداد غير المحلولة.`],"They apply to the next import or backfill run. No sessions were imported.":[`它们将在下一次导入或回填时生效。未导入任何会话。`,`تسري في عملية الاستيراد أو الاستكمال التالية. لم تُستورد أي جلسات.`],"Keep a map after its sessions import. Every import checks the map before it skips a session, so removing a map makes its sessions unresolved again on the next run.":[`会话导入后请保留映射。每次导入在跳过会话之前都会先检查映射,因此删除映射会使其会话在下次运行时重新变为未解析。`,`احتفظ بالخريطة بعد استيراد جلساتها. يفحص كل استيراد الخريطة قبل أن يتجاوز جلسة، لذا فإن حذف الخريطة يجعل جلساتها غير محلولة مجدداً في التشغيل التالي.`],"Save removals":[`保存删除`,`حفظ عمليات الحذف`],"Settings changed elsewhere. Check the list and try again.":[`设置已在其他位置更改。请检查列表后再试。`,`تغيّرت الإعدادات في مكان آخر. راجع القائمة، ثم حاول مجدداً.`],"Settings changed elsewhere and could not be refreshed. Refresh the list, then try again.":[`设置已在其他位置更改,且无法刷新。请刷新列表后再试。`,`تغيّرت الإعدادات في مكان آخر وتعذّر تحديثها. حدّث القائمة، ثم حاول مجدداً.`],"Saved. Removed maps stop applying at the next import or backfill run.":[`已保存。删除的映射将从下一次导入或回填起不再生效。`,`تم الحفظ. تتوقف الخرائط المحذوفة عن السريان في عملية الاستيراد أو الاستكمال التالية.`],"Removals could not be saved. Try again.":[`无法保存删除。请重试。`,`تعذّر حفظ عمليات الحذف. حاول مجدداً.`],"Ignored. The directory stays unimported.":[`已忽略。该目录保持未导入。`,`تم التجاهل. يبقى المجلد دون استيراد.`],"The directory could not be ignored. Try again.":[`无法忽略该目录。请重试。`,`تعذّر تجاهل المجلد. حاول مجدداً.`],"Restored. The directory shows again in each host list that reported it.":[`已恢复。该目录会重新出现在报告它的每个主机列表中。`,`تمت الاستعادة. يظهر المجلد مجدداً في قائمة كل مضيف أبلغ عنه.`],"The directory could not be restored. Try again.":[`无法恢复该目录。请重试。`,`تعذّرت استعادة المجلد. حاول مجدداً.`],"Saved, but the list could not be refreshed. Refresh the list without saving again.":[`已保存,但无法刷新列表。请刷新列表,无需再次保存。`,`تم الحفظ، لكن تعذّر تحديث القائمة. حدّث القائمة دون الحفظ مجدداً.`],"Review directory maps":[`检查目录映射`,`مراجعة خرائط المجلدات`],"Proposed maps":[`建议映射数`,`عدد الخرائط المقترحة`],Sessions:[`会话数`,`عدد الجلسات`],Confirm:[`确认`,`تأكيد`],"Saving…":[`正在保存…`,`جارٍ الحفظ…`],"Settings refreshed. No maps were saved.":[`设置已刷新。未保存任何映射。`,`حُدّثت الإعدادات. لم تُحفظ أي خرائط.`],"Settings could not be refreshed. Try Refresh list again.":[`无法刷新设置。请再次点击刷新列表。`,`تعذّر تحديث الإعدادات. حاول تحديث القائمة مجدداً.`],"Maps could not be saved. Review the targets and confirm again.":[`无法保存映射。请检查目标后再次确认。`,`تعذّر حفظ الخرائط. راجع المجلدات المستهدفة، ثم أكّد مجدداً.`],"Settings changed elsewhere. Review these maps and confirm again.":[`设置已在其他位置更改。请检查这些映射后再次确认。`,`تغيّرت الإعدادات في مكان آخر. راجع هذه الخرائط، ثم أكّد مجدداً.`],"Settings changed elsewhere and could not be refreshed. Refresh the list before confirming again.":[`设置已在其他位置更改,且无法刷新。请刷新列表后再次确认。`,`تغيّرت الإعدادات في مكان آخر وتعذّر تحديثها. حدّث القائمة قبل التأكيد مجدداً.`],"Maps were saved, but the list could not be refreshed. Refresh the list without saving again.":[`映射已保存,但无法刷新列表。请刷新列表,无需再次保存。`,`حُفظت الخرائط، لكن تعذّر تحديث القائمة. حدّث القائمة دون الحفظ مجدداً.`],"No model was recorded for these attempts. This happens with records written by older OMMS versions, and when an attempt stops before a model is chosen.":[`这些尝试没有记录模型。旧版 OMMS 写入的记录,以及在选定模型之前就停止的尝试,会出现这种情况。`,`لم يُسجَّل نموذج لهذه المحاولات. يحدث ذلك في السجلات التي كتبتها إصدارات أقدم من OMMS، وعندما تتوقف المحاولة قبل اختيار نموذج.`],"These sessions cannot be mapped.":[`这些会话无法映射。`,`لا يمكن ربط هذه الجلسات.`],unresolved:[`未解析`,`غير محلول`],"Use this profile":[`使用此画像`,`استخدام هذا الملف الشخصي`],"Use this profile for every folder?":[`在所有文件夹中使用此画像?`,`استخدام هذا الملف الشخصي في كل المجلدات؟`],"Used for":[`用途`,`الاستخدام`],Workflows:[`工作流`,`سير العمل`],Memory:[`记忆`,`الذاكرة`],Setting:[`设置`,`الإعداد`],Value:[`数值`,`القيمة`],Default:[`默认值`,`القيمة الافتراضية`],Unit:[`单位`,`الوحدة`],Affects:[`影响`,`التأثير`],Results:[`条结果`,`نتائج`],Bytes:[`字节`,`بايت`],"Approximate tokens":[`约计令牌`,`رموز تقريبية`],"Maximum memory search results. Manual searches can request fewer; prompt retrieval uses this ceiling.":[`记忆搜索结果的最大数量。手动搜索可以请求更少;提示词检索使用此上限。`,`الحد الأقصى لنتائج بحث الذاكرة. يمكن للبحث اليدوي طلب عدد أقل؛ ويستخدم استرجاع الطلب هذا السقف.`],"Conversation input sent to the memory-summary model through the shared capture pipeline. Smaller values can omit conversation text.":[`通过共享捕获管道发送给记忆摘要模型的对话输入。数值较小时可能省略部分对话文本。`,`مدخلات المحادثة التي تُرسل إلى نموذج تلخيص الذاكرة عبر مسار الالتقاط المشترك. القيم الأصغر قد تحذف نصاً من المحادثة.`],"OpenCode profile-learning input. Smaller values can omit prompts from that input. This control does not limit the other hosts' profile input.":[`OpenCode 画像学习的输入。数值较小时可能从该输入中省略部分提示词。此设置不限制其他主机的画像输入。`,`مدخلات تعلّم الملف الشخصي في OpenCode. القيم الأصغر قد تحذف مطالبات من هذه المدخلات. لا يقيّد هذا الإعداد مدخلات الملف الشخصي في المضيفات الأخرى.`],"Automatic memory context, including profile text and formatting, added to agent requests across all hosts. Smaller values can show fewer or shorter memories.":[`自动加入各主机代理请求的记忆上下文,包括画像文本和格式化内容。数值较小时会显示更少或更短的记忆。`,`سياق الذاكرة المُضاف تلقائياً إلى طلبات الوكيل في كل المضيفات، بما في ذلك نص الملف الشخصي والتنسيق. القيم الأصغر قد تعرض ذكريات أقل أو أقصر.`],"Enter a positive whole number.":[`请输入正整数。`,`أدخل رقماً صحيحاً موجباً.`],"Enter a whole number from 16,384 to 16,777,216.":[`请输入 16,384 到 16,777,216 之间的整数。`,`أدخل رقماً صحيحاً من 16,384 إلى 16,777,216.`],"Enter a whole number from 1,024 to 16,777,216.":[`请输入 1,024 到 16,777,216 之间的整数。`,`أدخل رقماً صحيحاً من 1,024 إلى 16,777,216.`],"Enter a whole number from 256 to 65,536.":[`请输入 256 到 65,536 之间的整数。`,`أدخل رقماً صحيحاً من 256 إلى 65,536.`],"Byte limits count UTF-8 bytes.":[`字节限制按 UTF-8 字节计数。`,`تُحتسب حدود البايت بوحدات بايت UTF-8.`],"Approximate tokens are estimated as ceil(UTF-8 bytes / 4). A provider can count more or fewer tokens for the same text.":[`约计令牌按 ceil(UTF-8 字节数 / 4) 估算。同一文本,提供商统计的令牌数可能更多或更少。`,`تُقدَّر الرموز التقريبية بالصيغة ceil(بايتات UTF-8 / 4). قد يحسب المزوّد للنص نفسه رموزاً أكثر أو أقل.`],"These controls do not delete stored data, set a spending limit, limit model replies, or control Graphify output.":[`这些设置不会删除已存储的数据、设定消费限额、限制模型回复,也不会控制 Graphify 输出。`,`لا تحذف هذه الإعدادات البيانات المخزنة، ولا تضع حد إنفاق، ولا تحدّ من ردود النموذج، ولا تتحكم في خرج Graphify.`],"Edit ~/.config/omms/omms.jsonc directly to set these limits without the web UI.":[`也可以直接编辑 ~/.config/omms/omms.jsonc 来设置这些限制,无需网页界面。`,`عدّل الملف ~/.config/omms/omms.jsonc مباشرة لضبط هذه الحدود دون واجهة الويب.`],"Save memory limits":[`保存记忆限制`,`حفظ حدود الذاكرة`],"Saved. New memory operations use these limits.":[`已保存。新的记忆操作将使用这些限制。`,`تم الحفظ. ستستخدم عمليات الذاكرة الجديدة هذه الحدود.`],"Invalid setting":[`无效的设置`,`إعداد غير صالح`],"Config changed. Reload settings and save again.":[`设置文件已更改。请重新加载设置后再次保存。`,`تغيّر ملف الإعدادات. أعد تحميل الإعدادات ثم احفظ مجدداً.`],"The memory settings could not be loaded. Reload the page to try again.":[`无法加载记忆设置。请重新加载页面重试。`,`تعذّر تحميل إعدادات الذاكرة. أعد تحميل الصفحة للمحاولة مجدداً.`],"The memory settings could not be saved.":[`无法保存记忆设置。`,`تعذّر حفظ إعدادات الذاكرة.`],"Effective value":[`生效值`,`القيمة السارية`],project:[`项目`,`المشروع`],"The project value stays in force. Saving edits the global file only.":[`项目值仍然生效。保存只修改全局文件。`,`تبقى قيمة المشروع سارية، والحفظ يعدّل الملف العام فقط.`],"Similarity score":[`相似度分数`,`درجة التشابه`],"Enter a number from 0 to 1.":[`请输入 0 到 1 之间的数字。`,`أدخل رقماً من 0 إلى 1.`],"Lowest score a memory needs to be returned by search. Lower values return more memories, including less relevant ones. Higher values can return none. The default depends on the embedder.":[`记忆被搜索返回所需的最低分数。较低的值会返回更多记忆,包括相关性较低的;较高的值可能一条也不返回。默认值取决于嵌入模型。`,`أدنى درجة تحتاجها الذاكرة لتُعاد في نتائج البحث. القيم الأدنى تعيد ذكريات أكثر بمن فيها الأقل صلة، والقيم الأعلى قد لا تعيد شيئاً. تعتمد القيمة الافتراضية على نموذج التضمين.`],"Reset to default":[`恢复默认`,`إعادة إلى الافتراضي`],"Differs from default":[`与默认值不同`,`يختلف عن الافتراضي`],"Keyword matching":[`关键词匹配`,`مطابقة الكلمات`],"Search finds memories by meaning and by exact words from your prompt.":[`搜索按含义和提示中的确切词语查找记忆。`,`يجد البحث الذكريات بالمعنى وبالكلمات الدقيقة من مطالبتك.`],"Word matching mode":[`词语匹配模式`,`وضع مطابقة الكلمات`],"Boost (default)":[`加分(默认)`,`تعزيز (افتراضي)`],"Rank fusion (experimental)":[`排名融合(实验性)`,`دمج الترتيب (تجريبي)`],"Boost adds a small score bonus to memories that contain a word of your prompt.":[`加分会给包含提示中某个词的记忆增加少量分数。`,`يضيف التعزيز مكافأة صغيرة في الدرجة للذكريات التي تحتوي على كلمة من مطالبتك.`],"Rank fusion merges a list by meaning and a list by words. A memory that contains a word of your prompt can be returned even when its meaning score is below the similarity threshold. Experimental: it has not been shown to find more relevant memories.":[`排名融合会合并按含义排序的列表和按词语排序的列表。即使含义得分低于相似度阈值,包含提示中某个词的记忆也可能被返回。实验性:尚未证明能找到更多相关记忆。`,`يدمج دمج الترتيب قائمة بالمعنى وقائمة بالكلمات. قد تُعاد ذاكرة تحتوي على كلمة من مطالبتك حتى لو كانت درجة المعنى أقل من حد التشابه. تجريبي: لم يثبت أنه يجد ذكريات أكثر صلة.`],"Rank fusion is not used while the reranker is on. Search uses the boost.":[`重排序器开启时不使用排名融合,搜索使用加分模式。`,`لا يُستخدم دمج الترتيب أثناء تشغيل معيد الترتيب. يستخدم البحث التعزيز.`],"A project file can override this setting. This page edits the global value.":[`项目文件可以覆盖此设置。此页面编辑全局值。`,`يمكن لملف المشروع تجاوز هذا الإعداد. تعدّل هذه الصفحة القيمة العامة.`],"Saved. New searches use this mode.":[`已保存。新的搜索将使用此模式。`,`تم الحفظ. تستخدم عمليات البحث الجديدة هذا الوضع.`],"The keyword matching setting could not be saved. Reload the page to try again.":[`无法保存关键词匹配设置。请重新加载页面后重试。`,`تعذّر حفظ إعداد مطابقة الكلمات. أعد تحميل الصفحة للمحاولة مرة أخرى.`],"The keyword matching setting could not be loaded. Reload the page to try again.":[`无法加载关键词匹配设置。请重新加载页面后重试。`,`تعذّر تحميل إعداد مطابقة الكلمات. أعد تحميل الصفحة للمحاولة مرة أخرى.`],Reranker:[`重排序器`,`إعادة الترتيب`],"Use a reranker":[`使用重排序器`,`استخدم معيد الترتيب`],Key:[`密钥`,`المفتاح`],Timeout:[`超时`,`مهلة الانتهاء`],"Search is unchanged while the switch is off.":[`开关关闭时,搜索行为保持不变。`,`يظل البحث دون تغيير أثناء إيقاف المفتاح.`],"The reranker reorders the best memory search results with your reranker server and keeps the top results.":[`重排序器使用您的重排序服务器对最佳记忆搜索结果重新排序,并保留最靠前的结果。`,`يعيد معيد الترتيب ترتيب أفضل نتائج بحث الذاكرة عبر خادم إعادة الترتيب لديك ويحتفظ بالنتائج العليا.`],"The reranker sends the prompt and the text of candidate memories to the server URL. A server on the same machine is recommended.":[`重排序器会将提示和候选记忆的文本发送到该服务器 URL。建议使用同一台机器上的服务器。`,`يرسل معيد الترتيب المطالبة ونص الذكريات المرشحة إلى عنوان URL للخادم. يُنصح بخادم على الجهاز نفسه.`],"This URL is not on this machine: memory text leaves this machine.":[`此 URL 不在本机上:记忆文本将离开本机。`,`هذا العنوان ليس على هذا الجهاز: نص الذاكرة يغادر جهازك.`],"A project file cannot change these settings. The reranker settings are global only.":[`项目文件无法更改这些设置。重排序器设置仅限全局。`,`لا يمكن لملف المشروع تغيير هذه الإعدادات. إعدادات معيد الترتيب عامة فقط.`],"The default of 4000 keeps the search inside OpenCode V2's 5-second wait. A value over 5000 can make OpenCode V2 send the request with no memory.":[`默认值 4000 使搜索保持在 OpenCode V2 的 5 秒等待之内。超过 5000 的值可能导致 OpenCode V2 在不注入记忆的情况下发送请求。`,`تحافظ القيمة الافتراضية 4000 على بقاء البحث داخل مهلة انتظار OpenCode V2 البالغة 5 ثوانٍ. القيمة الأعلى من 5000 قد تجعل OpenCode V2 يرسل الطلب دون ذاكرة.`],"Enter the server URL and model before turning the reranker on.":[`打开重排序器前,请先填写服务器 URL 和模型。`,`أدخل عنوان URL للخادم والنموذج قبل تشغيل معيد الترتيب.`],"The key must be an env:// or file:// reference, or left empty.":[`密钥必须是 env:// 或 file:// 引用,或留空。`,`يجب أن يكون المفتاح مرجع env:// أو file://، أو يُترك فارغاً.`],"Enter a whole number from 500 to 30,000.":[`请输入 500 到 30,000 之间的整数。`,`أدخل رقماً صحيحاً من 500 إلى 30,000.`],"Optional env:// or file:// key reference.":[`可选的 env:// 或 file:// 密钥引用。`,`مرجع مفتاح env:// أو file:// اختياري.`],milliseconds:[`毫秒`,`ميلي ثانية`],Save:[`保存`,`حفظ`],"Saved. New searches use these settings.":[`已保存。新的搜索将使用这些设置。`,`تم الحفظ. ستستخدم عمليات البحث الجديدة هذه الإعدادات.`],"The reranker settings could not be saved. Reload the page to try again.":[`无法保存重排序器设置。请重新加载页面重试。`,`تعذّر حفظ إعدادات معيد الترتيب. أعد تحميل الصفحة للمحاولة مجدداً.`],"The reranker settings could not be loaded. Reload the page to try again.":[`无法加载重排序器设置。请重新加载页面重试。`,`تعذّر تحميل إعدادات معيد الترتيب. أعد تحميل الصفحة للمحاولة مجدداً.`],"Test passed.":[`测试通过。`,`نجح الاختبار.`],"Test failed:":[`测试失败:`,`فشل الاختبار:`],"Change icon":[`更换图标`,`تغيير الأيقونة`],"Check again":[`再次检查`,`تحقق مرة أخرى`],"Choose a host to see its history import, sessions and settings.":[`选择一个宿主,查看其历史导入、会话和设置。`,`اختر مضيفاً لعرض استيراد سجله وجلساته وإعداداته.`],"Choose icon":[`选择图标`,`اختر أيقونة`],"Every avatar is shown at the same size. Images are cropped to a square.":[`所有头像大小一致。图片会被裁剪为正方形。`,`تظهر كل الصور الرمزية بالحجم نفسه. تُقصّ الصور إلى مربع.`],"Every host":[`所有宿主`,`كل المضيفين`],"Fix the service named here, then press Check again.":[`请修复此处所列的服务,然后点击“再次检查”。`,`أصلح الخدمة المذكورة هنا، ثم اضغط «تحقق مرة أخرى».`],"How many memories a search returns":[`一次搜索返回多少条记忆`,`عدد الذكريات التي يعيدها البحث`],"How to set up":[`如何设置`,`كيفية الإعداد`],"Ignore all":[`全部忽略`,`تجاهل الكل`],"Memory injection":[`记忆注入`,`حقن الذاكرة`],"Inject memories with the first message":[`随第一条消息注入记忆`,`حقن الذكريات مع الرسالة الأولى`],"Added once, with the first message of a new session. Nothing is added when a new session opens. OMMS searches the query below and adds only matching memories.":[`仅随新会话的第一条消息添加一次。新会话打开时不会添加任何内容。OMMS 会用下面的查询进行搜索,只添加匹配的记忆。`,`تُضاف مرة واحدة مع أول رسالة في جلسة جديدة. لا يُضاف شيء عند فتح جلسة جديدة. يبحث OMMS بالاستعلام أدناه ويضيف الذكريات المطابقة فقط.`],"Memories are added at these moments:":[`记忆会在这些时刻添加:`,`تُضاف الذكريات في هذه اللحظات:`],"With every message: the memories that match that message. On by default. chatMessage.enabled in the config file turns it off, and the first-message and subagent options with it.":[`随每条消息:与该消息匹配的记忆。默认开启。配置文件中的 chatMessage.enabled 可将其关闭,第一条消息和子代理选项也会随之关闭。`,`مع كل رسالة: الذكريات المطابقة لتلك الرسالة. مفعّلة افتراضيًا. يوقفها chatMessage.enabled في ملف الإعدادات، وتتوقف معها خيارات الرسالة الأولى والوكلاء الفرعيين.`],"With the first message of a new session: the memories that match the query below. Needs the first switch.":[`随新会话的第一条消息:与下面查询匹配的记忆。需要打开第一个开关。`,`مع أول رسالة في جلسة جديدة: الذكريات المطابقة للاستعلام أدناه. تتطلب المفتاح الأول.`],"For a subagent: the memories that match its task. Claude Code adds them once, when the subagent starts. OpenCode V2 and Pi add them with each prompt the subagent gets. Needs the Subagent memory switch.":[`对于子代理:与其任务匹配的记忆。Claude Code 在子代理启动时添加一次。OpenCode V2 和 Pi 在子代理收到的每条提示时添加。需要打开“子代理记忆”开关。`,`للوكيل الفرعي: الذكريات المطابقة لمهمته. يضيفها Claude Code مرة واحدة عند بدء الوكيل. ويضيفها OpenCode V2 وPi مع كل طلب يتلقاه الوكيل. يتطلب مفتاح ذاكرة الوكلاء الفرعيين.`],"After a compaction or resume: the memories that session captured. Needs the Restore switch.":[`压缩或恢复之后:该会话捕获的记忆。需要打开“还原”开关。`,`بعد الضغط أو الاستئناف: الذكريات التي التقطتها تلك الجلسة. تتطلب مفتاح الاستعادة.`],"Nothing is added when a new session opens.":[`新会话打开时不会添加任何内容。`,`لا يُضاف شيء عند فتح جلسة جديدة.`],"Claude Code can add memories when a session opens. Pi and OpenCode V2 cannot. To keep all three the same, OMMS adds them with the first message on every host.":[`Claude Code 可以在会话打开时添加记忆,Pi 和 OpenCode V2 不能。为了让三者保持一致,OMMS 在所有宿主上都随第一条消息添加记忆。`,`يمكن لـ Claude Code إضافة الذكريات عند فتح الجلسة، ولا يمكن ذلك لـ Pi وOpenCode V2. للإبقاء على الثلاثة متطابقة، يضيف OMMS الذكريات مع الرسالة الأولى على كل مضيف.`],"Added when a session resumes or compacts. Restores the memories that session captured.":[`会话恢复或压缩时添加。还原该会话捕获的记忆。`,`تُضاف عند استئناف الجلسة أو ضغطها. تستعيد الذكريات التي التقطتها تلك الجلسة.`],"First-message search query":[`第一条消息的搜索查询`,`استعلام البحث للرسالة الأولى`],"Sets how OMMS adds memories to the context the model sees.":[`设置 OMMS 如何将记忆添加到模型的上下文中。`,`يحدد كيفية إضافة OMMS للذكريات إلى سياق النموذج.`],"Subagent memory":[`子代理记忆`,`ذاكرة الوكلاء الفرعيين`],"Subagents get memories that match their task. Claude Code adds them once, at start. OpenCode V2 and Pi add them with each subagent prompt. No rows are shown for them.":[`子代理会获得与其任务匹配的记忆。Claude Code 在启动时添加一次。OpenCode V2 和 Pi 在每条子代理提示时添加。不会为它们显示记忆行。`,`يحصل الوكلاء الفرعيون على الذكريات المطابقة لمهمتهم. يضيفها Claude Code مرة واحدة عند البدء. ويضيفها OpenCode V2 وPi مع كل طلب للوكيل الفرعي. لا تُعرض لهم أي صفوف.`],"Restore memories after compaction or resume":[`压缩或恢复后还原记忆`,`استعادة الذكريات بعد الضغط أو الاستئناف`],"Most memories to restore":[`最多还原的记忆数`,`أقصى عدد من الذكريات للاستعادة`],"Applies to OpenCode V2, Pi and Claude Code. On Pi, a subagent gets memory only when its agent maps the OMMS extension in om-pi-subagents. Turn it on in /omps-settings, Agent capabilities, Memory.":[`适用于 OpenCode V2、Pi 和 Claude Code。在 Pi 上,只有当子代理的 agent 在 om-pi-subagents 中映射了 OMMS 扩展时,子代理才会获得记忆。请在 /omps-settings 的 Agent capabilities 中打开 Memory。`,`ينطبق على OpenCode V2 وPi وClaude Code. على Pi لا يحصل الوكيل الفرعي على الذكريات إلا إذا ربط وكيله امتداد OMMS في om-pi-subagents. فعّل ذلك من /omps-settings ثم Agent capabilities ثم Memory.`],"A project config can turn the first-message and subagent options off. It can turn restore on or off.":[`项目配置只能关闭第一条消息和子代理选项,但可以开启或关闭还原。`,`يمكن لإعدادات المشروع إيقاف خياري الرسالة الأولى والوكلاء الفرعيين فقط، ويمكنها تشغيل الاستعادة أو إيقافها.`],"Saved. The next session uses these options.":[`已保存。下一个会话将使用这些选项。`,`تم الحفظ. ستستخدم الجلسة التالية هذه الخيارات.`],"The memory injection settings could not be loaded. Reload the page to try again.":[`无法加载记忆注入设置。请重新加载页面后重试。`,`تعذّر تحميل إعدادات حقن الذاكرة. أعد تحميل الصفحة للمحاولة مرة أخرى.`],"First message {opening} · Subagents {subagent} · Restore {restore}":[`第一条消息 {opening} · 子代理 {subagent} · 还原 {restore}`,`الرسالة الأولى {opening} · الوكلاء الفرعيون {subagent} · الاستعادة {restore}`],"Invalid openingContext setting":[`openingContext 设置无效`,`إعداد openingContext غير صالح`],"Invalid subagentMemory setting":[`subagentMemory 设置无效`,`إعداد subagentMemory غير صالح`],"Invalid compaction.enabled setting":[`compaction.enabled 设置无效`,`إعداد compaction.enabled غير صالح`],"Invalid compaction.memoryLimit setting: accepted positive safe integers":[`compaction.memoryLimit 设置无效:只接受正整数`,`إعداد compaction.memoryLimit غير صالح: يُقبل عدد صحيح موجب فقط`],"openingContextQuery must be text of 500 characters or fewer":[`openingContextQuery 必须是不超过 500 个字符的文本`,`يجب أن يكون openingContextQuery نصاً لا يزيد عن 500 حرف`],"Import all hosts":[`导入所有宿主`,`استيراد كل المضيفين`],"Import progress":[`导入进度`,`تقدم الاستيراد`],"Running · history imported {date}":[`运行中 · 历史已导入 {date}`,`قيد التشغيل · استُورد السجل {date}`],"Running · history imported {date} · last saved {when}":[`运行中 · 历史已导入 {date} · 上次保存 {when}`,`قيد التشغيل · استُورد السجل {date} · آخر حفظ {when}`],"Running · last saved {when}":[`运行中 · 上次保存 {when}`,`قيد التشغيل · آخر حفظ {when}`],"today {time}":[`今天 {time}`,`اليوم {time}`],"yesterday {time}":[`昨天 {time}`,`أمس {time}`],"Importing makes model calls and can cost money.":[`导入会调用模型,可能产生费用。`,`يجري الاستيراد اتصالات بالنموذج وقد يكلّف مالاً.`],"Importing · {percent}%":[`正在导入 · {percent}%`,`جارٍ الاستيراد · {percent}%`],"Memories are not being saved.":[`记忆当前无法保存。`,`لا يتم حفظ الذكريات حالياً.`],"Memories not saved":[`记忆未保存`,`الذكريات غير محفوظة`],"Memory views":[`记忆视图`,`عروض الذاكرة`],"Mode: {mode}":[`模式:{mode}`,`الوضع: {mode}`],"No icon matches.":[`没有匹配的图标。`,`لا توجد أيقونة مطابقة.`],"Not set up":[`未设置`,`غير مُعد`],"Automatic import is on. Nothing was waiting before {date}. Use Sessions below for newer chats.":[`自动导入已开启。在 {date} 之前没有待导入的内容。更新的聊天请使用下方的“会话”。`,`الاستيراد التلقائي قيد التشغيل. لم يكن هناك ما ينتظر قبل {date}. استخدم «الجلسات» أدناه للمحادثات الأحدث.`],"Automatic import is on. Nothing is waiting.":[`自动导入已开启。没有待导入的内容。`,`الاستيراد التلقائي قيد التشغيل. لا يوجد ما ينتظر.`],"OMMS did not find this host's chat history on this computer. Install the host and use it once, then reload this page.":[`OMMS 在这台电脑上没有找到该宿主的聊天记录。请安装该宿主并使用一次,然后重新加载此页面。`,`لم يعثر OMMS على سجل محادثات هذا المضيف على هذا الحاسوب. ثبّت المضيف واستخدمه مرة واحدة، ثم أعد تحميل هذه الصفحة.`],Off:[`关`,`متوقف`],On:[`开`,`قيد التشغيل`],"On · {model}":[`开 · {model}`,`قيد التشغيل · {model}`],"PNG, JPEG, WebP or GIF, up to 20 MB.":[`PNG、JPEG、WebP 或 GIF,最大 20 MB。`,`PNG أو JPEG أو WebP أو GIF، حتى 20 ميغابايت.`],"Paused · {pending} pending":[`已暂停 · 待处理 {pending}`,`متوقف مؤقتاً · {pending} قيد الانتظار`],"Paused. Resume to continue.":[`已暂停。点击“恢复”继续。`,`متوقف مؤقتاً. اضغط «استئناف» للمتابعة.`],"Prompts waiting for profile learning, and re-analysis of old chats":[`等待画像学习的提示,以及旧聊天的重新分析`,`مطالبات تنتظر تعلم الملف الشخصي، وإعادة تحليل المحادثات القديمة`],"Results {results} · Similarity {similarity}":[`结果数 {results} · 相似度 {similarity}`,`النتائج {results} · التشابه {similarity}`],"Runs one import for every host you tick. It makes model calls and can cost money.":[`对勾选的每个宿主运行一次导入。它会调用模型,可能产生费用。`,`يشغّل استيراداً واحداً لكل مضيف تحدده. يجري اتصالات بالنموذج وقد يكلّف مالاً.`],"Saved maps and ignored directories":[`已保存的映射和已忽略的目录`,`الخرائط المحفوظة والمجلدات المتجاهلة`],"Search icons":[`搜索图标`,`ابحث عن أيقونة`],"Settings for every host":[`适用于所有宿主的设置`,`إعدادات لكل المضيفين`],Shared:[`共享`,`مشترك`],"Stopped · {pending} pending":[`已停止 · 待处理 {pending}`,`متوقف · {pending} قيد الانتظار`],"Stopped: {error}":[`已停止:{error}`,`توقف: {error}`],"These directories stay unimported and leave the unresolved counts.":[`这些目录保持未导入状态,并从未解析计数中移除。`,`تبقى هذه المجلدات غير مستوردة وتخرج من أعداد غير المحلولة.`],"These settings apply to every host. Open a row to change it.":[`这些设置适用于所有宿主。展开一行即可修改。`,`تنطبق هذه الإعدادات على كل المضيفين. افتح صفاً لتغييره.`],"This browser could not read the image.":[`此浏览器无法读取该图片。`,`تعذّر على هذا المتصفح قراءة الصورة.`],"This host is not set up on this machine.":[`此宿主尚未在这台机器上设置。`,`لم يتم إعداد هذا المضيف على هذا الجهاز.`],"This switch applies to every host. Automatic import makes model calls.":[`此开关适用于所有宿主。自动导入会调用模型。`,`ينطبق هذا المفتاح على كل المضيفين. يجري الاستيراد التلقائي اتصالات بالنموذج.`],"Upload image":[`上传图片`,`رفع صورة`],"Use external API":[`使用外部 API`,`استخدام واجهة API الخارجية`],settings:[`设置`,`الإعدادات`],"{saved} saved · {ignored} ignored":[`已保存 {saved} · 已忽略 {ignored}`,`{saved} محفوظة · {ignored} متجاهلة`],"The image is larger than 20 MB.":[`图片超过 20 MB。`,`الصورة أكبر من 20 ميغابايت.`],"Only PNG, JPEG, WebP and GIF images are accepted.":[`仅接受 PNG、JPEG、WebP 和 GIF 图片。`,`تُقبل صور PNG وJPEG وWebP وGIF فقط.`],"Importing {done} / {total}.":[`正在导入 {done} / {total}。`,`جارٍ الاستيراد {done} / {total}.`],"Importing {done} / {total}. About {minutes} min left.":[`正在导入 {done} / {total}。约剩 {minutes} 分钟。`,`جارٍ الاستيراد {done} / {total}. يتبقى نحو {minutes} دقيقة.`],"Nothing is waiting to import.":[`没有待导入的内容。`,`لا يوجد ما ينتظر الاستيراد.`],"{pending} still waiting to import.":[`仍有 {pending} 条待导入。`,`لا يزال {pending} بانتظار الاستيراد.`]};function Pf(e,t){return t===`en`?e:Nf[e]?.[t===`zh`?0:1]??e}function Y(){let{language:e}=G();return t=>Pf(t,e)}function Ff(e,t){return e.replace(/\{(\w+)\}/g,(e,n)=>n in t?String(t[n]):e)}function If(e,t){let n=t.trim().toLowerCase();return n?e.filter(e=>e.name.toLowerCase().includes(n)):e}function Lf(e){return e.state===`applied`&&e.appliedBy===`automatic`?`applied automatically`:e.state}function Rf(e){return e.filter(e=>e.state!==`pending`).sort((e,t)=>t.updatedAt-e.updatedAt)}function zf(e){return e.split(`
|
|
56
|
-
`).map(e=>e.startsWith(`@@`)?{kind:`hunk`,text:e}:e.startsWith(`+`)?{kind:`add`,text:e}:e.startsWith(`-`)?{kind:`del`,text:e}:{kind:`ctx`,text:e})}function Bf(e){if(e.diff===null)return{added:e.content.trim()?e.content.split(`
|
|
57
|
-
`).length:0,removed:0};let t=zf(e.diff);return{added:t.filter(e=>e.kind===`add`).length,removed:t.filter(e=>e.kind===`del`).length}}function Vf(e){let{content:t,diff:n,...r}=e;return{...r,...Bf({content:t,diff:n}),hasDiff:n!==null}}var Hf=160;function Uf(e){let t=e.summary??``;return t.length>Hf||t.split(`
|
|
58
|
-
`).length>2||e.hasDiff||e.added>0||e.evidenceTurnIds.length>0}var Wf=e=>e.toLocaleString(`en-US`);function Gf(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}function Kf(e,t){let n=t.trim();return n&&!e.includes(n)?[...e,n]:e}function qf(e,t){return e.filter(e=>e!==t)}var Jf=[`done`,`failed`,`cancelled`],Yf=e=>Jf.includes(e.state);function Xf(e){return e.summary?.skillTurnsRecorded===void 0?(e.hosts??[]).reduce((e,t)=>e+(t.summary?.skillTurnsRecorded??0),0):e.summary.skillTurnsRecorded}function Zf(e){let t=e.total??0;return t>0?Math.min(100,Math.floor((e.processed??0)*100/t)):0}var Qf=[3,5,10,25,50,100],$f=(e,t)=>Array.from({length:t-e+1},(t,n)=>e+n);function ep(e,t,n=1){if(t<=1)return[];if(t<=n*2+5)return $f(1,t);let r=Math.max(e-n,1),i=Math.min(e+n,t),a=r>2,o=i<t-1,s=3+n*2;return!a&&o?[...$f(1,s),`...`,t]:a&&!o?[1,`...`,...$f(t-s+1,t)]:[1,`...`,...$f(r,i),`...`,t]}var tp=(e,t)=>Math.max(1,Math.ceil(Math.max(0,e)/Math.max(1,t))),np=(e,t,n)=>Math.min(Math.max(1,Math.floor(e)||1),tp(t,n));function rp(e,t,n){let r=np(e,n,t),i=n===0?0:(r-1)*t+1;return{page:r,pageCount:tp(n,t),from:i,to:Math.min(n,r*t),total:n}}function ip(e,t,n){let r=rp(t,n,e.length);return{...r,items:e.slice(Math.max(0,r.from-1),r.to)}}function ap(e,t,n,r){let{from:i,to:a}=rp(e,t,n);return!r||n===0?{offset:Math.max(0,i-1),limit:t}:{offset:n-a,limit:a-i+1}}function op(e){let t=[...Qf];return t.includes(e)?t:[...t,e].sort((e,t)=>e-t)}function sp(e,t){let n=Number.parseInt(e.trim(),10);return Number.isNaN(n)||n<1?t:Math.min(n,200)}function cp(e,t,n,r){let i=n===`asc`?1:-1,a=e=>+!!r?.(e);return e.map((e,t)=>({item:e,index:t})).sort((e,n)=>a(e.item)-a(n.item)||(a(e.item)?0:i*t(e.item,n.item))||e.index-n.index).map(({item:e})=>e)}function lp(e){try{let t=localStorage.getItem(e);if(!t)return null;let n=JSON.parse(t),r=n.perPage===void 0?void 0:sp(String(n.perPage),5),i=n.order===`asc`||n.order===`desc`?n.order:void 0;return{perPage:r,sort:typeof n.sort==`string`?n.sort:void 0,order:i}}catch{return null}}function up(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch{}}function dp(e,t){try{if(localStorage.getItem(e)!==null)return;let n=lp(t);if(!n)return;let r=n.perPage===5?void 0:n.perPage;if(r===void 0&&n.sort===void 0&&n.order===void 0)return;up(e,{perPage:r,sort:n.sort,order:n.order})}catch{}}function fp(e,t){return e.key===t?e:{page:1,key:t}}function pp(e,t,n){let r=e.find(n=>n.value===e.find(e=>e.value===t)?.flip);return r?{sort:r.value,order:r.first}:{sort:t,order:n===`asc`?`desc`:`asc`}}function mp({view:e}){let t=Y(),n=(0,v.useRef)(null),r=(0,v.useRef)(!1);(0,v.useEffect)(()=>{r.current&&(r.current=!1,n.current?.querySelector(`[aria-current="page"]`)?.focus())},[e.page]);let i=ep(e.page,e.pageCount);if(i.length===0)return null;let a=t=>{r.current=t===1||t===e.pageCount,e.setPage(t)};return(0,H.jsxs)(`div`,{className:`flex flex-col items-center gap-3 pt-1`,children:[(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground tabular-nums`,children:Ff(t(`Showing {from} to {to} of {total} results`),{from:e.from,to:e.to,total:e.total})}),(0,H.jsx)(Of,{ref:n,"aria-label":t(`pagination`),children:(0,H.jsxs)(kf,{children:[(0,H.jsx)(Af,{children:(0,H.jsxs)(jf,{size:`sm`,className:`gap-1 px-2.5`,"aria-label":t(`Go to previous page`),disabled:e.page<=1,onClick:()=>a(e.page-1),children:[(0,H.jsx)(de,{className:`rtl:-scale-x-100`,"aria-hidden":`true`}),(0,H.jsx)(`span`,{className:`hidden sm:inline`,children:t(`Previous`)})]})}),i.map((n,r)=>n===`...`?(0,H.jsx)(Af,{children:(0,H.jsx)(Mf,{label:t(`More pages`)})},`gap-${r}`):(0,H.jsx)(Af,{children:(0,H.jsx)(jf,{isActive:n===e.page,"aria-label":Ff(t(`Go to page {page}`),{page:n}),onClick:()=>n===e.page?void 0:a(n),children:n})},n)),(0,H.jsx)(Af,{children:(0,H.jsxs)(jf,{size:`sm`,className:`gap-1 px-2.5`,"aria-label":t(`Go to next page`),disabled:e.page>=e.pageCount,onClick:()=>a(e.page+1),children:[(0,H.jsx)(`span`,{className:`hidden sm:inline`,children:t(`Next`)}),(0,H.jsx)(fe,{className:`rtl:-scale-x-100`,"aria-hidden":`true`})]})})]})})]})}var hp=()=>(0,H.jsx)(`span`,{"aria-hidden":`true`,className:`hidden text-muted-foreground/50 sm:inline`,children:`|`});function gp({view:e,totalLabel:t}){let n=Y(),[r,i]=(0,v.useState)(null),a=()=>{if(r===null)return;let t=sp(r,e.perPage);i(null),t!==e.perPage&&e.setPerPage(t)},o=e=>{e.key===`Enter`&&a()},s=e.order===`asc`,c=s?te:P;return(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-2 text-sm text-muted-foreground`,children:[(0,H.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`span`,{children:n(`Show`)}),(0,H.jsx)(Rr,{className:`h-8 w-fit`,value:e.perPage,"aria-label":n(`Results per page`),onChange:t=>e.setPerPage(Number(t.target.value)),children:op(e.perPage).map(e=>(0,H.jsx)(`option`,{value:e,children:e},e))}),(0,H.jsx)(`span`,{children:n(`results`)})]}),(0,H.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(hp,{}),(0,H.jsx)(`span`,{children:n(`Custom:`)}),(0,H.jsx)(Jd,{type:`number`,inputMode:`numeric`,min:1,max:200,className:`h-8 w-20 tabular-nums`,value:r??String(e.perPage),"aria-label":n(`Custom results per page`),onChange:e=>i(e.target.value),onKeyDown:o,onBlur:a})]}),e.sorts.length>0?(0,H.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(hp,{}),(0,H.jsx)(`span`,{children:n(`Sort by`)}),(0,H.jsx)(Rr,{className:`h-8 w-fit`,value:e.sort,"aria-label":n(`Sort by`),onChange:t=>{let n=e.sorts.find(e=>e.value===t.target.value);n&&e.setSort(n.value,n.first)},children:e.sorts.map(e=>(0,H.jsx)(`option`,{value:e.value,children:n(e.label)},e.value))}),(0,H.jsx)(q,{type:`button`,variant:`outline`,size:`icon-sm`,"aria-label":n(s?`Sort descending`:`Sort ascending`),title:n(s?`Sort descending`:`Sort ascending`),onClick:()=>{let t=pp(e.sorts,e.sort,e.order);e.setSort(t.sort,t.order)},children:(0,H.jsx)(c,{className:`size-3.5`,"aria-hidden":`true`})})]}):null,(0,H.jsx)(`span`,{className:`ms-auto tabular-nums`,children:t})]})}function _p({view:e,totalLabel:t,children:n}){return(0,H.jsxs)(`div`,{className:`space-y-3`,children:[(0,H.jsx)(gp,{view:e,totalLabel:t}),n,(0,H.jsx)(mp,{view:e})]})}function vp(e,t){let{perPage:n,...r}=e;return t?{perPage:n,...r}:r}function yp(e,t,n=5){let r=lp(e),i=t.find(e=>e.value===r?.sort)??t[0];return{perPage:r?.perPage??n,sort:i.value,order:(r?.sort===i.value?r.order:void 0)??i.first}}function bp({storageKey:e,total:t,sorts:n,resetKey:r=``,legacyKey:i,defaultPerPage:a}){let[o,s]=(0,v.useState)(()=>(i&&dp(e,i),yp(e,n,a))),[c,l]=(0,v.useState)(()=>lp(e)?.perPage!==void 0),[u,d]=(0,v.useState)({page:1,key:r}),f=fp(u,r);f!==u&&d(f);let p=rp(f.page,o.perPage,t),m=(t,n=c)=>{s(t),l(n),up(e,vp(t,n)),d({page:1,key:r})};return{...p,...o,sorts:n,setPage:e=>d({page:e,key:r}),setPerPage:e=>m({...o,perPage:e},!0),setSort:(e,t)=>m({...o,sort:e,order:t})}}function xp({items:e,sorts:t,...n}){let r=bp({...n,sorts:t,total:e.length}),{compare:i,last:a}=t.find(e=>e.value===r.sort)??t[0];return{view:r,pageItems:(0,v.useMemo)(()=>cp(e,i,r.order,a),[e,i,a,r.order]).slice(Math.max(0,r.from-1),r.to)}}var Sp=e=>e instanceof Date?e:new Date(e),Cp=()=>Fi(ga(),typeof navigator>`u`?void 0:navigator.language);function wp(e){return Vi(Sp(e),Ki(),Cp())}function Tp(e){return Bi(Sp(e),Ki(),Cp())}function Ep(e){return zi(Sp(e),Ki(),Cp())}function Dp(e,t=Ki()){return Ri(Sp(e),t,Cp())}function Op(){return{locale:Cp(),choice:Ki()}}function kp(e,t){return Bi(Sp(e),t,Cp())}var Ap=[`byte`,`kilobyte`,`megabyte`,`gigabyte`];function jp(e){let t=Math.max(0,e),n=0;for(;t>=1024&&n<Ap.length-1;)t/=1024,n++;return new Intl.NumberFormat(Cp(),{style:`unit`,unit:Ap[n],unitDisplay:`short`,maximumFractionDigits:n===0?0:1}).format(t)}var Mp={"Content-Type":`application/json`},Np=3e5,Pp=(e,t,n={},r)=>W(e,{method:t,headers:Mp,body:JSON.stringify(n),...r?{timeout:r}:{}}),Fp=(e,t)=>`/api/spaces/${encodeURIComponent(e)}/${t}`,Ip={list:()=>W(`/api/spaces`),create:e=>Pp(`/api/spaces`,`POST`,{name:e}),switchTo:e=>Pp(Fp(e,`switch`),`POST`),rename:(e,t)=>Pp(Fp(e,`rename`),`POST`,{name:t}),archive:e=>Pp(Fp(e,`archive`),`POST`),unarchive:e=>Pp(Fp(e,`unarchive`),`POST`),backUp:e=>Pp(Fp(e,`backup`),`POST`,{},Np),openFolder:e=>Pp(Fp(e,`open-folder`),`POST`),remove:(e,t)=>Pp(`/api/spaces/${encodeURIComponent(e)}`,`DELETE`,{confirmName:t},Np),setLook:(e,t)=>t.kind===`reset`?Pp(Fp(e,`appearance`),`DELETE`):Pp(Fp(e,`appearance`),`PUT`,t.kind===`icon`?{kind:`icon`,icon:t.icon}:{kind:`image`,png:t.png}),restore:e=>Pp(`/api/spaces/backups/restore`,`POST`,{backup:e},Np)};async function Lp(e,t){let n=!1;if(t.name!==void 0){let r=await Ip.rename(e,t.name);if(!r.success)return{...r,data:{renamed:n}};n=!0}if(t.change){let r=await Ip.setLook(e,t.change);if(!r.success)return{...r,data:{renamed:n}}}return{success:!0,data:{renamed:n}}}function Rp(e,t){let n=`spaces-why-${t}-${e}`;return zp.has(n)?n:`spaces-why-other`}var zp=new Set([`spaces-why-default-archive`,`spaces-why-default-delete`,`spaces-why-active-switch`,`spaces-why-active-archive`,`spaces-why-active-delete`,`spaces-why-archived-switch`]),Bp=(e,t)=>e.localeCompare(t,void 0,{sensitivity:`base`}),Vp=(e,t)=>(e??``).localeCompare(t??``),Hp=[{value:`newest`,label:`Newest`,first:`desc`,flip:`oldest`,compare:(e,t)=>Vp(e.createdAt,t.createdAt)},{value:`oldest`,label:`Oldest`,first:`asc`,flip:`newest`,compare:(e,t)=>Vp(e.createdAt,t.createdAt)},{value:`name`,label:`Name (A–Z)`,first:`asc`,compare:(e,t)=>Bp(e.spaceName,t.spaceName)},{value:`largest`,label:`Largest`,first:`desc`,compare:(e,t)=>e.sizeBytes-t.sizeBytes}],Up=[{value:`archived`,label:`Newest archived`,first:`desc`,compare:(e,t)=>Vp(e.archivedAt,t.archivedAt),last:e=>e.archivedAt===null},{value:`name`,label:`Name (A–Z)`,first:`asc`,compare:(e,t)=>Bp(e.name,t.name)},{value:`created`,label:`Created`,first:`desc`,compare:(e,t)=>Vp(e.createdAt,t.createdAt),last:e=>e.createdAt===null},{value:`size`,label:`Largest`,first:`desc`,compare:(e,t)=>e.sizeBytes-t.sizeBytes}];function Wp({spaces:e,busy:t,actions:n}){let{t:r}=G(),{view:i,pageItems:a}=xp({storageKey:`omms-list-archived-spaces`,items:e,sorts:Up});return e.length===0?(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:r(`spaces-archive-empty`)}):(0,H.jsx)(_p,{view:i,totalLabel:r(`spaces-archive-total`,{count:i.total}),children:(0,H.jsx)(`ul`,{"aria-label":r(`spaces-archive-list-label`),className:`space-y-3`,children:a.map(e=>{let i=`archived-${e.id}-name`,a=e.disabled.delete?r(Rp(`delete`,e.disabled.delete)):void 0;return(0,H.jsxs)(`li`,{className:hf,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,H.jsx)(Df,{name:e.name,look:e.look}),(0,H.jsx)(`h3`,{id:i,className:gf,children:(0,H.jsx)(`bdi`,{children:e.name})})]}),(0,H.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[e.archivedAt?r(`spaces-archived-at`,{date:wp(e.archivedAt)}):r(`spaces-archived-none`),` · `,e.createdAt?r(`spaces-created`,{date:Tp(e.createdAt)}):r(`spaces-created-none`),` · `,r(`spaces-size`,{size:jp(e.sizeBytes)})]}),(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,H.jsx)(xf,{reasonId:`archived-${e.id}-why-restore`,busy:t,variant:`outline`,label:r(`spaces-action-restore`),icon:M,onClick:()=>n.onRestore(e)}),(0,H.jsx)(xf,{reasonId:`archived-${e.id}-why-backup`,busy:t,iconOnly:!0,variant:`outline`,label:r(`spaces-action-backup`),icon:Ce,onClick:()=>n.onBackUp(e)}),(0,H.jsx)(xf,{reason:a,reasonId:`archived-${e.id}-why-delete`,busy:t,iconOnly:!0,variant:`destructive`,label:r(`spaces-action-delete`),icon:Jt,onClick:()=>n.onDelete(e)})]})]},e.id)})})})}var Gp=new Set;function Kp(e){return Gp.add(e),()=>{Gp.delete(e)}}function qp(){for(let e of Gp)e()}function Jp(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(!1),[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(null),c=(0,v.useCallback)(async()=>{r(!0);let e=await Ip.list();r(!1),e.success&&e.data?(t(e.data),a(``)):a(e.error??``)},[]);return{snapshot:e,loading:n,loadError:i,busy:o,load:c,run:(0,v.useCallback)(async(e,t)=>{s(e);let n=await t();return n.success&&(await c(),await Ga(),qp()),s(null),n},[c])}}var Yp={success:{box:`border-status-success/25 bg-status-success/10`,icon:`text-status-success`,Icon:ge},info:{box:`border-status-info/25 bg-status-info/10`,icon:`text-status-info`,Icon:qe},warning:{box:`border-status-warning/25 bg-status-warning/10`,icon:`text-status-warning`,Icon:Xt},danger:{box:`border-destructive/25 bg-destructive/10`,icon:`text-destructive-label`,Icon:ht}};function Xp({tone:e,children:t,className:n}){let{box:r,icon:i,Icon:a}=Yp[e];return(0,H.jsxs)(`div`,{role:e===`danger`?`alert`:`note`,"data-tone":e,className:V(`flex min-w-0 items-start gap-2.5 rounded-xl border px-3 py-2.5 text-start text-sm`,r,n),children:[(0,H.jsx)(a,{className:V(`mt-0.5 size-4 shrink-0`,i),"aria-hidden":`true`}),(0,H.jsx)(`div`,{className:`min-w-0 space-y-1.5 text-foreground`,children:t})]})}var Zp={switch:`spaces-action-switch`,archive:`spaces-action-archive`,restore:`spaces-action-restore`,backup:`spaces-action-backup`},Qp={switch:`spaces-switching`,archive:`spaces-archiving`,restore:`spaces-restoring`,backup:`spaces-backing-up`};function $p({request:e,onConfirm:t,onClose:n}){let{t:r}=G(),[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)(``),{kind:c,name:l}=e;async function u(){a(!0),s(``);let r=await t(e);a(!1),r.success?n():s(r.error??``)}return(0,H.jsx)(Du,{open:!0,onOpenChange:e=>e||i?void 0:n(),children:(0,H.jsxs)(Au,{children:[(0,H.jsxs)(ju,{children:[(0,H.jsx)(Nu,{children:(0,H.jsx)(`bdi`,{children:r(`spaces-confirm-${c}-title`,{name:l})})}),(0,H.jsx)(Pu,{children:r(`spaces-confirm-${c}-body`)})]}),o?(0,H.jsx)(Xp,{tone:`danger`,children:o}):null,i?(0,H.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-muted-foreground`,children:[(0,H.jsx)(at,{className:`size-4 animate-spin`,"aria-hidden":`true`}),r(Qp[c],{name:l})]}):null,(0,H.jsxs)(Mu,{children:[(0,H.jsx)(q,{type:`button`,variant:`outline`,disabled:i,onClick:n,children:r(`spaces-cancel`)}),(0,H.jsx)(q,{type:`button`,disabled:i,onClick:()=>void u(),children:r(Zp[c])})]})]})})}var em=Object.defineProperty,tm=v.forwardRef(((e,t)=>em(e,`name`,{value:t,configurable:!0}))(function(e,t){return(0,H.jsx)(bs.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},`Label`));function nm({className:e,...t}){return(0,H.jsx)(tm,{"data-slot":`label`,className:V(`flex items-center gap-2 text-ui leading-normal select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}function rm({space:e,onDelete:t,onClose:n}){let{t:r}=G(),[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(``),[u,d]=(0,v.useState)(null),f=e?.name??``;function p(){a(``),l(``),d(null),n()}async function m(){if(!e||i!==e.name)return;s(!0),l(``);let n=await t(e,i);s(!1),n.success&&n.data?d(n.data):l(n.error??``)}return(0,H.jsx)(Du,{open:e!==null,onOpenChange:e=>e||o?void 0:p(),children:(0,H.jsx)(Au,{children:u?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(ju,{children:[(0,H.jsx)(Nu,{children:r(`spaces-deleted-title`,{name:f})}),(0,H.jsx)(Pu,{children:r(`spaces-delete-restore`)})]}),(0,H.jsxs)(`div`,{className:`min-w-0 space-y-1 text-sm`,children:[(0,H.jsx)(`p`,{children:r(`spaces-delete-backup`)}),(0,H.jsx)(`p`,{dir:`ltr`,className:`break-all rounded-lg bg-secondary px-2 py-1 font-mono text-xs`,children:u.backup.path})]}),u.leftoverFolder?(0,H.jsxs)(Xp,{tone:`warning`,children:[(0,H.jsx)(`p`,{children:r(`spaces-delete-leftover`)}),(0,H.jsx)(`p`,{dir:`ltr`,className:`break-all font-mono text-xs`,children:u.leftoverFolder})]}):null,(0,H.jsx)(Mu,{children:(0,H.jsx)(q,{type:`button`,onClick:p,children:r(`spaces-close`)})})]}):(0,H.jsxs)(`form`,{className:`grid gap-6`,onSubmit:e=>{e.preventDefault(),m()},children:[(0,H.jsxs)(ju,{children:[(0,H.jsx)(Nu,{children:(0,H.jsx)(`bdi`,{children:r(`spaces-delete-title`,{name:f})})}),(0,H.jsx)(Pu,{children:r(`spaces-delete-warning`)})]}),(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsx)(nm,{htmlFor:`space-delete-name`,children:r(`spaces-delete-confirm-label`,{name:f})}),(0,H.jsx)(Jd,{id:`space-delete-name`,value:i,disabled:o,autoComplete:`off`,onChange:e=>a(e.target.value)})]}),c?(0,H.jsx)(Xp,{tone:`danger`,children:c}):null,o?(0,H.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-muted-foreground`,children:[(0,H.jsx)(at,{className:`size-4 animate-spin`,"aria-hidden":`true`}),r(`spaces-deleting`,{name:f})]}):null,(0,H.jsxs)(Mu,{children:[(0,H.jsx)(q,{type:`button`,variant:`outline`,disabled:o,onClick:p,children:r(`spaces-cancel`)}),(0,H.jsx)(q,{type:`submit`,variant:`destructive`,disabled:i!==f||o,children:r(`spaces-delete-button`)})]})]})})})}var im={opencode:`OpenCode`,pi:`Pi`,"claude-code":`Claude Code`};function am(e){return im[e]}function om(e){return Object.hasOwn(im,e)?im[e]:e}var sm=Qd.map(e=>({id:e,title:e===`shared`?`Shared`:am(e)})),cm=[{id:`shared-profile`,title:`Profile learning`},{id:`shared-limits`,title:`Memory limits`},{id:`shared-keywords`,title:`Keyword matching`},{id:`shared-reranker`,title:`Reranker`},{id:`shared-directory-maps`,title:`Directory maps`}];cm.map(e=>e.id);var lm=e=>`${$d(`shared`)}#${e}`,um=`/memory`,dm={"settings-section-import":um,"settings-section-auto-import":um,"settings-section-profile":lm(`shared-profile`),"settings-section-memory":lm(`shared-limits`),"settings-section-directory-maps":lm(`shared-directory-maps`)},fm={"memory-section-import":um,"memory-section-auto-import":um,"memory-section-profile":lm(`shared-profile`),"memory-section-limits":lm(`shared-limits`),"memory-section-keywords":lm(`shared-keywords`),"memory-section-reranker":lm(`shared-reranker`),"memory-section-project-folders":lm(`shared-directory-maps`)};function pm(e,t){if(e!==`/settings`&&e!==um)return null;let n=t.replace(/^#/,``),r=/^directory-maps-(pi|opencode|claude-code)$/.exec(n)?.[1];return r?`${$d(r)}#host-unresolved`:(e===`/settings`?dm:fm)[n]??null}var mm={block:`start`};function hm(e){let t=e.classList;t&&(t.remove(`anchor-flash`),e.offsetWidth,t.add(`anchor-flash`),setTimeout(()=>t.remove(`anchor-flash`),1600))}function gm(e,t){let n=e.startsWith(`#`)?e.slice(1):``;if(!/^(settings|memory)-section-[a-z0-9-]+$/.test(n))return!1;let r=t.getElementById(n);return r?(r.scrollIntoView(mm),hm(r),!0):!1}function _m(e){if(typeof document>`u`||typeof requestAnimationFrame>`u`)return;let t=e.replace(/^#/,``);if(!/^(?:(?:settings|memory|skills)-section-[a-z0-9-]+|space-card-[a-z0-9-]+|directory-maps-(?:pi|opencode|claude-code)|shared-(?:profile|limits|keywords|reranker|directory-maps)|host-unresolved|memory-injection|profile-(?:preferences|patterns|workflows))$/.test(t))return;let n=0,r=()=>{let e=document.getElementById(t);if(!e){n++<50&&requestAnimationFrame(r);return}if(t.startsWith(`shared-`)){let t=e.closest(`details`);t&&(t.open=!0)}if(t.startsWith(`directory-maps-`)){let t=e.parentElement;t&&(t.open=!0),e.focus({preventScroll:!0})}e.scrollIntoView(mm),hm(e)};requestAnimationFrame(r)}function vm(e,t=``){return pm(nf(e),t)??`${of(e)}${t}`}var ym=typeof window<`u`?vm(window.location.pathname,window.location.hash):J.project,bm=new Set;function xm(){for(let e of bm)e()}function Sm(e){ym!==e&&(ym=e,xm())}function Cm(e){return bm.add(e),()=>{bm.delete(e)}}function wm(){return ym}function Tm(){return J.project}function Em(e,t=!1){let[n,r=``]=e.split(/(?=#)/),i=vm(n,r),a=pm(nf(n),r);`${nf(window.location.pathname)}${window.location.hash}`!==i&&(t||a?window.history.replaceState({},``,i):window.history.pushState({},``,i)),Sm(i);let o=i.indexOf(`#`);o>=0&&_m(i.slice(o))}function Dm(){let e=()=>{let e=`${nf(window.location.pathname)}${window.location.hash}`,t=vm(window.location.pathname,window.location.hash);e!==t&&window.history.replaceState({},``,t),Sm(t),window.location.hash&&_m(window.location.hash)};return e(),window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)}function Om(){return(0,v.useSyncExternalStore)(Cm,wm,Tm)}function km(){return rf(Om().split(`#`)[0])}function Am(){let{t:e}=G(),t=Jp(),[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(null);async function c(e,n,i,a,o=``){r(null);let s=await t.run(n,i);return r(s.success?{where:e,tone:`success`,...a(s.data)}:{where:e,tone:`danger`,text:[o,s.error??``].filter(Boolean).join(` `)}),s}function l({kind:t,id:n,name:r}){return t===`switch`?c(`spaces`,e(`spaces-switching`,{name:r}),()=>Ip.switchTo(n),()=>({text:e(`spaces-switched`,{name:r})}),e(`spaces-switch-failed`)):t===`archive`?c(`spaces`,e(`spaces-archiving`,{name:r}),()=>Ip.archive(n),()=>({text:e(`spaces-archived`,{name:r}),link:{href:J.spacesArchive,label:e(`spaces-archive-open`)}})):t===`restore`?c(`spaces`,e(`spaces-restoring`,{name:r}),()=>Ip.unarchive(n),()=>({text:e(`spaces-restored-space`,{name:r})})):c(`spaces`,e(`spaces-backing-up`,{name:r}),()=>Ip.backUp(n),t=>({text:e(`spaces-backed-up`,{path:t.backup.path})}))}let u=e=>t=>a({kind:e,id:t.id,name:t.name});return{spaces:t,act:c,ask:u,askDelete:s,setFeedback:r,dialogs:(0,H.jsxs)(H.Fragment,{children:[i?(0,H.jsx)($p,{request:i,onClose:()=>a(null),onConfirm:l}):null,(0,H.jsx)(rm,{space:o,onClose:()=>s(null),onDelete:(n,r)=>t.run(e(`spaces-deleting`,{name:n.name}),()=>Ip.remove(n.id,r))})]}),feedbackFor:r=>n?.where===r?(0,H.jsxs)(`div`,{"aria-live":`polite`,className:`space-y-2`,children:[(0,H.jsx)(Xp,{tone:n.tone===`success`?`success`:`danger`,children:n.text}),n.link?(0,H.jsx)(`a`,{href:n.link.href,onClick:e=>{e.preventDefault(),Em(n.link.href)},className:`text-ui text-primary-label underline-offset-4 hover:underline focus-visible:outline-2 focus-visible:outline-ring`,children:n.link.label}):null,n.offerSwitch?(0,H.jsx)(q,{type:`button`,variant:`outline`,size:`sm`,disabled:t.busy!==null,onClick:()=>u(`switch`)(n.offerSwitch),children:e(`spaces-created-switch`,{name:n.offerSwitch.name})}):null]}):null}}function jm(){let{t:e}=G(),{spaces:t,ask:n,askDelete:r,dialogs:i,feedbackFor:a}=Am(),{load:o}=t,s=(t.snapshot?.spaces??[]).filter(e=>e.archived);return(0,v.useEffect)(()=>{o()},[o]),(0,H.jsxs)(`div`,{className:`space-y-6`,children:[(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`spaces-archive-intro`)}),t.busy?(0,H.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,H.jsx)(at,{className:`size-4 animate-spin`,"aria-hidden":`true`}),t.busy]}):null,a(`spaces`),t.loading&&!t.snapshot?(0,H.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,H.jsx)(at,{className:`size-4 animate-spin`,"aria-hidden":`true`}),e(`spaces-loading`)]}):null,!t.snapshot&&t.loadError?(0,H.jsxs)(Xp,{tone:`danger`,children:[(0,H.jsx)(`p`,{children:e(`spaces-load-failed`)}),(0,H.jsx)(`p`,{children:t.loadError})]}):null,t.snapshot?(0,H.jsx)(Wp,{spaces:s,busy:t.busy!==null,actions:{onRestore:n(`restore`),onBackUp:n(`backup`),onDelete:r}}):null,i]})}function Mm(e,t){if(typeof document>`u`)return;let n=URL.createObjectURL(e),r=document.createElement(`a`);r.href=n,r.download=t,r.click(),URL.revokeObjectURL(n)}function Nm({space:e,onClose:t}){let{t:n}=G(),[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(!1),[l,u]=(0,v.useState)(!1),[d,f]=(0,v.useState)(``),[p,m]=(0,v.useState)(null);async function h(){u(!0),f(``);try{let t=await fetch(`/api/spaces/${e.id}/export`,{method:`POST`,headers:{"Content-Type":`application/json`,"x-omms-token":window.__OMMS_TOKEN__||``},body:JSON.stringify({...r?{since:r}:{},...a?{until:a}:{},includeProfile:s})}),n=t.headers.get(`content-disposition`);if(t.ok&&n){let r=/filename="([^"]+)"/.exec(n)?.[1]??`omms-space-export-${e.id}.json`,i=JSON.parse(t.headers.get(`x-omms-export-info`)??`{}`),a=await t.blob();m({written:!0,counts:i.counts,warnings:i.warnings??[],blob:a,fileName:r}),Mm(a,r);return}let i=await t.json().catch(()=>null);if(i?.success&&i.data){m({written:!1,warnings:[]});return}f(i?.error??`Export failed (${t.status}).`)}catch(e){f(e instanceof Error?e.message:String(e))}finally{u(!1)}}return(0,H.jsx)(Du,{open:!0,onOpenChange:e=>e||l?void 0:t(),children:(0,H.jsx)(Au,{children:(0,H.jsxs)(`form`,{className:`grid gap-4`,onSubmit:e=>{e.preventDefault(),l||h()},children:[(0,H.jsx)(ju,{children:(0,H.jsx)(Nu,{children:(0,H.jsx)(`bdi`,{children:n(`spaces-export-title`,{name:e.name})})})}),(0,H.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsx)(nm,{htmlFor:`space-export-since`,children:n(`spaces-export-from`)}),(0,H.jsx)(Jd,{id:`space-export-since`,type:`date`,value:r,disabled:l,onChange:e=>i(e.target.value)})]}),(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsx)(nm,{htmlFor:`space-export-until`,children:n(`spaces-export-to`)}),(0,H.jsx)(Jd,{id:`space-export-until`,type:`date`,value:a,disabled:l,onChange:e=>o(e.target.value)})]})]}),(0,H.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,H.jsx)(Bs,{id:`space-export-profile`,checked:s,disabled:l,onCheckedChange:e=>c(e===!0)}),(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsx)(nm,{htmlFor:`space-export-profile`,children:n(`spaces-export-profile-label`)}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`spaces-export-profile-note`)})]})]}),d?(0,H.jsx)(Xp,{tone:`danger`,children:d}):null,l?(0,H.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-muted-foreground`,children:[(0,H.jsx)(at,{className:`size-4 animate-spin`,"aria-hidden":`true`}),n(`spaces-export-running`)]}):null,p?p.written?(0,H.jsxs)(Xp,{tone:`success`,children:[(0,H.jsx)(`p`,{children:n(`spaces-export-replaced`,{paths:p.counts?.pathsReplaced??0,emails:p.counts?.emailsReplaced??0})}),(0,H.jsx)(`p`,{children:n(`spaces-export-names-note`)}),p.warnings.length>0?(0,H.jsx)(`ul`,{className:`list-inside list-disc space-y-0.5 text-xs text-muted-foreground`,children:p.warnings.map(e=>(0,H.jsx)(`li`,{className:`break-words`,children:e},e))}):null]}):(0,H.jsx)(`p`,{children:n(`spaces-export-empty`)}):null,(0,H.jsxs)(Mu,{children:[(0,H.jsx)(q,{type:`button`,variant:`outline`,disabled:l,onClick:t,children:n(`spaces-close`)}),p?.written?(0,H.jsx)(q,{type:`button`,variant:`outline`,disabled:l,onClick:()=>{p?.blob&&p.fileName&&Mm(p.blob,p.fileName)},children:n(`spaces-export-download`)}):null,(0,H.jsx)(q,{type:`submit`,disabled:l,children:n(`spaces-export-download`)})]})]})})})}function Pm({spaces:e,onImported:t,onClose:n}){let{t:r}=G(),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(null),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(null),[f,p]=(0,v.useState)(``),[m,h]=(0,v.useState)(``),[g,_]=(0,v.useState)(``),[y,b]=(0,v.useState)(!1),[x,S]=(0,v.useState)(!1),[C,w]=(0,v.useState)(``),[T,E]=(0,v.useState)(null);function D(e){return e.code===`name-taken`?r(`spaces-import-name-taken`,{name:m.trim()}):e.code===`missing-folder`?r(`spaces-import-folder-missing`):e.error??``}async function O(e){l(!0),p(``);let t=await W(`/api/spaces/import/check`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({document:e})});l(!1),t.success&&t.data?d(t.data):p(D(t))}async function k(e){if(!e)return;a(e),d(null),p(``),s(null);let t;try{t=JSON.parse(await e.text())}catch{p(r(`spaces-import-error-not-json`));return}s(t),O(t)}let A=m.trim()!==``&&e.some(e=>e.name===m.trim()),j=u!==null&&(u.embedding.fileModel!==u.embedding.currentModel||u.embedding.fileDimensions!==u.embedding.currentDimensions),M=o!==null&&u!==null&&!A&&m.trim()!==``&&!x&&!T;async function N(){if(!o)return;S(!0),w(``);let e=await W(`/api/spaces/import`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({document:o,name:m.trim(),...g.trim()?{retagToProject:g.trim()}:{}})});if(S(!1),b(!1),e.success&&e.data){E({count:e.data.counts.projectMemories+e.data.counts.userMemories,name:e.data.spaceName??m.trim()}),t();return}w(D(e))}return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(Du,{open:!0,onOpenChange:e=>e||x?void 0:n(),children:(0,H.jsx)(Au,{children:T?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(ju,{children:(0,H.jsx)(Nu,{children:r(`spaces-import-title`)})}),(0,H.jsx)(Xp,{tone:`success`,children:(0,H.jsx)(`p`,{children:(0,H.jsx)(`bdi`,{children:r(`spaces-import-done`,{count:T.count,name:T.name})})})}),(0,H.jsx)(Mu,{children:(0,H.jsx)(q,{type:`button`,onClick:n,children:r(`spaces-close`)})})]}):(0,H.jsxs)(`form`,{className:`grid gap-4`,onSubmit:e=>{e.preventDefault(),M&&b(!0)},children:[(0,H.jsx)(ju,{children:(0,H.jsx)(Nu,{children:r(`spaces-import-title`)})}),(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsx)(nm,{htmlFor:`space-import-file`,children:r(`spaces-import-file`)}),(0,H.jsxs)(`label`,{className:`inline-flex`,children:[(0,H.jsx)(`input`,{type:`file`,accept:`application/json,.json`,className:`sr-only peer`,disabled:c||x,onChange:e=>void k(e.target.files?.[0])}),(0,H.jsxs)(`span`,{className:`inline-flex h-8 cursor-pointer items-center gap-1.5 rounded-[9px] border border-border px-3 text-ui font-medium hover:bg-interactive-hover peer-focus-visible:outline-2 peer-focus-visible:outline-ring`,children:[(0,H.jsx)(je,{className:`size-4`,"aria-hidden":`true`}),r(`spaces-import-choose-file`)]})]}),i?(0,H.jsx)(`p`,{dir:`ltr`,className:`text-xs text-muted-foreground`,children:i.name}):null]}),c?(0,H.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-muted-foreground`,children:[(0,H.jsx)(at,{className:`size-4 animate-spin`,"aria-hidden":`true`}),r(`spaces-import-running`)]}):null,f?(0,H.jsx)(Xp,{tone:`danger`,children:f}):null,u?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsx)(nm,{htmlFor:`space-import-name`,children:r(`spaces-import-name`)}),(0,H.jsx)(Jd,{id:`space-import-name`,value:m,disabled:x,onChange:e=>h(e.target.value)})]}),(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsx)(nm,{htmlFor:`space-import-project`,children:r(`spaces-import-project`)}),(0,H.jsx)(Jd,{id:`space-import-project`,value:g,disabled:x,dir:`ltr`,onChange:e=>_(e.target.value)}),(0,H.jsx)(`p`,{children:g.trim()?r(`spaces-import-projects-merge`,{count:u.projects.length,folder:g.trim()}):r(`spaces-import-projects-kept`)})]}),j&&u?(0,H.jsx)(Xp,{tone:`warning`,children:r(`spaces-import-model-warning`,{fileModel:u.embedding.fileModel,fileDimensions:u.embedding.fileDimensions,currentModel:u.embedding.currentModel,currentDimensions:u.embedding.currentDimensions})}):null]}):null,A?(0,H.jsx)(Xp,{tone:`danger`,children:r(`spaces-import-name-taken`,{name:m.trim()})}):null,C?(0,H.jsx)(Xp,{tone:`danger`,children:C}):null,(0,H.jsxs)(Mu,{children:[(0,H.jsx)(q,{type:`button`,variant:`outline`,disabled:x,onClick:n,children:r(`spaces-cancel`)}),(0,H.jsx)(q,{type:`submit`,disabled:!M,children:r(`spaces-import-confirm`)})]})]})})}),y&&M?(0,H.jsx)(Du,{open:!0,onOpenChange:e=>e||x?void 0:b(!1),children:(0,H.jsxs)(Au,{children:[(0,H.jsxs)(ju,{children:[(0,H.jsx)(Nu,{children:(0,H.jsx)(`bdi`,{children:r(`spaces-import-confirm-title`,{name:m.trim()})})}),(0,H.jsx)(Pu,{children:(0,H.jsx)(`bdi`,{children:r(`spaces-import-confirm-body`,{name:m.trim()})})})]}),x?(0,H.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-muted-foreground`,children:[(0,H.jsx)(at,{className:`size-4 animate-spin`,"aria-hidden":`true`}),r(`spaces-import-running`)]}):null,(0,H.jsxs)(Mu,{children:[(0,H.jsx)(q,{type:`button`,variant:`outline`,disabled:x,onClick:()=>b(!1),children:r(`spaces-cancel`)}),(0,H.jsx)(q,{type:`button`,disabled:x,onClick:()=>void N(),children:r(`spaces-import-confirm`)})]})]})}):null]})}function Fm(e){return e.links??[]}function Im({space:e,spaces:t,busy:n,onChanged:r}){let{t:i}=G(),a=Fm(e),o=new Set(a.map(e=>e.id)),s=t.filter(t=>!t.archived&&t.id!==e.id&&!o.has(t.id)),[c,l]=(0,v.useState)(``),[u,d]=(0,v.useState)(null),[f,p]=(0,v.useState)(!1),[m,h]=(0,v.useState)(``),[g,_]=(0,v.useState)(null),y=c||s[0]?.id||``,b=n||f;async function x(t){p(!0),h(``);let n=await W(`/api/spaces/${e.id}/links`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t.kind===`link`?{add:t.id}:{remove:t.id})});if(p(!1),d(null),!n.success){h(n.error??``);return}l(``),t.kind===`unlink`&&_(t.name),r()}return(0,H.jsxs)(`div`,{className:`space-y-1 text-xs`,children:[(0,H.jsx)(`p`,{className:`font-medium`,children:i(`spaces-links-title`)}),a.length>0?(0,H.jsx)(`ul`,{"aria-label":i(`spaces-links-list-label`),className:`space-y-1`,children:a.map(e=>(0,H.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`bdi`,{className:`min-w-0 break-words`,children:e.name}),e.available?null:(0,H.jsx)(`span`,{children:i(`spaces-links-unavailable`)}),(0,H.jsx)(q,{type:`button`,variant:`ghost`,size:`icon-sm`,disabled:b,"aria-label":i(`spaces-links-unlink-label`,{name:e.name}),onClick:()=>d({kind:`unlink`,id:e.id,name:e.name}),children:(0,H.jsx)(et,{"aria-hidden":`true`})})]},e.id))}):(0,H.jsx)(`p`,{children:i(`spaces-links-none`)}),s.length>0?(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,H.jsx)(Rr,{id:`space-links-picker`,value:y,disabled:b,onChange:e=>l(e.target.value),children:s.map(e=>(0,H.jsx)(`option`,{value:e.id,children:e.name},e.id))}),(0,H.jsxs)(q,{type:`button`,variant:`outline`,size:`sm`,disabled:b||y===``,onClick:()=>d({kind:`link`,id:y,name:s.find(e=>e.id===y)?.name??``}),children:[(0,H.jsx)(tt,{className:`size-4`,"aria-hidden":`true`}),i(`spaces-links-add`)]})]}):null,f?(0,H.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-muted-foreground`,children:[(0,H.jsx)(at,{className:`size-4 animate-spin`,"aria-hidden":`true`}),i(`spaces-transfer-applying`)]}):null,g?(0,H.jsx)(Xp,{tone:`success`,children:(0,H.jsx)(`p`,{children:(0,H.jsx)(`bdi`,{children:i(`spaces-links-unlinked`,{name:g})})})}):null,m?(0,H.jsx)(Xp,{tone:`danger`,children:m}):null,u?(0,H.jsx)(Du,{open:!0,onOpenChange:e=>e||f?void 0:d(null),children:(0,H.jsxs)(Au,{children:[(0,H.jsxs)(ju,{children:[(0,H.jsx)(Nu,{children:(0,H.jsx)(`bdi`,{children:u.kind===`link`?i(`spaces-links-confirm-link-title`,{name:u.name,space:e.name}):i(`spaces-links-confirm-unlink-title`,{name:u.name})})}),(0,H.jsx)(Pu,{children:(0,H.jsx)(`bdi`,{children:u.kind===`link`?i(`spaces-links-confirm-link-body`,{name:u.name,space:e.name}):i(`spaces-links-confirm-unlink-body`)})})]}),(0,H.jsxs)(Mu,{children:[(0,H.jsx)(q,{type:`button`,variant:`outline`,disabled:f,onClick:()=>d(null),children:i(`spaces-cancel`)}),(0,H.jsx)(q,{type:`button`,disabled:f,onClick:()=>void x(u),children:u.kind===`link`?i(`spaces-links-confirm-link-button`):i(`spaces-links-unlink`)})]})]})}):null]})}function Lm({backups:e,busy:t,onRestore:n}){let{t:r}=G(),{view:i,pageItems:a}=xp({storageKey:`omms-list-space-backups`,items:e,sorts:Hp});return e.length===0?(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:r(`spaces-backups-empty`)}):(0,H.jsx)(_p,{view:i,totalLabel:r(`spaces-backups-total`,{count:i.total}),children:(0,H.jsx)(`ul`,{"aria-label":r(`spaces-backups-list-label`),className:`space-y-3`,children:a.map(e=>(0,H.jsxs)(`li`,{className:hf,children:[(0,H.jsx)(`h3`,{id:`backup-${e.folder}`,className:gf,children:(0,H.jsx)(`bdi`,{children:e.spaceName})}),(0,H.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[r(`spaces-backup-date`,{date:wp(e.createdAt)}),` · `,r(`spaces-size`,{size:jp(e.sizeBytes)})]}),(0,H.jsx)(q,{type:`button`,variant:`outline`,size:`sm`,disabled:t,"aria-describedby":`backup-${e.folder}`,onClick:()=>n(e),children:r(`spaces-restore`)})]},e.folder))})})}function Rm(e){let t=(t,...n)=>n.every((n,r)=>e[t+r]===n);return t(0,137,80,78,71,13,10,26,10)?`png`:t(0,255,216,255)?`jpeg`:t(0,71,73,70,56)?`gif`:t(0,82,73,70,70)&&t(8,87,69,66,80)?`webp`:null}async function zm(e){return e.size>20971520?`size`:Rm(new Uint8Array(await e.slice(0,16).arrayBuffer()))?null:`type`}function Bm(e,t){let n=Math.min(e,t);return{x:Math.floor((e-n)/2),y:Math.floor((t-n)/2),side:n}}async function Vm(e){let t=await createImageBitmap(e);try{let{x:e,y:n,side:r}=Bm(t.width,t.height),i=document.createElement(`canvas`);i.width=128,i.height=128;let a=i.getContext(`2d`);if(!a)throw Error(`This browser cannot draw the image`);a.imageSmoothingQuality=`high`,a.drawImage(t,e,n,r,r,0,0,128,128);let o=await new Promise(e=>i.toBlob(e,`image/png`));if(!o)throw Error(`This browser cannot save the image`);let s=new Uint8Array(await o.arrayBuffer()),c=``;for(let e of s)c+=String.fromCharCode(e);return btoa(c)}finally{t.close()}}function Hm({title:e,look:t,renderAvatar:n,extra:r,extraChanged:i=!1,onSave:a,onClose:o}){let s=Y(),[c,l]=(0,v.useState)(null),[u,d]=(0,v.useState)(``),[f,p]=(0,v.useState)(``),[m,h]=(0,v.useState)(!1),g=c===null?t:`reset`in c?{kind:`default`}:c.look,_=Cf.filter(e=>e.includes(u.trim().toLowerCase()));async function y(e){if(!e)return;p(``);let t=await zm(e);if(t){p(s(t===`size`?`The image is larger than 20 MB.`:`Only PNG, JPEG, WebP and GIF images are accepted.`));return}try{let t=await Vm(e);l({look:{kind:`image`,image:`data:image/png;base64,${t}`},png:t})}catch{p(s(`This browser could not read the image.`))}}function b(){return c===null?null:`reset`in c?{kind:`reset`}:c.look.kind===`icon`?{kind:`icon`,icon:c.look.icon}:c.png?{kind:`image`,png:c.png}:null}async function x(){h(!0),p(``);try{await a(b()),o()}catch(e){p(e.message),h(!1)}}return(0,H.jsx)(Du,{open:!0,onOpenChange:e=>!e&&!m&&o(),children:(0,H.jsxs)(Au,{className:`sm:max-w-lg`,children:[(0,H.jsxs)(ju,{children:[(0,H.jsx)(Nu,{children:e}),(0,H.jsx)(Pu,{children:s(`Every avatar is shown at the same size. Images are cropped to a square.`)})]}),r,(0,H.jsxs)(`div`,{className:`flex items-center gap-3`,children:[n(g),(0,H.jsxs)(`label`,{className:`inline-flex`,children:[(0,H.jsx)(`input`,{type:`file`,accept:`image/png,image/jpeg,image/webp,image/gif`,className:`sr-only peer`,onChange:e=>void y(e.target.files?.[0])}),(0,H.jsxs)(`span`,{className:`inline-flex h-8 cursor-pointer items-center gap-1.5 rounded-[9px] border border-border px-3 text-ui font-medium hover:bg-interactive-hover peer-focus-visible:outline-2 peer-focus-visible:outline-ring`,children:[(0,H.jsx)(Ge,{className:`size-4`,"aria-hidden":`true`}),s(`Upload image`)]})]}),(0,H.jsxs)(q,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>l({reset:!0}),children:[(0,H.jsx)(Pt,{"aria-hidden":`true`}),s(`Reset to default`)]})]}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:s(`PNG, JPEG, WebP or GIF, up to 20 MB.`)}),(0,H.jsx)(Jd,{type:`search`,value:u,onChange:e=>d(e.target.value),"aria-label":s(`Search icons`),placeholder:s(`Search icons`)}),(0,H.jsxs)(`div`,{role:`group`,"aria-label":s(`Choose icon`),className:`grid max-h-48 grid-cols-6 gap-1 overflow-y-auto sm:grid-cols-8`,children:[_.map(e=>{let t=Sf[e],n=g.kind===`icon`&&g.icon===e;return(0,H.jsx)(`button`,{type:`button`,title:e,"aria-label":e,"aria-pressed":n,onClick:()=>l({look:{kind:`icon`,icon:e}}),className:V(`grid size-10 cursor-pointer place-items-center rounded-[9px] border border-transparent text-muted-foreground hover:bg-interactive-hover focus-visible:outline-2 focus-visible:outline-ring`,n&&`border-primary bg-primary/10 text-primary-label`),children:(0,H.jsx)(t,{className:`size-5`,"aria-hidden":`true`})},e)}),_.length===0&&(0,H.jsx)(`p`,{className:`col-span-full text-sm text-muted-foreground`,children:s(`No icon matches.`)})]}),f&&(0,H.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive-label`,children:f}),(0,H.jsxs)(Mu,{children:[(0,H.jsx)(q,{type:`button`,variant:`outline`,onClick:o,disabled:m,children:s(`Cancel`)}),(0,H.jsx)(q,{type:`button`,onClick:()=>void x(),disabled:m||c===null&&!i,children:s(`Save`)})]})]})})}function Um({space:e,onSave:t,onClose:n}){let{t:r}=G(),[i,a]=(0,v.useState)(null),o=i??e.name,s=e.disabled.rename,c=s===void 0&&o.trim()!==``&&o!==e.name,l=`space-${e.id}-edit-why`;return(0,H.jsx)(Hm,{title:r(`spaces-edit-title`,{name:e.name}),look:e.look,renderAvatar:e=>(0,H.jsx)(Df,{name:o,look:e}),extraChanged:c,onClose:n,onSave:e=>t(c?o:void 0,e),extra:(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsx)(nm,{htmlFor:`space-edit-name`,children:r(`spaces-edit-name`)}),(0,H.jsx)(Jd,{id:`space-edit-name`,value:o,disabled:s!==void 0,"aria-describedby":s?l:void 0,onChange:e=>a(e.target.value)}),s?(0,H.jsx)(`p`,{id:l,className:`text-xs text-muted-foreground`,children:r(Rp(`rename`,s))}):null]})})}function Wm({preview:e}){let{t}=G();return(0,H.jsxs)(`div`,{className:`space-y-2 text-sm`,"data-slot":`transfer-preview`,children:[(0,H.jsx)(`p`,{className:`font-medium`,children:e.matched===0?t(`spaces-transfer-preview-empty`):t(`spaces-transfer-preview-count`,{count:e.matched})}),e.groups.length>0?(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t(`spaces-transfer-preview-projects-label`)}),(0,H.jsx)(`ul`,{className:`list-inside list-disc space-y-0.5 text-xs text-muted-foreground`,children:e.groups.map(e=>(0,H.jsx)(`li`,{className:`break-words`,children:(0,H.jsx)(`bdi`,{children:t(`spaces-transfer-preview-project-count`,{project:e.name,count:e.count})})},e.name))})]}):null,e.examples.length>0?(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t(`spaces-transfer-preview-examples-label`)}),(0,H.jsx)(`ul`,{className:`list-inside list-disc space-y-0.5 text-xs text-muted-foreground`,children:e.examples.map(e=>(0,H.jsx)(`li`,{className:`break-words`,children:(0,H.jsx)(`bdi`,{children:e.text})},e.id))})]}):null,(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t(`spaces-transfer-preview-duplicates`,{count:e.duplicates})})]})}function Gm({id:e,label:t,children:n}){return(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsx)(nm,{htmlFor:e,children:t}),n]})}function Km({source:e,spaces:t,onApplied:n,onClose:r}){let{t:i}=G(),a=t.filter(t=>!t.archived&&t.id!==e.id),[o,s]=(0,v.useState)({to:a[0]?.id??``,mode:`copy`}),[c,l]=(0,v.useState)(null),[u,d]=(0,v.useState)(!1),[f,p]=(0,v.useState)(!1),[m,h]=(0,v.useState)(!1),[g,_]=(0,v.useState)(!1),[y,b]=(0,v.useState)(``),[x,S]=(0,v.useState)(!1),[C,w]=(0,v.useState)(null),T=a.find(e=>e.id===o.to)?.name??``,E=o.to!==``&&!f&&!C,D=c!==null&&c.toCopy>0&&!f&&!C;function O(e,t){s(n=>({...n,[e]:t})),d(c!==null),l(null),S(!1)}function k(t){return{from:e.id,to:o.to,mode:o.mode,...o.since?{since:o.since}:{},...o.until?{until:o.until}:{},...o.project?.trim()?{projects:[o.project.trim()]}:{},...t?{confirm:!0}:{}}}async function A(e,t){return await W(e,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)})}async function j(){if(!E)return;p(!0),b(``);let e=await A(`/api/spaces/transfer/preview`,k(!1));p(!1),e.success&&e.data?.preview?(l(e.data.preview),d(!1),S(!1)):b(e.error??``)}async function M(){_(!0),b(``);let e=await A(`/api/spaces/transfer`,k(!0));_(!1),h(!1);let t=e.data?.result;if(e.success&&t){let e=o.mode===`move`?t.removed:t.copied;w({mode:o.mode,count:e,skipped:t.skipped}),n();return}e.code===`transfer-busy`?S(!0):b(e.error??``)}let N=o.mode;return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(Du,{open:!0,onOpenChange:e=>e||g?void 0:r(),children:(0,H.jsx)(Au,{children:C?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(ju,{children:(0,H.jsx)(Nu,{children:i(`spaces-transfer-title`)})}),(0,H.jsx)(Xp,{tone:`success`,children:(0,H.jsx)(`p`,{children:i(`spaces-transfer-result-${C.mode===`move`?`moved`:`copied`}`,{count:C.count,skipped:C.skipped,source:e.name})})}),(0,H.jsx)(Mu,{children:(0,H.jsx)(q,{type:`button`,onClick:r,children:i(`spaces-close`)})})]}):(0,H.jsxs)(`form`,{className:`grid gap-4`,onSubmit:e=>{e.preventDefault(),j()},children:[(0,H.jsxs)(ju,{children:[(0,H.jsx)(Nu,{children:i(`spaces-transfer-title`)}),(0,H.jsx)(Pu,{children:i(`spaces-transfer-intro`)})]}),(0,H.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,H.jsx)(Gm,{id:`space-transfer-source`,label:i(`spaces-transfer-source`),children:(0,H.jsx)(Rr,{id:`space-transfer-source`,value:e.id,onChange:()=>{},disabled:!0,children:(0,H.jsx)(`option`,{value:e.id,children:e.name})})}),(0,H.jsx)(Gm,{id:`space-transfer-target`,label:i(`spaces-transfer-target`),children:(0,H.jsx)(Rr,{id:`space-transfer-target`,value:o.to,onChange:e=>O(`to`,e.target.value),disabled:f,children:a.map(e=>(0,H.jsx)(`option`,{value:e.id,children:e.name},e.id))})}),(0,H.jsx)(Gm,{id:`space-transfer-mode`,label:i(`spaces-transfer-mode`),children:(0,H.jsxs)(Rr,{id:`space-transfer-mode`,value:o.mode,onChange:e=>O(`mode`,e.target.value),disabled:f,children:[(0,H.jsx)(`option`,{value:`copy`,children:i(`spaces-transfer-mode-copy`)}),(0,H.jsx)(`option`,{value:`move`,children:i(`spaces-transfer-mode-move`)})]})}),(0,H.jsx)(Gm,{id:`space-transfer-project`,label:i(`spaces-transfer-project`),children:(0,H.jsx)(Jd,{id:`space-transfer-project`,value:o.project??``,disabled:f,onChange:e=>O(`project`,e.target.value)})}),(0,H.jsx)(Gm,{id:`space-transfer-since`,label:i(`spaces-transfer-from`),children:(0,H.jsx)(Jd,{id:`space-transfer-since`,type:`date`,value:o.since??``,disabled:f,onChange:e=>O(`since`,e.target.value)})}),(0,H.jsx)(Gm,{id:`space-transfer-until`,label:i(`spaces-transfer-to`),children:(0,H.jsx)(Jd,{id:`space-transfer-until`,type:`date`,value:o.until??``,disabled:f,onChange:e=>O(`until`,e.target.value)})})]}),x?(0,H.jsx)(Xp,{tone:`info`,children:i(`spaces-transfer-busy`)}):null,y?(0,H.jsx)(Xp,{tone:`danger`,children:y}):null,f?(0,H.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-muted-foreground`,children:[(0,H.jsx)(at,{className:`size-4 animate-spin`,"aria-hidden":`true`}),i(`spaces-transfer-previewing`)]}):c?(0,H.jsx)(Wm,{preview:c}):u?(0,H.jsx)(`p`,{children:i(`spaces-transfer-preview-cleared`)}):(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:i(`spaces-transfer-why-disabled`)}),(0,H.jsxs)(Mu,{children:[(0,H.jsx)(q,{type:`button`,variant:`outline`,disabled:f,onClick:r,children:i(`spaces-cancel`)}),(0,H.jsx)(q,{type:`submit`,disabled:!E,children:i(`spaces-transfer-preview`)}),(0,H.jsx)(q,{type:`button`,disabled:!D,onClick:()=>h(!0),children:i(`spaces-transfer-apply`)})]})]})})}),m&&c?(0,H.jsx)(Du,{open:!0,onOpenChange:e=>e||g?void 0:h(!1),children:(0,H.jsxs)(Au,{children:[(0,H.jsxs)(ju,{children:[(0,H.jsx)(Nu,{children:(0,H.jsx)(`bdi`,{children:i(`spaces-transfer-confirm-${N}-title`,{count:c.toCopy})})}),(0,H.jsx)(Pu,{children:(0,H.jsx)(`bdi`,{children:i(`spaces-transfer-confirm-${N}-body`,{count:c.toCopy,source:e.name,target:T})})})]}),g?(0,H.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-muted-foreground`,children:[(0,H.jsx)(at,{className:`size-4 animate-spin`,"aria-hidden":`true`}),i(`spaces-transfer-applying`)]}):null,(0,H.jsxs)(Mu,{children:[(0,H.jsx)(q,{type:`button`,variant:`outline`,disabled:g,onClick:()=>h(!1),children:i(`spaces-cancel`)}),(0,H.jsx)(q,{type:`button`,disabled:g,onClick:()=>void M(),children:i(`spaces-transfer-confirm-${N}-button`)})]})]})}):null]})}function qm({space:e,busy:t,actions:n,layout:r=`grid`,linkSpaces:i,onLinksChanged:a}){let{t:o}=G(),[s,c]=(0,v.useState)(null),l=`space-${e.id}-name`,u=e.active?`active`:`available`,d=t=>{let n=e.disabled[t];if(!(n===void 0||t===`switch`&&n===`active`))return o(Rp(t,n))},f=t=>`space-${e.id}-why-${t}`,p=e=>({reason:d(e),reasonId:f(e),busy:t}),m=e.folder?`${o(`spaces-action-open-folder`)}: ${e.folder}`:o(`spaces-action-open-folder`),h=async()=>{c(null);let t=await Ip.openFolder(e.id);t.success||c(t.error??``)};return(0,H.jsx)(`li`,{className:`min-w-0`,children:(0,H.jsxs)(`div`,{id:Ef(e.id),className:V(`relative flex h-full min-w-0 scroll-mt-4 flex-col gap-3 rounded-xl border bg-card p-4 text-start`,e.active?`border-status-success`:`border-border`,r===`list`&&`sm:flex-row sm:items-center sm:gap-4 sm:pe-12`),children:[(0,H.jsx)(Df,{name:e.name,look:e.look}),(0,H.jsxs)(`div`,{className:V(`min-w-0 space-y-1`,r===`list`&&`sm:flex-1`),children:[(0,H.jsx)(`h3`,{id:l,className:`block break-words text-subsection-title font-semibold`,children:(0,H.jsx)(`bdi`,{children:e.name})}),(0,H.jsx)(`p`,{className:V(`break-words text-xs`,e.active?`font-medium text-status-success`:`text-muted-foreground`),children:o(`spaces-state`,{state:o(`spaces-status-${u}`)})}),(0,H.jsx)(`p`,{className:`break-words text-xs text-muted-foreground`,children:o(`spaces-size`,{size:jp(e.sizeBytes)})}),(0,H.jsx)(`p`,{className:`break-words text-xs text-muted-foreground`,children:e.createdAt?o(`spaces-created`,{date:Tp(e.createdAt)}):o(`spaces-created-none`)}),e.id!=="default"&&i&&a?(0,H.jsx)(Im,{space:e,spaces:i,busy:t,onChanged:a}):null,s?(0,H.jsx)(`p`,{role:`alert`,className:`break-words text-xs text-destructive-label`,children:s}):null]}),(0,H.jsxs)(`div`,{className:V(`flex flex-wrap items-center gap-1.5`,r===`list`&&`sm:justify-end`),children:[e.active?null:(0,H.jsx)(xf,{...p(`switch`),label:o(`spaces-action-switch`),icon:Et,onClick:()=>n.onSwitch(e)}),(0,H.jsx)(xf,{reasonId:f(`transfer`),busy:t,iconOnly:!0,variant:`outline`,label:o(`spaces-action-transfer`),icon:ee,onClick:()=>n.onTransfer(e)}),(0,H.jsx)(xf,{reasonId:f(`export`),busy:t,iconOnly:!0,variant:`outline`,label:o(`spaces-action-export`),icon:Qt,onClick:()=>n.onExport(e)}),(0,H.jsx)(xf,{...p(`archive`),iconOnly:!0,variant:`outline`,label:o(`spaces-action-archive`),icon:N,onClick:()=>n.onArchive(e)}),(0,H.jsx)(xf,{reasonId:f(`backup`),busy:t,iconOnly:!0,variant:`outline`,label:o(`spaces-action-backup`),icon:Ce,onClick:()=>n.onBackUp(e)}),(0,H.jsx)(xf,{reasonId:f(`open-folder`),busy:t,iconOnly:!0,variant:`outline`,label:m,icon:Fe,onClick:()=>void h()}),(0,H.jsx)(xf,{...p(`delete`),iconOnly:!0,variant:`destructive`,label:o(`spaces-action-delete`),icon:Jt,onClick:()=>n.onDelete(e)})]}),(0,H.jsx)(q,{type:`button`,variant:`ghost`,size:`icon-sm`,className:`absolute end-2 top-2`,"aria-label":o(`spaces-edit-title`,{name:e.name}),title:o(`spaces-edit`),disabled:t,onClick:()=>n.onEdit(e),children:(0,H.jsx)(wt,{"aria-hidden":`true`})})]})})}var Jm=`omms-spaces-view`;function Ym(){let[e,t]=(0,v.useState)(()=>{try{return localStorage.getItem(Jm)===`list`?`list`:`grid`}catch{return`grid`}});return[e,e=>{t(e);try{localStorage.setItem(Jm,e)}catch{}}]}function Xm({layout:e,onChange:t}){let{t:n}=G(),r=[{value:`grid`,label:n(`spaces-view-grid`),Icon:Xe},{value:`list`,label:n(`spaces-view-list`),Icon:rt}];return(0,H.jsx)(`div`,{role:`group`,"aria-label":n(`spaces-view-label`),className:`flex items-center gap-1`,children:r.map(({value:n,label:r,Icon:i})=>(0,H.jsx)(q,{type:`button`,size:`icon-sm`,variant:e===n?`secondary`:`ghost`,"aria-label":r,"aria-pressed":e===n,title:r,onClick:()=>t(n),children:(0,H.jsx)(i,{className:`size-4`,"aria-hidden":`true`})},n))})}function Zm(e){let t=e=>e.id==="default"?0:1;return[...e].sort((e,n)=>t(e)-t(n)||(e.createdAt??``).localeCompare(n.createdAt??``))}function Qm(){let{t:e}=G(),[t,n]=Ym(),{spaces:r,act:i,ask:a,askDelete:o,setFeedback:s,dialogs:c,feedbackFor:l}=Am(),{load:u}=r,[d,f]=(0,v.useState)(``),[p,m]=(0,v.useState)(null),[h,g]=(0,v.useState)(null),[_,y]=(0,v.useState)(null),[b,x]=(0,v.useState)(!1),S=Zm((r.snapshot?.spaces??[]).filter(e=>!e.archived)),C=S.find(e=>e.id===p)??null,w=r.snapshot!==null;(0,v.useEffect)(()=>{u()},[u]),(0,v.useEffect)(()=>{w&&typeof window<`u`&&_m(window.location.hash)},[w]);let T={onSwitch:a(`switch`),onEdit:e=>m(e.id),onTransfer:g,onExport:y,onArchive:a(`archive`),onBackUp:a(`backup`),onDelete:o};async function E(t){t.preventDefault();let n=d.trim();n&&(await i(`spaces`,e(`spaces-creating`,{name:n}),()=>Ip.create(n),t=>({text:e(`spaces-created-done`,{name:t.space.name}),offerSwitch:t.space}))).success&&f(``)}return(0,H.jsxs)(`div`,{className:`space-y-6`,children:[(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`spaces-intro`)}),r.snapshot?.problem?(0,H.jsxs)(Xp,{tone:`warning`,children:[(0,H.jsx)(`p`,{className:`font-medium`,children:e(`spaces-problem`)}),(0,H.jsx)(`p`,{children:r.snapshot.problem})]}):null,r.snapshot?.current.customStoragePath?(0,H.jsx)(Xp,{tone:`info`,children:e(`spaces-custom-note`)}):null,r.busy?(0,H.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,H.jsx)(at,{className:`size-4 animate-spin`,"aria-hidden":`true`}),r.busy]}):null,(0,H.jsxs)(`section`,{"aria-labelledby":`spaces-create`,className:`space-y-3`,children:[(0,H.jsx)(`h2`,{id:`spaces-create`,className:`text-section-title font-semibold text-muted-foreground`,children:e(`spaces-create-title`)}),(0,H.jsxs)(`form`,{className:`flex flex-wrap items-end gap-2`,onSubmit:e=>void E(e),children:[(0,H.jsxs)(`div`,{className:`w-72 min-w-0 max-w-full space-y-1`,children:[(0,H.jsx)(nm,{htmlFor:`space-new-name`,children:e(`spaces-create-label`)}),(0,H.jsx)(Jd,{id:`space-new-name`,value:d,placeholder:e(`spaces-create-placeholder`),onChange:e=>f(e.target.value)})]}),(0,H.jsx)(q,{type:`submit`,disabled:r.busy!==null||d.trim()===``,children:e(`spaces-create-button`)})]})]}),(0,H.jsxs)(`section`,{"aria-labelledby":`spaces-list`,className:`space-y-3`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,H.jsx)(`h2`,{id:`spaces-list`,className:`text-section-title font-semibold text-muted-foreground`,children:e(`spaces-list-title`)}),(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsxs)(q,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>x(!0),children:[(0,H.jsx)(Ee,{className:`size-4`,"aria-hidden":`true`}),e(`spaces-action-import`)]}),(0,H.jsx)(Xm,{layout:t,onChange:n})]})]}),l(`spaces`),r.loading&&!r.snapshot?(0,H.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,H.jsx)(at,{className:`size-4 animate-spin`,"aria-hidden":`true`}),e(`spaces-loading`)]}):null,!r.snapshot&&r.loadError?(0,H.jsxs)(Xp,{tone:`danger`,children:[(0,H.jsx)(`p`,{children:e(`spaces-load-failed`)}),(0,H.jsx)(`p`,{children:r.loadError})]}):null,r.snapshot?(0,H.jsx)(`ul`,{"aria-label":e(`spaces-list-label`),className:t===`list`?`flex flex-col gap-3`:`grid grid-cols-1 items-stretch gap-3 sm:grid-cols-2`,children:S.map(e=>(0,H.jsx)(qm,{layout:t,space:e,busy:r.busy!==null,actions:T,linkSpaces:S,onLinksChanged:()=>void u()},e.id))}):null]}),r.snapshot?(0,H.jsxs)(`section`,{"aria-labelledby":`spaces-backups`,className:`space-y-3`,children:[(0,H.jsx)(`h2`,{id:`spaces-backups`,className:`text-section-title font-semibold text-muted-foreground`,children:e(`spaces-backups-title`)}),(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`spaces-backups-intro`)}),l(`backups`),(0,H.jsx)(Lm,{backups:r.snapshot.backups,busy:r.busy!==null,onRestore:t=>void i(`backups`,e(`spaces-restoring`,{name:t.spaceName}),()=>Ip.restore(t.folder),t=>({text:e(`spaces-restored`,{name:t.space.name})}))})]}):null,h?(0,H.jsx)(Km,{source:h,spaces:S,onApplied:()=>void u(),onClose:()=>g(null)},h.id):null,_?(0,H.jsx)(Nm,{space:_,onClose:()=>y(null)},_.id):null,b?(0,H.jsx)(Pm,{spaces:S,onImported:()=>void u(),onClose:()=>x(!1)}):null,C?(0,H.jsx)(Um,{space:C,onClose:()=>m(null),onSave:async(t,n)=>{let i=await r.run(e(`spaces-saving`,{name:C.name}),()=>Lp(C.id,{name:t,change:n}));if(!i.success)throw i.data?.renamed&&(await r.load(),qp()),Error(i.error??``);s({where:`spaces`,tone:`success`,text:e(`spaces-saved`,{name:t??C.name})})}},C.id):null,c]})}var $m={pi:`Pi`,opencode:`OC`,"claude-code":`CC`};function eh({host:e,look:t,className:n}){let r=V(`grid size-10 shrink-0 place-items-center overflow-hidden rounded-[10px] border`,n);if(t.kind===`image`)return(0,H.jsx)(`span`,{className:V(r,`border-border bg-muted`),"aria-hidden":`true`,children:(0,H.jsx)(`img`,{src:t.image,alt:``,className:`size-full object-cover`})});let i=t.kind===`icon`?Sf[t.icon]:void 0,a=Wd(e);return(0,H.jsx)(`span`,{className:V(r,`text-ui font-semibold [color:oklch(0.42_0.13_var(--host-hue))] dark:[color:oklch(0.8_0.13_var(--host-hue))]`),style:{backgroundColor:`oklch(0.72 0.14 ${a} / 0.18)`,borderColor:`oklch(0.72 0.14 ${a} / 0.45)`,"--host-hue":String(a)},"aria-hidden":`true`,children:i?(0,H.jsx)(i,{className:`size-5`}):$m[e]})}function th({className:e,iconClassName:t=`size-5`}){return(0,H.jsx)(`span`,{"aria-hidden":`true`,className:V(`grid size-10 shrink-0 place-items-center overflow-hidden rounded-[10px] border border-border bg-muted text-muted-foreground`,e),children:(0,H.jsx)(Ye,{className:t})})}function nh(){let e=Ya().status?.activeSpace,t=e?.id,[n,r]=(0,v.useState)([]),[i,a]=(0,v.useState)(0);return(0,v.useEffect)(()=>Kp(()=>a(e=>e+1)),[]),(0,v.useEffect)(()=>{if(t===void 0)return;let e=!0;return Ip.list().then(t=>{e&&t.success&&t.data&&r(t.data.spaces)}),()=>{e=!1}},[t,i]),{spaces:n,activeId:t,activeName:e?.name,customStoragePath:e?.customStoragePath===!0}}var rh=`omms-sidebar-spaces-open`,ih=`space-archive`;function ah({className:e,collapsed:t,currentView:n,hideWhenCollapsed:r,onNavigate:i}){let{t:a}=G(),{spaces:o,activeId:s,activeName:c,customStoragePath:l}=nh(),u=n===`spaces`||n===`spaces-archive`,[d,f]=sf(rh,u),p=a(`nav-spaces`),m=c?a(l?`spaces-nav-hover-custom`:`spaces-nav-hover`,{name:c}):p,h=[...o.filter(e=>!e.archived).map(e=>({id:Ef(e.id),label:e.name,title:e.name,leading:(0,H.jsx)(Df,{name:e.name,look:e.look,className:`size-5 rounded-md text-[9px]`,iconClassName:`size-3`}),trailing:e.id===s?(0,H.jsx)(`span`,{role:`img`,"aria-label":a(`spaces-active-mark`),title:a(`spaces-active-mark`),className:`ms-auto size-2 shrink-0 rounded-full bg-status-success`}):null})),{id:ih,label:a(`nav-spaces-archive`),href:J.spacesArchive,current:n===`spaces-archive`,leading:(0,H.jsx)(th,{className:`size-5 rounded-md`,iconClassName:`size-3`})}];return(0,H.jsx)(cf,{link:(0,H.jsx)(mf,{href:J.spaces,label:p,icon:ie,collapsed:t,active:u,className:e,title:t?m:void 0,note:l?a(`spaces-nav-custom`):void 0,onNavigate:i}),label:p,sections:h,open:d,onToggle:f,hideWhenCollapsed:r,id:`sidebar-spaces-tree`,base:J.spaces,onSectionClick:(e,t)=>i(e,t===ih?J.spacesArchive:`${J.spaces}#${t}`)})}var oh=[{view:`chat`,href:J.chat,icon:ct},{view:`project`,href:J.project,icon:Le},{view:`profile`,href:J.profile,icon:en},{view:`memorisation`,href:J.memorisation,icon:re},{view:`skills`,href:J.skills,icon:Bt}];function sh({currentView:e,labels:t,collapsed:n,navClass:r,onNavigate:i,profileTree:a,skillsTree:o}){return[(0,H.jsx)(ah,{className:r(e===`spaces`||e===`spaces-archive`),collapsed:n,currentView:e,hideWhenCollapsed:a.hideWhenCollapsed,onNavigate:i},`spaces`),...oh.map(({view:s,href:c,icon:l})=>{let u=t[s],d=(0,H.jsx)(mf,{href:c,label:u,icon:l,collapsed:n,onNavigate:i,active:e===s,className:r(e===s)},s);return s===`profile`?(0,H.jsx)(cf,{link:d,label:u,...a},s):s===`skills`?(0,H.jsx)(cf,{link:d,label:u,id:`sidebar-skills-tree`,base:J.skills,...o},s):d})]}var ch=[{label:`update-host-claude`,command:`claude plugin update omms@omms`},{label:`update-host-opencode`,command:`opencode plugin update om-memory-system`},{label:`update-host-pi`,command:`pi update npm:om-memory-system`},{label:`update-host-global`,command:`npm i -g om-memory-system@latest && om-memory-system web install`}],lh={row:`mb-2 flex min-h-11 w-full rounded-lg border border-sidebar-border/80 bg-card/70 px-2`,inline:`inline-flex min-h-8 self-stretch border-s border-sidebar-border px-2`,icon:`inline-flex min-h-8 min-w-7 self-stretch px-1.5 py-1.5`};function uh(){let{ok:e,status:t}=Ya(),n=t?.update;return!t?.canControl||!n?.available?null:{ok:e,status:t,update:n,available:n.available}}function dh({variant:e=`row`,className:t,onOpen:n}){let{t:r}=G(),i=uh();return i?.ok?(0,H.jsx)(`button`,{type:`button`,"data-update":i.available,"data-variant":e,className:V(`items-center justify-center text-xs font-medium text-brand-label transition-colors duration-150 hover:bg-interactive-hover hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring`,lh[e],t),onClick:n,"aria-label":r(`update-button`,{version:i.available}),title:r(`update-button`,{version:i.available}),children:e===`icon`?(0,H.jsx)(he,{className:`size-4`}):r(`update-label`)}):null}function fh({open:e,onOpenChange:t}){let{t:n}=G(),r=uh(),[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(null);if(!r)return null;let{status:u,update:d,available:f}=r,p=d.state===`failed`?d.code:null,m=i||d.state===`installing`||d.state===`restarting`;async function h(){if(m)return;if(a(!0),s(``),!await La()){a(!1),s(n(`update-request-failed`));return}let e=await Ra(u?.instance??null);if(e.kind===`restarted`){window.location.reload();return}a(!1),s(e.kind===`failed`?n(`update-failed`,{code:e.code}):n(`update-timeout`))}function g(e){navigator.clipboard?.writeText(e),l(e)}let _=o||(p?n(`update-failed`,{code:p}):``);return(0,H.jsx)(H.Fragment,{children:(0,H.jsx)(Du,{open:e,onOpenChange:e=>!m&&t(e),children:(0,H.jsxs)(Au,{showCloseButton:!1,children:[(0,H.jsx)(ju,{children:(0,H.jsx)(Nu,{children:n(`update-dialog-title`)})}),(0,H.jsx)(`p`,{children:n(`update-versions`,{running:u.version,available:f})}),(0,H.jsx)(`p`,{className:`text-sm`,children:n(`update-hosts-intro`)}),(0,H.jsx)(`ul`,{className:`flex flex-col gap-2`,children:ch.map(({label:e,command:t})=>(0,H.jsxs)(`li`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,H.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:n(e)}),(0,H.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,H.jsx)(`code`,{className:`min-w-0 flex-1 break-all rounded-md bg-muted px-2 py-1 text-xs`,children:t}),(0,H.jsxs)(q,{variant:`ghost`,size:`sm`,onClick:()=>g(t),"aria-label":`${n(`update-copy`)}: ${t}`,children:[(0,H.jsx)(xe,{className:`size-3.5`}),n(c===t?`update-copied`:`update-copy`)]})]})]},t))}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`update-hosts-note`)}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:d.canInstall?n(`update-install-note`):n(`update-cannot-install`)}),m?(0,H.jsx)(`p`,{role:`status`,className:`text-sm`,children:n(`update-installing`)}):null,_&&!m?(0,H.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:_}):null,(0,H.jsxs)(`div`,{className:`flex flex-wrap justify-end gap-2`,children:[(0,H.jsx)(q,{variant:`ghost`,disabled:m,onClick:()=>t(!1),children:n(`update-close`)}),(0,H.jsx)(q,{autoFocus:!0,disabled:m||!d.canInstall,onClick:()=>void h(),children:n(`update-install`)})]})]})})})}var ph=Object.defineProperty,mh=(e,t)=>ph(e,`name`,{value:t,configurable:!0}),hh=`horizontal`,gh=[`horizontal`,`vertical`],_h=v.forwardRef(mh(function(e,t){let{decorative:n,orientation:r=hh,...i}=e,a=vh(r)?r:hh,o=n?{role:`none`}:{"aria-orientation":a===`vertical`?a:void 0,role:`separator`};return(0,H.jsx)(bs.div,{"data-orientation":a,...o,...i,ref:t})},`Separator`));function vh(e){return gh.includes(e)}mh(vh,`isValidOrientation`);var yh=_h;function bh({className:e,orientation:t=`horizontal`,decorative:n=!0,...r}){return(0,H.jsx)(yh,{"data-slot":`separator`,decorative:n,orientation:t,className:V(`bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px`,e),...r})}function xh(e){return e===`light`||e===`dark`?e:null}function Sh(e,t){return e??(t?`dark`:`light`)}var Ch=[{id:`aura-light`,name:`Aura`,variant:`light`,colours:{canvas:`#f6f3fe`,elevated:`#ede9f5`,muted:`#f1eef9`,text:`#474056`,textSecondary:`#605a71`,border:`#00000013`,borderHover:`#0000002e`,accent:`#7557b7`,accentHover:`#6c50a8`,accentActive:`#62499a`,selection:`#dfdce9`,hover:`#0000000a`,active:`#00000014`,focus:`#cdbefe`,error:`#ad0620`,warning:`#8b6113`,success:`#087846`,info:`#356ba6`}},{id:`aura-dark`,name:`Aura`,variant:`dark`,colours:{canvas:`#121117`,elevated:`#1c1b21`,muted:`#0c0b11`,text:`#dbdbdc`,textSecondary:`#88878b`,border:`#ffffff0c`,borderHover:`#ffffff33`,accent:`#a277ff`,accentHover:`#a982ff`,accentActive:`#b18dff`,selection:`#47454bb6`,hover:`#ffffff0f`,active:`#ffffff13`,focus:`#cdbefb`,error:`#ff6767`,warning:`#ffca85`,success:`#61ffca`,info:`#82e2ff`}},{id:`ayu-light`,name:`Ayu`,variant:`light`,colours:{canvas:`#fdfbf5`,elevated:`#f5f4ed`,muted:`#f8f6f1`,text:`#3f4851`,textSecondary:`#5c6570`,border:`#00000013`,borderHover:`#0000002e`,accent:`#1b7793`,accentHover:`#196d87`,accentActive:`#17647b`,selection:`#e8eae3`,hover:`#0000000a`,active:`#00000014`,focus:`#73d8fc`,error:`#c21f38`,warning:`#996219`,success:`#157f3f`,info:`#147794`}},{id:`ayu-dark`,name:`Ayu`,variant:`dark`,colours:{canvas:`#0b1015`,elevated:`#151a1f`,muted:`#06090d`,text:`#d9d9db`,textSecondary:`#81868b`,border:`#ffffff0c`,borderHover:`#ffffff33`,accent:`#3fb7e3`,accentHover:`#4ebde5`,accentActive:`#5ec3e7`,selection:`#3c4147c9`,hover:`#ffffff0f`,active:`#ffffff14`,focus:`#7dd6fc`,error:`#f58572`,warning:`#e4a75c`,success:`#78d05c`,info:`#66c6f1`}},{id:`carbonfox-light`,name:`Carbonfox`,variant:`light`,colours:{canvas:`#eeeeee`,elevated:`#e4e4e4`,muted:`#e9e9e9`,text:`#404040`,textSecondary:`#5a5a5a`,border:`#00000013`,borderHover:`#0000002f`,accent:`#1159e3`,accentHover:`#1052d1`,accentActive:`#0e4bbf`,selection:`#d5d5d5`,hover:`#0000000a`,active:`#00000014`,focus:`#accaff`,error:`#980313`,warning:`#7a6211`,success:`#105223`,info:`#0c42a8`}},{id:`carbonfox-dark`,name:`Carbonfox`,variant:`dark`,colours:{canvas:`#292929`,elevated:`#2f2f2f`,muted:`#252525`,text:`#f7f7f7`,textSecondary:`#999a9c`,border:`#ffffff0b`,borderHover:`#ffffff33`,accent:`#33b1ff`,accentHover:`#43b7ff`,accentActive:`#54bdff`,selection:`#5b5c5b97`,hover:`#ffffff0d`,active:`#ffffff12`,focus:`#adcafa`,error:`#ff8389`,warning:`#f1c21b`,success:`#42be65`,info:`#78a9ff`}},{id:`catppuccin-light`,name:`Catppuccin`,variant:`light`,colours:{canvas:`#eff1f5`,elevated:`#e5e7eb`,muted:`#e9ebef`,text:`#4c4f69`,textSecondary:`#616274`,border:`#66677023`,borderHover:`#66677026`,accent:`#7130c7`,accentHover:`#6e32bf`,accentActive:`#6b35b8`,selection:`#ccd0da`,hover:`#0000000a`,active:`#00000014`,focus:`#8839ef`,error:`#cb0f37`,warning:`#af4508`,success:`#2f7520`,info:`#1850c1`}},{id:`catppuccin-dark`,name:`Catppuccin`,variant:`dark`,colours:{canvas:`#1e1e2e`,elevated:`#181825`,muted:`#181825`,text:`#cdd6f4`,textSecondary:`#a6adc8`,border:`#7f849c19`,borderHover:`#7f849c1d`,accent:`#cba6f7`,accentHover:`#dec7fa`,accentActive:`#dec7fa`,selection:`#313244`,hover:`#cdd6f412`,active:`#cdd6f41f`,focus:`#cba6f7`,error:`#f38ba8`,warning:`#fab387`,success:`#a6e3a1`,info:`#89b4fa`}},{id:`cursor-light`,name:`Cursor`,variant:`light`,author:`cedricverlinden`,colours:{canvas:`#fcfcfc`,elevated:`#f2f2f2`,muted:`#f6f6f6`,text:`#454a50`,textSecondary:`#66696f`,border:`#5058601e`,borderHover:`#50586040`,accent:`#2567a8`,accentHover:`#1d568e`,accentActive:`#194b7c`,selection:`#e1e1e1`,hover:`#0000000a`,active:`#00000014`,focus:`#2567a8b3`,error:`#a3424b`,warning:`#806015`,success:`#467037`,info:`#315d9b`}},{id:`cursor-dark`,name:`Cursor`,variant:`dark`,author:`cedricverlinden`,colours:{canvas:`#1a1a1a`,elevated:`#232323`,muted:`#151515`,text:`#e1e1e2`,textSecondary:`#8e8e8e`,border:`#8484841a`,borderHover:`#8484841f`,accent:`#4c9df3`,accentHover:`#66aefa`,accentActive:`#66aefa`,selection:`#ffffff1d`,hover:`#ffffff0f`,active:`#ffffff1a`,focus:`#4c9df399`,error:`#c6747b`,warning:`#ebcb8b`,success:`#a3be8c`,info:`#81a1c1`}},{id:`dracula-light`,name:`Dracula`,variant:`light`,colours:{canvas:`#f9f9f4`,elevated:`#eeefe9`,muted:`#f3f4ee`,text:`#45454f`,textSecondary:`#5f5f6a`,border:`#00000013`,borderHover:`#0000002e`,accent:`#6957d7`,accentHover:`#6150c6`,accentActive:`#5849b5`,selection:`#dee1db`,hover:`#0000000a`,active:`#00000014`,focus:`#c2c2fd`,error:`#ad1446`,warning:`#9e5a04`,success:`#167a46`,info:`#366da9`}},{id:`dracula-dark`,name:`Dracula`,variant:`dark`,colours:{canvas:`#151720`,elevated:`#1c2029`,muted:`#12121b`,text:`#e0e0e2`,textSecondary:`#8a8b8a`,border:`#ffffff0c`,borderHover:`#ffffff33`,accent:`#bd93f9`,accentHover:`#c29cf9`,accentActive:`#c8a4fa`,selection:`#4650559f`,hover:`#ffffff0e`,active:`#ffffff13`,focus:`#d3bcfa`,error:`#ff5555`,warning:`#ffb86c`,success:`#50fa7b`,info:`#8be9fd`}},{id:`everforest-light`,name:`Everforest`,variant:`light`,colours:{canvas:`#fdf8e8`,elevated:`#f5f2e2`,muted:`#f7f3e4`,text:`#3b474e`,textSecondary:`#656b62`,border:`#00000013`,borderHover:`#0000002e`,accent:`#65740b`,accentHover:`#5d6b0a`,accentActive:`#556109`,selection:`#e9e8d5`,hover:`#0000000a`,active:`#00000014`,focus:`#bfd747`,error:`#c4222a`,warning:`#ad5410`,success:`#66731b`,info:`#366eaa`}},{id:`everforest-dark`,name:`Everforest`,variant:`dark`,colours:{canvas:`#1c252b`,elevated:`#222c32`,muted:`#1a2127`,text:`#f0efed`,textSecondary:`#8f978e`,border:`#ffffff0b`,borderHover:`#ffffff33`,accent:`#a7c080`,accentHover:`#aec58a`,accentActive:`#b5ca94`,selection:`#3e5151c5`,hover:`#ffffff0d`,active:`#ffffff12`,focus:`#bad492`,error:`#e67e80`,warning:`#e69875`,success:`#a7c080`,info:`#83afe0`}},{id:`fields-of-the-shire-light`,name:`Fields of the Shire`,variant:`light`,author:`OpenChamber`,colours:{canvas:`#f9f5eb`,elevated:`#efebe2`,muted:`#f3efe5`,text:`#514a40`,textSecondary:`#6c6459`,border:`#1a161215`,borderHover:`#1a161230`,accent:`#4a6030`,accentHover:`#5e773f`,accentActive:`#708a50`,selection:`#1a16121a`,hover:`#0000000a`,active:`#00000014`,focus:`#4a603040`,error:`#a24d3f`,warning:`#8c5520`,success:`#4a6030`,info:`#3d4f5a`}},{id:`fields-of-the-shire-dark`,name:`Fields of the Shire`,variant:`dark`,author:`OpenChamber`,colours:{canvas:`#1b1815`,elevated:`#24211e`,muted:`#161311`,text:`#e9decf`,textSecondary:`#948b7c`,border:`#2e2b28d4`,borderHover:`#f0e6d830`,accent:`#809062`,accentHover:`#8a996f`,accentActive:`#94a27b`,selection:`#f0e6d81f`,hover:`#ffffff0f`,active:`#ffffff1a`,focus:`#8090624d`,error:`#c47466`,warning:`#c47a3a`,success:`#7f905e`,info:`#798d99`}},{id:`flexoki-light`,name:`Flexoki`,variant:`light`,colours:{canvas:`#fffdf4`,elevated:`#f5f3ea`,muted:`#f9f7ee`,text:`#494741`,textSecondary:`#6a6962`,border:`#e6e4db`,borderHover:`#cecdc3`,accent:`#b54f14`,accentHover:`#a74912`,accentActive:`#984211`,selection:`#76736f30`,hover:`#0000000a`,active:`#00000014`,focus:`#b54f1440`,error:`#af3029`,warning:`#b54f14`,success:`#5e760a`,info:`#205ea6`}},{id:`flexoki-dark`,name:`Flexoki`,variant:`dark`,colours:{canvas:`#171515`,elevated:`#201e1e`,muted:`#121111`,text:`#dedcd3`,textSecondary:`#8b8a83`,border:`#2b2a28d4`,borderHover:`#403e3c`,accent:`#da702c`,accentHover:`#da702c`,accentActive:`#f9ae77`,selection:`#f4f4f41f`,hover:`#ffffff0f`,active:`#ffffff1a`,focus:`#da702c50`,error:`#d76459`,warning:`#da702c`,success:`#a0af54`,info:`#4d8cc1`}},{id:`github-light`,name:`GitHub`,variant:`light`,colours:{canvas:`#ffffff`,elevated:`#f5f5f4`,muted:`#fafaf9`,text:`#464a4e`,textSecondary:`#5c646e`,border:`#00000013`,borderHover:`#0000002e`,accent:`#0f69d8`,accentHover:`#0e61c7`,accentActive:`#0d58b5`,selection:`#e7e7e6`,hover:`#0000000a`,active:`#00000014`,focus:`#a9cbfd`,error:`#8f0617`,warning:`#664407`,success:`#105122`,info:`#09448f`}},{id:`github-dark`,name:`GitHub`,variant:`dark`,colours:{canvas:`#0a0e14`,elevated:`#13171e`,muted:`#05070c`,text:`#d7d8da`,textSecondary:`#7d848e`,border:`#ffffff0d`,borderHover:`#ffffff33`,accent:`#58a6ff`,accentHover:`#65adff`,accentActive:`#73b4ff`,selection:`#373d44d8`,hover:`#ffffff0f`,active:`#ffffff15`,focus:`#a3cdfe`,error:`#f85149`,warning:`#e3b341`,success:`#3fb950`,info:`#83afe0`}},{id:`gruvbox-light`,name:`Gruvbox`,variant:`light`,colours:{canvas:`#fcf5d7`,elevated:`#f4eccf`,muted:`#f8f0d3`,text:`#47433c`,textSecondary:`#615d58`,border:`#00000013`,borderHover:`#0000002e`,accent:`#12697a`,accentHover:`#116170`,accentActive:`#0f5866`,selection:`#e8dfc5`,hover:`#0000000a`,active:`#00000014`,focus:`#83d8ed`,error:`#650304`,warning:`#805104`,success:`#4f4c0c`,info:`#013d48`}},{id:`gruvbox-dark`,name:`Gruvbox`,variant:`dark`,colours:{canvas:`#1f1e1d`,elevated:`#272623`,muted:`#1a1a1a`,text:`#e9e8e4`,textSecondary:`#9b9074`,border:`#ffffff0b`,borderHover:`#ffffff33`,accent:`#83a598`,accentHover:`#8daca0`,accentActive:`#97b3a8`,selection:`#514d43b4`,hover:`#ffffff0e`,active:`#ffffff12`,focus:`#aed2c4`,error:`#fb533f`,warning:`#fabd2f`,success:`#b8bb26`,info:`#83afe0`}},{id:`jetbrains-light`,name:`JetBrains`,variant:`light`,author:`Artem Evsevev, adapted for OpenChamber`,colours:{canvas:`#fff`,elevated:`#f5f5f5`,muted:`#f9f9f9`,text:`#45474b`,textSecondary:`#696a6f`,border:`#dde0eadc`,borderHover:`#aeb3c2ad`,accent:`#195ce3`,accentHover:`#2d61f0`,accentActive:`#0055ff`,selection:`#dfe1e5`,hover:`#0000000a`,active:`#00000014`,focus:`#0055ff40`,error:`#ce0606`,warning:`#9d620a`,success:`#077d18`,info:`#29769f`}},{id:`jetbrains-dark`,name:`JetBrains`,variant:`dark`,author:`Artem Evsevev, adapted for OpenChamber`,colours:{canvas:`#1e1f22`,elevated:`#27282b`,muted:`#18191b`,text:`#e5e7eb`,textSecondary:`#90939a`,border:`#303238b8`,borderHover:`#4b5059`,accent:`#6796f5`,accentHover:`#70aeff`,accentActive:`#5594fa`,selection:`#43454a`,hover:`#ffffff0f`,active:`#ffffff1a`,focus:`#6796f550`,error:`#fa6675`,warning:`#f2c55c`,success:`#639d69`,info:`#4199c8`}},{id:`kanagawa-light`,name:`Kanagawa`,variant:`light`,colours:{canvas:`#f4ede3`,elevated:`#ede5db`,muted:`#efe8df`,text:`#4c3d33`,textSecondary:`#64635e`,border:`#00000013`,borderHover:`#0000002f`,accent:`#326384`,accentHover:`#2e5b79`,accentActive:`#2a536f`,selection:`#e2dad0`,hover:`#0000000a`,active:`#00000014`,focus:`#a6cfed`,error:`#a40d11`,warning:`#8e4e14`,success:`#456114`,info:`#073652`}},{id:`kanagawa-dark`,name:`Kanagawa`,variant:`dark`,colours:{canvas:`#17161e`,elevated:`#221e28`,muted:`#111119`,text:`#e0dfde`,textSecondary:`#8a8a83`,border:`#ffffff0c`,borderHover:`#ffffff33`,accent:`#7e9cd8`,accentHover:`#88a4db`,accentActive:`#93acde`,selection:`#4f414ac7`,hover:`#ffffff0e`,active:`#ffffff13`,focus:`#afc9fd`,error:`#ed5252`,warning:`#d7a657`,success:`#98bb6c`,info:`#83afe0`}},{id:`material-light`,name:`Material`,variant:`light`,colours:{canvas:`#fafafa`,elevated:`#f1f1f0`,muted:`#f5f5f5`,text:`#3e484c`,textSecondary:`#5f6c72`,border:`#00000013`,borderHover:`#0000002e`,accent:`#19787f`,accentHover:`#176e75`,accentActive:`#15656b`,selection:`#e3e3e2`,hover:`#0000000a`,active:`#00000014`,focus:`#65dee7`,error:`#aa0d15`,warning:`#8f6510`,success:`#537702`,info:`#12787f`}},{id:`material-dark`,name:`Material`,variant:`dark`,colours:{canvas:`#1a252a`,elevated:`#212c31`,muted:`#162126`,text:`#edeff0`,textSecondary:`#85989f`,border:`#ffffff0b`,borderHover:`#ffffff33`,accent:`#82aaff`,accentHover:`#8cb1ff`,accentActive:`#96b8ff`,selection:`#4e5b6094`,hover:`#ffffff0d`,active:`#ffffff12`,focus:`#80d6f9`,error:`#f07178`,warning:`#ffcb6b`,success:`#c3e88d`,info:`#83afe0`}},{id:`mono-light`,name:`Mono`,variant:`light`,colours:{canvas:`#ffffff`,elevated:`#f5f5f5`,muted:`#f9f9f9`,text:`#454545`,textSecondary:`#656565`,border:`#e3e3e3f2`,borderHover:`#b3b3b3ac`,accent:`#000000`,accentHover:`#1a1a1a`,accentActive:`#333333`,selection:`#00000015`,hover:`#0000000a`,active:`#00000014`,focus:`#00000040`,error:`#999999`,warning:`#666666`,success:`#1a1a1a`,info:`#595959`}},{id:`mono-dark`,name:`Mono`,variant:`dark`,colours:{canvas:`#000000`,elevated:`#141414`,muted:`#0a0a0a`,text:`#d0d0d0`,textSecondary:`#828282`,border:`#232323c6`,borderHover:`#333333`,accent:`#ffffff`,accentHover:`#e5e5e5`,accentActive:`#cccccc`,selection:`#ffffff1f`,hover:`#ffffff0f`,active:`#ffffff1a`,focus:`#ffffff50`,error:`#666666`,warning:`#999999`,success:`#e5e5e5`,info:`#a6a6a6`}},{id:`mono-plus-light`,name:`Mono Plus`,variant:`light`,colours:{canvas:`#ffffff`,elevated:`#f5f5f5`,muted:`#f9f9f9`,text:`#454545`,textSecondary:`#6a6a6a`,border:`#e3e3e3f2`,borderHover:`#b3b3b3ac`,accent:`#4a6a9e`,accentHover:`#1a1a1a`,accentActive:`#333333`,selection:`#00000015`,hover:`#0000000a`,active:`#00000014`,focus:`#00000040`,error:`#8a5a5a`,warning:`#7c6d51`,success:`#577757`,info:`#5a6a8a`}},{id:`mono-plus-dark`,name:`Mono Plus`,variant:`dark`,colours:{canvas:`#000000`,elevated:`#141414`,muted:`#0a0a0a`,text:`#cecece`,textSecondary:`#828282`,border:`#232323c6`,borderHover:`#333333`,accent:`#a2bee8`,accentHover:`#e5e5e5`,accentActive:`#cccccc`,selection:`#ffffff1f`,hover:`#ffffff0f`,active:`#ffffff1a`,focus:`#ffffff50`,error:`#a47373`,warning:`#9e8a6a`,success:`#6a8e6a`,info:`#6d80a0`}},{id:`monokai-light`,name:`Monokai`,variant:`light`,colours:{canvas:`#fdf9ef`,elevated:`#f3efe5`,muted:`#f8f4ea`,text:`#4b463c`,textSecondary:`#656056`,border:`#00000013`,borderHover:`#0000002e`,accent:`#8556b0`,accentHover:`#7a4fa2`,accentActive:`#704894`,selection:`#e5e0d6`,hover:`#0000000a`,active:`#00000014`,focus:`#d9b9fd`,error:`#b21523`,warning:`#936115`,success:`#1b7c1b`,info:`#366eaa`}},{id:`monokai-dark`,name:`Monokai`,variant:`dark`,colours:{canvas:`#1d1e19`,elevated:`#252620`,muted:`#191a15`,text:`#e7e7e7`,textSecondary:`#90918b`,border:`#ffffff0b`,borderHover:`#ffffff33`,accent:`#ae81ff`,accentHover:`#b48bff`,accentActive:`#bb95ff`,selection:`#53544e9a`,hover:`#ffffff0e`,active:`#ffffff12`,focus:`#d0bdfc`,error:`#fa4888`,warning:`#fd971f`,success:`#a6e22e`,info:`#66d9ef`}},{id:`nightowl-light`,name:`Night Owl`,variant:`light`,colours:{canvas:`#f1f1f1`,elevated:`#e9e9e8`,muted:`#ececeb`,text:`#41404f`,textSecondary:`#5a5a6b`,border:`#00000013`,borderHover:`#0000002f`,accent:`#2c60d4`,accentHover:`#2858c3`,accentActive:`#2551b2`,selection:`#dfdddb`,hover:`#0000000a`,active:`#00000014`,focus:`#aec9fe`,error:`#a4151c`,warning:`#856215`,success:`#327443`,info:`#0941c4`}},{id:`nightowl-dark`,name:`Night Owl`,variant:`dark`,colours:{canvas:`#04101c`,elevated:`#0d1a26`,muted:`#010a12`,text:`#d7d9dc`,textSecondary:`#7e8692`,border:`#ffffff0d`,borderHover:`#ffffff33`,accent:`#82aaff`,accentHover:`#8cb1ff`,accentActive:`#96b8ff`,selection:`#36424fc6`,hover:`#ffffff0f`,active:`#ffffff14`,focus:`#afc9fd`,error:`#ef5350`,warning:`#ecc48d`,success:`#c5e478`,info:`#82aaff`}},{id:`nord-light`,name:`Nord`,variant:`light`,colours:{canvas:`#eef1f5`,elevated:`#e5e8ed`,muted:`#e9ecf1`,text:`#3c424c`,textSecondary:`#565c67`,border:`#00000013`,borderHover:`#0000002f`,accent:`#426999`,accentHover:`#3d618d`,accentActive:`#375881`,selection:`#d8dce1`,hover:`#0000000a`,active:`#00000014`,focus:`#a4ccfe`,error:`#a0203b`,warning:`#a54d31`,success:`#327443`,info:`#29588f`}},{id:`nord-dark`,name:`Nord`,variant:`dark`,colours:{canvas:`#1f2530`,elevated:`#262c37`,muted:`#1c212c`,text:`#f0f1f2`,textSecondary:`#93979f`,border:`#ffffff0b`,borderHover:`#ffffff33`,accent:`#88c0d0`,accentHover:`#92c5d4`,accentActive:`#9bcad8`,selection:`#505661a3`,hover:`#ffffff0d`,active:`#ffffff12`,focus:`#9ad4e4`,error:`#cb7f86`,warning:`#d08770`,success:`#a3be8c`,info:`#81a1c1`}},{id:`onedarkpro-light`,name:`One Dark Pro`,variant:`light`,colours:{canvas:`#f5f6f8`,elevated:`#ebecee`,muted:`#eff0f2`,text:`#454c58`,textSecondary:`#616770`,border:`#d5d8dedb`,borderHover:`#d4d9e3`,accent:`#3c67bc`,accentHover:`#375fad`,accentActive:`#32579e`,selection:`#d8dde6`,hover:`#0000000a`,active:`#00000014`,focus:`#3c67bc40`,error:`#a54f56`,warning:`#866241`,success:`#38754d`,info:`#336da3`}},{id:`onedarkpro-dark`,name:`One Dark Pro`,variant:`dark`,colours:{canvas:`#1e222a`,elevated:`#272b33`,muted:`#181b22`,text:`#e4ebf8`,textSecondary:`#8d97a2`,border:`#3138489b`,borderHover:`#363d52`,accent:`#61afef`,accentHover:`#579ad1`,accentActive:`#77baf1`,selection:`#a8aec533`,hover:`#ffffff0f`,active:`#ffffff1a`,focus:`#61afef40`,error:`#e17179`,warning:`#e5c07b`,success:`#98c379`,info:`#61afef`}},{id:`openchamber-light`,name:`OpenChamber`,variant:`light`,author:`OpenChamber`,colours:{canvas:`#fdfcfa`,elevated:`#f3f2f0`,muted:`#f7f6f4`,text:`#44443d`,textSecondary:`#696960`,border:`#e5e1debf`,borderHover:`#cbc7c2`,accent:`#b35017`,accentHover:`#9a4310`,accentActive:`#85390c`,selection:`#a9998f2b`,hover:`#0000000a`,active:`#00000014`,focus:`#b3501755`,error:`#b7493f`,warning:`#886914`,success:`#517734`,info:`#2c6ebd`}},{id:`openchamber-dark`,name:`OpenChamber`,variant:`dark`,author:`OpenChamber`,colours:{canvas:`#120f0e`,elevated:`#1b1918`,muted:`#0e0c0b`,text:`#dbd7cc`,textSecondary:`#89867c`,border:`#242323bf`,borderHover:`#504e4c`,accent:`#da7c47`,accentHover:`#eb8c57`,accentActive:`#fd9b66`,selection:`#c8c6c52b`,hover:`#ffffff0f`,active:`#ffffff1a`,focus:`#da7c4755`,error:`#da5b4a`,warning:`#c67f13`,success:`#76ad4f`,info:`#479fe6`}},{id:`opencode-light`,name:`OpenCode`,variant:`light`,author:`OpenCode`,colours:{canvas:`#ffffff`,elevated:`#fafafa`,muted:`#fafafa`,text:`#4a4a4a`,textSecondary:`#646464`,border:`#00000013`,borderHover:`#0000002e`,accent:`#3b5cf6ff`,accentHover:`#3655e2`,accentActive:`#324dcf`,selection:`#eeeeeeff`,hover:`#0000000a`,active:`#00000014`,focus:`#7698fdff`,error:`#b82d35ff`,warning:`#8c6e24`,success:`#18833f`,info:`#3250dfff`}},{id:`opencode-dark`,name:`OpenCode`,variant:`dark`,author:`OpenCode`,colours:{canvas:`#161616`,elevated:`#1f1f1f`,muted:`#0a0a0a`,text:`#dfdfdf`,textSecondary:`#8a8a8a`,border:`#ffffff0c`,borderHover:`#ffffff33`,accent:`#637ef8`,accentHover:`#6f88f9`,accentActive:`#7c93f9`,selection:`#3a3a3af6`,hover:`#ffffff0e`,active:`#ffffff13`,focus:`#7698fdff`,error:`#f17471ff`,warning:`#f2cf76ff`,success:`#6bd586ff`,info:`#7698fdff`}},{id:`osaka-jade-refined-light`,name:`Osaka Jade`,variant:`light`,author:`tbcode-org`,colours:{canvas:`#f1eee8`,elevated:`#e7e4de`,muted:`#ebe9e3`,text:`#40463e`,textSecondary:`#53685b`,border:`#00000013`,borderHover:`#0000002e`,accent:`#197160`,accentHover:`#176858`,accentActive:`#155f51`,selection:`#d8d5d0`,hover:`#0000000a`,active:`#00000014`,focus:`#5ce4c6`,error:`#8f110b`,warning:`#73650e`,success:`#02532a`,info:`#33679f`}},{id:`osaka-jade-refined`,name:`Osaka Jade`,variant:`dark`,author:`tbcode-org`,colours:{canvas:`#0a1611`,elevated:`#121f18`,muted:`#07100c`,text:`#d9dbd6`,textSecondary:`#7b8c81`,border:`#ffffff0c`,borderHover:`#ffffff33`,accent:`#2dd5b7`,accentHover:`#3ed8bd`,accentActive:`#4fdcc3`,selection:`#324235e1`,hover:`#ffffff0f`,active:`#ffffff14`,focus:`#90d9d1`,error:`#ff5345`,warning:`#e7c831`,success:`#63b07a`,info:`#82aecb`}},{id:`rosepine-light`,name:`Rose Pine`,variant:`light`,colours:{canvas:`#fbf5ef`,elevated:`#f5ede7`,muted:`#f7f0eb`,text:`#464061`,textSecondary:`#6a6673`,border:`#00000013`,borderHover:`#0000002e`,accent:`#177394`,accentHover:`#156a88`,accentActive:`#13617c`,selection:`#ece2db`,hover:`#0000000a`,active:`#00000014`,focus:`#8cd4f4`,error:`#942a50`,warning:`#965f0b`,success:`#347846`,info:`#0c4b62`}},{id:`rosepine-dark`,name:`Rose Pine`,variant:`dark`,colours:{canvas:`#12101d`,elevated:`#1c1a28`,muted:`#0c0b15`,text:`#dbdade`,textSecondary:`#87849b`,border:`#ffffff0c`,borderHover:`#ffffff33`,accent:`#9ccfd8`,accentHover:`#a4d3db`,accentActive:`#acd7de`,selection:`#444252c0`,hover:`#ffffff0f`,active:`#ffffff14`,focus:`#9fd3dd`,error:`#eb6f92`,warning:`#f6c177`,success:`#80b888`,info:`#9ccfd8`}},{id:`solarized-light`,name:`Solarized`,variant:`light`,colours:{canvas:`#fdf8e8`,elevated:`#f5f2e2`,muted:`#f7f3e4`,text:`#33494f`,textSecondary:`#596c73`,border:`#00000013`,borderHover:`#0000002e`,accent:`#0a72b1`,accentHover:`#0969a3`,accentActive:`#086095`,selection:`#e6e8da`,hover:`#0000000a`,active:`#00000014`,focus:`#98d0ff`,error:`#9b1a1a`,warning:`#806318`,success:`#5f6c17`,info:`#136196`}},{id:`solarized-dark`,name:`Solarized`,variant:`dark`,colours:{canvas:`#041d24`,elevated:`#0c242b`,muted:`#021820`,text:`#e0e4e5`,textSecondary:`#818e8f`,border:`#ffffff0c`,borderHover:`#ffffff33`,accent:`#7e83cb`,accentHover:`#888dcf`,accentActive:`#9397d3`,selection:`#293f44`,hover:`#ffffff0e`,active:`#ffffff13`,focus:`#bec4fa`,error:`#e35e5b`,warning:`#b58900`,success:`#859900`,info:`#2aa198`}},{id:`tokyonight-light`,name:`Tokyonight`,variant:`light`,colours:{canvas:`#e5e6ea`,elevated:`#dcdee3`,muted:`#e0e2e6`,text:`#343a56`,textSecondary:`#4b5472`,border:`#00000013`,borderHover:`#0000002f`,accent:`#195fba`,accentHover:`#1757ab`,accentActive:`#15509c`,selection:`#d0d2da`,hover:`#0000000a`,active:`#00000014`,focus:`#abcbfa`,error:`#97073a`,warning:`#65440a`,success:`#314e04`,info:`#0a54ae`}},{id:`tokyonight-dark`,name:`Tokyonight`,variant:`dark`,colours:{canvas:`#13141e`,elevated:`#1b1d28`,muted:`#0f0f18`,text:`#dcdde3`,textSecondary:`#8187a8`,border:`#ffffff0c`,borderHover:`#ffffff33`,accent:`#7aa2f7`,accentHover:`#85a9f8`,accentActive:`#8fb1f8`,selection:`#3d4053d5`,hover:`#ffffff0f`,active:`#ffffff13`,focus:`#afc9fe`,error:`#f7768e`,warning:`#e0af68`,success:`#9ece6a`,info:`#7dcfff`}},{id:`vercel-light`,name:`Vercel`,variant:`light`,colours:{canvas:`#ffffff`,elevated:`#f4f4f4`,muted:`#f9f9f9`,text:`#4a4a4a`,textSecondary:`#666666`,border:`#00000013`,borderHover:`#0000002e`,accent:`#0769e1`,accentHover:`#0661cf`,accentActive:`#0658bd`,selection:`#e4e4e4`,hover:`#0000000a`,active:`#00000014`,focus:`#a9cbfd`,error:`#a10725`,warning:`#a35d02`,success:`#14621b`,info:`#0a4ca2`}},{id:`vercel-dark`,name:`Vercel`,variant:`dark`,colours:{canvas:`#000000`,elevated:`#070707`,muted:`#000000`,text:`#cfcfcf`,textSecondary:`#7b7b7b`,border:`#ffffff12`,borderHover:`#ffffff33`,accent:`#0674f3`,accentHover:`#1a7ff4`,accentActive:`#2e8af5`,selection:`#2c2c2c`,hover:`#ffffff0f`,active:`#ffffff1a`,focus:`#a1cdfe`,error:`#e5484d`,warning:`#ffb224`,success:`#46a758`,info:`#52a8ff`}},{id:`vesper-light`,name:`Vesper`,variant:`light`,colours:{canvas:`#f1f1f1`,elevated:`#e7e7e7`,muted:`#ebebeb`,text:`#424242`,textSecondary:`#5c5c5c`,border:`#00000013`,borderHover:`#0000002f`,accent:`#8a5c35`,accentHover:`#7f5531`,accentActive:`#744d2d`,selection:`#d7d7d7`,hover:`#0000000a`,active:`#00000014`,focus:`#f6bb8a`,error:`#c91b35`,warning:`#955817`,success:`#327343`,info:`#3469a2`}},{id:`vesper-dark`,name:`Vesper`,variant:`dark`,colours:{canvas:`#0f0f0f`,elevated:`#191919`,muted:`#080808`,text:`#d9d9d9`,textSecondary:`#858585`,border:`#ffffff0c`,borderHover:`#ffffff33`,accent:`#ffc799`,accentHover:`#ffcba1`,accentActive:`#ffd0a9`,selection:`#484848a8`,hover:`#ffffff0f`,active:`#ffffff14`,focus:`#f4bc8d`,error:`#ff8080`,warning:`#ffc799`,success:`#80b888`,info:`#83afe0`}},{id:`vitesse-light-light`,name:`Vitesse`,variant:`light`,colours:{canvas:`#ffffff`,elevated:`#f5f5f5`,muted:`#f9f9f9`,text:`#484843`,textSecondary:`#6b6b64`,border:`#e6e2e2f1`,borderHover:`#cbc7c7f5`,accent:`#1c6b48`,accentHover:`#1c6b48`,accentActive:`#228056`,selection:`#22222218`,hover:`#0000000a`,active:`#00000014`,focus:`#00000050`,error:`#a85757`,warning:`#a45d2b`,success:`#1e754f`,info:`#296aa3`}},{id:`vitesse-dark-dark`,name:`Vitesse`,variant:`dark`,colours:{canvas:`#121212`,elevated:`#1b1b1b`,muted:`#0e0e0e`,text:`#ddd9cd`,textSecondary:`#878781`,border:`#292929cd`,borderHover:`#3c3c3c`,accent:`#4d9375`,accentHover:`#4d9375`,accentActive:`#5cb08c`,selection:`#eeeeee18`,hover:`#ffffff0f`,active:`#ffffff1a`,focus:`#00000050`,error:`#cb7676`,warning:`#d4976c`,success:`#4d9375`,info:`#6394bf`}}],wh=`omms-light`,Th=`omms-dark`,Eh=[{id:wh,name:`OMMS`,variant:`light`,colours:{canvas:`#fdfcfa`,elevated:`#f8f7f5`,muted:`#f7f6f4`,text:`#393a34`,textSecondary:`#5c5c54`,border:`#e5e1de`,borderHover:`#cbc7c2`,accent:`#b35017`,accentHover:`#9a4310`,accentActive:`#85390c`,selection:`#a9998f2b`,hover:`#0000000d`,active:`#00000014`,focus:`#b35017`,error:`#b7493f`,warning:`#8d6c15`,success:`#5f8d3d`,info:`#2d72c4`}},{id:Th,name:`OMMS`,variant:`dark`,colours:{canvas:`#120f0e`,elevated:`#181715`,muted:`#171615`,text:`#c9c5ba`,textSecondary:`#8f8b81`,border:`#242323`,borderHover:`#504e4c`,accent:`#da7c47`,accentHover:`#eb8c57`,accentActive:`#fd9b66`,selection:`#c8c6c52b`,hover:`#ffffff12`,active:`#ffffff1f`,focus:`#da7c47`,error:`#da5b4a`,warning:`#c67f13`,success:`#76ad4f`,info:`#479fe6`}},...Ch];function Dh(e){return Eh.filter(t=>t.variant===e)}function Oh(e,t){let n=t===`light`?wh:Th;return Eh.find(n=>n.id===e&&n.variant===t)??Eh.find(e=>e.id===n)}function kh(e){return e.id===`omms-light`||e.id===`omms-dark`}var Ah=e=>`color-mix(in srgb, var(${e}) 75%, var(--foreground))`;function jh(e,t){let n=t===`light`?`#ffffff`:e.canvas;return{"--background":e.canvas,"--foreground":e.text,"--card":e.elevated,"--card-foreground":e.text,"--popover":e.elevated,"--popover-foreground":e.text,"--primary":e.accent,"--primary-foreground":n,"--primary-hover":e.accentHover,"--primary-active":e.accentActive,"--primary-label":`color-mix(in srgb, var(--primary) 70%, var(--foreground))`,"--secondary":e.muted,"--secondary-foreground":e.text,"--muted":e.muted,"--muted-foreground":e.textSecondary,"--accent":e.selection,"--accent-foreground":e.text,"--selection":e.selection,"--interactive-hover":e.hover,"--interactive-active":e.active,"--destructive":e.error,"--destructive-label":Ah(`--destructive`),"--border":e.border,"--border-hover":e.borderHover,"--input":`color-mix(in srgb, var(--muted-foreground) 75%, var(--background))`,"--ring":e.accent,"--status-warning":e.warning,"--status-warning-label":Ah(`--status-warning`),"--status-success":e.success,"--status-success-label":Ah(`--status-success`),"--status-info":e.info,"--status-info-label":Ah(`--status-info`),"--chart-1":e.accent,"--chart-2":e.success,"--chart-3":e.info,"--chart-4":e.warning,"--chart-5":e.error,"--sidebar":e.muted,"--sidebar-foreground":e.text,"--sidebar-primary":e.accent,"--sidebar-primary-foreground":n,"--sidebar-accent":e.selection,"--sidebar-accent-foreground":e.text,"--sidebar-border":e.border,"--sidebar-ring":e.accent}}function Mh(e,t){return`${e} {\n${Object.entries(t).map(([e,t])=>` ${e}: ${t};`).join(`
|
|
59
|
-
`)}\n}`}function Nh(e,t){let n=Oh(e,`light`),r=Oh(t,`dark`),i=[];return kh(n)||i.push(Mh(`:root:not(.dark)`,jh(n.colours,`light`))),kh(r)||i.push(Mh(`:root.dark`,jh(r.colours,`dark`))),i.join(`
|
|
60
|
-
`)}var Ph=`omms-theme`,Fh=`opencode-mem-theme`,Ih=`omms-theme-light`,Lh=`omms-theme-dark`,Rh=`omms-theme`,zh=`(prefers-color-scheme: dark)`;function Bh(){return typeof window>`u`?null:xh(Si(Ph,Fh))}function Vh(){return typeof window>`u`||!window.matchMedia||window.matchMedia(zh).matches}function Hh(){return Sh(Bh(),Vh())}function Uh(){let e=(e,t)=>typeof window>`u`?t:Si(e,e)??t;return{mode:Bh()??`system`,light:Oh(e(Ih,wh),`light`).id,dark:Oh(e(Lh,Th),`dark`).id}}var Wh=Hh(),Gh=Uh(),Kh=!1,qh=new Set;function Jh(){for(let e of qh)e()}function Yh(e,t=!1){Wh=e,typeof document<`u`&&(document.documentElement.classList.toggle(`dark`,e===`dark`),Xh(document,e),t&&(Kh=!0,wi(Ph,e),Gh={...Gh,mode:e})),Jh()}function Xh(e,t){let n=Nh(Gh.light,Gh.dark),r=e.getElementById(Rh);n===``?r?.remove():(r||(r=e.createElement(`style`),r.id=Rh,e.head.append(r)),r.textContent=n),$i(e,t,(t===`dark`?Oh(Gh.dark,`dark`):Oh(Gh.light,`light`)).colours.canvas)}function Zh(e){return qh.add(e),()=>{qh.delete(e)}}function Qh(){return Wh}function $h(){return`dark`}function eg(e){Yh(e,!0)}function tg(){let e=Wh===`dark`?`light`:`dark`;return eg(e),e}function ng(){Yh(Hh())}function rg(){return(0,v.useSyncExternalStore)(Zh,Qh,$h)}var ig=()=>Gh;function ag(){return(0,v.useSyncExternalStore)(Zh,ig,ig)}function og(e){if(e!==`system`)return eg(e);Kh=!1,Ci(Ph),Ci(Fh),Gh={...Gh,mode:`system`},Yh(Hh())}function sg(e,t){let n=Oh(t,e).id;wi(e===`light`?Ih:Lh,n),Gh={...Gh,[e]:n},Yh(Wh)}typeof document<`u`&&(Yh(Wh),window.matchMedia?.(zh).addEventListener?.(`change`,()=>{!Kh&&Bh()===null&&Yh(Hh())}));var cg=[{code:`en`,label:`English (EN)`},{code:`zh`,label:`中文 (ZH)`},{code:`ar`,label:`العربية (AR)`}],lg=`omms-sidebar-collapsed`,ug=`omms-sidebar-settings-open`,eee=`omms-sidebar-memory-open`,tee=`omms-sidebar-profile-open`,dg=`omms-sidebar-skills-open`,fg=`inline-flex min-h-11 min-w-11 md:min-h-8 md:min-w-7 items-center justify-center text-muted-foreground transition-colors duration-150 hover:bg-interactive-hover hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring`;function pg(){try{let e=localStorage.getItem(ug);return e===null?null:e===`1`}catch{return null}}function mg(){try{return localStorage.getItem(lg)===`1`}catch{return!1}}function hg({open:e=!1,currentView:t,brand:n,projectLabel:r,profileLabel:i,chatLabel:a,memorisationLabel:o=`Memorisation`,skillsLabel:s=`Skills`,profileSections:c,skillsSections:l=[],settingsSections:u=[],memoryLabel:d=`Memory`,memorySections:f=[],memoryWarningLabel:p=``,memoryViewId:m=null,langLabel:h,languageLabel:g,themeLabel:_,settingsLabel:y,closeLabel:b,collapseLabel:x,expandLabel:S,onOpenChange:C,onLanguageSelect:w}){let T=rg()===`dark`,[E,D]=(0,v.useState)(!1),[O,k]=(0,v.useState)(!1),A=(0,v.useRef)(null),j=(0,v.useRef)(null),[M,N]=(0,v.useState)(mg),P=e=>M?e:``,[ee,F]=(0,v.useState)(()=>pg()??t===`settings`),[I,te]=sf(eee,t===`memory`),[L,ne]=sf(tee,t===`profile`),[re,R]=sf(dg,t===`skills`);function ie(){let e=!ee;F(e);try{localStorage.setItem(ug,e?`1`:`0`)}catch{}}function ae(){let e=!M;N(e);try{localStorage.setItem(lg,e?`1`:`0`)}catch{}}(0,v.useEffect)(()=>{if(!E)return;A.current?.querySelector(`[aria-checked=true]`)?.focus();function e(e){A.current?.contains(e.target)||D(!1)}return document.addEventListener(`pointerdown`,e),()=>document.removeEventListener(`pointerdown`,e)},[E]);function se(e){if(e.key===`Escape`&&(e.preventDefault(),D(!1),j.current?.focus()),![`ArrowDown`,`ArrowUp`,`Home`,`End`].includes(e.key))return;e.preventDefault();let t=Array.from(A.current?.querySelectorAll(`[role=menuitemradio]`)??[]),n=t.indexOf(document.activeElement);t[e.key===`Home`?0:e.key===`End`?t.length-1:(n+(e.key===`ArrowDown`?1:-1)+t.length)%t.length]?.focus()}function ce(e){C?.(e)}function le(e,t){e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),Em(t),ce(!1))}function ue(e,t,n=`profile`){e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),Em(n===`memory`?`${J.memory}/${t}`:`${J[n]}#${t}`),ce(!1))}function de(e){return V(`flex w-full min-w-0 min-h-11 md:min-h-9 items-center gap-2 rounded-[10px] px-3 py-2 text-ui transition-colors duration-150 focus-visible:outline-2 focus-visible:outline-ring focus-visible:outline-offset-2`,P(`md:justify-center md:px-0`),e?`bg-sidebar-accent text-sidebar-accent-foreground`:`text-sidebar-foreground hover:bg-interactive-hover active:bg-interactive-active`)}return(0,H.jsxs)(H.Fragment,{children:[e?(0,H.jsx)(`button`,{type:`button`,className:`fixed inset-0 z-40 bg-black/50 md:hidden`,"aria-label":b,onClick:()=>ce(!1)}):null,(0,H.jsxs)(`aside`,{className:V(`inset-y-0 start-0 z-50 flex h-svh w-64 shrink-0 flex-col border-e border-sidebar-border bg-sidebar text-sidebar-foreground transition-[transform,width] duration-200`,P(`md:w-14`),`fixed md:sticky md:top-0 md:translate-x-0!`,e?`translate-x-0`:`max-md:-translate-x-full max-md:rtl:translate-x-full`),children:[(0,H.jsxs)(`div`,{className:V(`flex items-center gap-2 px-4 py-4`,P(`md:flex-col md:px-2`)),children:[(0,H.jsxs)(`a`,{href:J.home,className:`flex min-w-0 flex-1 items-center gap-2 rounded-lg transition-colors hover:opacity-90`,onClick:e=>le(e,J.home),children:[(0,H.jsx)(`img`,{src:`/omms-icon.svg`,alt:``,width:20,height:20,className:`size-5 shrink-0 rounded-sm`}),(0,H.jsx)(pf,{brand:n,className:P(`md:hidden`)})]}),(0,H.jsx)(q,{variant:`ghost`,size:`icon-sm`,className:`hidden shrink-0 text-muted-foreground hover:text-primary md:inline-flex`,onClick:ae,"aria-label":M?S:x,"aria-expanded":!M,title:M?S:x,children:M?(0,H.jsx)(bt,{className:`size-4 rtl:-scale-x-100`}):(0,H.jsx)(yt,{className:`size-4 rtl:-scale-x-100`})}),(0,H.jsx)(q,{variant:`ghost`,size:`icon-sm`,className:`md:hidden min-h-11 min-w-11 shrink-0`,onClick:()=>ce(!1),"aria-label":b,children:(0,H.jsx)(an,{className:`size-4`})})]}),(0,H.jsx)(bh,{className:`bg-sidebar-border`}),(0,H.jsxs)(`nav`,{className:V(`flex min-h-0 flex-1 flex-col gap-1 overflow-y-auto p-3`,P(`md:px-2`)),"aria-label":`Main`,children:[sh({currentView:t,labels:{project:r,chat:a,memorisation:o,profile:i,skills:s},collapsed:M,navClass:de,onNavigate:le,profileTree:{sections:c,open:L,onToggle:ne,hideWhenCollapsed:P(`md:hidden`),onSectionClick:ue},skillsTree:{sections:l,open:re,onToggle:R,hideWhenCollapsed:P(`md:hidden`),onSectionClick:(e,t)=>ue(e,t,`skills`)}}),(0,H.jsxs)(`div`,{className:`flex items-center gap-0.5`,children:[(0,H.jsxs)(`a`,{href:J.memory,className:de(t===`memory`),"aria-current":t===`memory`?`page`:void 0,title:M?d:void 0,onClick:e=>le(e,J.memory),children:[(0,H.jsx)(oe,{className:`size-4 shrink-0`,"aria-hidden":`true`}),(0,H.jsx)(`span`,{className:V(`min-w-0 break-words text-start`,P(`md:sr-only`)),children:d})]}),f.length>0?(0,H.jsx)(`button`,{type:`button`,className:V(`inline-flex min-h-11 min-w-11 md:min-h-7 md:min-w-7 shrink-0 items-center justify-center rounded-lg p-1.5 text-muted-foreground hover:bg-interactive-hover focus-visible:outline-2 focus-visible:outline-ring`,P(`md:hidden`)),onClick:te,"aria-expanded":I,"aria-controls":`sidebar-memory-tree`,"aria-label":d,title:d,children:(0,H.jsx)(fe,{className:V(`size-4 transition-transform rtl:-scale-x-100`,I&&`rotate-90 rtl:rotate-90`)})}):null]}),I&&f.length>0?(0,H.jsx)(lf,{sections:f,currentView:t,memoryViewId:m,warningLabel:p,className:V(`ms-5 space-y-0.5 border-s border-sidebar-border ps-2`,P(`md:hidden`)),onSectionClick:ue}):null,(0,H.jsxs)(`div`,{className:`flex items-center gap-0.5`,children:[(0,H.jsxs)(`a`,{href:J.settings,className:de(t===`settings`),"aria-current":t===`settings`?`page`:void 0,title:M?y:void 0,onClick:e=>le(e,J.settings),children:[(0,H.jsx)(Rt,{className:`size-4 shrink-0`}),(0,H.jsx)(`span`,{className:V(`min-w-0 break-words text-start`,P(`md:sr-only`)),children:y})]}),u.length>0?(0,H.jsx)(`button`,{type:`button`,className:V(`inline-flex min-h-11 min-w-11 md:min-h-7 md:min-w-7 shrink-0 items-center justify-center rounded-lg p-1.5 text-muted-foreground transition-colors duration-150 hover:bg-interactive-hover hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring`,P(`md:hidden`)),onClick:ie,"aria-expanded":ee,"aria-controls":`sidebar-settings-tree`,"aria-label":y,title:y,children:(0,H.jsx)(fe,{className:V(`size-4 transition-transform rtl:-scale-x-100`,ee&&`rotate-90 rtl:rotate-90`)})}):null]}),ee&&u.length>0?(0,H.jsx)(`ul`,{id:`sidebar-settings-tree`,className:V(`ms-5 space-y-0.5 border-s border-sidebar-border ps-2`,P(`md:hidden`)),children:u.map(e=>(0,H.jsx)(`li`,{children:(0,H.jsx)(`a`,{href:`${J.settings}#${e.id}`,className:`flex min-h-11 md:min-h-7 items-center break-words rounded-lg px-2.5 py-1 text-xs text-muted-foreground transition-colors duration-150 hover:bg-interactive-hover hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring focus-visible:outline-offset-2`,onClick:t=>ue(t,e.id,`settings`),children:e.label})},e.id))}):null]}),(0,H.jsxs)(`div`,{className:V(`mt-auto p-3`,P(`md:px-2`)),children:[(0,H.jsx)(dh,{variant:`row`,className:`md:hidden`,onOpen:()=>k(!0)}),(0,H.jsxs)(`div`,{className:V(`flex w-fit items-center rounded-lg border border-sidebar-border/80 bg-card/70`,P(`md:mx-auto md:flex-col md:[&>*]:justify-center md:[&>*]:py-1.5 md:[&>*+*]:border-s-0 md:[&>*+*]:border-t md:[&>*]:rounded-none`)),children:[(0,H.jsxs)(`div`,{ref:A,className:`relative flex self-stretch`,onBlur:e=>{A.current?.contains(e.relatedTarget)||D(!1)},children:[(0,H.jsx)(`button`,{ref:j,type:`button`,className:`${fg} rounded-s-lg px-1.5 py-1.5 text-ui`,onClick:()=>D(e=>!e),"aria-label":`${g}: ${h}`,"aria-haspopup":`menu`,"aria-expanded":E,"aria-controls":`sidebar-language-menu`,title:g,children:(0,H.jsx)(`span`,{className:`text-xs tabular-nums`,children:h})}),E?(0,H.jsx)(`div`,{id:`sidebar-language-menu`,role:`menu`,"aria-label":g,onKeyDown:se,className:`absolute bottom-full start-0 z-10 mb-2 w-44 max-h-[60vh] overflow-y-auto rounded-lg border border-sidebar-border bg-card p-1 shadow-lg`,children:cg.map(({code:e,label:t})=>(0,H.jsx)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":h.toLowerCase()===e,className:`flex min-h-11 md:min-h-9 w-full items-center rounded-md px-2.5 py-2 text-start text-ui text-card-foreground aria-checked:bg-selection hover:bg-interactive-hover focus-visible:bg-selection focus-visible:outline-2 focus-visible:outline-ring`,onClick:()=>{w?.(e),D(!1),j.current?.focus()},children:t},e))}):null]}),(0,H.jsx)(`button`,{type:`button`,className:`${fg} self-stretch border-s border-sidebar-border px-1.5`,onClick:()=>tg(),"aria-label":_,title:_,children:T?(0,H.jsx)(ft,{className:`size-4 rounded-md p-0.5`}):(0,H.jsx)(Wt,{className:`size-4 rounded-md p-0.5`})}),(0,H.jsx)(`a`,{href:J.settings,className:`${fg} self-stretch border-s border-sidebar-border px-1.5`,onClick:e=>le(e,J.settings),"aria-label":y,title:y,"aria-current":t===`settings`?`page`:void 0,children:(0,H.jsx)(Rt,{className:`size-4`})}),(0,H.jsx)(ff,{}),(0,H.jsx)(`a`,{href:`https://github.com/cmdaltctr/omms`,target:`_blank`,rel:`noopener noreferrer`,className:`${fg} self-stretch rounded-e-lg border-s border-sidebar-border px-1.5`,title:`GitHub`,"aria-label":`GitHub`,children:(0,H.jsx)(uf,{className:`size-4`})}),(0,H.jsx)(dh,{onOpen:()=>k(!0),variant:M?`icon`:`inline`,className:V(`max-md:hidden`,M?`md:border-t md:border-sidebar-border`:`rounded-e-lg`)})]}),(0,H.jsx)(fh,{open:O,onOpenChange:k})]})]})]})}function gg({className:e,...t}){return(0,H.jsx)(`textarea`,{"data-slot":`textarea`,dir:`auto`,className:V(`border-input placeholder:text-muted-foreground selection:bg-selection selection:text-foreground flex field-sizing-content min-h-16 w-full min-w-0 rounded-[10px] border bg-card px-2.5 py-2 text-ui [unicode-bidi:plaintext] transition-colors duration-150 outline-none disabled:cursor-not-allowed disabled:opacity-50`,`focus-visible:border-ring focus-visible:ring-ring focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-background`,`aria-invalid:ring-destructive aria-invalid:ring-1 aria-invalid:border-destructive`,e),...t})}function _g({open:e=!1,content:t=``,onOpenChange:n,onSave:r}){let{t:i}=G(),[a,o]=(0,v.useState)(``);(0,v.useEffect)(()=>{e&&o(t)},[e,t]);function s(e){n?.(e)}function c(e){e.preventDefault();let t=a.trim();t&&r?.(t)}return(0,H.jsx)(Du,{open:e,onOpenChange:s,children:(0,H.jsxs)(Au,{className:`sm:max-w-lg`,children:[(0,H.jsx)(ju,{children:(0,H.jsx)(Nu,{children:i(`modal-edit-title`)})}),(0,H.jsxs)(`form`,{className:`space-y-4`,onSubmit:c,children:[(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(nm,{htmlFor:`edit-content`,children:i(`label-content`)}),(0,H.jsx)(gg,{id:`edit-content`,rows:6,value:a,onChange:e=>o(e.target.value),required:!0})]}),(0,H.jsxs)(Mu,{children:[(0,H.jsx)(q,{type:`button`,variant:`secondary`,onClick:()=>s(!1),children:i(`btn-cancel`)}),(0,H.jsx)(q,{type:`submit`,children:i(`btn-save`)})]})]})]})})}function vg({children:e,maxHeight:t,fade:n=`var(--card)`}){let{t:r}=G(),i=(0,v.useId)(),a=(0,v.useRef)(null),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(!1);(0,v.useEffect)(()=>{let e=a.current;if(!e)return;let n=()=>l(e.offsetHeight>t);if(n(),typeof ResizeObserver>`u`)return;let r=new ResizeObserver(n);return r.observe(e),()=>r.disconnect()},[t]);let u=c&&!o;return(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsxs)(`div`,{id:i,className:`relative overflow-hidden`,style:u?{maxHeight:t}:void 0,"data-collapsed":u?`true`:void 0,children:[(0,H.jsx)(`div`,{ref:a,children:e}),u?(0,H.jsx)(`div`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-x-0 bottom-0 h-12`,style:{background:`linear-gradient(to top, ${n}, transparent)`}}):null]}),c?(0,H.jsxs)(q,{variant:`ghost`,size:`xs`,"aria-expanded":o,"aria-controls":i,onClick:()=>s(e=>!e),children:[o?(0,H.jsx)(pe,{}):(0,H.jsx)(ue,{}),r(o?`btn-see-less`:`btn-see-more`)]}):null]})}function yg({type:e}){let{t}=G();return(0,H.jsx)(bf,{content:t(`tooltip-memory-type`),className:`min-w-0 max-w-full`,children:(0,H.jsx)(qd,{variant:`outline`,"data-memory-type":e,tabIndex:0,className:`h-auto min-h-5 max-w-full shrink break-all whitespace-normal bg-transparent border-current [color:oklch(0.42_0.13_var(--memory-type-hue))] dark:[color:oklch(0.8_0.13_var(--memory-type-hue))]`,style:{"--memory-type-hue":String(Wd(e))},children:e})})}var bg=/<pasted_content\b[^>]*>([\s\S]*?)<\/pasted_content[^>]*>|```[^\n]*\n([\s\S]*?)```/g;function xg(e){return e.replace(/^\n+|\n+$/g,``)}function Sg(e){let t=[],n=e=>{let n=xg(e);n.trim()&&t.push({kind:`text`,text:n})},r=0;for(let i of e.matchAll(bg)){n(e.slice(r,i.index));let a=i[1]!==void 0;t.push({kind:a?`pasted`:`code`,text:xg(a?i[1]:i[2])}),r=i.index+i[0].length}return n(e.slice(r)),t}function Cg(e){let t=[],n=0;for(let r of e.matchAll(/`([^`\n]+)`/g))r.index>n&&t.push({code:!1,text:e.slice(n,r.index)}),t.push({code:!0,text:r[1]}),n=r.index+r[0].length;return n<e.length&&t.push({code:!1,text:e.slice(n)}),t}function wg({label:e,children:t}){return(0,H.jsxs)(`div`,{className:`overflow-hidden rounded-lg border border-border bg-background/60`,children:[e?(0,H.jsx)(`div`,{className:`border-b border-border px-3 py-1.5 text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:e}):null,(0,H.jsx)(`pre`,{dir:`ltr`,className:`overflow-x-auto p-3 font-mono text-code leading-relaxed whitespace-pre-wrap break-words`,children:t})]})}function Tg({content:e}){let{t}=G();return(0,H.jsx)(`div`,{className:`space-y-3`,children:Sg(e).map((e,n)=>e.kind===`pasted`?(0,H.jsx)(wg,{label:t(`label-pasted-content`),children:e.text},n):e.kind===`code`?(0,H.jsx)(wg,{children:e.text},n):(0,H.jsx)(`p`,{className:`text-sm whitespace-pre-wrap break-words`,children:Cg(e.text).map((e,t)=>e.code?(0,H.jsx)(`code`,{className:`inline-code`,children:e.text},t):(0,H.jsx)(v.Fragment,{children:e.text},t))},n))})}function Eg(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Dg(e){if(Array.isArray(e))return e}function Og(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function kg(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
61
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ag(e,t){return Dg(e)||Og(e,t)||jg(e,t)||kg()}function jg(e,t){if(e){if(typeof e==`string`)return Eg(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Eg(e,t):void 0}}var Mg=Object.entries,Ng=Object.setPrototypeOf,Pg=Object.isFrozen,Fg=Object.getPrototypeOf,Ig=Object.getOwnPropertyDescriptor,Lg=Object.freeze,Rg=Object.seal,zg=Object.create,Bg=typeof Reflect<`u`&&Reflect,Vg=Bg.apply,Hg=Bg.construct;Lg||=function(e){return e},Rg||=function(e){return e},Vg||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},Hg||=function(e){return new e(...[...arguments].slice(1))};var Ug=l_(Array.prototype.forEach),Wg=l_(Array.prototype.lastIndexOf),Gg=l_(Array.prototype.pop),Kg=l_(Array.prototype.push),qg=l_(Array.prototype.splice),Jg=Array.isArray,Yg=l_(String.prototype.toLowerCase),Xg=l_(String.prototype.toString),Zg=l_(String.prototype.match),Qg=l_(String.prototype.replace),$g=l_(String.prototype.indexOf),e_=l_(String.prototype.trim),t_=l_(Number.prototype.toString),n_=l_(Boolean.prototype.toString),r_=typeof BigInt>`u`?null:l_(BigInt.prototype.toString),i_=typeof Symbol>`u`?null:l_(Symbol.prototype.toString),a_=l_(Object.prototype.hasOwnProperty),o_=l_(Object.prototype.toString),s_=l_(RegExp.prototype.test),c_=u_(TypeError);function l_(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return Vg(e,t,n)}}function u_(e){return function(){return Hg(e,[...arguments])}}function d_(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Yg;if(Ng&&Ng(e,null),!Jg(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(Pg(t)||(t[r]=e),i=e)}e[i]=!0}return e}function f_(e){for(let t=0;t<e.length;t++)a_(e,t)||(e[t]=null);return e}function p_(e){let t=zg(null);for(let r of Mg(e)){var n=Ag(r,2);let i=n[0],a=n[1];a_(e,i)&&(t[i]=Jg(a)?f_(a):a&&typeof a==`object`&&a.constructor===Object?p_(a):a)}return t}function m_(e){switch(typeof e){case`string`:return e;case`number`:return t_(e);case`boolean`:return n_(e);case`bigint`:return r_?r_(e):`0`;case`symbol`:return i_?i_(e):`Symbol()`;case`undefined`:return o_(e);case`function`:case`object`:{if(e===null)return o_(e);let t=e,n=h_(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:o_(e)}return o_(e)}default:return o_(e)}}function h_(e,t){for(;e!==null;){let n=Ig(e,t);if(n){if(n.get)return l_(n.get);if(typeof n.value==`function`)return l_(n.value)}e=Fg(e)}function n(){return null}return n}function g_(e){try{return s_(e,``),!0}catch{return!1}}var __=Lg(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),v_=Lg(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),y_=Lg([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),b_=Lg([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),x_=Lg(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),S_=Lg([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),C_=Lg([`#text`]),w_=Lg(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),T_=Lg(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),E_=Lg(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),D_=Lg([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),O_=Rg(/{{[\w\W]*|^[\w\W]*}}/g),k_=Rg(/<%[\w\W]*|^[\w\W]*%>/g),A_=Rg(/\${[\w\W]*/g),j_=Rg(/^data-[\-\w.\u00B7-\uFFFF]+$/),M_=Rg(/^aria-[\-\w]+$/),N_=Rg(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),P_=Rg(/^(?:\w+script|data):/i),F_=Rg(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),I_=Rg(/^html$/i),L_=Rg(/^[a-z][.\w]*(-[.\w]+)+$/i),R_=Rg(/<[/\w!]/g),z_=Rg(/<[/\w]/g),B_=Rg(/<\/no(script|embed|frames)/i),V_=Rg(/\/>/i),H_={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},U_=[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`],W_=Lg(d_({},U_)),G_=function(){let e={};return Ug(U_,t=>{e[t]=Rg(RegExp(`</`+t+`(?=[\\t\\n\\f\\r />])`,`i`))}),Lg(e)}(),K_=function(){return typeof window>`u`?null:window},q_=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},J_=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Y_=function(e,t,n,r){return a_(e,t)&&Jg(e[t])?d_(r.base?p_(r.base):{},e[t],r.transform):n},X_=function(e,t,n){let r=a_(e,t)?e[t]:void 0;return r&&typeof r==`object`?p_(r):n()};function Z_(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:K_(),t=e=>Z_(e);if(t.version=`3.4.14`,t.removed=[],!e||!e.document||e.document.nodeType!==H_.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=h_(d,`cloneNode`),p=h_(d,`remove`),m=h_(d,`nextSibling`),h=h_(d,`childNodes`),g=h_(d,`parentNode`),_=h_(d,`shadowRoot`),v=h_(d,`attributes`),y=o&&o.prototype?h_(o.prototype,`nodeType`):null,b=o&&o.prototype?h_(o.prototype,`nodeName`):null,x=o&&o.prototype?h_(o.prototype,`ownerDocument`):null,S=function(e){return y?y(e):e.nodeType},C=function(e){return b?b(e):e.nodeName};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let w,T=``,E,D=!1,O=0,k=function(){if(O>0)throw c_(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},A=function(e){k(),O++;try{return w.createHTML(e)}finally{O--}},j=function(e){k(),O++;try{return w.createScriptURL(e)}finally{O--}},M=function(){return D||=(E=q_(u,i),!0),E},N=n,P=N.implementation,ee=N.createNodeIterator,F=N.createDocumentFragment,I=N.getElementsByTagName,te=r.importNode,L=J_();t.isSupported=typeof Mg==`function`&&typeof g==`function`&&P&&P.createHTMLDocument!==void 0;let ne=O_,re=k_,R=A_,ie=j_,ae=M_,oe=P_,se=F_,ce=L_,le=N_,ue=null,de=d_({},[...__,...v_,...y_,...x_,...C_]),fe=null,pe=d_({},[...w_,...T_,...E_,...D_]),me=Object.seal(zg(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),he=null,ge=null,_e=Object.seal(zg(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),ve=!0,ye=!0,be=!1,xe=!0,Se=!1,Ce=!0,we=!1,Te=!1,Ee=null,De=null,Oe=!1,ke=!1,Ae=!1,je=!1,Me=!0,Ne=!1,Pe=`user-content-`,Fe=!0,Ie=!1,Le={},Re=null,ze=d_({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),Be=null,Ve=d_({},[`audio`,`video`,`img`,`source`,`image`,`track`]),He=null,Ue=d_({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),We=`http://www.w3.org/1998/Math/MathML`,Ge=`http://www.w3.org/2000/svg`,Ke=`http://www.w3.org/1999/xhtml`,qe=Ke,Je=!1,Ye=null,Xe=d_({},[We,Ge,Ke],Xg),Ze=Lg([`mi`,`mo`,`mn`,`ms`,`mtext`]),Qe=d_({},Ze),$e=Lg([`annotation-xml`]),et=d_({},$e),tt=d_({},[`title`,`style`,`font`,`a`,`script`]),nt=null,rt=[`application/xhtml+xml`,`text/html`],it=null,at=null,ot=n.createElement(`form`),st=function(e){return e instanceof RegExp||e instanceof Function},ct=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(at&&at===e)return;(!e||typeof e!=`object`)&&(e={}),e=p_(e),nt=rt.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,it=nt===`application/xhtml+xml`?Xg:Yg,ue=Y_(e,`ALLOWED_TAGS`,de,{transform:it}),fe=Y_(e,`ALLOWED_ATTR`,pe,{transform:it}),Ye=Y_(e,`ALLOWED_NAMESPACES`,Xe,{transform:Xg}),He=Y_(e,`ADD_URI_SAFE_ATTR`,Ue,{transform:it,base:Ue}),Be=Y_(e,`ADD_DATA_URI_TAGS`,Ve,{transform:it,base:Ve}),Re=Y_(e,`FORBID_CONTENTS`,ze,{transform:it}),he=Y_(e,`FORBID_TAGS`,p_({}),{transform:it}),ge=Y_(e,`FORBID_ATTR`,p_({}),{transform:it}),Le=a_(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?p_(e.USE_PROFILES):e.USE_PROFILES:!1,ve=e.ALLOW_ARIA_ATTR!==!1,ye=e.ALLOW_DATA_ATTR!==!1,be=e.ALLOW_UNKNOWN_PROTOCOLS||!1,xe=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Se=e.SAFE_FOR_TEMPLATES||!1,Ce=e.SAFE_FOR_XML!==!1,we=e.WHOLE_DOCUMENT||!1,ke=e.RETURN_DOM||!1,Ae=e.RETURN_DOM_FRAGMENT||!1,je=e.RETURN_TRUSTED_TYPE||!1,Oe=e.FORCE_BODY||!1,Me=e.SANITIZE_DOM!==!1,Ne=e.SANITIZE_NAMED_PROPS||!1,Fe=e.KEEP_CONTENT!==!1,Ie=e.IN_PLACE||!1,le=g_(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:N_,qe=typeof e.NAMESPACE==`string`?e.NAMESPACE:Ke,Qe=X_(e,`MATHML_TEXT_INTEGRATION_POINTS`,()=>d_({},Ze)),et=X_(e,`HTML_INTEGRATION_POINTS`,()=>d_({},$e));let t=X_(e,`CUSTOM_ELEMENT_HANDLING`,()=>zg(null));if(me=zg(null),a_(t,`tagNameCheck`)&&st(t.tagNameCheck)&&(me.tagNameCheck=t.tagNameCheck),a_(t,`attributeNameCheck`)&&st(t.attributeNameCheck)&&(me.attributeNameCheck=t.attributeNameCheck),a_(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(me.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),Rg(me),Se&&(ye=!1),Ae&&(ke=!0),Le&&(ue=d_({},C_),fe=zg(null),Le.html===!0&&(d_(ue,__),d_(fe,w_)),Le.svg===!0&&(d_(ue,v_),d_(fe,T_),d_(fe,D_)),Le.svgFilters===!0&&(d_(ue,y_),d_(fe,T_),d_(fe,D_)),Le.mathMl===!0&&(d_(ue,x_),d_(fe,E_),d_(fe,D_))),_e.tagCheck=null,_e.attributeCheck=null,a_(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?_e.tagCheck=e.ADD_TAGS:Jg(e.ADD_TAGS)&&(ue===de&&(ue=p_(ue)),d_(ue,e.ADD_TAGS,it))),a_(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?_e.attributeCheck=e.ADD_ATTR:Jg(e.ADD_ATTR)&&(fe===pe&&(fe=p_(fe)),d_(fe,e.ADD_ATTR,it))),a_(e,`ADD_FORBID_CONTENTS`)&&Jg(e.ADD_FORBID_CONTENTS)&&(Re===ze&&(Re=p_(Re)),d_(Re,e.ADD_FORBID_CONTENTS,it)),Fe&&(ue[`#text`]=!0),we&&d_(ue,[`html`,`head`,`body`]),ue.table&&(d_(ue,[`tbody`]),delete he.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw c_(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw c_(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=w;w=e.TRUSTED_TYPES_POLICY;try{T=A(``)}catch(e){throw w=t,e}}else e.TRUSTED_TYPES_POLICY===null?(w=void 0,T=``):(w===void 0&&(w=M()),w&&typeof T==`string`&&(T=A(``)));Lg&&Lg(e),at=e},lt=d_({},[...v_,...y_,...b_]),ut=d_({},[...x_,...S_]),dt=function(e,t,n){return t.namespaceURI===Ke?e===`svg`:t.namespaceURI===We?e===`svg`&&(n===`annotation-xml`||Qe[n]):!!lt[e]},ft=function(e,t,n){return t.namespaceURI===Ke?e===`math`:t.namespaceURI===Ge?e===`math`&&et[n]:!!ut[e]},pt=function(e,t,n){return t.namespaceURI===Ge&&!et[n]||t.namespaceURI===We&&!Qe[n]?!1:!ut[e]&&(tt[e]||!lt[e])},mt=function(e){let t=g(e);(!t||!t.tagName)&&(t={namespaceURI:qe,tagName:`template`});let n=Yg(e.tagName),r=Yg(t.tagName);return Ye[e.namespaceURI]?e.namespaceURI===Ge?dt(n,t,r):e.namespaceURI===We?ft(n,t,r):e.namespaceURI===Ke?pt(n,t,r):!!(nt===`application/xhtml+xml`&&Ye[e.namespaceURI]):!1},ht=function(e){Kg(t.removed,{element:e});try{g(e).removeChild(e)}catch{if(p(e),!g(e))throw c_(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},gt=function(e,t,n){try{e.removeAttributeNode(t)}catch{try{e.removeAttribute(n)}catch{}}},_t=function(e){bt(e);let t=h(e);if(t){let e=[];Ug(t,t=>{Kg(e,t)}),Ug(e,e=>{try{p(e)}catch{}})}let n=v(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;typeof i==`string`&>(e,r,i)}},vt=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}Kg(t.removed,{attribute:r||null,from:n});try{r?n.removeAttributeNode(r):n.removeAttribute(e)}catch{try{n.removeAttribute(e)}catch{}}if(e===`is`){if(ke||Ae)try{ht(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},yt=function(e){let t=v(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;typeof i!=`string`||fe[it(i)]||gt(e,r,i)}},bt=function(e){let t=[e];for(;t.length>0;){let e=t.pop();S(e)===H_.element&&yt(e);let n=h(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},xt=function(e,t){return Ce?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},St=function(e){if(!Ce)return;let t=[e];for(;t.length>0;){let e=t.pop(),n=S(e);if(n===H_.processingInstruction||n===H_.comment&&s_(z_,e.data)){try{p(e)}catch{}continue}if(n===H_.element){let t=e,n=it(C(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&xt(`for`,n)&&t.removeAttribute(`for`)}catch{}}let r=h(e);if(r)for(let e=r.length-1;e>=0;--e)t.push(r[e])}},Ct=function(e){let t=null,r=null;if(Oe)e=`<remove></remove>`+e;else{let t=Zg(e,/^[\r\n\t ]+/);r=t&&t[0]}nt===`application/xhtml+xml`&&qe===Ke&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=w?A(e):e;if(qe===Ke)try{t=new l().parseFromString(i,nt)}catch{}if(!t||!t.documentElement){t=P.createDocument(qe,`template`,null);try{t.documentElement.innerHTML=Je?T:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),qe===Ke?I.call(t,we?`html`:`body`)[0]:we?t.documentElement:a},wt=function(e){let t=x?x(e):e.ownerDocument;return ee.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Tt=function(e){return e=Qg(e,ne,` `),e=Qg(e,re,` `),e=Qg(e,R,` `),e},Et=function(e){e.normalize();let t=x?x(e):e.ownerDocument,n=ee.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=Tt(r.data),r=n.nextNode();let i=e.querySelectorAll?.call(e,`template`);i&&Ug(i,e=>{Ot(e.content)&&Et(e.content)})},Dt=function(e){let t=b?b(e):null;return typeof t!=`string`||it(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==v(e)||typeof e.removeAttribute!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==y(e)||e.childNodes!==h(e)},Ot=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return y(e)===H_.documentFragment}catch{return!1}},kt=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return typeof y(e)==`number`}catch{return!1}};function At(e,n,r){e.length!==0&&Ug(e,e=>{e.call(t,n,r,at)})}let jt=function(e,t){return!!(Ce&&e.hasChildNodes()&&!kt(e.firstElementChild)&&s_(R_,e.textContent)&&s_(R_,e.innerHTML)||Ce&&e.namespaceURI===Ke&&W_[t]&&(kt(e.firstElementChild)||typeof e.textContent==`string`&&s_(G_[t],e.textContent))||e.nodeType===H_.processingInstruction||Ce&&e.nodeType===H_.comment&&s_(z_,e.data))},Mt=function(e,t){return e instanceof RegExp?s_(e,t):e instanceof Function&&!!e(t,...[...arguments].slice(2))},Nt=function(e,t,n){if(!he[t]&&zt(t)&&Mt(me.tagNameCheck,t))return!1;if(Fe&&!Re[t]){let t=g(e),r=h(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?f(r[a],!0):r[a];t.insertBefore(i,m(e))}}}return ht(e),!0},Pt=function(e,t,n,r){return e.length===0?t:t===n||t===r?p_(t):t},Ft=function(e,t){return e===t||g(e)!==null?!1:(Ie&&bt(e),!0)},It=function(e,n){if(At(L.beforeSanitizeElements,e,null),Ft(e,n))return!0;if(Dt(e))return ht(e),!0;let r=it(C(e));if(ue=Pt(L.uponSanitizeElement,ue,de,Ee),At(L.uponSanitizeElement,e,{tagName:r,allowedTags:ue}),Ft(e,n))return!0;if(jt(e,r))return ht(e),!0;if(he[r]||!(_e.tagCheck instanceof Function&&_e.tagCheck(r))&&!ue[r]){let t=Nt(e,r,n);return t===!1&&At(L.afterSanitizeElements,e,null),t}if(S(e)===H_.element&&!mt(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&s_(B_,e.innerHTML))return ht(e),!0;if(Se&&e.nodeType===H_.text){let n=Tt(e.textContent);e.textContent!==n&&(Kg(t.removed,{element:e.cloneNode()}),e.textContent=n)}return At(L.afterSanitizeElements,e,null),!1},Lt=function(e,t,r){if(ge[t]||xt(t,e)||Me&&(t===`id`||t===`name`)&&(r in n||r in ot))return!1;let i=fe[t]||_e.attributeCheck instanceof Function&&_e.attributeCheck(t,e);return ye&&s_(ie,t)||ve&&s_(ae,t)?!0:i?He[t]||s_(le,Qg(r,se,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&$g(r,`data:`)===0&&Be[e]||be&&!s_(oe,Qg(r,se,``))?!0:!r:zt(e)&&Mt(me.tagNameCheck,e)&&Mt(me.attributeNameCheck,t,e)||t===`is`&&me.allowCustomizedBuiltInElements&&Mt(me.tagNameCheck,r)},Rt=d_({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),zt=function(e){return!Rt[Yg(e)]&&s_(ce,e)},Bt=function(e,t,n,r){if(w&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return A(r);case`TrustedScriptURL`:return j(r)}return r},Vt=function(e,n,r,i){try{r?e.setAttributeNS(r,n,i):e.setAttribute(n,i),Dt(e)?ht(e):Gg(t.removed)}catch{vt(n,e)}},Ht=function(e){At(L.beforeSanitizeAttributes,e,null);let t=e.attributes;if(!t||Dt(e))return;fe=Pt(L.uponSanitizeAttribute,fe,pe,De);let n={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:fe,forceKeepAttr:void 0},r=t.length,i=it(e.nodeName);for(;r--;){let a=t[r],o=a.name,s=a.namespaceURI,c=a.value,l=it(o),u=c,d=o===`value`?u:e_(u);if(n.attrName=l,n.attrValue=d,n.keepAttr=!0,n.forceKeepAttr=void 0,At(L.uponSanitizeAttribute,e,n),d=n.attrValue,Ne&&(l===`id`||l===`name`)&&$g(d,Pe)!==0&&(vt(o,e,a),d=Pe+d),Ce&&s_(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,d)){vt(o,e,a);continue}if(l===`attributename`&&Zg(d,`href`)){vt(o,e,a);continue}if(!n.forceKeepAttr){if(!n.keepAttr){vt(o,e,a);continue}if(!xe&&s_(V_,d)){vt(o,e,a);continue}if(Se&&(d=Tt(d)),!Lt(i,l,d)){vt(o,e,a);continue}d=Bt(i,l,s,d),d!==u&&Vt(e,o,s,d)}}At(L.afterSanitizeAttributes,e,null)},Ut=function(e){let t=null,n=wt(e);for(At(L.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(At(L.uponSanitizeShadowNode,t,null),It(t,e),Ht(t),Ot(t.content)&&Ut(t.content),S(t)===H_.element){let e=_(t);Ot(e)&&(Wt(e),Ut(e))}At(L.afterSanitizeShadowDOM,e,null)},Wt=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){Ut(e.shadow);continue}let n=e.node,r=S(n)===H_.element,i=h(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=b?b(n):null;if(typeof e==`string`&&it(e)===`template`){let e=n.content;Ot(e)&&t.push({node:e,shadow:null})}}if(r){let e=_(n);Ot(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(Je=!e,Je&&(e=`<!-->`),typeof e!=`string`&&!kt(e)&&(e=m_(e),typeof e!=`string`))throw c_(`dirty is not a string, aborting`);if(!t.isSupported)return e;Te?(ue=Ee,fe=De):ct(n),(L.uponSanitizeElement.length>0||L.uponSanitizeAttribute.length>0)&&(ue=p_(ue)),L.uponSanitizeAttribute.length>0&&(fe=p_(fe)),t.removed=[];let c=Ie&&typeof e!=`string`&&kt(e);if(c){St(e);let t=C(e);if(typeof t==`string`){let n=it(t);if(!ue[n]||he[n])throw _t(e),c_(`root node is forbidden and cannot be sanitized in-place`)}if(Dt(e))throw _t(e),c_(`root node is clobbered and cannot be sanitized in-place`);try{Wt(e)}catch(t){throw _t(e),t}}else if(kt(e))i=Ct(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===H_.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),Wt(a);else{if(!ke&&!Se&&!we&&e.indexOf(`<`)===-1)return w&&je?A(e):e;if(i=Ct(e),!i)return ke?null:je?T:``}i&&Oe&&ht(i.firstChild);let l=c?e:i;try{let e=wt(l);for(;o=e.nextNode();)It(o,l),Ht(o),Ot(o.content)&&Ut(o.content)}catch(n){throw c&&(_t(e),Ug(t.removed,e=>{e.element&&bt(e.element)})),n}if(c)return Ug(t.removed,e=>{e.element&&bt(e.element)}),Se&&Et(e),e;if(ke){if(Se&&Et(i),Ae)for(s=F.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(fe.shadowroot||fe.shadowrootmode)&&(s=te.call(r,s,!0)),s}let u=we?i.outerHTML:i.innerHTML;return we&&ue[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&s_(I_,i.ownerDocument.doctype.name)&&(u=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
|
|
62
|
-
`+u),Se&&(u=Tt(u)),w&&je?A(u):u},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ct(e),Te=!0,Ee=ue,De=fe},t.clearConfig=function(){at=null,Te=!1,Ee=null,De=null,w=E,T=``},t.isValidAttribute=function(e,t,n){at||ct({});let r=it(e),i=it(t);return Lt(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&a_(L,e)&&Kg(L[e],t)},t.removeHook=function(e,t){if(a_(L,e)){if(t!==void 0){let n=Wg(L[e],t);return n===-1?void 0:qg(L[e],n,1)[0]}return Gg(L[e])}},t.removeHooks=function(e){a_(L,e)&&(L[e]=[])},t.removeAllHooks=function(){L=J_()},t}var Q_=Z_();function $_(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ev=$_();function tv(e){ev=e}var nv={exec:()=>null};function rv(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function iv(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(ov.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var av=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),ov={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:rv(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:rv(e=>RegExp(`^ {0,${e}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:rv(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:rv(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:rv(e=>RegExp(`^ {0,${e}}<(?:[a-z].*>|!--)`,`i`)),blockquoteBeginRegex:rv(e=>RegExp(`^ {0,${e}}>`))},sv=/^(?:[ \t]*(?:\n|$))+/,cv=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,lv=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,uv=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,dv=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,fv=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,pv=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,mv=iv(pv).replace(/bull/g,fv).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),hv=iv(pv).replace(/bull/g,fv).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),gv=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,_v=/^[^\n]+/,vv=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,yv=iv(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,vv).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),bv=iv(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,fv).getRegex(),xv=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,Sv=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Cv=iv(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,Sv).replace(`tag`,xv).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),wv=e=>iv(gv).replace(`hr`,uv).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,e).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,xv).getRegex(),Tv=wv(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),nee=wv(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),Ev={blockquote:iv(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,nee).getRegex(),code:cv,def:yv,fences:lv,heading:dv,hr:uv,html:Cv,lheading:mv,list:bv,newline:sv,paragraph:Tv,table:nv,text:_v},Dv=iv(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,uv).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,xv).getRegex(),ree={...Ev,lheading:hv,table:Dv,paragraph:iv(gv).replace(`hr`,uv).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,Dv).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,xv).getRegex()},iee={...Ev,html:iv(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,Sv).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:nv,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:iv(gv).replace(`hr`,uv).replace(`heading`,` *#{1,6} *[^
|
|
63
|
-
]`).replace(`lheading`,mv).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},aee=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,oee=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Ov=/^( {2,}|\\)\n(?!\s*$)/,kv=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Av=/[\p{P}\p{S}]/u,jv=/[\s\p{P}\p{S}]/u,Mv=/[^\s\p{P}\p{S}]/u,Nv=iv(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,jv).getRegex(),Pv=/[\p{Pi}\p{Ps}"']/u,Fv=/(?!~)[\p{P}\p{S}]/u,Iv=/(?!~)[\s\p{P}\p{S}]/u,Lv=/(?:[^\s\p{P}\p{S}]|~)/u,Rv=iv(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,av?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),zv=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Bv=iv(zv,`u`).replace(/punct/g,Av).getRegex(),Vv=iv(zv,`u`).replace(/punct/g,Fv).getRegex(),Hv=iv(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,`u`).replace(/openQuote/g,Pv).replace(/punct/g,Av).getRegex(),Uv=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,Wv=iv(Uv,`gu`).replace(/notPunctSpace/g,Mv).replace(/punctSpace/g,jv).replace(/punct/g,Av).getRegex(),Gv=iv(Uv,`gu`).replace(/notPunctSpace/g,Lv).replace(/punctSpace/g,Iv).replace(/punct/g,Fv).getRegex(),Kv=iv(`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,Mv).replace(/punctSpace/g,jv).replace(/punct/g,Av).getRegex(),qv=iv(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,Mv).replace(/punctSpace/g,jv).replace(/punct/g,Av).getRegex(),Jv=iv(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,Mv).replace(/punctSpace/g,jv).replace(/punct/g,Av).getRegex(),Yv=iv(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,Av).getRegex(),Xv=iv(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,Mv).replace(/punctSpace/g,jv).replace(/punct/g,Av).getRegex(),Zv=iv(/\\(punct)/,`gu`).replace(/punct/g,Av).getRegex(),Qv=iv(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),$v=iv(Sv).replace(`(?:-->|$)`,`-->`).getRegex(),ey=iv(`^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,$v).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ty=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,ny=iv(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace(`label`,ty).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),ry=iv(/^!?\[(label)\]\[(ref)\]/).replace(`label`,ty).replace(`ref`,vv).getRegex(),iy=iv(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,vv).getRegex(),ay=iv(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,ry).replace(`nolink`,iy).getRegex(),oy=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,sy={_backpedal:nv,anyPunctuation:Zv,autolink:Qv,blockSkip:Rv,br:Ov,code:oee,del:nv,delLDelim:nv,delRDelim:nv,emStrongLDelim:Bv,emStrongRDelimAst:Wv,emStrongRDelimUnd:qv,escape:aee,link:ny,nolink:iy,punctuation:Nv,reflink:ry,reflinkSearch:ay,tag:ey,text:kv,url:nv},cy={...sy,emStrongLDelim:Hv,emStrongRDelimAst:Kv,emStrongRDelimUnd:Jv,link:iv(/^!?\[(label)\]\((.*?)\)/).replace(`label`,ty).getRegex(),reflink:iv(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,ty).getRegex()},ly={...sy,emStrongRDelimAst:Gv,emStrongLDelim:Vv,delLDelim:Yv,delRDelim:Xv,url:iv(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`protocol`,oy).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:iv(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace(`protocol`,oy).getRegex()},uy={...ly,br:iv(Ov).replace(`{2,}`,`*`).getRegex(),text:iv(ly.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},dy={normal:Ev,gfm:ree,pedantic:iee},fy={normal:sy,gfm:ly,breaks:uy,pedantic:cy},py={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},my=e=>py[e];function hy(e,t){if(t){if(ov.escapeTest.test(e))return e.replace(ov.escapeReplace,my)}else if(ov.escapeTestNoEncode.test(e))return e.replace(ov.escapeReplaceNoEncode,my);return e}function gy(e){try{e=encodeURI(e).replace(ov.percentDecode,`%`)}catch{return null}return e}function _y(e,t){let n=e.replace(ov.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(ov.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t){if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``)}for(;r<n.length;r++)n[r]=n[r].trim().replace(ov.slashPipe,`|`);return n}function vy(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function yy(e){let t=e.split(`
|
|
64
|
-
`),n=t.length-1;for(;n>=0&&ov.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
|
|
65
|
-
`)}function by(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function xy(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function Sy(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`),c=e[0].charAt(0)===`!`;r.state.inLink=!0;let l=r.state.linkEmitted,u=r.state.inRawBlock;r.state.linkEmitted=!1;let d=r.inlineTokens(s),f=r.state.linkEmitted;if(r.state.linkEmitted=l,r.state.inLink=!1,!c){if(f){r.state.inRawBlock=u;return}r.state.linkEmitted=!0}return{type:c?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:d}}function Cy(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
|
|
66
|
-
`).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return r.length>=i.length?e.slice(i.length):e}).join(`
|
|
67
|
-
`)}var wy=class{options;rules;lexer;constructor(e){this.options=e||ev}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=this.options.pedantic?t[0]:yy(t[0]);return{type:`code`,raw:e,codeBlockStyle:`indented`,text:e.replace(this.rules.other.codeRemoveIndent,``)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=Cy(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=vy(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:vy(t[0],`
|
|
68
|
-
`),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:vy(t[0],`
|
|
69
|
-
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=vy(t[0],`
|
|
70
|
-
`).split(`
|
|
71
|
-
`),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o;for(o=0;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
|
|
72
|
-
`),c=s.replace(this.rules.other.blockquoteSetextReplace,`
|
|
73
|
-
$1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
|
|
74
|
-
${s}`:s,r=r?`${r}
|
|
75
|
-
${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i.at(-1);if(u?.type===`code`)break;if(u?.type===`blockquote`){let t=u,a=e.join(`
|
|
76
|
-
`),o=t.raw+`
|
|
77
|
-
`+a.replace(this.rules.other.blockquoteSetextReplace2,``),s=this.blockquote(o);i[i.length-1]=s,n=`${n}
|
|
78
|
-
${a}`,r=r.substring(0,r.length-t.text.length)+s.text;break}if(u?.type===`list`){let t=u,a=t.raw+`
|
|
79
|
-
`+e.join(`
|
|
80
|
-
`),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`
|
|
81
|
-
`);continue}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=xy(t[2].split(`
|
|
82
|
-
`,1)[0],t[1].length),l=e.split(`
|
|
83
|
-
`,1)[0],u=!c.trim(),d=0;if(this.options.pedantic?(d=2,s=c.trimStart()):u?d=t[1].length+1:(d=c.search(this.rules.other.nonSpaceChar),d=d>4?1:d,s=c.slice(d),d+=t[1].length),u&&this.rules.other.blankLine.test(l)&&(r+=l+`
|
|
84
|
-
`,e=e.substring(l.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(d),n=this.rules.other.hrRegex(d),i=this.rules.other.fencesBeginRegex(d),a=this.rules.other.headingBeginRegex(d),o=this.rules.other.htmlBeginRegex(d),f=this.rules.other.blockquoteBeginRegex(d);for(;e;){let p=e.split(`
|
|
85
|
-
`,1)[0],m;if(l=p,this.options.pedantic?(l=l.replace(this.rules.other.listReplaceNesting,` `),m=l):m=l.replace(this.rules.other.tabCharGlobal,` `),i.test(l)||a.test(l)||o.test(l)||f.test(l)||t.test(l)||n.test(l))break;if(m.search(this.rules.other.nonSpaceChar)>=d||!l.trim())s+=`
|
|
86
|
-
`+m.slice(d);else{if(u||c.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||i.test(c)||a.test(c)||n.test(c))break;s+=`
|
|
87
|
-
`+l}u=!l.trim(),r+=p+`
|
|
88
|
-
`,e=e.substring(p.length+1),c=m.slice(d)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:`list_item`,raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e of i.items)if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),!i.loose){let t=e.tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}for(let e of i.items){let t=e.tokens[0];if(e.task&&(t?.type===`text`||t?.type===`paragraph`)){e.text=e.text.replace(this.rules.other.listReplaceTask,``),t.raw=t.raw.replace(this.rules.other.listReplaceTask,``),t.text=t.text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}let n=this.rules.other.listTaskCheckbox.exec(e.raw);if(n){let t={type:`checkbox`,raw:n[0]+` `,checked:n[0]!==`[ ]`};e.checked=t.checked,i.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=t.raw+e.tokens[0].raw,e.tokens[0].text=t.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(t)):e.tokens.unshift({type:`paragraph`,raw:t.raw,text:t.raw,tokens:[t]}):e.tokens.unshift(t)}}else e.task&&=!1}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return i}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=yy(t[0]);return{type:`html`,block:!0,raw:e,pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:e}}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:vy(t[0],`
|
|
89
|
-
`),href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=_y(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
|
|
90
|
-
`):[],a={type:`table`,raw:vy(t[0],`
|
|
91
|
-
`),header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(_y(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:vy(t[0],`
|
|
92
|
-
`),depth:t[2].charAt(0)===`=`?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
|
|
93
|
-
`?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=vy(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=by(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let n=t[2],r=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):``;return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),Sy(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,`$1`),title:r&&r.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `).toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return Sy(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let i=[...r[0]].length-1,a,o,s=i,c=0,l=r[0][0],u=n===l,d=l===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+i);(r=d.exec(t))!==null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(o=[...a].length,r[3]||r[4]){s+=o;continue}if(r[5]||r[6]){if(i%3&&!((i+o)%3)){c+=o;continue}if(u)break}if(s-=o,s>0)continue;o=Math.min(o,o+s+c);let t=[...r[0]][0].length,n=e.slice(0,i+r.index+t+o);if(Math.min(i,o)%2){let e=n.slice(1,-1);return{type:`em`,raw:n,text:e,tokens:this.lexer.inlineTokens(e)}}let l=n.slice(2,-2);return{type:`strong`,raw:n,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:t[0],escaped:e}}}},Ty=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||ev,this.options.tokenizer=this.options.tokenizer||new wy,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,top:!0};let t={other:ov,block:dy.normal,inline:fy.normal};this.options.pedantic?(t.block=dy.pedantic,t.inline=fy.pedantic):this.options.gfm&&(t.block=dy.gfm,t.inline=this.options.breaks?fy.breaks:fy.gfm),this.tokenizer.rules=t}static get rules(){return{block:dy,inline:fy}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(ov.carriageReturn,`
|
|
94
|
-
`),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(ov.tabCharGlobal,` `).replace(ov.spaceLine,``));let r=1/0;for(;e;){if(e.length<r)r=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let i;if(this.options.extensions?.block?.some(n=>(i=n.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let n=t.at(-1);i.raw.length===1&&n!==void 0?n.raw+=`
|
|
95
|
-
`:t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
96
|
-
`)?``:`
|
|
97
|
-
`)+i.raw,n.text+=`
|
|
98
|
-
`+i.text,this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if(i=this.tokenizer.fences(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.heading(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.hr(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.blockquote(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.list(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.html(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
99
|
-
`)?``:`
|
|
100
|
-
`)+i.raw,n.text+=`
|
|
101
|
-
`+i.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},t.push(i));continue}if(i=this.tokenizer.table(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.lheading(e)){e=e.substring(i.raw.length),t.push(i);continue}let a=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(a=e.substring(0,t+1))}if(this.state.top&&(i=this.tokenizer.paragraph(a))){let r=t.at(-1);n&&r?.type===`paragraph`?(r.raw+=(r.raw.endsWith(`
|
|
102
|
-
`)?``:`
|
|
103
|
-
`)+i.raw,r.text+=`
|
|
104
|
-
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(i),n=a.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
105
|
-
`)?``:`
|
|
106
|
-
`)+i.raw,n.text+=`
|
|
107
|
-
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}linkInText(e){if(!e.includes(`[`))return!1;let t=this.tokenizer.rules.inline.link;for(let n of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(t.test(n[0])&&e.charAt(n.index-1)!==`!`)return!0;for(let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let e=t[0],n=e.lastIndexOf(`[`);if(!(e.charAt(0)===`!`||!Object.hasOwn(this.tokens.links,e.slice(n+1,-1)))&&!(n>1&&this.linkInText(e.slice(1,n-1))))return!0}return!1}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=e;if(this.tokens.links&&e.includes(`[`)){let e=this.tokenizer.rules.inline.reflinkSearch,t=n=>{let r=n.lastIndexOf(`[`);if(!Object.hasOwn(this.tokens.links,n.slice(r+1,-1)))return n;if(r>1&&n.charAt(0)!==`!`){let i=n.slice(1,r-1);if(this.linkInText(i))return`[`+i.replace(e,t)+`][`+`a`.repeat(n.length-r-2)+`]`}return`[`+`a`.repeat(n.length-2)+`]`};n=n.replace(e,t)}n=n.replace(this.tokenizer.rules.inline.anyPunctuation,e=>`+`.repeat(e.length)),n=n.replace(this.tokenizer.rules.inline.blockSkip,(e,t,n)=>{let r=n?n.length:0;return e.slice(0,r)+`[`+`a`.repeat(e.length-r-2)+`]`}),n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let r=!1,i=``,a=1/0;for(;e;){if(e.length<a)a=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}r||(i=``),r=!1;let o;if(this.options.extensions?.inline?.some(n=>(o=n.call({lexer:this},e,t))?(e=e.substring(o.raw.length),t.push(o),!0):!1))continue;if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let n=t.at(-1);o.type===`text`&&n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if(o=this.tokenizer.emStrong(e,n,i)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.del(e,n,i)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),t.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),t.push(o);continue}let s=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(o=this.tokenizer.inlineText(s)){e=e.substring(o.raw.length),o.raw.slice(-1)!==`_`&&(i=o.raw.slice(-1)),r=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t=`Infinite loop on byte: `+e;if(this.options.silent)console.error(t);else throw Error(t)}},Ey=class{options;parser;constructor(e){this.options=e||ev}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(ov.notSpaceStart)?.[0],i=e.replace(ov.endingNewline,``)+`
|
|
108
|
-
`;return r?`<pre><code class="language-`+hy(r)+`">`+(n?i:hy(i,!0))+`</code></pre>
|
|
109
|
-
`:`<pre><code>`+(n?i:hy(i,!0))+`</code></pre>
|
|
110
|
-
`}blockquote({tokens:e}){return`<blockquote>
|
|
111
|
-
${this.parser.parse(e)}</blockquote>
|
|
112
|
-
`}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
113
|
-
`}hr(e){return`<hr>
|
|
114
|
-
`}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?`ol`:`ul`,a=t&&n!==1?` start="`+n+`"`:``;return`<`+i+a+`>
|
|
115
|
-
`+r+`</`+i+`>
|
|
116
|
-
`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
|
|
117
|
-
`}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox"> `}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
118
|
-
`}table(e){let t=``,n=``;for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r=``;for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n=``;for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&=`<tbody>${r}</tbody>`,`<table>
|
|
119
|
-
<thead>
|
|
120
|
-
`+t+`</thead>
|
|
121
|
-
`+r+`</table>
|
|
122
|
-
`}tablerow({text:e}){return`<tr>
|
|
123
|
-
${e}</tr>
|
|
124
|
-
`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
125
|
-
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${hy(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=gy(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+hy(t)+`"`),a+=`>`+r+`</a>`,a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=gy(e);if(i===null)return hy(n);e=i;let a=`<img src="${e}" alt="${hy(n)}"`;return t&&(a+=` title="${hy(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:hy(e.text)}},Dy=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},Oy=class e{options;renderer;textRenderer;constructor(e){this.options=e||ev,this.options.renderer=this.options.renderer||new Ey,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Dy}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`checkbox`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`checkbox`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},ky=class{options;block;constructor(e){this.options=e||ev}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?Ty.lex:Ty.lexInline}provideParser(e=this.block){return e?Oy.parse:Oy.parseInline}},Ay=new class{defaults=$_();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Oy;Renderer=Ey;TextRenderer=Dy;Lexer=Ty;Tokenizer=wy;Hooks=ky;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new Ey(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new wy(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new ky;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=ky.passThroughHooks.has(n)?e=>{if(this.defaults.async&&ky.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Ty.lex(e,t??this.defaults)}parser(e,t){return Oy.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?Ty.lex:Ty.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?Oy.parse:Oy.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?Ty.lex:Ty.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?Oy.parse:Oy.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
|
|
126
|
-
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+hy(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function jy(e,t){return Ay.parse(e,t)}jy.options=jy.setOptions=function(e){return Ay.setOptions(e),jy.defaults=Ay.defaults,tv(jy.defaults),jy},jy.getDefaults=$_,jy.defaults=ev;function My(...e){return Ay.use(...e),jy.defaults=Ay.defaults,tv(jy.defaults),jy}jy.use=My,jy.walkTokens=function(e,t){return Ay.walkTokens(e,t)},jy.parseInline=Ay.parseInline,jy.Parser=Oy,jy.parser=Oy.parse,jy.Renderer=Ey,jy.TextRenderer=Dy,jy.Lexer=Ty,jy.lexer=Ty.lex,jy.Tokenizer=wy,jy.Hooks=ky,jy.parse=jy,jy.options,jy.setOptions,jy.walkTokens,jy.parseInline,Oy.parse,Ty.lex,jy.setOptions({gfm:!0,breaks:!0});function Ny(e){let t=jy.parse(e,{async:!1});return Q_.sanitize(t)}var Py=320,Fy=240;function Iy(e){if(e.projectPath){let t=e.projectPath.replace(/\\/g,`/`).split(`/`).filter(e=>e);return t[t.length-1]||e.projectPath}return e.displayName||e.id}function Ly(e){return{createdDate:wp(e.createdAt),updatedDate:e.updatedAt&&e.updatedAt!==e.createdAt?wp(e.updatedAt):null}}function Ry(e,t){return e.similarity===void 0?null:t?`${Math.round(e.similarity*100)}%`:`${e.similarity}%`}function zy({variant:e,item:t,memory:n,prompt:r,selected:i=!1,onSelect:a,onPin:o,onUnpin:s,onEdit:c,onDeleteMemory:l,onDeletePrompt:u,activeKeyword:d,onKeywordClick:f}){let{t:p}=G();if(e===`pair`&&n&&r){let e=n.isPinned||!1,t=Ly(n),u=Ry(n,!0);return(0,H.jsxs)(`div`,{className:`min-w-0 rounded-xl border border-border bg-card p-3 space-y-3 ${i?`ring-1 ring-input`:``} ${e?`border-primary/40`:``}`,"data-id":n.id,children:[(0,H.jsxs)(`div`,{className:`space-y-3 rounded-lg border border-border bg-muted p-3`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,H.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:p(`badge-prompt`)}),(0,H.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:wp(r.createdAt)})]}),(0,H.jsx)(vg,{maxHeight:Fy,fade:`var(--muted)`,children:(0,H.jsx)(Tg,{content:r.content})})]}),(0,H.jsx)(`div`,{className:`flex justify-center text-muted-foreground`,children:(0,H.jsx)(P,{className:`size-4`})}),(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-2`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 min-w-0`,children:[(0,H.jsx)(Bs,{checked:i,onCheckedChange:e=>a?.(n.id,e===!0)}),(0,H.jsx)(qd,{children:p(`badge-memory`)}),n.memoryType?(0,H.jsx)(yg,{type:n.memoryType}):null,u?(0,H.jsx)(`span`,{className:`text-xs text-primary`,children:u}):null,e?(0,H.jsx)(qd,{variant:`secondary`,children:p(`badge-pinned`)}):null,(0,H.jsx)(`span`,{dir:`auto`,className:`text-xs text-muted-foreground font-mono min-w-0 break-all`,children:n.displayName||n.id})]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-1 shrink-0`,children:[e?(0,H.jsx)(q,{variant:`ghost`,size:`icon-xs`,title:`Unpin`,onClick:()=>s?.(n.id),children:(0,H.jsx)(Tt,{className:`size-3.5 fill-current`})}):(0,H.jsx)(q,{variant:`ghost`,size:`icon-xs`,title:`Pin`,onClick:()=>o?.(n.id),children:(0,H.jsx)(Tt,{className:`size-3.5`})}),(0,H.jsx)(q,{variant:`ghost`,size:`icon-xs`,onClick:()=>c?.(n.id),children:(0,H.jsx)(Ct,{className:`size-3.5`})}),(0,H.jsx)(bf,{content:p(`tooltip-delete-pair`),children:(0,H.jsx)(q,{variant:`destructive`,size:`icon-xs`,"aria-label":p(`btn-delete-pair`),onClick:()=>l?.(n.id,!0),children:(0,H.jsx)(Jt,{className:`size-3.5`})})})]})]}),n.tags?.length?(0,H.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:n.tags.map(e=>(0,H.jsx)(bf,{content:p(`tooltip-tags`),className:`min-w-0 max-w-full`,children:(0,H.jsx)(Gd,{keyword:e,active:d?.toLowerCase()===e.toLowerCase(),"aria-label":`${p(`tooltip-filter-keyword`)}: ${e}`,onClick:f})},e))}):null,(0,H.jsx)(`div`,{className:`rounded-lg border border-border bg-muted p-3`,children:(0,H.jsx)(vg,{maxHeight:Py,fade:`var(--muted)`,children:(0,H.jsx)(`div`,{className:`markdown-content text-sm prose-invert max-w-none`,dangerouslySetInnerHTML:{__html:Ny(n.content)}})})}),(0,H.jsxs)(`div`,{className:`flex flex-wrap gap-3 text-xs text-muted-foreground`,children:[(0,H.jsxs)(`span`,{children:[p(`date-created`),` `,t.createdDate]}),t.updatedDate?(0,H.jsxs)(`span`,{children:[p(`date-updated`),` `,t.updatedDate]}):null,(0,H.jsxs)(`span`,{dir:`ltr`,className:`font-mono break-all`,children:[`ID: `,n.id]})]})]})]})}if(e===`prompt`&&t){let e=!!t.linkedMemoryId;return(0,H.jsxs)(`div`,{className:`min-w-0 rounded-xl border border-border bg-card p-3 space-y-2 ${i?`ring-1 ring-input`:``}`,"data-id":t.id,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-2`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,H.jsx)(Bs,{checked:i,onCheckedChange:e=>a?.(t.id,e===!0)}),(0,H.jsx)(st,{className:`size-3.5 text-muted-foreground`}),(0,H.jsx)(qd,{variant:`secondary`,children:p(`badge-prompt`)}),e?(0,H.jsxs)(qd,{variant:`outline`,className:`border-status-success text-status-success bg-transparent`,children:[(0,H.jsx)(nt,{className:`size-3`}),p(`badge-linked`)]}):null,(0,H.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:wp(t.createdAt)})]}),e?(0,H.jsx)(bf,{content:p(`tooltip-delete-prompt-pair`),children:(0,H.jsx)(q,{variant:`destructive`,size:`icon-xs`,"aria-label":p(e?`btn-delete-pair`:`btn-delete`),onClick:()=>u?.(t.id,e),children:(0,H.jsx)(Jt,{className:`size-3.5`})})}):(0,H.jsx)(q,{variant:`destructive`,size:`icon-xs`,"aria-label":p(e?`btn-delete-pair`:`btn-delete`),title:p(`btn-delete`),onClick:()=>u?.(t.id,e),children:(0,H.jsx)(Jt,{className:`size-3.5`})})]}),(0,H.jsx)(vg,{maxHeight:Fy,children:(0,H.jsx)(Tg,{content:t.content})}),e?(0,H.jsxs)(`div`,{className:`flex items-center gap-1 text-xs text-muted-foreground`,children:[(0,H.jsx)(P,{className:`size-3`}),p(`text-generated-above`),(0,H.jsx)(te,{className:`size-3`})]}):null]})}if(e===`memory`&&t){let e=t.isPinned||!1,n=!!t.linkedPromptId,r=Ly(t),u=Ry(t,!1);return(0,H.jsxs)(`div`,{className:`min-w-0 rounded-xl border border-border bg-card p-3 space-y-2 ${i?`ring-1 ring-input`:``} ${e?`border-primary/40`:``}`,"data-id":t.id,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-2`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 min-w-0`,children:[(0,H.jsx)(Bs,{checked:i,onCheckedChange:e=>a?.(t.id,e===!0)}),t.memoryType?(0,H.jsx)(yg,{type:t.memoryType}):null,n?(0,H.jsxs)(qd,{variant:`outline`,className:`border-status-success text-status-success bg-transparent`,children:[(0,H.jsx)(nt,{className:`size-3`}),p(`badge-linked`)]}):null,u?(0,H.jsx)(`span`,{className:`text-xs text-primary`,children:u}):null,e?(0,H.jsx)(qd,{variant:`secondary`,children:p(`badge-pinned`)}):null,(0,H.jsx)(`span`,{dir:`auto`,className:`text-xs text-muted-foreground font-mono min-w-0 break-all`,children:Iy(t)}),t.projectPath?(0,H.jsx)(`span`,{dir:`ltr`,className:`text-code text-muted-foreground font-mono break-all w-full`,children:t.projectPath}):null]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-1 shrink-0`,children:[e?(0,H.jsx)(q,{variant:`ghost`,size:`icon-xs`,title:`Unpin`,onClick:()=>s?.(t.id),children:(0,H.jsx)(Tt,{className:`size-3.5 fill-current`})}):(0,H.jsx)(q,{variant:`ghost`,size:`icon-xs`,title:`Pin`,onClick:()=>o?.(t.id),children:(0,H.jsx)(Tt,{className:`size-3.5`})}),(0,H.jsx)(q,{variant:`ghost`,size:`icon-xs`,onClick:()=>c?.(t.id),children:(0,H.jsx)(Ct,{className:`size-3.5`})}),n?(0,H.jsx)(bf,{content:p(`tooltip-delete-pair`),children:(0,H.jsx)(q,{variant:`destructive`,size:`icon-xs`,"aria-label":p(n?`btn-delete-pair`:`btn-delete`),onClick:()=>l?.(t.id,n),children:(0,H.jsx)(Jt,{className:`size-3.5`})})}):(0,H.jsx)(q,{variant:`destructive`,size:`icon-xs`,"aria-label":p(n?`btn-delete-pair`:`btn-delete`),title:p(`btn-delete`),onClick:()=>l?.(t.id,n),children:(0,H.jsx)(Jt,{className:`size-3.5`})})]})]}),t.tags?.length?(0,H.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:t.tags.map(e=>(0,H.jsx)(bf,{content:p(`tooltip-tags`),className:`min-w-0 max-w-full`,children:(0,H.jsx)(Gd,{keyword:e,active:d?.toLowerCase()===e.toLowerCase(),"aria-label":`${p(`tooltip-filter-keyword`)}: ${e}`,onClick:f})},e))}):null,(0,H.jsx)(`div`,{className:`rounded-lg border border-border bg-muted p-3`,children:(0,H.jsx)(vg,{maxHeight:Py,fade:`var(--muted)`,children:(0,H.jsx)(`div`,{className:`markdown-content text-sm prose-invert max-w-none`,dangerouslySetInnerHTML:{__html:Ny(t.content)}})})}),n?(0,H.jsxs)(`div`,{className:`flex items-center gap-1 text-xs text-muted-foreground`,children:[(0,H.jsx)(te,{className:`size-3`}),p(`text-from-below`),(0,H.jsx)(P,{className:`size-3`})]}):null,(0,H.jsxs)(`div`,{className:`flex flex-wrap gap-3 text-xs text-muted-foreground`,children:[(0,H.jsxs)(`span`,{children:[p(`date-created`),` `,r.createdDate]}),r.updatedDate?(0,H.jsxs)(`span`,{children:[p(`date-updated`),` `,r.updatedDate]}):null,(0,H.jsxs)(`span`,{dir:`ltr`,className:`font-mono break-all`,children:[`ID: `,t.id]})]})]})}return null}function By(e){let t=new Map(e.map(e=>[e.id,e])),n=[],r=new Set;for(let i of e)if(!r.has(i.id)){if(i.type===`memory`&&i.linkedPromptId&&t.has(i.linkedPromptId)){let e=t.get(i.linkedPromptId);n.push({isPair:!0,memory:i,prompt:e}),r.add(i.id),r.add(e.id)}else if(i.type===`prompt`&&i.linkedMemoryId&&t.has(i.linkedMemoryId)){let e=t.get(i.linkedMemoryId);n.push({isPair:!0,memory:e,prompt:i}),r.add(i.id),r.add(e.id)}else n.push({isPair:!1,type:i.type,item:i}),r.add(i.id)}return n.sort((e,t)=>{let n=e.isPair?e.memory.createdAt:e.item.createdAt,r=t.isPair?t.memory.createdAt:t.item.createdAt;return new Date(r).getTime()-new Date(n).getTime()})}function Vy({memories:e,selectedIds:t,currentPage:n,totalPages:r,loading:i=!1,error:a=null,onSelect:o,onPageChange:s,onPin:c,onUnpin:l,onEdit:u,onDeleteMemory:d,onDeletePrompt:f,activeKeyword:p,onKeywordClick:m}){let{t:h}=G(),g=(0,v.useMemo)(()=>By(e),[e]),_=h(`text-page`,{current:n,total:r}),y=(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(q,{variant:`outline`,size:`icon-xs`,disabled:!(n>1),onClick:()=>s(-1),children:(0,H.jsx)(de,{className:`size-3.5`})}),(0,H.jsx)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:_}),(0,H.jsx)(q,{variant:`outline`,size:`icon-xs`,disabled:!(n<r),onClick:()=>s(1),children:(0,H.jsx)(fe,{className:`size-3.5`})})]});return(0,H.jsxs)(`div`,{className:`space-y-3`,children:[(0,H.jsx)(`div`,{className:`grid min-h-32 items-start gap-3 lg:grid-cols-2`,children:i&&e.length===0?(0,H.jsx)(`div`,{className:`text-sm text-muted-foreground py-8 text-center`,children:h(`loading-init`)}):a?(0,H.jsxs)(`div`,{className:`text-sm text-destructive py-8 text-center`,children:[`Error: `,a]}):g.length===0?(0,H.jsx)(`div`,{className:`text-sm text-muted-foreground py-8 text-center`,children:h(`empty-memories`)}):g.map(e=>e.isPair?(0,H.jsx)(zy,{variant:`pair`,memory:e.memory,prompt:e.prompt,selected:t.has(e.memory.id),onSelect:o,onPin:c,onUnpin:l,onEdit:u,onDeleteMemory:d,onDeletePrompt:f,activeKeyword:p,onKeywordClick:m},e.memory.id):e.type===`prompt`?(0,H.jsx)(zy,{variant:`prompt`,item:e.item,selected:t.has(e.item.id),onSelect:o,onPin:c,onUnpin:l,onEdit:u,onDeleteMemory:d,onDeletePrompt:f,activeKeyword:p,onKeywordClick:m},e.item.id):(0,H.jsx)(zy,{variant:`memory`,item:e.item,selected:t.has(e.item.id),onSelect:o,onPin:c,onUnpin:l,onEdit:u,onDeleteMemory:d,onDeletePrompt:f,activeKeyword:p,onKeywordClick:m},e.item.id))}),(0,H.jsx)(`div`,{className:`flex justify-end`,children:y})]})}function Hy(e){let[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(0);return(0,v.useEffect)(()=>{let e=!1;return xi.status().then(t=>{e||n(t.success?t.data??null:null)}),()=>{e=!0}},[e,r]),{record:t,reload:(0,v.useCallback)(()=>i(e=>e+1),[])}}function Uy(e){return e!==null}function Wy(e){return{createdAt:e.createdAt,merged:e.merged,removed:e.removed}}function Gy(e,t){return e===`idle`&&t===`open`?`confirming`:e===`confirming`&&t===`cancel`?`idle`:e===`confirming`&&t===`confirm`?`working`:e===`working`&&t===`done`?`idle`:e}function Ky(e,t){return e===`confirming`&&t===`confirm`}function qy(e){return{key:e.notFound>0?`toast-auto-cleanup-undone-partial`:`toast-auto-cleanup-undone`,params:{restored:e.restored,notFound:e.notFound}}}function Jy({version:e,onUndone:t}){let{t:n}=G(),{record:r,reload:i}=Hy(e),[a,o]=(0,v.useState)(`idle`);if(!Uy(r)||!r)return null;async function s(){if(!Ky(a,`confirm`))return;o(Gy(a,`confirm`));let e=await xi.undo();if(o(`idle`),i(),!e.success||!e.data){U.info(e.error||n(`toast-auto-cleanup-undo-failed`));return}let r=qy(e.data);U.success(n(r.key,r.params)),t?.()}let c=Wy(r);return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(q,{variant:`secondary`,size:`sm`,onClick:()=>o(Gy(a,`open`)),children:[(0,H.jsx)(Zt,{className:`size-3.5`}),n(`btn-auto-cleanup-undo`)]}),(0,H.jsx)(Du,{open:a!==`idle`,onOpenChange:e=>{e||o(Gy(a,`cancel`))},children:(0,H.jsxs)(Au,{className:`sm:max-w-md`,children:[(0,H.jsxs)(ju,{children:[(0,H.jsx)(Nu,{children:n(`title-auto-cleanup-undo`)}),(0,H.jsx)(Pu,{children:n(`label-auto-cleanup-undo-body`,{when:wp(new Date(c.createdAt).toISOString()),merged:c.merged,removed:c.removed})})]}),(0,H.jsxs)(Mu,{className:`gap-2`,children:[(0,H.jsx)(q,{variant:`secondary`,size:`sm`,disabled:a===`working`,onClick:()=>o(Gy(a,`cancel`)),children:n(`btn-cancel`)}),(0,H.jsx)(q,{size:`sm`,disabled:a===`working`,onClick:()=>void s(),children:n(`btn-auto-cleanup-undo-confirm`)})]})]})})]})}var Yy=ko(`grid min-w-0 gap-0.5 rounded-xl border px-4 py-3 text-start text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pe-18 has-[>svg]:grid-cols-[auto_minmax(0,1fr)] has-[>svg]:gap-x-2.5 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4 group/alert relative w-full`,{variants:{variant:{default:`bg-card text-card-foreground`,destructive:`text-destructive-label bg-card *:data-[slot=alert-description]:text-destructive-label *:[svg]:text-current`}},defaultVariants:{variant:`default`}});function Xy({className:e,variant:t,...n}){return(0,H.jsx)(`div`,{"data-slot":`alert`,role:`alert`,className:V(Yy({variant:t}),e),...n})}function Zy({className:e,...t}){return(0,H.jsx)(`div`,{"data-slot":`alert-description`,className:V(`text-muted-foreground text-sm [&_p]:leading-relaxed col-start-2`,e),...t})}function Qy(e){if(!e)return null;let t=e.status;switch(t.state){case`grouping`:return{kind:`grouping`};case`checking`:return t.total>0?{kind:`checking`,done:t.done,total:t.total}:{kind:`grouping`};case`done`:return{kind:`ready`,groups:t.preview.groups.length};case`failed`:return{kind:`failed`,error:t.error}}}function $y(e){return e?.status.state===`grouping`||e?.status.state===`checking`}var eb=3e3;function tb(e){let[t,n]=(0,v.useState)(null);return(0,v.useEffect)(()=>{if(e)return;let t=!1,r,i=async()=>{let e=await W(`/api/user-profile/category-cleanup`);if(t)return;let a=e.success?e.data??null:null;n(a),$y(a)&&(r=setTimeout(()=>void i(),eb))};return i(),()=>{t=!0,clearTimeout(r)}},[e]),t}function nb({paused:e,onOpen:t}){let{t:n}=G(),r=Qy(tb(e));if(e||!r)return null;let i=r.kind===`failed`;return(0,H.jsx)(Xy,{variant:i?`destructive`:`default`,role:i?`alert`:`status`,children:(0,H.jsxs)(`div`,{className:`col-start-1 flex min-w-0 flex-wrap items-center justify-between gap-2`,children:[(0,H.jsxs)(`span`,{className:`min-w-0 break-words`,children:[r.kind===`grouping`&&n(`label-category-cleanup-loading`),r.kind===`checking`&&n(`label-category-cleanup-progress`,{done:r.done,total:r.total}),r.kind===`ready`&&n(`label-category-cleanup-banner-ready`,{groups:r.groups}),r.kind===`failed`&&(0,H.jsxs)(H.Fragment,{children:[n(`label-category-cleanup-banner-failed`),` `,(0,H.jsx)(`bdi`,{children:r.error})]})]}),(0,H.jsx)(q,{variant:`outline`,size:`xs`,onClick:t,children:n(`btn-category-cleanup-banner-open`)})]})})}var rb=Object.defineProperty,ib=(e,t)=>rb(e,`name`,{value:t,configurable:!0}),ab=v.createContext(void 0);function ob(e){let t=v.useContext(ab);return e||t||`ltr`}ib(ob,`useDirection`);var sb=Object.defineProperty,cb=(e,t)=>sb(e,`name`,{value:t,configurable:!0});function lb(e,[t,n]){return Math.min(n,Math.max(t,e))}cb(lb,`clamp`);var ub=Object.defineProperty,db=(e,t)=>ub(e,`name`,{value:t,configurable:!0});function fb(e,t){return v.useReducer((e,n)=>t[e][n]??e,e)}db(fb,`useStateMachine`);var pb=`ScrollArea`,[mb,see]=Io(pb),[hb,gb]=mb(pb),_b=v.forwardRef(db(function(e,t){let{__scopeScrollArea:n,type:r=`hover`,dir:i,scrollHideDelay:a=600,...o}=e,[s,c]=v.useState(null),[l,u]=v.useState(null),[d,f]=v.useState(null),[p,m]=v.useState(null),[h,g]=v.useState(null),[_,y]=v.useState(0),[b,x]=v.useState(0),[S,C]=v.useState(!1),[w,T]=v.useState(!1),E=lo(t,c),D=ob(i);return(0,H.jsx)(hb,{scope:n,type:r,dir:D,scrollHideDelay:a,scrollArea:s,viewport:l,onViewportChange:u,content:d,onContentChange:f,scrollbarX:p,onScrollbarXChange:m,scrollbarXEnabled:S,onScrollbarXEnabledChange:C,scrollbarY:h,onScrollbarYChange:g,scrollbarYEnabled:w,onScrollbarYEnabledChange:T,onCornerWidthChange:y,onCornerHeightChange:x,children:(0,H.jsx)(bs.div,{dir:D,...o,ref:E,style:{position:`relative`,"--radix-scroll-area-corner-width":_+`px`,"--radix-scroll-area-corner-height":b+`px`,...e.style}})})},`ScrollArea`)),vb=`ScrollAreaViewport`,yb=v.forwardRef(db(function(e,t){let{__scopeScrollArea:n,children:r,nonce:i,...a}=e,o=gb(vb,n),s=lo(t,v.useRef(null),o.onViewportChange);return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(bb,{nonce:i}),(0,H.jsx)(bs.div,{"data-radix-scroll-area-viewport":``,...a,ref:s,style:{overflowX:o.scrollbarXEnabled?`scroll`:`hidden`,overflowY:o.scrollbarYEnabled?`scroll`:`hidden`,...e.style},children:(0,H.jsx)(`div`,{ref:o.onContentChange,style:{minWidth:`100%`,display:`table`},children:r})})]})},`ScrollAreaViewport`)),bb=v.memo(db(function({nonce:e}){return(0,H.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}`},nonce:e})},`ScrollAreaViewportStyle`),(e,t)=>e.nonce===t.nonce),xb=`ScrollAreaScrollbar`,Sb=v.forwardRef(db(function(e,t){let{forceMount:n,...r}=e,i=gb(xb,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:o}=i,s=e.orientation===`horizontal`;return v.useEffect(()=>(s?a(!0):o(!0),()=>{s?a(!1):o(!1)}),[s,a,o]),i.type===`hover`?(0,H.jsx)(Cb,{...r,ref:t,forceMount:n}):i.type===`scroll`?(0,H.jsx)(wb,{...r,ref:t,forceMount:n}):i.type===`auto`?(0,H.jsx)(Tb,{...r,ref:t,forceMount:n}):i.type===`always`?(0,H.jsx)(Eb,{...r,ref:t,"data-state":`visible`}):null},`ScrollAreaScrollbar`)),Cb=v.forwardRef(db(function(e,t){let{forceMount:n,...r}=e,i=gb(xb,e.__scopeScrollArea),[a,o]=v.useState(!1);return v.useEffect(()=>{let e=i.scrollArea,t=0;if(e){let n=db(()=>{window.clearTimeout(t),o(!0)},`handlePointerEnter`),r=db(()=>{t=window.setTimeout(()=>o(!1),i.scrollHideDelay)},`handlePointerLeave`);return e.addEventListener(`pointerenter`,n),e.addEventListener(`pointerleave`,r),()=>{window.clearTimeout(t),e.removeEventListener(`pointerenter`,n),e.removeEventListener(`pointerleave`,r)}}},[i.scrollArea,i.scrollHideDelay]),(0,H.jsx)(fs,{present:n||a,children:(0,H.jsx)(Tb,{"data-state":a?`visible`:`hidden`,...r,ref:t})})},`ScrollAreaScrollbarHover`)),wb=v.forwardRef(db(function(e,t){let{forceMount:n,...r}=e,i=gb(xb,e.__scopeScrollArea),a=e.orientation===`horizontal`,o=Kb(()=>c(`SCROLL_END`),100),[s,c]=fb(`hidden`,{hidden:{SCROLL:`scrolling`},scrolling:{SCROLL_END:`idle`,POINTER_ENTER:`interacting`},interacting:{SCROLL:`interacting`,POINTER_LEAVE:`idle`},idle:{HIDE:`hidden`,SCROLL:`scrolling`,POINTER_ENTER:`interacting`}});return v.useEffect(()=>{if(s===`idle`){let e=window.setTimeout(()=>c(`HIDE`),i.scrollHideDelay);return()=>window.clearTimeout(e)}},[s,i.scrollHideDelay,c]),v.useEffect(()=>{let e=i.viewport,t=a?`scrollLeft`:`scrollTop`;if(e){let n=e[t],r=db(()=>{let r=e[t];n!==r&&(c(`SCROLL`),o()),n=r},`handleScroll`);return e.addEventListener(`scroll`,r),()=>e.removeEventListener(`scroll`,r)}},[i.viewport,a,c,o]),(0,H.jsx)(fs,{present:n||s!==`hidden`,children:(0,H.jsx)(Eb,{"data-state":s===`hidden`?`hidden`:`visible`,...r,ref:t,onPointerEnter:Vo(e.onPointerEnter,()=>c(`POINTER_ENTER`)),onPointerLeave:Vo(e.onPointerLeave,()=>c(`POINTER_LEAVE`))})})},`ScrollAreaScrollbarScroll`)),Tb=v.forwardRef(db(function(e,t){let n=gb(xb,e.__scopeScrollArea),{forceMount:r,...i}=e,[a,o]=v.useState(!1),s=e.orientation===`horizontal`,c=Kb(()=>{if(n.viewport){let e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;o(s?e:t)}},10);return qb(n.viewport,c),qb(n.content,c),(0,H.jsx)(fs,{present:r||a,children:(0,H.jsx)(Eb,{"data-state":a?`visible`:`hidden`,...i,ref:t})})},`ScrollAreaScrollbarAuto`)),Eb=v.forwardRef(db(function(e,t){let{orientation:n=`vertical`,...r}=e,i=gb(xb,e.__scopeScrollArea),a=v.useRef(null),o=v.useRef(0),[s,c]=v.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),l=zb(s.viewport,s.content),u={...r,sizes:s,onSizesChange:c,hasThumb:l>0&&l<1,onThumbChange:db(e=>a.current=e,`onThumbChange`),onThumbPointerUp:db(()=>o.current=0,`onThumbPointerUp`),onThumbPointerDown:db(e=>o.current=e,`onThumbPointerDown`)};function d(e,t){return Vb(e,o.current,s,t)}return db(d,`getScrollPosition`),n===`horizontal`?(0,H.jsx)(Db,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollLeft,t=Hb(e,s,i.dir);a.current.style.transform=`translate3d(${t}px, 0, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollLeft=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollLeft=d(e,i.dir))}}):n===`vertical`?(0,H.jsx)(Ob,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollTop,t=Hb(e,s);a.current.style.transform=`translate3d(0, ${t}px, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollTop=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollTop=d(e))}}):null},`ScrollAreaScrollbarVisible`)),Db=v.forwardRef(db(function(e,t){let{sizes:n,onSizesChange:r,...i}=e,a=gb(xb,e.__scopeScrollArea),[o,s]=v.useState(),c=v.useRef(null),l=lo(t,c,a.onScrollbarXChange);return v.useEffect(()=>{c.current&&s(getComputedStyle(c.current))},[c]),(0,H.jsx)(jb,{"data-orientation":`horizontal`,...i,ref:l,sizes:n,style:{bottom:0,left:a.dir===`rtl`?`var(--radix-scroll-area-corner-width)`:0,right:a.dir===`ltr`?`var(--radix-scroll-area-corner-width)`:0,"--radix-scroll-area-thumb-width":Bb(n)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,n)=>{if(a.viewport){let r=a.viewport.scrollLeft+t.deltaX;e.onWheelScroll(r),Wb(r,n)&&t.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:Rb(o.paddingLeft),paddingEnd:Rb(o.paddingRight)}})}})},`ScrollAreaScrollbarX`)),Ob=v.forwardRef(db(function(e,t){let{sizes:n,onSizesChange:r,...i}=e,a=gb(xb,e.__scopeScrollArea),[o,s]=v.useState(),c=v.useRef(null),l=lo(t,c,a.onScrollbarYChange);return v.useEffect(()=>{c.current&&s(getComputedStyle(c.current))},[c]),(0,H.jsx)(jb,{"data-orientation":`vertical`,...i,ref:l,sizes:n,style:{top:0,right:a.dir===`ltr`?0:void 0,left:a.dir===`rtl`?0:void 0,bottom:`var(--radix-scroll-area-corner-height)`,"--radix-scroll-area-thumb-height":Bb(n)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,n)=>{if(a.viewport){let r=a.viewport.scrollTop+t.deltaY;e.onWheelScroll(r),Wb(r,n)&&t.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:Rb(o.paddingTop),paddingEnd:Rb(o.paddingBottom)}})}})},`ScrollAreaScrollbarY`)),[kb,Ab]=mb(xb),jb=v.forwardRef(db(function(e,t){let{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:a,onThumbPointerUp:o,onThumbPointerDown:s,onThumbPositionChange:c,onDragScroll:l,onWheelScroll:u,onResize:d,...f}=e,p=gb(xb,n),[m,h]=v.useState(null),g=lo(t,h),_=v.useRef(null),y=v.useRef(``),b=p.viewport,x=r.content-r.viewport,S=Js(u),C=Js(c),w=Kb(d,10);function T(e){if(_.current){let t=e.clientX-_.current.left,n=e.clientY-_.current.top;l({x:t,y:n})}}return db(T,`handleDragScroll`),v.useEffect(()=>{let e=db(e=>{let t=e.target;m?.contains(t)&&S(e,x)},`handleWheel`);return document.addEventListener(`wheel`,e,{passive:!1}),()=>document.removeEventListener(`wheel`,e,{passive:!1})},[b,m,x,S]),v.useEffect(C,[r,C]),qb(m,w),qb(p.content,w),(0,H.jsx)(kb,{scope:n,scrollbar:m,hasThumb:i,onThumbChange:Js(a),onThumbPointerUp:Js(o),onThumbPositionChange:C,onThumbPointerDown:Js(s),children:(0,H.jsx)(bs.div,{...f,ref:g,style:{position:`absolute`,...f.style},onPointerDown:Vo(e.onPointerDown,e=>{e.button===0&&(e.target.setPointerCapture(e.pointerId),_.current=m.getBoundingClientRect(),y.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect=`none`,p.viewport&&(p.viewport.style.scrollBehavior=`auto`),T(e))}),onPointerMove:Vo(e.onPointerMove,T),onPointerUp:Vo(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=y.current,p.viewport&&(p.viewport.style.scrollBehavior=``),_.current=null})})})},`ScrollAreaScrollbarImpl`)),Mb=`ScrollAreaThumb`,Nb=v.forwardRef(db(function(e,t){let{forceMount:n,...r}=e,i=Ab(Mb,e.__scopeScrollArea);return(0,H.jsx)(fs,{present:n||i.hasThumb,children:(0,H.jsx)(Pb,{ref:t,...r})})},`ScrollAreaThumb`)),Pb=v.forwardRef(db(function(e,t){let{__scopeScrollArea:n,style:r,...i}=e,a=gb(Mb,n),o=Ab(Mb,n),{onThumbPositionChange:s}=o,c=lo(t,o.onThumbChange),l=v.useRef(void 0),u=Kb(()=>{l.current&&=(l.current(),void 0)},100);return v.useEffect(()=>{let e=a.viewport;if(e){let t=db(()=>{if(u(),!l.current){let t=Gb(e,s);l.current=t,s()}},`handleScroll`);return s(),e.addEventListener(`scroll`,t),()=>e.removeEventListener(`scroll`,t)}},[a.viewport,u,s]),(0,H.jsx)(bs.div,{"data-state":o.hasThumb?`visible`:`hidden`,...i,ref:c,style:{width:`var(--radix-scroll-area-thumb-width)`,height:`var(--radix-scroll-area-thumb-height)`,...r},onPointerDownCapture:Vo(e.onPointerDownCapture,e=>{let t=e.target.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;o.onThumbPointerDown({x:n,y:r})}),onPointerUp:Vo(e.onPointerUp,o.onThumbPointerUp)})},`ScrollAreaThumbImpl`)),Fb=`ScrollAreaCorner`,Ib=v.forwardRef(db(function(e,t){let n=gb(Fb,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!==`scroll`&&r?(0,H.jsx)(Lb,{...e,ref:t}):null},`ScrollAreaCorner`)),Lb=v.forwardRef(db(function(e,t){let{__scopeScrollArea:n,...r}=e,i=gb(Fb,n),[a,o]=v.useState(0),[s,c]=v.useState(0),l=!!(a&&s),{onCornerWidthChange:u,onCornerHeightChange:d}=i;return qb(i.scrollbarX,()=>{let e=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(e),c(e)}),qb(i.scrollbarY,()=>{let e=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(e),o(e)}),v.useEffect(()=>()=>{u(0),d(0)},[u,d]),l?(0,H.jsx)(bs.div,{...r,ref:t,style:{width:a,height:s,position:`absolute`,right:i.dir===`ltr`?0:void 0,left:i.dir===`rtl`?0:void 0,bottom:0,...e.style}}):null},`ScrollAreaCornerImpl`));function Rb(e){return e?parseInt(e,10):0}db(Rb,`toInt`);function zb(e,t){let n=e/t;return isNaN(n)?0:n}db(zb,`getThumbRatio`);function Bb(e){let t=zb(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}db(Bb,`getThumbSize`);function Vb(e,t,n,r=`ltr`){let i=Bb(n),a=i/2,o=t||a,s=i-o,c=n.scrollbar.paddingStart+o,l=n.scrollbar.size-n.scrollbar.paddingEnd-s,u=n.content-n.viewport,d=r===`ltr`?[0,u]:[u*-1,0];return Ub([c,l],d)(e)}db(Vb,`getScrollPositionFromPointer`);function Hb(e,t,n=`ltr`){let r=Bb(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-i,o=t.content-t.viewport,s=a-r,c=lb(e,n===`ltr`?[0,o]:[o*-1,0]);return Ub([0,o],[0,s])(c)}db(Hb,`getThumbOffsetFromScroll`);function Ub(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}db(Ub,`linearScale`);function Wb(e,t){return e>0&&e<t}db(Wb,`isScrollingWithinScrollbarBounds`);var Gb=db((e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return db((function i(){let a={left:e.scrollLeft,top:e.scrollTop},o=n.left!==a.left,s=n.top!==a.top;(o||s)&&t(),n=a,r=window.requestAnimationFrame(i)}),`loop`)(),()=>window.cancelAnimationFrame(r)},`addUnlinkedScrollListener`);function Kb(e,t){let n=Js(e),r=v.useRef(0);return v.useEffect(()=>()=>window.clearTimeout(r.current),[]),v.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}db(Kb,`useDebounceCallback`);function qb(e,t){let n=Js(t);Ko(()=>{let t=0;if(e){let r=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}},[e,n])}db(qb,`useResizeObserver`);var Jb=_b,Yb=yb,Xb=Ib;function Zb({className:e,children:t,...n}){return(0,H.jsxs)(Jb,{"data-slot":`scroll-area`,className:V(`relative`,e),...n,children:[(0,H.jsx)(Yb,{"data-slot":`scroll-area-viewport`,className:`focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1`,children:t}),(0,H.jsx)(Qb,{}),(0,H.jsx)(Xb,{})]})}function Qb({className:e,orientation:t=`vertical`,...n}){return(0,H.jsx)(Sb,{"data-slot":`scroll-area-scrollbar`,orientation:t,className:V(`flex touch-none p-px transition-colors select-none`,t===`vertical`&&`h-full w-2.5 border-l border-l-transparent`,t===`horizontal`&&`h-2.5 flex-col border-t border-t-transparent`,e),...n,children:(0,H.jsx)(Nb,{"data-slot":`scroll-area-thumb`,className:`bg-border relative flex-1 rounded-full`})})}function $b({open:e=!1,profileId:t=``,onOpenChange:n}){let{t:r}=G(),[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)([]);(0,v.useEffect)(()=>{e&&t&&c(t)},[e,t]);async function c(e){a(!0),s([]);let t=await W(`/api/user-profile/changelog?profileId=${encodeURIComponent(e)}&limit=10`);a(!1),t.success&&t.data?s(t.data):s([])}return(0,H.jsx)(Du,{open:e,onOpenChange:n,children:(0,H.jsxs)(Au,{className:`sm:max-w-lg`,children:[(0,H.jsx)(ju,{children:(0,H.jsx)(Nu,{children:r(`modal-changelog-title`)})}),(0,H.jsx)(Zb,{className:`max-h-80`,children:i?(0,H.jsx)(`div`,{className:`text-sm text-muted-foreground py-6 text-center`,children:r(`loading-changelog`)}):o.length===0?(0,H.jsx)(`div`,{className:`text-sm text-muted-foreground py-6 text-center`,children:r(`empty-changelog`)}):(0,H.jsx)(`div`,{className:`space-y-3 pr-3`,children:o.map((e,t)=>(0,H.jsxs)(`div`,{className:`rounded-lg border border-border p-3 space-y-1`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs`,children:[(0,H.jsxs)(`span`,{className:`font-medium`,children:[`v`,e.version]}),(0,H.jsx)(`span`,{className:`text-muted-foreground`,children:e.changeType}),(0,H.jsx)(`span`,{className:`text-muted-foreground ml-auto`,children:wp(e.createdAt)})]}),(0,H.jsx)(`p`,{className:`text-sm`,children:e.changeSummary})]},`${e.version}-${t}`))})})]})})}function ex({item:e,onOpen:t,focusKey:n}){let{t:r}=G(),i=Pd(e).length;return i===0?null:(0,H.jsxs)(q,{type:`button`,variant:`ghost`,size:`xs`,className:`-mx-1.5 h-5 cursor-pointer px-1.5 text-xs font-normal text-muted-foreground transition-colors duration-200 ease-in hover:bg-transparent hover:text-primary-label focus-visible:text-primary-label`,"aria-haspopup":`dialog`,"data-evidence-key":n,"aria-label":r(`evidence-open-label`,{count:i}),onClick:t,children:[(0,H.jsx)(qe,{className:`size-3`,"aria-hidden":`true`}),r(`evidence-count`,{count:i})]})}var tx={preferences:`profile-preferences`,patterns:`profile-patterns`,workflows:`profile-workflows`};function nx({item:e,section:t}){let{t:n,language:r}=G(),i=Pd(e);return(0,H.jsxs)(`div`,{className:`flex min-h-0 flex-col gap-3`,children:[(0,H.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,H.jsxs)(`span`,{className:`text-xs font-medium tracking-wide text-muted-foreground`,children:[n(tx[t]),e.category?` · ${e.category}`:null]}),(0,H.jsx)(`p`,{dir:`auto`,className:`text-sm leading-6 break-words`,children:e.description}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`evidence-hit-count`,{count:e.frequency||1})})]}),(0,H.jsx)(Zb,{dir:r===`ar`?`rtl`:`ltr`,className:`max-h-[50vh] rounded-lg border`,children:(0,H.jsx)(`ol`,{className:`flex flex-col divide-y`,children:i.map((e,t)=>(0,H.jsxs)(`li`,{className:`flex gap-3 px-3 py-2.5 text-sm leading-6`,children:[(0,H.jsx)(`span`,{className:`w-5 shrink-0 text-end text-xs leading-6 text-muted-foreground tabular-nums`,children:t+1}),e.kind===`manual-write`?(0,H.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-muted-foreground italic`,children:[(0,H.jsx)(Ct,{className:`size-3.5`,"aria-hidden":`true`}),n(`evidence-manual-write`)]}):(0,H.jsx)(`span`,{dir:`auto`,className:`min-w-0 whitespace-pre-wrap break-words`,children:e.text})]},t))})}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`evidence-note`)})]})}function rx({item:e,section:t,focusKey:n,onOpenChange:r}){let{t:i}=G(),a=(0,v.useRef)(null);return n&&(a.current=n),(0,H.jsx)(Du,{open:e!==null,onOpenChange:r,children:(0,H.jsxs)(Au,{className:`sm:max-w-lg`,onCloseAutoFocus:e=>{let t=a.current,n=t?document.querySelector(`[data-evidence-key="${CSS.escape(t)}"]`):null;n&&(e.preventDefault(),n.focus())},children:[(0,H.jsxs)(ju,{children:[(0,H.jsx)(Nu,{children:i(`evidence-dialog-title`)}),(0,H.jsx)(Pu,{className:`sr-only`,children:e?.description})]}),e?(0,H.jsx)(nx,{item:e,section:t}):null]})})}function ix({open:e=!1,type:t=null,index:n=0,action:r=`edit`,item:i=null,onOpenChange:a,onSaved:o}){let{t:s}=G(),[c,l]=(0,v.useState)(``),[u,d]=(0,v.useState)(``),[f,p]=(0,v.useState)([``]),[m,h]=(0,v.useState)(`1`),[g,_]=(0,v.useState)(!1),y=r===`edit`,b=t===`workflows`;(0,v.useEffect)(()=>{e&&i&&(l(i.category||``),d(i.description||``),p(i.steps?.length?[...i.steps]:[``]),h(`1`))},[e,i]);let x=y?s(`btn-edit`)||`Edit Item`:m===`2`?s(`confirm-delete-title`)||`Confirm Delete`:s(`confirm-delete`)||`Delete Item?`;function S(e){a?.(e)}function C(){p(e=>[...e,``])}function w(e){p(t=>{let n=t.filter((t,n)=>n!==e);return n.length===0?[``]:n})}function T(e,t){p(n=>n.map((n,r)=>r===e?t:n))}async function E(e){if(e.preventDefault(),!t)return;if(r===`delete`){if(m===`1`){h(`2`);return}_(!0);let e=await W(`/api/user-profile/item`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify({type:t,index:n,action:`delete`})});_(!1),e.success?(U.success(s(`toast-delete-success`)||`Item deleted`),S(!1),o?.()):U.error(e.error||s(`toast-delete-failed`)||`Delete failed`);return}_(!0);let i={type:t,index:n,action:`edit`,category:b?void 0:c,description:u};t===`workflows`&&(i.steps=f.map(e=>e.trim()).filter(Boolean));let a=await W(`/api/user-profile/item`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify(i)});_(!1),a.success?(U.success(s(`toast-update-success`)||`Item updated`),S(!1),o?.()):U.error(a.error||s(`toast-update-failed`)||`Update failed`)}return(0,H.jsx)(Du,{open:e,onOpenChange:S,children:(0,H.jsxs)(Au,{className:`sm:max-w-lg`,children:[(0,H.jsx)(ju,{children:(0,H.jsx)(Nu,{children:x})}),(0,H.jsxs)(`form`,{className:`space-y-4`,onSubmit:E,children:[y||m===`1`?(0,H.jsxs)(H.Fragment,{children:[b?null:(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(nm,{htmlFor:`profile-item-category`,children:s(`label-category`)}),(0,H.jsx)(Jd,{id:`profile-item-category`,value:c,onChange:e=>l(e.target.value),disabled:!y})]}),(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(nm,{htmlFor:`profile-item-description`,children:s(`label-description`)}),(0,H.jsx)(gg,{id:`profile-item-description`,rows:4,value:u,onChange:e=>d(e.target.value),disabled:!y})]}),b&&y?(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(nm,{children:s(`label-steps`)}),(0,H.jsx)(`div`,{className:`space-y-2`,children:f.map((e,t)=>(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`text-xs text-muted-foreground w-5 tabular-nums`,children:t+1}),(0,H.jsx)(Jd,{value:e,placeholder:`Step ${t+1}...`,onChange:e=>T(t,e.target.value)}),(0,H.jsx)(q,{type:`button`,variant:`ghost`,size:`icon-xs`,onClick:()=>w(t),children:`×`})]},t))}),(0,H.jsx)(q,{type:`button`,variant:`secondary`,size:`sm`,onClick:C,children:s(`btn-add-step`)})]}):null]}):null,(0,H.jsxs)(Mu,{children:[(0,H.jsx)(q,{type:`button`,variant:`secondary`,onClick:()=>S(!1),children:s(`btn-cancel`)}),(0,H.jsx)(q,{type:`submit`,variant:y?`default`:`destructive`,disabled:g,children:y?s(`btn-save`)||`Save`:s(`btn-delete`)||`Delete`})]})]})]})})}var ax=8;function ox({label:e,children:t,className:n}){let r=v.useId(),i=v.useRef(null),a=v.useRef(null),[o,s]=v.useState(!1),[c,l]=v.useState(0);return v.useEffect(()=>{if(!o)return;let e=e=>{i.current?.contains(e.target)||s(!1)},t=e=>{e.key===`Escape`&&s(!1)};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[o]),v.useLayoutEffect(()=>{let e=a.current,t=i.current;if(!o||!e||!t)return;let n=t.getBoundingClientRect(),r=e.offsetWidth/2,s=n.left+n.width/2,c=document.documentElement.clientWidth,u=Math.min(Math.max(s,ax+r),c-ax-r);l(u-s)},[o]),(0,H.jsxs)(`span`,{ref:i,className:V(`relative inline-flex`,n),children:[(0,H.jsx)(`button`,{type:`button`,"aria-label":e,"aria-expanded":o,"aria-controls":r,onClick:()=>s(e=>!e),className:`inline-flex size-6 shrink-0 items-center justify-center rounded-full text-muted-foreground transition-colors duration-150 outline-none hover:bg-interactive-hover hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring aria-expanded:bg-selection aria-expanded:text-foreground`,children:(0,H.jsx)(qe,{className:`size-3.5`,"aria-hidden":`true`})}),o?(0,H.jsx)(`div`,{ref:a,id:r,style:{transform:`translateX(calc(-50% + ${c}px))`},className:`absolute top-full left-1/2 z-30 mt-2 w-72 max-w-[calc(100vw-1rem)] rounded-lg border border-border bg-card p-3 text-start text-xs whitespace-normal text-card-foreground shadow-sm`,children:t}):null]})}var sx=20;function cx(e,t){let n=e.length,r=Math.max(1,Math.ceil(n/sx)),i=Math.min(t,r),a=(i-1)*sx;return{items:e.slice(a,a+sx),total:n,totalPages:r,page:i,start:a}}function lx(e){return Math.round((e.confidence||0)*100)}function ux({profile:e,loading:t=!1,onRefresh:n,onCleanup:r,onCategoryCleanup:i,categoryCleanupOpen:a=!1}){let{t:o}=G(),[s,c]=(0,v.useState)({pref:1,pat:1,wf:1}),[l,u]=(0,v.useState)(!1),[d,f]=(0,v.useState)(!1),[p,m]=(0,v.useState)(null),[h,g]=(0,v.useState)(0),[_,y]=(0,v.useState)(`edit`),[b,x]=(0,v.useState)(null),[S,C]=(0,v.useState)(null),w=(0,v.useMemo)(()=>{if(!e?.exists||!e.profileData)return null;let t=e.profileData;if(typeof t==`string`)try{t=JSON.parse(t)}catch{return null}return t},[e]),T=(0,v.useMemo)(()=>{let e=[...w?.preferences??[],...w?.patterns??[]];return new Set(e.map(e=>e.category||`General`)).size},[w]),E=(0,v.useMemo)(()=>Ad(w?.preferences),[w]),D=(0,v.useMemo)(()=>Ad(w?.patterns),[w]),O=(0,v.useMemo)(()=>Ad(w?.workflows),[w]),k=(0,v.useMemo)(()=>O.map((e,t)=>({item:e,index:t})).sort((e,t)=>(t.item.frequency||0)-(e.item.frequency||0)),[O]),j=cx(E,s.pref),M=cx(D,s.pat),N=cx(k,s.wf),P=O.length;function ee(e,t,n){let r=(e===`preferences`?E:e===`patterns`?D:O)[t];r&&(m(e),g(t),y(n),x(r),f(!0))}function F(e,t){return e.indexOf(t)}function I({page:e,pageKey:t}){return e.total<=sx?null:(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 pt-2`,children:[(0,H.jsxs)(`span`,{className:`text-xs text-muted-foreground me-2`,children:[e.start+1,`-`,Math.min(e.start+sx,e.total),` / `,e.total]}),Array.from({length:e.totalPages},(e,t)=>t+1).map(n=>(0,H.jsx)(q,{size:`xs`,variant:n===e.page?`default`:`outline`,onClick:()=>c(e=>({...e,[t]:n})),children:n},n))]})}function te({item:e,type:t,fullList:n}){let r=F(n,e),i=lx(e);return(0,H.jsxs)(`div`,{className:`min-w-0 rounded-xl border border-border bg-card p-4 space-y-3`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-start gap-2`,children:[t!==`workflows`||e.category?(0,H.jsx)(qd,{variant:`outline`,className:`bg-transparent border-current [color:oklch(0.42_0.13_var(--category-hue))] dark:[color:oklch(0.8_0.13_var(--category-hue))]`,style:{"--category-hue":String(Wd(e.category||`General`))},children:e.category||`General`}):null,(0,H.jsxs)(`div`,{className:`flex items-center gap-0.5 ms-auto`,children:[(0,H.jsx)(q,{variant:`ghost`,size:`icon-xs`,title:o(`btn-edit`)||`Edit`,onClick:()=>ee(t,r,`edit`),children:(0,H.jsx)(wt,{className:`size-3`})}),(0,H.jsx)(q,{variant:`ghost`,size:`icon-xs`,title:o(`btn-delete`)||`Delete`,onClick:()=>ee(t,r,`delete`),children:(0,H.jsx)(Jt,{className:`size-3`})})]}),(0,H.jsxs)(`div`,{className:V(`shrink-0 rounded-md border px-1.5 py-0.5 text-xs font-medium tabular-nums`,Id[Fd(i)]),title:`${o(`label-confidence`)}: ${i}%`,children:[i,`%`]})]}),(0,H.jsxs)(`div`,{className:`space-y-3 rounded-lg border border-border bg-muted p-3`,children:[(0,H.jsx)(`p`,{className:`text-sm break-words`,children:e.description||``}),e.steps?.length?(0,H.jsx)(`ol`,{className:`flex flex-col items-start gap-1.5`,children:e.steps.map((e,t)=>(0,H.jsxs)(`li`,{className:`flex min-w-0 max-w-full items-start gap-2 rounded-2xl border border-blue-600/40 bg-blue-500/15 py-1 ps-1 pe-3 text-xs leading-5 text-blue-700 dark:text-blue-400`,children:[(0,H.jsx)(`span`,{className:`flex size-5 shrink-0 items-center justify-center rounded-full bg-blue-500/30 text-[11px] font-medium tabular-nums dark:bg-blue-400/30`,children:t+1}),(0,H.jsx)(`span`,{className:`min-w-0 break-words`,children:e})]},t))}):null]}),e.evidence||e.frequency?(0,H.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,H.jsxs)(`span`,{className:`inline-flex items-center gap-1`,title:o(`label-evidence-tooltip`,{count:e.frequency||1}),children:[(0,H.jsx)(Kt,{className:`size-3`}),e.frequency||1]}),Pd(e).length>0?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`span`,{children:`·`}),(0,H.jsx)(ex,{item:e,focusKey:`${t}-${r}`,onOpen:()=>C({item:e,section:t,focusKey:`${t}-${r}`})})]}):null]}):null]})}return t&&!e?(0,H.jsx)(`div`,{className:`text-sm text-muted-foreground py-8 text-center`,children:o(`loading-profile`)}):e?.exists?w?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{className:`space-y-8`,children:[(0,H.jsxs)(`div`,{className:`space-y-3`,children:[(0,H.jsx)(`h2`,{dir:`auto`,className:`text-section-title font-semibold break-words`,children:e.displayName||e.userId}),(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,H.jsxs)(`span`,{className:`rounded-full bg-muted px-2.5 py-1 text-xs`,children:[(0,H.jsx)(`span`,{className:`text-muted-foreground`,children:o(`profile-version`)}),(0,H.jsx)(`span`,{className:`ms-1 font-mono`,children:e.version})]}),(0,H.jsxs)(`span`,{className:`rounded-full bg-muted px-2.5 py-1 text-xs`,children:[(0,H.jsx)(`span`,{className:`text-muted-foreground`,children:o(`profile-prompts`)}),(0,H.jsx)(`span`,{className:`ms-1 font-mono`,children:e.totalPromptsAnalyzed})]}),(0,H.jsxs)(`span`,{className:`rounded-full bg-muted px-2.5 py-1 text-xs`,children:[(0,H.jsx)(`span`,{className:`text-muted-foreground`,children:o(`profile-updated`)}),(0,H.jsx)(`span`,{className:`ms-1`,children:e.lastAnalyzedAt?wp(e.lastAnalyzedAt):`—`})]}),(0,H.jsxs)(`div`,{className:`ms-auto flex flex-wrap items-center gap-1.5`,children:[(0,H.jsxs)(`span`,{className:`inline-flex items-center gap-0.5`,children:[(0,H.jsxs)(q,{variant:`outline`,size:`sm`,onClick:()=>r?.(),children:[(0,H.jsx)(Bt,{className:`size-3.5`}),o(`btn-ai-cleanup`)]}),(0,H.jsx)(ox,{label:o(`label-more-info`),children:o(`help-ai-cleanup`)})]}),(0,H.jsxs)(`span`,{className:`inline-flex items-center gap-0.5`,children:[(0,H.jsxs)(q,{variant:`outline`,size:`sm`,onClick:()=>i?.(),children:[(0,H.jsx)(Gt,{className:`size-3.5`}),o(`btn-category-cleanup`),(0,H.jsx)(`span`,{className:`font-mono opacity-70`,title:o(`label-category-count-title`),children:T})]}),(0,H.jsx)(ox,{label:o(`label-more-info`),children:o(`help-category-cleanup`)})]}),(0,H.jsx)(Jy,{version:e.version,onUndone:n}),(0,H.jsxs)(q,{variant:`secondary`,size:`sm`,onClick:()=>n?.(),children:[(0,H.jsx)(jt,{className:`size-3.5`}),o(`btn-refresh`)]}),(0,H.jsxs)(q,{variant:`secondary`,size:`sm`,onClick:()=>u(!0),children:[(0,H.jsx)(Nt,{className:`size-3.5`}),`History`]})]})]}),(0,H.jsx)(nb,{paused:a,onOpen:()=>i?.()})]}),(0,H.jsxs)(`div`,{className:`grid gap-8`,children:[(0,H.jsxs)(`section`,{id:`profile-preferences`,className:`scroll-mt-4 space-y-3`,children:[(0,H.jsxs)(`h2`,{className:`flex flex-wrap items-center gap-2 text-section-title font-semibold`,children:[(0,H.jsx)(We,{className:`size-4`}),o(`profile-preferences`),(0,H.jsx)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:E.length})]}),E.length===0?(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:o(`empty-preferences`)}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2 lg:grid-cols-3`,children:j.items.map(e=>(0,H.jsx)(te,{item:e,type:`preferences`,fullList:E},F(E,e)))}),(0,H.jsx)(I,{page:j,pageKey:`pref`})]})]}),(0,H.jsxs)(`section`,{id:`profile-patterns`,className:`scroll-mt-4 space-y-3`,children:[(0,H.jsxs)(`h2`,{className:`flex flex-wrap items-center gap-2 text-section-title font-semibold`,children:[(0,H.jsx)(A,{className:`size-4`}),o(`profile-patterns`),(0,H.jsx)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:D.length})]}),D.length===0?(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:o(`empty-patterns`)}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2 lg:grid-cols-3`,children:M.items.map(e=>(0,H.jsx)(te,{item:e,type:`patterns`,fullList:D},F(D,e)))}),(0,H.jsx)(I,{page:M,pageKey:`pat`})]})]}),(0,H.jsxs)(`section`,{id:`profile-workflows`,className:`scroll-mt-4 space-y-3`,children:[(0,H.jsxs)(`h2`,{className:`flex flex-wrap items-center gap-2 text-section-title font-semibold`,children:[(0,H.jsx)(nn,{className:`size-4`}),o(`profile-workflows`),(0,H.jsx)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:P})]}),P===0?(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:o(`empty-workflows`)}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`div`,{className:`grid items-start gap-3 lg:grid-cols-2`,children:N.items.map(e=>(0,H.jsx)(te,{item:e.item,type:`workflows`,fullList:O},e.index))}),(0,H.jsx)(I,{page:N,pageKey:`wf`})]})]})]})]}),(0,H.jsx)($b,{open:l,onOpenChange:u,profileId:e?.id||``}),(0,H.jsx)(ix,{open:d,onOpenChange:f,type:p,index:h,action:_,item:b,onSaved:n}),(0,H.jsx)(rx,{item:S?.item??null,section:S?.section??`preferences`,focusKey:S?.focusKey??null,onOpenChange:e=>{e||C(null)}})]}):null:(0,H.jsxs)(`div`,{className:`flex flex-col items-center gap-2 py-10 text-muted-foreground`,children:[(0,H.jsx)($t,{className:`size-8`}),(0,H.jsx)(`p`,{className:`text-sm`,children:e?.message||o(`empty-preferences`)})]})}function dx(e,t){let n=e.failed??0;if(n===0)return null;let r={tagged:e.tagged??0,total:e.total,failed:n};return{message:t(e.errorKind===`no_credit`?`tag-migration-no-credit`:e.errorKind===`auth`?`tag-migration-auth`:`tag-migration-partial`,r),...e.error?{reason:t(`tag-migration-reason`,{error:e.error})}:{}}}function fx({open:e=!1,count:t=0,onOpenChange:n,onComplete:r}){let{t:i}=G(),[a,o]=(0,v.useState)(!1),[s,c]=(0,v.useState)(null),[l,u]=(0,v.useState)(0),[d,f]=(0,v.useState)(null),p=d?dx(d,i):null;(0,v.useEffect)(()=>{e&&(c(null),u(0),f(null))},[e,t]);function m(e){a&&!e||n?.(e)}async function h(){o(!0),f(null),c(i(`status-migration-init`)),u(0);let e=!0,t=0,n=null,a=1e3;for(;e&&t<a;){t++;let r=await W(`/api/migration/tags/run-batch`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({batchSize:3})});if(!r.success||!r.data){c(i(`toast-migration-failed`)+`: `+(r.error||``)),o(!1);return}n=r.data;let a=r.data.processed;e=r.data.hasMore;let s=r.data.total;u(s>0?Math.round(a/s*100):0),c(i(`status-migration-progress`,{current:a,total:s})),e&&await new Promise(e=>setTimeout(e,100))}if(t>=a){c(i(`migration-stopped`)),o(!1);return}if(n&&dx(n,i)){f(n),o(!1);return}u(100),c(i(`toast-migration-success`)),U.success(i(`toast-migration-success`)),setTimeout(()=>{o(!1),m(!1),r?.()},2e3)}return(0,H.jsx)(Du,{open:e,onOpenChange:m,children:(0,H.jsxs)(Au,{className:`sm:max-w-md`,showCloseButton:!a,children:[(0,H.jsx)(ju,{children:(0,H.jsx)(Nu,{children:i(`modal-migration-title`)})}),(0,H.jsxs)(`div`,{className:`space-y-3`,children:[p?(0,H.jsxs)(`div`,{role:`alert`,className:`space-y-1 text-sm text-destructive`,children:[(0,H.jsx)(`p`,{children:p.message}),p.reason?(0,H.jsx)(`p`,{className:`text-xs break-words`,children:p.reason}):null]}):(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,role:`status`,children:s??i(`migration-found-tags`,{count:t})}),(0,H.jsx)(`div`,{className:`h-2 rounded-full bg-muted overflow-hidden`,children:(0,H.jsx)(`div`,{className:`h-full bg-primary transition-all duration-200`,style:{width:`${l}%`}})}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:i(`tag-migration-cost`)}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:i(`migration-note`)})]}),a?null:(0,H.jsx)(Mu,{children:(0,H.jsxs)(q,{onClick:h,children:[(0,H.jsx)(Et,{className:`size-3.5`}),i(p?`tag-migration-retry`:`btn-start-migration`)]})})]})})}var px=[{id:`settings-section-external-api`,title:`External API`},{id:`settings-section-models`,title:`Models`},{id:`settings-section-embedding`,title:`Embedding`},{id:`settings-section-keys`,title:`Keys and access`},{id:`settings-section-diagnostics`,title:`Capture diagnostics`},{id:`settings-section-health`,title:`Health`},{id:`settings-section-claude-folder`,title:`Claude Code folder`},{id:`settings-section-capture-language`,title:`Memory language`},{id:`settings-section-appearance`,title:`Appearance`},{id:`settings-section-profiles`,title:`Profiles`},{id:`settings-section-web-app`,title:`Web app`},{id:`settings-section-skill-learning`,title:`Skill learning`},{id:`settings-section-log`,title:`Log`}];function mx(e){try{return localStorage.getItem(e)!==`0`}catch{return!0}}function hx(e,t){try{localStorage.setItem(e,t?`1`:`0`)}catch{}}function gx({storageKey:e,sections:t,back:n}){let r=Y(),[i,a]=(0,v.useState)(()=>mx(e)),o=()=>a(t=>(hx(e,!t),!t)),s=e=>t=>{t.preventDefault();let n=document.getElementById(e);n&&(n.scrollIntoView(mm),hm(n))};return(0,H.jsxs)(`div`,{className:`fixed top-16 end-3 z-20 flex flex-col items-end gap-1 md:top-3`,children:[(0,H.jsx)(q,{type:`button`,variant:`outline`,size:`icon-sm`,"aria-expanded":i,"aria-controls":`${e}-nav`,"aria-label":r(i?`Hide contents`:`Show contents`),onClick:o,className:`bg-card/95 shadow-sm backdrop-blur`,children:(0,H.jsx)(rt,{className:`size-4`,"aria-hidden":`true`})}),i?(0,H.jsx)(`nav`,{id:`${e}-nav`,"aria-label":r(`Contents`),className:`max-h-[70vh] w-48 max-w-full overflow-y-auto rounded-xl border border-border bg-card/95 px-2 py-1.5 shadow-sm backdrop-blur`,children:(0,H.jsxs)(`ul`,{children:[n?(0,H.jsx)(`li`,{className:`mb-1 border-b border-border pb-1`,children:(0,H.jsxs)(`button`,{type:`button`,onClick:n.onBack,className:`flex w-full items-center gap-2 rounded-lg px-2 py-1.5 text-start text-sm hover:bg-interactive-hover`,children:[(0,H.jsx)(F,{className:`rtl:-scale-x-100 size-3.5 shrink-0`,"aria-hidden":`true`}),n.label]})}):null,t.map(e=>(0,H.jsx)(`li`,{children:(0,H.jsx)(`a`,{href:`#${e.id}`,onClick:s(e.id),className:`block rounded-lg px-2 py-1.5 text-start text-sm hover:bg-interactive-hover`,children:r(e.title)})},e.id))]})}):null]})}var _x=class extends Error{status;constructor(e,t){super(e),this.name=`SettingsRequestError`,this.status=t}};async function X(e,t={}){let n=(t.method??`GET`).toUpperCase(),r=n!==`GET`&&n!==`HEAD`,i=await fetch(e,{...t,headers:{"x-omms-token":window.__OMMS_TOKEN__??``,...r||t.body?{"Content-Type":`application/json`}:{},...t.headers}}),a=await i.json();if(!i.ok)throw new _x(a.error??`Request failed (${i.status})`,i.status);return a}var vx=new Set,yx=0;function bx(e){yx++;for(let t of vx)t(e)}function xx(){let e=yx;return{isCurrent:()=>yx===e}}async function Sx(){try{let e=await X(`/api/settings`);return bx(e),e}catch{return null}}function Cx(e){return vx.add(e),()=>{vx.delete(e)}}function wx(e,t){return`${e.replace(/\.+$/,``)}. ${t}`}function Tx(){let e=0;return{begin(){let t=++e;return()=>t===e}}}async function Ex(e,t){e(!0);try{return await t()}finally{e(!1)}}function Dx(e,t){if(e===`env`){let n=(t.name??``).trim();if(!/^[A-Za-z_][A-Za-z0-9_]*$/.test(n))throw Error(`Enter a variable name such as ZAI_API_KEY`);return{source:e,name:n}}if(e===`file`){let n=(t.path??``).trim();if(!n)throw Error(`Enter the path of a key file`);return{source:e,path:n}}let n=(t.name??``).trim()||`memory-api`;if(!/^[A-Za-z0-9_-]{1,64}$/.test(n))throw Error(`Name the key file with letters, digits, dashes, or underscores`);if(!(t.value??``).trim())throw Error(`Paste the key`);return{source:e,name:n,value:t.value??``,replace:t.replace===!0}}function Ox(e){let t=[],n=e.memoryProvider===`orcarouter`;return!n&&!e.memoryModel&&t.push(`memoryModel`),!n&&!e.memoryApiUrl&&t.push(`memoryApiUrl`),e.keySet||t.push(`memoryApiKey`),t}function kx(e,t){if(t===`inherit`||t===`external`)return{[`${e}Model`]:t};let n=t.indexOf(`/`);if(n<1||n===t.length-1)throw Error(`Enter a model as provider/model.`);return{[`${e}Provider`]:t.slice(0,n),[`${e}Model`]:t.slice(n+1)}}function Ax(e){return{kind:e.relation,command:e.relation===`older`?`npm i -g om-memory-system@latest`:null}}function jx(e,t){return e.filter(e=>!t.has(e.from))}function Mx({status:e}){let t=Y();return(0,H.jsxs)(`div`,{className:`space-y-1 rounded-lg border border-border p-3`,children:[(0,H.jsx)(`h3`,{className:`text-subsection-title font-semibold`,children:am(`claude-code`)}),e?.ready===!0&&(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t(`Claude Code capture uses the external API.`)}),e?.ready===!1&&(0,H.jsxs)(`div`,{role:`alert`,className:`space-y-1 text-xs`,children:[(0,H.jsx)(`p`,{className:`text-amber-600`,children:t(`Claude Code capture is off. Complete the external API settings.`)}),(e.issues??[]).length>0&&(0,H.jsxs)(`p`,{children:[t(`Missing settings`),`: `,(e.issues??[]).map(e=>t(e)).join(`; `)]})]})]})}function Nx(){let e=Y(),[t,n]=(0,v.useState)(),[r,i]=(0,v.useState)({}),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(!1);(0,v.useEffect)(()=>{let e=!0,t=xx();X(`/api/settings`).then(r=>{e&&t.isCurrent()&&n(r)}).catch(t=>{e&&o(t.message)});for(let t of[`opencode`,`pi`])X(`/api/settings/models?host=${t}`).then(n=>{e&&i(e=>({...e,[t]:n}))}).catch(()=>{e&&i(e=>({...e,[t]:{available:!1}}))});let r=Cx(t=>{e&&n(t)});return()=>{e=!1,r()}},[]);async function l(n,r){if(!t)return;let i;try{i=kx(n,r)}catch(t){o(e(t.message));return}c(!0);let a,s;try{a=await X(`/api/settings`,{method:`PATCH`,body:JSON.stringify({edits:i,revision:t.revision})})}catch(e){s=e}let l=await Sx()!==null;if(c(!1),a){let t=e(a.migratedLegacy?`Saved. OMMS now reads ~/.config/omms/omms.jsonc. The legacy config was kept.`:`Saved. New capture and profile work uses these settings.`);o(l?t:`${t} ${e(`Reload the page before saving again.`)}`)}else o(wx(s?.message??``,e(l?`Current settings were reloaded; check the values and save again.`:`The current settings could not be reloaded. Reload the page.`)))}let u=Ox({memoryProvider:t?.settings.memoryProvider?.globalValue,memoryModel:t?.settings.memoryModel?.globalValue,memoryApiUrl:t?.settings.memoryApiUrl?.globalValue,keySet:!!t?.secrets.memoryApiKey?.set});return(0,H.jsxs)(`section`,{className:`space-y-3 rounded-xl border border-border bg-card p-4`,"aria-label":e(`Models`),children:[(0,H.jsx)(`h2`,{className:`text-section-title font-semibold`,children:e(`Models`)}),(0,H.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[e(`External API fallback`),`: `,t?.fallback.model??e(`none`),` (`,e(t?.fallback.configured?`ready`:`not ready`),`).`]}),[`opencode`,`pi`].map(e=>(0,H.jsx)(Px,{host:e,model:t?.settings[`${e}Model`],provider:t?.settings[`${e}Provider`],effective:e===`pi`?t?.effective.pi.kind:t?.effective.opencode.mode??`unready`,list:r[e],externalMissing:u,busy:s||!t,onSave:t=>l(e,t)},e)),(0,H.jsx)(Mx,{status:t?.effective[`claude-code`]}),a&&(0,H.jsx)(`p`,{role:`status`,className:`text-sm`,children:a})]})}function Px({host:e,model:t,provider:n,effective:r,list:i,externalMissing:a,busy:o,onSave:s}){let c=Y(),l=t?.globalValue===`inherit`||!t?.globalValue?`inherit`:t.globalValue===`external`?`external`:`${n?.globalValue??``}/${t.globalValue}`,[u,d]=(0,v.useState)(),[f,p]=(0,v.useState)(),[m,h]=(0,v.useState)(),g=u??(l===`inherit`||l===`external`?l:`manual`),_=i?.models??[],y=l===`inherit`||l===`external`?``:l,b=m||y||(_[0]?`${_[0].provider}/${_[0].model}`:`typed`),x=!_.some(e=>`${e.provider}/${e.model}`===b),S=f??y;return(0,H.jsxs)(`div`,{className:`space-y-2 rounded-lg border border-border p-3`,children:[(0,H.jsx)(`h3`,{className:`text-subsection-title font-semibold`,children:am(e)}),(0,H.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[c(`Effective model`),`:`,` `,t?.value===`external`&&r===`manual`?c(`external API`):t?.value===`inherit`||r===`session`?c(`session`):r===`manual`?c(`external API`):r===`unready`?c(`unavailable`):`${n?.value??``}/${t?.value??``}`]}),(t?.source===`project`||n?.source===`project`)&&(0,H.jsx)(`p`,{className:`text-xs text-amber-600`,children:c(`Project override is active. Changes to the global file may not take effect here.`)}),(0,H.jsx)(`label`,{className:`block text-sm`,htmlFor:`${e}-model`,children:c(`Model choice`)}),(0,H.jsx)(`div`,{className:Lr,children:(0,H.jsxs)(Rr,{id:`${e}-model`,className:`w-full rounded-lg border border-border bg-background p-2 text-sm`,value:g,onChange:e=>d(e.target.value),children:[(0,H.jsx)(`option`,{value:`inherit`,children:c(`Session model`)}),(0,H.jsx)(`option`,{value:`manual`,children:c(`Manual model`)}),(0,H.jsx)(`option`,{value:`external`,disabled:a.length>0,children:c(`External API`)})]})}),a.length>0&&(0,H.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[c(`External API needs`),`: `,a.join(`, `)]}),g===`manual`&&i?.available&&_.length>0&&(0,H.jsxs)(Rr,{className:`w-full rounded-lg border border-border bg-background p-2 text-sm`,"aria-label":`${am(e)} ${c(`Model`)}`,value:x?`typed`:b,onChange:e=>h(e.target.value),children:[_.map(e=>(0,H.jsxs)(`option`,{value:`${e.provider}/${e.model}`,children:[e.name,` (`,e.provider,`/`,e.model,`)`]},`${e.provider}/${e.model}`)),(0,H.jsx)(`option`,{value:`typed`,children:c(`Manual provider/model`)})]}),g===`manual`&&x&&(0,H.jsx)(`input`,{className:`w-full rounded-lg border border-border bg-background p-2 text-sm`,"aria-label":`${e} ${c(`Manual provider/model`)}`,placeholder:`provider/model`,value:S,onChange:e=>{p(e.target.value),h(`typed`)}}),g===`manual`&&i&&!i.available&&(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:i.reason?c(i.reason):c(`Model list unavailable. Enter provider/model manually.`)}),(0,H.jsx)(`button`,{type:`button`,className:`rounded-lg border border-border px-3 py-1.5 text-sm`,disabled:o,onClick:()=>s(g===`manual`?x?S.trim():b:g),children:c(`Save model`)})]})}var Fx=new Set([`order`,`only`,`allow_fallbacks`,`data_collection`,`zdr`]),Ix=`https://openrouter.ai/api/v1`,Lx=e=>{try{return new URL(e.trim()).hostname===`openrouter.ai`}catch{return!1}},Rx=e=>Array.isArray(e)?e.filter(e=>typeof e==`string`):[];function zx(e){let t=e??{},n=Rx(t.order),r=Rx(t.only),i=r.length?[...n.filter(e=>r.includes(e)),...r.filter(e=>!n.includes(e))]:n;return{dataCollection:t.data_collection===`deny`,zdr:t.zdr===!0,only:t.allow_fallbacks===!1||r.length>0,ticked:i}}function Bx(e,t){if(!e.zdr)return e.ticked;let n=new Set(t.filter(e=>e.policy===`unknown`).map(e=>e.slug));return e.ticked.filter(e=>!n.has(e))}function Vx(e,t){let n=Bx(e,t),r={};return e.dataCollection&&(r.data_collection=`deny`),e.zdr&&(r.zdr=!0),n.length&&(r.order=n),n.length&&e.only&&(r.only=n,r.allow_fallbacks=!1),r}var Hx=e=>e===`zdr`?`No retention`:e===`safety`?`Abuse checks only`:`May keep or train on data`,Ux=e=>Object.keys(e??{}).some(e=>!Fx.has(e)),Wx=e=>({...e,memoryApiUrl:Ix,memoryProvider:`openai-chat`}),Gx=`/api/settings/external-api/openrouter-providers`,Kx=`/api/settings/external-api/openrouter-routing`,qx=`[a-z0-9][a-z0-9._-]{0,63}`,Jx=RegExp(`^${qx}(?:/${qx}){0,2}$`,`i`),Yx={zdr:`default`,safety:`info`,unknown:`warning`};function Xx({reason:e,children:t}){return(0,H.jsx)(bf,{content:e,children:(0,H.jsx)(`span`,{tabIndex:0,className:`inline-flex`,children:t})})}function Zx({shown:e,ticked:t,zdr:n,onToggle:r,onRemove:i}){let a=Y();return(0,H.jsx)(`ul`,{className:`space-y-2 sm:w-1/2`,children:e.map(({slug:e,name:o,policy:s})=>{let c=`openrouter-provider-${e}`,l=t.indexOf(e)+1,u=n&&s===`unknown`,d=a(`Not available while Zero data retention only is on.`),f=(0,H.jsx)(Bs,{id:c,checked:l>0,disabled:u,"aria-describedby":u?`${c}-reason`:void 0,onCheckedChange:t=>r(e,t===!0)});return(0,H.jsxs)(`li`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1 rounded-lg border border-border bg-card px-3 py-2`,children:[u?(0,H.jsx)(Xx,{reason:d,children:f}):f,(0,H.jsx)(`span`,{className:`w-6 shrink-0`,children:l>0&&(0,H.jsxs)(qd,{variant:`outline`,"data-position":l,"data-slug":e,children:[(0,H.jsxs)(`span`,{className:`sr-only`,children:[a(`Try position`),` `]}),l]})}),(0,H.jsxs)(nm,{htmlFor:c,className:`min-w-0 flex-1 basis-[min(100%,12rem)] flex-wrap gap-x-2 gap-y-0 break-words`,children:[s&&(0,H.jsx)(`bdi`,{className:`font-medium`,children:o}),(0,H.jsx)(`span`,{dir:`ltr`,className:`font-mono text-xs text-muted-foreground`,children:e})]}),s&&(0,H.jsx)(qd,{variant:Yx[s],className:`ms-auto`,children:a(Hx(s))}),u&&(0,H.jsx)(`span`,{id:`${c}-reason`,className:`sr-only`,children:d}),!s&&(0,H.jsx)(q,{variant:`ghost`,size:`icon-xs`,"aria-label":`${a(`Remove provider`)} ${e}`,onClick:()=>i(e),children:(0,H.jsx)(an,{"aria-hidden":`true`})})]},e)})})}function Qx({model:e,savedModel:t,revision:n,saved:r,savedIsOpenRouter:i,debounceMs:a=500}){let o=Y(),[s,c]=(0,v.useState)(()=>zx(r)),[l,u]=(0,v.useState)(e.trim()),[d,f]=(0,v.useState)({kind:e.trim()?`loading`:`idle`}),[p,m]=(0,v.useState)(``),[h,g]=(0,v.useState)(``),[_,y]=(0,v.useState)({kind:`idle`}),b=(0,v.useRef)(Tx());(0,v.useEffect)(()=>{let t=setTimeout(()=>u(e.trim()),a);return()=>clearTimeout(t)},[e,a]),(0,v.useEffect)(()=>{if(!l){b.current.begin(),f({kind:`idle`});return}let e=b.current.begin();f({kind:`loading`}),X(`${Gx}?model=${encodeURIComponent(l)}`).then(t=>{e()&&f(t.ok?{kind:`ready`,rows:t.providers}:{kind:`failed`,unknownModel:t.reason===`unknown-model`,reason:t.reason===`unknown-model`?void 0:t.reason,error:t.error})}).catch(t=>{e()&&f({kind:`failed`,unknownModel:!1,error:t.message})})},[l]);let x=d.kind===`ready`?d.rows:[],S=new Set(x.map(e=>e.slug)),C=[...x,...s.ticked.filter(e=>!S.has(e)).map(e=>({slug:e,name:e}))],w=(0,v.useRef)(0),T=e=>{w.current+=1,c(e),y(e=>e.kind===`saved`?{kind:`idle`}:e)},E=(e,t)=>T(n=>({...n,ticked:t?[...n.ticked.filter(t=>t!==e),e]:n.ticked.filter(t=>t!==e)}));function D(){let e=p.trim(),t=[...s.ticked,...x.map(e=>e.slug)];if(!Jx.test(e))return g(o(`Not a valid provider slug.`));if(t.some(t=>t.toLowerCase()===e.toLowerCase()))return g(o(`That provider is already in the list.`));g(``),m(``),E(e,!0)}async function O(){y({kind:`saving`});let e=w.current;try{await X(Kx,{method:`POST`,body:JSON.stringify({revision:n,routing:Vx(s,x)})}),y({kind:w.current===e?`saved`:`idle`})}catch(e){y({kind:`error`,message:e.message})}await Sx()}let k=Bx(s,x).length>0,A=(0,H.jsx)(Bs,{id:`openrouter-only`,checked:s.only&&k,disabled:!k,"aria-describedby":k?void 0:`openrouter-only-reason`,onCheckedChange:e=>T(t=>({...t,only:e===!0}))}),j=i?e.trim()===t.trim()?void 0:o(`Save the endpoint first. The providers shown are for the model above, which is not saved yet.`):o(`Save the endpoint first. Routing applies after the OpenRouter URL is saved.`),M=(0,H.jsx)(q,{disabled:_.kind===`saving`||j!==void 0,"aria-describedby":j===void 0?void 0:`openrouter-save-reason`,onClick:()=>void O(),children:o(`Save routing`)}),N=e=>(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e});return(0,H.jsxs)(`section`,{className:`space-y-3 rounded-lg border border-border p-3 text-sm`,"aria-label":o(`OpenRouter routing`),children:[(0,H.jsx)(`h3`,{className:`text-subsection-title font-semibold`,children:o(`OpenRouter routing`)}),[[`data-collection`,`dataCollection`,`Block providers that may train on or store data`],[`zdr`,`zdr`,`Zero data retention only`]].map(([e,t,n])=>(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(Bs,{id:`openrouter-${e}`,checked:s[t],onCheckedChange:e=>T(n=>({...n,[t]:e===!0}))}),(0,H.jsx)(nm,{htmlFor:`openrouter-${e}`,children:o(n)})]},e)),N(o(`OpenRouter can still use providers labelled Abuse checks only. For strict no retention, set ZDR only in your OpenRouter privacy settings.`)),(0,H.jsx)(`h4`,{className:`font-medium`,children:o(`Providers for this model`)}),N(o(`Tick providers in the order OpenRouter should try them.`)),d.kind===`idle`&&N(o(`Enter a model ID to see its providers.`)),d.kind===`loading`&&(0,H.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,H.jsx)(at,{className:`size-4 animate-spin`,"aria-hidden":`true`}),o(`Loading the provider list…`)]}),d.kind===`failed`&&d.unknownModel&&N(o(`OpenRouter has no providers for this model.`)),d.kind===`failed`&&!d.unknownModel&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`p`,{className:`text-sm`,children:[o(`The provider list is not available.`),d.reason&&` ${d.reason===`timeout`?o(`OpenRouter did not answer within 10 seconds.`):o(`OpenRouter could not be reached.`)}`]}),!d.reason&&(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:(0,H.jsx)(`bdi`,{children:d.error})})]}),(0,H.jsx)(Zx,{shown:C,ticked:Bx(s,x),zdr:s.zdr,onToggle:E,onRemove:e=>E(e,!1)}),(0,H.jsxs)(`div`,{className:`flex gap-2 sm:w-1/2`,children:[(0,H.jsx)(Jd,{dir:`ltr`,className:`font-mono`,"aria-label":o(`Provider slug`),placeholder:`deepinfra`,value:p,"aria-invalid":h?!0:void 0,onChange:e=>m(e.target.value),onKeyDown:e=>e.key===`Enter`&&D()}),(0,H.jsx)(q,{variant:`outline`,onClick:D,children:o(`Add provider`)})]}),h&&(0,H.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive-label`,children:h}),(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[k?A:(0,H.jsx)(Xx,{reason:o(`Tick at least one provider first.`),children:A}),(0,H.jsx)(nm,{htmlFor:`openrouter-only`,children:o(`Use only these providers`)}),!k&&(0,H.jsx)(`span`,{id:`openrouter-only-reason`,className:`sr-only`,children:o(`Tick at least one provider first.`)})]}),s.only&&k&&N(o(`OpenRouter never falls back to other providers.`)),Ux(r)&&N(o(`Other routing fields are set in the config file and are kept.`)),j===void 0?M:(0,H.jsx)(Xx,{reason:j,children:M}),j!==void 0&&(0,H.jsx)(`p`,{id:`openrouter-save-reason`,className:`text-xs text-muted-foreground`,children:j}),_.kind===`saving`&&(0,H.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,H.jsx)(at,{className:`size-4 animate-spin`,"aria-hidden":`true`}),o(`Saving routing…`)]}),_.kind===`saved`&&(0,H.jsx)(`p`,{role:`status`,className:`text-sm`,children:o(`Routing saved.`)}),_.kind===`error`&&(0,H.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive-label`,children:_.message})]})}var $x=[`openai-chat`,`openai-responses`,`anthropic`,`minimax`,`orcarouter`,`google-gemini`];function eS(){let e=Y(),[t,n]=(0,v.useState)(),[r,i]=(0,v.useState)({}),[a,o]=(0,v.useState)(`file`),[s,c]=(0,v.useState)({name:``,path:``,value:``}),[l,u]=(0,v.useState)(``),[d,f]=(0,v.useState)(!1),[p,m]=(0,v.useState)(!1);(0,v.useEffect)(()=>{let e=!0,t=xx();X(`/api/settings`).then(r=>{e&&t.isCurrent()&&n(r)}).catch(t=>{e&&u(t.message)});let r=Cx(t=>{e&&n(t)});return()=>{e=!1,r()}},[]);let h=e=>String(t?.settings[e]?.globalValue??``),g=e=>r[e]??h(e);async function _(){if(!t)return;let n={};for(let e of[`memoryProvider`,`memoryApiUrl`,`memoryModel`]){let t=g(e).trim();t&&t!==h(e)&&(n[e]=t)}if(!Object.keys(n).length){u(e(`Nothing to save.`));return}f(!0);try{await X(`/api/settings`,{method:`PATCH`,body:JSON.stringify({edits:n,revision:t.revision})}),i({}),u(e(`Saved. New capture and profile work uses these settings.`))}catch(e){u(e.message)}await Sx(),f(!1)}async function y(){if(t&&window.confirm(e(`Remove OpenRouter routing? Requests to this endpoint will no longer carry the routing choices.`))){f(!0),m(!0),u(``);try{await X(`/api/settings/external-api/openrouter-routing`,{method:`POST`,body:JSON.stringify({revision:t.revision,routing:null})}),u(e(`OpenRouter routing removed.`))}catch(e){u(e.message)}await Sx(),m(!1),f(!1)}}async function b(n=!1){if(!t)return;let r;try{r=Dx(a,{...s,replace:n})}catch(t){u(e(t.message));return}f(!0);try{await X(`/api/settings/external-api/key`,{method:`POST`,body:JSON.stringify({...r,revision:t.revision})}),c(e=>({...e,value:``})),u(e(`Key source saved.`))}catch(t){let r=t.message;if(a===`paste`&&!n&&r.includes(`Confirm to replace`)){f(!1),window.confirm(e(`A key file with this name exists. Replace it?`))&&await b(!0);return}u(r)}await Sx(),f(!1)}async function x(){f(!0);try{let t=await X(`/api/settings/external-api/test`,{method:`POST`,body:`{}`});u(t.ok?`${e(`Test call succeeded`)}: ${t.model??``}`:`${e(`Test call failed`)}: ${t.error??``}`)}catch(e){u(e.message)}f(!1)}let S=t?.externalKey;return(0,H.jsxs)(`section`,{className:`space-y-3 rounded-xl border border-border bg-card p-4`,"aria-label":e(`External API`),children:[(0,H.jsx)(`h2`,{className:`text-section-title font-semibold`,children:e(`External API`)}),(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`An OpenAI- or Anthropic-compatible endpoint that either host can use for capture and backfill.`)}),(0,H.jsxs)(`label`,{className:`block text-sm`,children:[e(`Preset`),(0,H.jsx)(`div`,{className:Lr,children:(0,H.jsxs)(Rr,{"aria-label":e(`Preset`),className:`mt-1 block w-full rounded border border-border bg-background p-2`,value:Lx(g(`memoryApiUrl`))?`openrouter`:`custom`,onChange:e=>{e.target.value===`openrouter`?i(Wx(r)):i({...r,memoryApiUrl:``})},children:[(0,H.jsx)(`option`,{value:`custom`,children:e(`Custom`)}),(0,H.jsx)(`option`,{value:`openrouter`,children:`OpenRouter`})]})})]}),(0,H.jsxs)(`label`,{className:`block text-sm`,children:[e(`Provider`),(0,H.jsx)(`div`,{className:Lr,children:(0,H.jsx)(Rr,{"aria-label":e(`Provider`),className:`mt-1 block w-full rounded border border-border bg-background p-2`,value:g(`memoryProvider`)||`openai-chat`,onChange:e=>i({...r,memoryProvider:e.target.value}),children:$x.map(e=>(0,H.jsx)(`option`,{value:e,children:e},e))})})]}),(0,H.jsxs)(`label`,{className:`block text-sm`,children:[e(`API URL`),(0,H.jsx)(`div`,{className:Lr,children:(0,H.jsx)(`input`,{dir:`ltr`,className:`mt-1 block w-full rounded border border-border bg-background p-2 font-mono`,placeholder:`https://api.example.com/v1`,value:g(`memoryApiUrl`),onChange:e=>i({...r,memoryApiUrl:e.target.value})})})]}),(0,H.jsxs)(`label`,{className:`block text-sm`,children:[e(`Model`),(0,H.jsx)(`div`,{className:Lr,children:(0,H.jsx)(`input`,{dir:`ltr`,className:`mt-1 block w-full rounded border border-border bg-background p-2 font-mono`,placeholder:`glm-5-turbo`,value:g(`memoryModel`),onChange:e=>i({...r,memoryModel:e.target.value})})})]}),(0,H.jsx)(`button`,{type:`button`,className:`rounded border border-border px-3 py-1.5 text-sm`,disabled:d||!t,onClick:()=>void _(),children:e(`Save endpoint`)}),t&&Lx(g(`memoryApiUrl`))&&(0,H.jsx)(Qx,{model:g(`memoryModel`),savedModel:h(`memoryModel`),revision:t.revision,saved:t.openrouterProvider??null,savedIsOpenRouter:Lx(h(`memoryApiUrl`))}),t&&!Lx(h(`memoryApiUrl`))&&t.openrouterProvider&&(0,H.jsxs)(Xp,{tone:`warning`,children:[(0,H.jsx)(`p`,{children:e(`OpenRouter routing is still saved and is sent with every request to this endpoint.`)}),(0,H.jsx)(q,{variant:`outline`,disabled:d,onClick:()=>void y(),children:e(`Remove OpenRouter routing`)}),p&&(0,H.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-muted-foreground`,children:[(0,H.jsx)(at,{className:`size-4 animate-spin`,"aria-hidden":`true`}),e(`Removing OpenRouter routing…`)]})]}),(0,H.jsxs)(`fieldset`,{className:`${Lr} space-y-2 rounded-lg border border-border p-3 text-sm`,children:[(0,H.jsx)(`legend`,{className:`px-1 font-medium`,children:e(`API key`)}),(0,H.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[e(`Key source`),`:`,` `,S?.source===`env`?`${e(`environment variable`)} ${S.reference}`:S?.source===`file`?`${e(`key file`)} ${S.reference}`:S?.source===`literal`?e(`set in the config file`):e(`not set`),S?.source&&` · ${e(S.resolvesInWebApp?`resolves in the web app`:`does not resolve in the web app`)}`]}),S?.source===`env`&&(0,H.jsx)(`p`,{className:`text-xs text-amber-600`,children:e(`A login web app does not see variables set only in a shell profile; a key file works everywhere.`)}),S?.source&&!S.resolvesInWebApp&&(0,H.jsx)(`p`,{className:`text-xs text-amber-600`,children:e(`The key does not resolve in this web app. Save it to a key file instead.`)}),(0,H.jsxs)(`div`,{className:`space-y-2`,children:[[[`env`,`Environment variable`],[`file`,`Key file`],[`paste`,`Save key to a private file`]].map(([t,n])=>(0,H.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`input`,{type:`radio`,name:`omms-key-source`,checked:a===t,onChange:()=>o(t)}),e(n)]},t)),a===`env`&&(0,H.jsx)(`input`,{"aria-label":e(`Variable name`),className:`w-full rounded border border-border bg-background p-2`,placeholder:`ZAI_API_KEY`,value:s.name,onChange:e=>c({...s,name:e.target.value})}),a===`file`&&(0,H.jsx)(`input`,{"aria-label":e(`Key file path`),className:`w-full rounded border border-border bg-background p-2`,placeholder:`~/.config/omms/secrets/zai.key`,value:s.path,onChange:e=>c({...s,path:e.target.value})}),a===`paste`&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`input`,{"aria-label":e(`Key file name`),className:`w-full rounded border border-border bg-background p-2`,placeholder:`memory-api`,value:s.name,onChange:e=>c({...s,name:e.target.value})}),(0,H.jsx)(`input`,{"aria-label":e(`API key`),type:`password`,autoComplete:`off`,className:`w-full rounded border border-border bg-background p-2`,value:s.value,onChange:e=>c({...s,value:e.target.value})}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`The key is written to ~/.config/omms/secrets/ readable only by you. It is never shown again.`)})]})]}),(0,H.jsx)(`button`,{type:`button`,className:`rounded border border-border px-3 py-1.5`,disabled:d||!t,onClick:()=>void b(),children:e(`Save key source`)})]}),(0,H.jsx)(`button`,{type:`button`,className:`rounded border border-border px-3 py-1.5 text-sm`,disabled:d,onClick:()=>void x(),children:e(`Test`)}),l&&(0,H.jsx)(`p`,{role:`status`,className:`text-sm`,children:l})]})}var tS=new Set([`localhost`,`127.0.0.1`,`::1`,`[::1]`,`0:0:0:0:0:0:0:1`]);function nS(e){let t=e.trim().toLowerCase();return tS.has(t)||/^127(?:\.\d{1,3}){3}$/.test(t)}function rS(e){try{return nS(new URL(e).hostname)}catch{return!1}}function iS(e,t){return e?`set`:t?`missing`:`not-needed`}function aS(e){let{access:t,secrets:n}=e,r=t.embeddingApiUrl;return{memoryApiKey:(e=>e===`not-needed`?`never-used`:e)(iS(!!n.memoryApiKey?.set,e.externalUsed||e.claudeCodeInUse)),embeddingApiKey:iS(!!n.embeddingApiKey?.set,!!r&&!rS(r)),apiTokens:iS(t.tokenAvailable,!nS(t.host)&&!t.authEnabled),webPassword:iS(!!n.webServerAuthPassword?.set,!1)}}function oS(e){return e?`Browser password cleared. Restart the web app to turn it off.`:`Saved. Restart the web app to use the new browser password.`}var sS=[{id:`ollama`,label:`Ollama`,url:`http://localhost:11434/v1`},{id:`llamacpp`,label:`llama.cpp`,url:`http://localhost:8080/v1`},{id:`openrouter`,label:`OpenRouter`,url:`https://openrouter.ai/api/v1`},{id:`openai`,label:`OpenAI`,url:`https://api.openai.com/v1`},{id:`custom`,label:`Custom`,url:``}];function cS(e,t){let n=sS.find(t=>t.id===e);return n&&n.url?n.url:t}function lS(e){if(e.kind===`builtin`)return{kind:`builtin`,model:e.model.trim()};let t=e.key===`none`||e.key===`saved`?{source:e.key}:Dx(e.key,{...e.keyInput,name:e.keyInput.name||`embedding-api`});return{kind:`server`,url:e.url.trim(),model:e.model.trim(),key:t}}function uS(e){return JSON.stringify([e.kind,e.kind===`server`?e.url.trim():``,e.model.trim(),e.kind===`server`?e.key:`none`,e.kind===`server`?e.keyInput:null])}function dS(e,t){return e!==void 0&&e===uS(t)}function fS(e,t){let n=t.kind===`server`&&!rS(t.url);return{count:e.toLocaleString(`en-US`),risks:[...n?[`The hosted server is called once for each memory, which may cost money.`]:[],`Search results are poor until the re-embed ends.`,`Restart open OpenCode and Pi sessions after the change.`]}}var pS=`Xenova/nomic-embed-text-v1`;function mS(e,t=pS){return e===`builtin`?{kind:e,model:t}:{kind:e}}function hS(e,t){return e===`server`&&t?`saved`:`none`}function gS({current:e,keySet:t}){let n=Y();return(0,H.jsxs)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-sm`,children:[(0,H.jsx)(`dt`,{children:n(`Kind`)}),(0,H.jsx)(`dd`,{children:n(e.kind===`server`?`OpenAI-compatible server`:`Built-in model`)}),e.url&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`dt`,{children:n(`Server URL`)}),(0,H.jsx)(`dd`,{className:`break-all`,children:e.url})]}),(0,H.jsx)(`dt`,{children:n(`Model`)}),(0,H.jsx)(`dd`,{className:`break-all`,children:e.model}),(0,H.jsx)(`dt`,{children:n(`Vector size`)}),(0,H.jsx)(`dd`,{children:e.dimensions}),(0,H.jsx)(`dt`,{children:n(`API key`)}),(0,H.jsx)(`dd`,{children:n(t?`set`:`not set`)}),(0,H.jsx)(`dt`,{children:n(`Stored memories`)}),(0,H.jsx)(`dd`,{children:e.memoryCount.toLocaleString(`en-US`)})]})}function _S({run:e,onRetry:t}){let n=Y();return e.state===`idle`?null:(0,H.jsxs)(`div`,{role:`status`,className:`space-y-1 text-sm`,children:[e.state===`running`&&(0,H.jsxs)(`p`,{children:[n(`Re-embedding`),`: `,e.progress.processed,`/`,e.progress.total]}),e.state===`done`&&(0,H.jsx)(`p`,{children:n(`Re-embed finished.`)}),e.state===`failed`&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`p`,{className:`text-red-600`,children:[n(`Re-embed failed`),`: `,e.error??``]}),(0,H.jsx)(`button`,{type:`button`,className:`rounded border border-border px-3 py-1.5`,onClick:t,children:n(`Retry`)})]})]})}function vS(e,t){return{kind:e.kind,url:e.url??``,model:e.model,key:hS(e.kind,t),keyInput:{name:``,path:``,value:``}}}function yS(){let e=Y(),[t,n]=(0,v.useState)(),[r,i]=(0,v.useState)(),[a,o]=(0,v.useState)(!1),[s,c]=(0,v.useState)(!1),[l,u]=(0,v.useState)(),[d,f]=(0,v.useState)(),[p,m]=(0,v.useState)({state:`idle`,progress:{processed:0,total:0}}),[h,g]=(0,v.useState)(``),[_,y]=(0,v.useState)(!1);async function b(){let e=await X(`/api/settings/embedding`);return n(e),m(e.run),e}(0,v.useEffect)(()=>{let e=!0,t=xx();b().catch(t=>e&&g(t.message)),X(`/api/settings`).then(n=>e&&t.isCurrent()&&i(n)).catch(()=>{}),X(`/api/web/status`).then(t=>e&&o(!!t.isLocal)).catch(()=>{});let n=Cx(t=>e&&i(t));return()=>{e=!1,n()}},[]),(0,v.useEffect)(()=>{if(p.state!==`running`)return;let e=setInterval(()=>{X(`/api/settings/embedding/run`).then(e=>{m(e),e.state!==`running`&&b()}).catch(()=>{})},1e3);return()=>clearInterval(e)},[p.state]);function x(){if(s||!t){c(!1),u(void 0),f(void 0);return}u(vS(t,!!r?.secrets.embeddingApiKey?.set)),c(!0)}let S=e=>u(t=>t&&{...t,...e});async function C(){l&&await Ex(y,async()=>{try{let t=await X(`/api/settings/embedding/test`,{method:`POST`,body:JSON.stringify(lS(l))});t.ok&&t.dimensions?(f({key:uS(l),dimensions:t.dimensions}),g(`${e(`Test passed. Vector size`)}: ${t.dimensions}`)):(f(void 0),g(`${e(`Test failed`)}: ${t.reason??``}`))}catch(t){g(e(t.message))}})}async function w(){if(!l||!t||!r)return;let{count:n,risks:i}=fS(t.memoryCount,l),a=[`${e(`Every stored memory will be re-embedded`)}: ${n}`,...i.map(t=>e(t))].join(`
|
|
127
|
-
`);window.confirm(a)&&await Ex(y,async()=>{try{let e=await X(`/api/settings/embedding/apply`,{method:`POST`,body:JSON.stringify({candidate:lS(l),revision:r.revision})});m(e),c(!1),u(void 0),f(void 0),g(``)}catch(e){g(e.message)}await Sx()})}async function T(){try{m(await X(`/api/settings/embedding/run`,{method:`POST`,body:`{}`}))}catch(e){g(e.message)}}let E=!!r?.secrets.embeddingApiKey?.set;return(0,H.jsxs)(`section`,{className:`space-y-3 rounded-xl border border-border bg-card p-4`,"aria-label":e(`Embedding`),children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,H.jsx)(`h2`,{className:`text-section-title font-semibold`,children:e(`Embedding`)}),a&&(0,H.jsx)(`button`,{type:`button`,"aria-label":e(s?`Lock`:`Unlock to change`),title:e(s?`Lock`:`Unlock to change`),className:`rounded border border-border px-2 py-1`,disabled:!t||p.state===`running`,onClick:x,children:s?`🔓`:`🔒`})]}),(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`The model that turns memory text into search vectors. A change re-embeds every memory.`)}),t&&!s&&(0,H.jsx)(gS,{current:t,keySet:E}),s&&l&&(0,H.jsxs)(`div`,{className:`space-y-2 text-sm`,children:[[`builtin`,`server`].map(n=>(0,H.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`input`,{type:`radio`,name:`omms-embedding-kind`,checked:l.kind===n,onChange:()=>S(mS(n,t?.kind===`builtin`?t.model:`Xenova/nomic-embed-text-v1`))}),e(n===`server`?`OpenAI-compatible server`:`Built-in model`)]},n)),l.kind===`server`&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`label`,{className:`block`,children:[e(`Preset`),(0,H.jsx)(`div`,{className:`w-72 max-w-full`,children:(0,H.jsx)(Rr,{"aria-label":e(`Preset`),className:`mt-1 block w-full rounded border border-border bg-background p-2`,value:sS.find(e=>e.url===l.url)?.id??`custom`,onChange:e=>S({url:cS(e.target.value,l.url)}),children:sS.map(t=>(0,H.jsx)(`option`,{value:t.id,children:t.id===`custom`?e(`Custom`):t.label},t.id))})})]}),(0,H.jsxs)(`label`,{className:`block`,children:[e(`Server URL`),(0,H.jsx)(`input`,{className:`mt-1 block w-full rounded border border-border bg-background p-2`,value:l.url,onChange:e=>S({url:e.target.value})})]})]}),(0,H.jsxs)(`label`,{className:`block`,children:[e(`Model`),(0,H.jsx)(`input`,{className:`mt-1 block w-full rounded border border-border bg-background p-2`,placeholder:l.kind===`server`?`nomic-embed-text`:`Xenova/nomic-embed-text-v1`,value:l.model,onChange:e=>S({model:e.target.value})})]}),l.kind===`server`&&(0,H.jsxs)(`fieldset`,{className:`space-y-2 rounded-lg border border-border p-3`,children:[(0,H.jsx)(`legend`,{className:`px-1 font-medium`,children:e(`API key`)}),[[`none`,`No key`],...E?[[`saved`,`Keep the saved key`]]:[],[`env`,`Environment variable`],[`file`,`Key file`],[`paste`,`Save key to a private file`]].map(([t,n])=>(0,H.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`input`,{type:`radio`,name:`omms-embedding-key`,checked:l.key===t,onChange:()=>S({key:t})}),e(n)]},t)),l.key===`env`&&(0,H.jsx)(`input`,{"aria-label":e(`Variable name`),className:`w-full rounded border border-border bg-background p-2`,placeholder:`OPENROUTER_API_KEY`,value:l.keyInput.name,onChange:e=>S({keyInput:{...l.keyInput,name:e.target.value}})}),l.key===`file`&&(0,H.jsx)(`input`,{"aria-label":e(`Key file path`),className:`w-full rounded border border-border bg-background p-2`,value:l.keyInput.path,onChange:e=>S({keyInput:{...l.keyInput,path:e.target.value}})}),l.key===`paste`&&(0,H.jsx)(`input`,{"aria-label":e(`API key`),type:`password`,autoComplete:`off`,className:`w-full rounded border border-border bg-background p-2`,value:l.keyInput.value,onChange:e=>S({keyInput:{...l.keyInput,value:e.target.value}})})]}),(0,H.jsxs)(`div`,{className:`flex gap-2`,children:[(0,H.jsx)(`button`,{type:`button`,className:`rounded border border-border px-3 py-1.5`,disabled:_||!l.model.trim(),onClick:()=>void C(),children:e(`Test`)}),(0,H.jsx)(`button`,{type:`button`,className:`rounded border border-border px-3 py-1.5`,disabled:_||!dS(d?.key,l),onClick:()=>void w(),children:e(`Apply`)}),(0,H.jsx)(`button`,{type:`button`,className:`rounded border border-border px-3 py-1.5`,onClick:x,children:e(`Cancel`)})]})]}),(0,H.jsx)(_S,{run:p,onRetry:()=>void T()}),h&&(0,H.jsx)(`p`,{className:`text-sm`,children:h})]})}async function bS(e,t){return e()?(await t(),!0):!1}var xS=[[`7`,`7 days`],[`30`,`30 days`],[`90`,`90 days`],[`never`,`Never`]];function SS({tokens:e,newValue:t,busy:n,onGenerate:r,onRevoke:i}){let a=Y(),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(`30`),u=e=>e===null?a(`Never`):Tp(e);return(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsxs)(`table`,{className:`w-full text-left text-xs`,children:[(0,H.jsx)(`thead`,{children:(0,H.jsxs)(`tr`,{children:[(0,H.jsx)(`th`,{children:a(`Name`)}),(0,H.jsx)(`th`,{children:a(`Created`)}),(0,H.jsx)(`th`,{children:a(`Expires`)}),(0,H.jsx)(`th`,{children:a(`Last used`)}),(0,H.jsx)(`th`,{})]})}),(0,H.jsx)(`tbody`,{children:e.map(e=>(0,H.jsxs)(`tr`,{children:[(0,H.jsx)(`td`,{children:e.name}),(0,H.jsx)(`td`,{children:u(e.createdAt)}),(0,H.jsx)(`td`,{children:u(e.expiresAt)}),(0,H.jsx)(`td`,{children:e.lastUsedAt===null?`-`:u(e.lastUsedAt)}),(0,H.jsx)(`td`,{children:(0,H.jsx)(`button`,{type:`button`,className:`rounded border border-border px-2 py-0.5`,disabled:n,onClick:()=>i(e),children:a(`Revoke`)})})]},e.id))})]}),t&&(0,H.jsxs)(`div`,{role:`status`,className:`space-y-1 rounded border border-border p-2 text-xs`,children:[(0,H.jsx)(`code`,{className:`block break-all`,children:t}),(0,H.jsx)(`button`,{type:`button`,className:`rounded border border-border px-2 py-0.5`,onClick:()=>void navigator.clipboard?.writeText(t),children:a(`Copy`)}),(0,H.jsx)(`p`,{className:`text-amber-600`,children:a(`Copy this token now. It will not be shown again.`)})]}),(0,H.jsxs)(`div`,{className:`flex flex-wrap items-end gap-2 text-sm`,children:[(0,H.jsxs)(`label`,{className:`block`,children:[a(`Token name`),(0,H.jsx)(`input`,{className:`mt-1 block rounded border border-border bg-background p-1.5`,placeholder:`ci`,value:o,onChange:e=>s(e.target.value)})]}),(0,H.jsxs)(`label`,{className:`block`,children:[a(`Expires after`),(0,H.jsx)(Rr,{"aria-label":a(`Expires after`),className:`mt-1 block rounded border border-border bg-background p-1.5`,value:c,onChange:e=>l(e.target.value),children:xS.map(([e,t])=>(0,H.jsx)(`option`,{value:e,children:a(t)},e))})]}),(0,H.jsx)(`button`,{type:`button`,className:`rounded border border-border px-3 py-1.5`,disabled:n||!o.trim(),onClick:()=>r(o.trim(),c===`never`?null:Number(c)),children:a(`Generate token`)})]})]})}var CS=`relative overflow-x-auto rounded-lg border border-border`,wS=`px-3 py-2 text-start font-medium`,TS=`bg-muted/50 text-xs text-muted-foreground`,ES=`px-3 py-2 text-start font-medium`,DS=`border-t border-border transition-colors hover:bg-muted/30`,OS=`px-3 py-1.5`;function kS(e){return{secrets:e.secrets??{},externalUsed:e.effective?.opencode?.mode===`manual`||e.effective?.pi?.kind===`manual`,claudeCodeInUse:!!(e.claudeCodeEvidence?.attempts||e.claudeCodeEvidence?.folderSet),access:e.access??{host:`127.0.0.1`,authEnabled:!1,tokenAvailable:!1,embeddingApiUrl:null}}}var AS=[{id:`memoryApiKey`,label:`External API key`,purpose:`Capture and profile learning through the external API. Claude Code always uses it.`,hosts:`OpenCode, Pi, Claude Code`,where:`External API card`},{id:`embeddingApiKey`,label:`Embedding server key`,purpose:`Sent to an embedding server on another machine.`,hosts:`OpenCode, Pi, Claude Code`,where:`Embedding card`},{id:`apiTokens`,label:`API tokens`,purpose:`Let scripts and other computers call the web app's API.`,hosts:`Web app`,where:`Table below`},{id:`webPassword`,label:`Browser password`,purpose:`Asks for a user name and password before the page opens.`,hosts:`Web app`,where:`Form below`}];function jS({state:e}){let t=Y();return e===`set`?(0,H.jsxs)(`span`,{children:[`✅ `,t(`set`)]}):e===`missing`?(0,H.jsxs)(`span`,{className:`text-red-600`,children:[`⛔️ `,t(`missing`)]}):e===`never-used`?(0,H.jsx)(`span`,{className:`text-muted-foreground`,children:t(`never used before`)}):(0,H.jsx)(`span`,{className:`text-muted-foreground`,children:t(`not needed`)})}function MS({states:e}){let t=Y();return(0,H.jsx)(`div`,{className:CS,children:(0,H.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,H.jsx)(`caption`,{className:V(wS,`sr-only`),children:t(`Keys and access`)}),(0,H.jsx)(`thead`,{className:TS,children:(0,H.jsxs)(`tr`,{children:[(0,H.jsx)(`th`,{className:ES,children:t(`Credential`)}),(0,H.jsx)(`th`,{className:ES,children:t(`State`)}),(0,H.jsx)(`th`,{className:ES,children:t(`Used for`)}),(0,H.jsx)(`th`,{className:ES,children:t(`Hosts`)}),(0,H.jsx)(`th`,{className:ES,children:t(`Change it in`)})]})}),(0,H.jsx)(`tbody`,{children:AS.map(n=>(0,H.jsxs)(`tr`,{className:V(DS,`align-top`),children:[(0,H.jsx)(`td`,{className:V(OS,`font-medium`),children:t(n.label)}),(0,H.jsx)(`td`,{className:V(OS,`whitespace-nowrap`),children:(0,H.jsx)(jS,{state:e[n.id]})}),(0,H.jsx)(`td`,{className:OS,children:t(n.purpose)}),(0,H.jsx)(`td`,{className:OS,children:n.hosts===`Web app`?t(`Web app`):n.hosts}),(0,H.jsx)(`td`,{className:OS,children:t(n.where)})]},n.id))})]})})}function NS({value:e,onChange:t}){let n=Y();return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`label`,{className:`block w-full max-w-72`,children:[(0,H.jsx)(`span`,{children:n(`User name`)}),(0,H.jsx)(`input`,{className:`mt-1 block w-full rounded border border-border bg-background p-2`,autoComplete:`username`,value:e.username,onChange:n=>t({...e,username:n.target.value})})]}),(0,H.jsxs)(`label`,{className:`block w-full max-w-72`,children:[(0,H.jsx)(`span`,{children:n(`Password`)}),(0,H.jsx)(`input`,{type:`password`,autoComplete:`new-password`,className:`mt-1 block w-full rounded border border-border bg-background p-2`,value:e.value,onChange:n=>t({...e,value:n.target.value})})]})]})}function PS(){let e=Y(),[t,n]=(0,v.useState)(),[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)([]),[s,c]=(0,v.useState)(),[l,u]=(0,v.useState)({username:``,value:``}),[d,f]=(0,v.useState)(``),[p,m]=(0,v.useState)(!1);async function h(){let e=await X(`/api/settings/tokens`);o(e.tokens)}(0,v.useEffect)(()=>{let e=!0,t=xx();X(`/api/settings`).then(r=>{e&&t.isCurrent()&&n(r)}).catch(t=>{e&&f(t.message)}),X(`/api/web/status`).then(async t=>{!e||!t.isLocal||(i(!0),await h())}).catch(()=>{});let r=Cx(t=>{e&&n(t)});return()=>{e=!1,r()}},[]);async function g(e){await Ex(m,async()=>{try{await e()}catch(e){f(e.message)}await Sx()}).catch(()=>{})}let _=(e,t)=>g(async()=>{let n=await X(`/api/settings/tokens`,{method:`POST`,body:JSON.stringify({name:e,expiresInDays:t})});c(n.value),f(``),await h()}),y=t=>g(async()=>{c(void 0),await bS(()=>window.confirm(e(`Revoke this token? Scripts that use it stop working.`)),async()=>{await X(`/api/settings/tokens/${t.id}`,{method:`DELETE`}),await h()})}),b=n=>g(async()=>{t&&(await X(`/api/settings/web-password`,{method:`POST`,body:JSON.stringify(n?{clear:!0,revision:t.revision}:{password:l.value,username:l.username,revision:t.revision})}),u({username:``,value:``}),f(e(oS(n))))}),x=t?.access;return(0,H.jsxs)(`section`,{className:`space-y-3 rounded-xl border border-border bg-card p-4`,"aria-label":e(`Keys and access`),children:[(0,H.jsx)(`h2`,{className:`text-section-title font-semibold`,children:e(`Keys and access`)}),t&&(0,H.jsx)(MS,{states:aS(kS(t))}),x?.configTokenIgnored&&(0,H.jsx)(`p`,{className:`text-xs text-amber-600`,children:e(`The config file still sets webServerApiToken. OMMS imported it once as the token “from config file” and no longer reads the key. Use the token table instead.`)}),r?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`fieldset`,{className:`space-y-2 rounded-lg border border-border p-3 text-sm`,children:[(0,H.jsx)(`legend`,{className:`px-1 font-medium`,children:e(`API tokens`)}),(0,H.jsx)(SS,{tokens:a,newValue:s,busy:p,onGenerate:(e,t)=>void _(e,t),onRevoke:e=>void y(e)})]}),(0,H.jsxs)(`fieldset`,{className:`space-y-2 rounded-lg border border-border p-3 text-sm`,children:[(0,H.jsx)(`legend`,{className:`px-1 font-medium`,children:e(`Browser password`)}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:x?.authEnabled?x.authUsername?`${e(`A browser password is set for user`)} ${x.authUsername}.`:e(`A browser password is set for your computer user name.`):e(`No browser password is set.`)}),(0,H.jsx)(NS,{value:l,onChange:u}),(0,H.jsxs)(`div`,{className:`flex gap-2`,children:[(0,H.jsx)(`button`,{type:`button`,className:`rounded border border-border px-3 py-1.5`,disabled:p||!t||!l.value,onClick:()=>void b(!1),children:e(`Save password`)}),(0,H.jsx)(`button`,{type:`button`,className:`rounded border border-border px-3 py-1.5`,disabled:p||!t||!x?.authEnabled,onClick:()=>void b(!0),children:e(`Clear password`)})]})]})]}):(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`Open this page on the computer that runs OMMS to manage tokens and the password.`)}),d&&(0,H.jsx)(`p`,{role:`status`,className:`text-sm`,children:d})]})}function FS(){let e=Y(),[t,n]=(0,v.useState)([]),[r,i]=(0,v.useState)({}),[a,o]=(0,v.useState)(!1),[s,c]=(0,v.useState)(``);async function l(){let e=await X(`/api/settings/profiles`);n(e.profiles)}if((0,v.useEffect)(()=>{l().catch(e=>c(e.message))},[]),t.length<2)return null;let u=t=>Ex(o,async()=>{if(window.confirm(`${e(`Use this profile for every folder?`)} ${t.userId}`))try{let n=await Sx();await X(`/api/settings/profiles/use`,{method:`POST`,body:JSON.stringify({userId:t.userId,revision:n?.revision})}),await Sx(),await l(),c(e(`Saved. OMMS now uses this profile in every folder.`))}catch(e){c(e.message)}}),d=n=>Ex(o,async()=>{let i=t.find(e=>e.id===(r[n.id]??t.find(e=>e.id!==n.id)?.id));if(i&&window.confirm(`${e(`Merge this profile into the other one? The source profile is turned off, not deleted.`)}\n${n.userId} → ${i.userId}`))try{await X(`/api/settings/profiles/merge`,{method:`POST`,body:JSON.stringify({sourceId:n.id,targetId:i.id})}),await l(),c(e(`Merged.`))}catch(e){c(e.message)}});return(0,H.jsxs)(`section`,{className:`space-y-3 rounded-xl border border-border bg-card p-4`,"aria-label":e(`Profiles`),children:[(0,H.jsx)(`h2`,{className:`text-section-title font-semibold`,children:e(`Profiles`)}),(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`OMMS keeps one profile for each git email. A folder whose repository has its own email starts a second profile. Choose the profile that is yours, or merge the extra one into it.`)}),(0,H.jsx)(`div`,{className:CS,children:(0,H.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,H.jsx)(`caption`,{className:V(wS,`sr-only`),children:e(`Profiles`)}),(0,H.jsx)(`thead`,{className:TS,children:(0,H.jsxs)(`tr`,{children:[(0,H.jsx)(`th`,{className:ES,children:e(`Email`)}),(0,H.jsx)(`th`,{className:ES,children:e(`Preferences`)}),(0,H.jsx)(`th`,{className:ES,children:e(`Patterns`)}),(0,H.jsx)(`th`,{className:ES,children:e(`Workflows`)}),(0,H.jsx)(`th`,{className:ES,children:e(`Prompts analysed`)}),(0,H.jsx)(`th`,{className:ES,children:e(`Last update`)}),(0,H.jsx)(`th`,{className:ES,children:e(`Actions`)})]})}),(0,H.jsx)(`tbody`,{children:t.map(n=>(0,H.jsxs)(`tr`,{className:DS,children:[(0,H.jsxs)(`td`,{className:V(OS,`font-medium`),children:[n.userId,n.inUse&&(0,H.jsxs)(`span`,{className:`ms-2 text-xs text-green-700`,children:[`✅ `,e(`in use`)]})]}),(0,H.jsx)(`td`,{className:OS,children:n.preferences}),(0,H.jsx)(`td`,{className:OS,children:n.patterns}),(0,H.jsx)(`td`,{className:OS,children:n.workflows}),(0,H.jsx)(`td`,{className:OS,children:n.totalPromptsAnalyzed}),(0,H.jsx)(`td`,{className:OS,children:wp(n.lastAnalyzedAt)}),(0,H.jsxs)(`td`,{className:V(OS,`space-y-1`),children:[!n.inUse&&(0,H.jsx)(`button`,{type:`button`,className:`rounded border border-border px-2 py-1`,disabled:a,onClick:()=>void u(n),children:e(`Use this profile`)}),(0,H.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,H.jsx)(`label`,{className:`sr-only`,htmlFor:`merge-${n.id}`,children:e(`Merge into`)}),(0,H.jsx)(`select`,{id:`merge-${n.id}`,className:`rounded border border-border bg-background px-1 py-1 text-xs`,value:r[n.id]??``,onChange:e=>i(t=>({...t,[n.id]:e.target.value})),children:t.filter(e=>e.id!==n.id).map(e=>(0,H.jsx)(`option`,{value:e.id,children:e.userId},e.id))}),(0,H.jsx)(`button`,{type:`button`,className:`rounded border border-border px-2 py-1`,disabled:a,onClick:()=>void d(n),children:e(`Merge into`)})]})]})]},n.id))})]})}),s&&(0,H.jsx)(`p`,{role:`status`,className:`text-sm`,children:s})]})}var IS=[`opencode`,`pi`,`claude-code`];function LS(e){return!e.provider&&!e.model?null:`${e.provider??``}/${e.model??``}`}function RS(e){let t=new Map;for(let n of e){let e=t.get(n.host)??{host:n.host,total:0,saved:0,skipped:0,failed:0,models:[]};e.total+=n.total,e.saved+=n.saved,e.skipped+=n.skipped,e.failed+=n.failed;let r=LS(n),i=e.models.find(e=>e.label===r);i?(i.total+=n.total,i.saved+=n.saved,i.skipped+=n.skipped,i.failed+=n.failed):e.models.push({label:r,provider:n.provider,model:n.model,total:n.total,saved:n.saved,skipped:n.skipped,failed:n.failed}),t.set(n.host,e)}let n=e=>{let t=IS.indexOf(e);return t<0?IS.length:t};return[...t.values()].map(e=>({...e,models:e.models.sort((e,t)=>t.total-e.total)})).sort((e,t)=>n(e.host)-n(t.host))}function zS(e,t){return t>0?Math.round(100*e/t):0}function BS(e){let t=new Map;for(let n of e){let e=`${n.host}\u0000${n.reason}`,r=t.get(e)??{host:n.host,reason:n.reason,count:0};r.count+=n.count,t.set(e,r)}return[...t.values()].sort((e,t)=>t.count-e.count)}function VS({row:e}){return(0,H.jsxs)(H.Fragment,{children:[[e.saved,e.skipped,e.failed].map((t,n)=>(0,H.jsxs)(`td`,{className:V(OS,`text-end tabular-nums`),children:[t,` `,(0,H.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[zS(t,e.total),`%`]})]},n)),(0,H.jsx)(`td`,{className:V(OS,`text-end font-medium tabular-nums`),children:e.total})]})}function HS(e,t){return`/api/settings/diagnostics?days=${e}${t===`all`?``:`&host=${t}`}`}function US(){let e=Y(),[t,n]=(0,v.useState)(7),[r,i]=(0,v.useState)(`all`),[a,o]=(0,v.useState)(()=>new Set),[s,c]=(0,v.useState)(),[l,u]=(0,v.useState)([]),[d,f]=(0,v.useState)(),[p,m]=(0,v.useState)(``),[h,g]=(0,v.useState)(``),[_,y]=(0,v.useState)(``),[b]=(0,v.useState)(Tx),x=(0,v.useCallback)(async(e,t)=>{let n=xx(),r=b.begin();try{let[i,a,o]=await Promise.all([X(HS(e,t)),X(`/api/settings/traces`),X(`/api/settings`)]);if(!r())return;c(i),u(a.traces),n.isCurrent()&&f(o),g(``)}catch(e){if(!r())return;g(e.message)}},[b]);(0,v.useEffect)(()=>{x(t,r)},[t,r,x]),(0,v.useEffect)(()=>Cx(e=>f(e)),[]);async function S(n){if(!d)return;let i;try{await X(`/api/settings`,{method:`PATCH`,body:JSON.stringify({revision:d.revision,edits:n})})}catch(e){i=e}let a=await Sx()!==null;if(!i){y(``),await x(t,r),a||g(e(`Reload the page before saving again.`));return}g(wx(i.message,e(a?`Current settings were reloaded; check the values and save again.`:`The current settings could not be reloaded. Reload the page.`)))}async function C(e){try{let t=await X(`/api/settings/traces/${encodeURIComponent(e)}`);m(t.content)}catch(e){g(e.message)}}async function w(n){if(window.confirm(`${e(`Delete`)} ${n}?`))try{await X(`/api/settings/traces/${encodeURIComponent(n)}`,{method:`DELETE`}),m(``),await x(t,r)}catch(e){g(e.message)}}async function T(n){try{let{result:i}=await X(`/api/settings/capture-retry/${n}/run`,{method:`POST`,body:`{}`});y(e(i===`scheduled`?n===`pi`?`These turns retry at the next Pi session start.`:n===`claude-code`?`These turns retry at the next Claude Code session start.`:`These turns retry at the next OpenCode session start.`:i===`running`?`A retry is already running.`:`Retrying now.`)),await x(t,r)}catch(e){g(e.message)}}let E=d?.settings.captureTrace,D=Number(d?.settings.captureRetryRetentionHours?.value??72);return(0,H.jsxs)(`section`,{className:`space-y-4 rounded-xl border border-border bg-card p-4`,"aria-label":e(`Capture diagnostics`),children:[(0,H.jsx)(`h2`,{className:`text-section-title font-semibold`,children:e(`Capture diagnostics`)}),(0,H.jsxs)(`label`,{className:`flex items-center gap-2 pb-2 text-sm`,children:[e(`Time range`),(0,H.jsxs)(Rr,{"aria-label":e(`Time range`),className:`rounded-lg border border-border bg-background px-2 py-1`,value:t,onChange:e=>n(Number(e.target.value)),children:[(0,H.jsx)(`option`,{value:1,children:e(`24 hours`)}),(0,H.jsx)(`option`,{value:7,children:e(`7 days`)}),(0,H.jsx)(`option`,{value:30,children:e(`30 days`)}),(0,H.jsx)(`option`,{value:90,children:e(`90 days`)})]}),e(`Host`),(0,H.jsxs)(Rr,{"aria-label":e(`Host`),className:`rounded-lg border border-border bg-background px-2 py-1`,value:r,onChange:e=>i(e.target.value),children:[(0,H.jsx)(`option`,{value:`all`,children:e(`All`)}),[`opencode`,`pi`,`claude-code`].map(e=>(0,H.jsx)(`option`,{value:e,children:am(e)},e))]})]}),h&&(0,H.jsx)(`p`,{role:`alert`,children:h}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`Saved: a memory was stored. Skipped: the model or a rule found nothing worth keeping, or the turn was private or trivial. Failed: the attempt hit an error. Total: the three added up. Each percentage is a share of its row's total.`)}),(0,H.jsx)(`div`,{className:CS,children:(0,H.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,H.jsx)(`caption`,{className:wS,children:e(`Outcomes by host`)}),(0,H.jsx)(`thead`,{className:TS,children:(0,H.jsx)(`tr`,{children:[`Host / model`,`Saved`,`Skipped`,`Failed`,`Total`].map((t,n)=>(0,H.jsx)(`th`,{scope:`col`,className:V(ES,n>0&&`text-end`),children:e(t)},t))})}),(0,H.jsx)(`tbody`,{children:RS(s?.byModel??[]).map(t=>{let n=a.has(t.host);return(0,H.jsxs)(v.Fragment,{children:[(0,H.jsxs)(`tr`,{className:V(DS,`font-medium`),children:[(0,H.jsx)(`td`,{className:OS,children:(0,H.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1`,"aria-expanded":n,onClick:()=>o(e=>{let r=new Set(e);return n?r.delete(t.host):r.add(t.host),r}),children:[(0,H.jsx)(`span`,{"aria-hidden":!0,children:n?`▾`:`▸`}),om(t.host),(0,H.jsxs)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:[`(`,t.models.length,` `,e(t.models.length===1?`model`:`models`),`)`]})]})}),(0,H.jsx)(VS,{row:t})]}),n&&t.models.map(n=>(0,H.jsxs)(`tr`,{className:`border-t border-border transition-colors hover:bg-muted/30`,children:[(0,H.jsx)(`td`,{className:V(`px-3 py-1.5`,`ps-8`),children:n.label?(0,H.jsx)(`span`,{className:`font-mono text-xs`,children:n.label}):(0,H.jsx)(`span`,{className:`text-xs italic text-muted-foreground`,title:e(`No model was recorded for these attempts. This happens with records written by older OMMS versions, and when an attempt stops before a model is chosen.`),children:e(`model not recorded`)})}),(0,H.jsx)(VS,{row:n})]},`${t.host}-${n.label??`none`}`))]},t.host)})})]})}),(0,H.jsx)(`div`,{className:CS,children:(0,H.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,H.jsx)(`caption`,{className:wS,children:e(`Failure reasons`)}),(0,H.jsx)(`thead`,{className:TS,children:(0,H.jsxs)(`tr`,{children:[(0,H.jsx)(`th`,{scope:`col`,className:ES,children:e(`Host`)}),(0,H.jsx)(`th`,{scope:`col`,className:ES,children:e(`Reason`)}),(0,H.jsx)(`th`,{scope:`col`,className:V(ES,`text-end`),children:e(`Total`)})]})}),(0,H.jsx)(`tbody`,{children:BS(s?.byReason??[]).map((e,t)=>(0,H.jsxs)(`tr`,{className:DS,children:[(0,H.jsx)(`td`,{className:V(OS,`text-muted-foreground`),children:om(e.host)}),(0,H.jsx)(`td`,{className:V(OS,`font-mono text-xs`),children:e.reason}),(0,H.jsx)(`td`,{className:V(OS,`text-end tabular-nums`),children:e.count})]},`${e.host}-${e.reason}-${t}`))})]})}),(0,H.jsx)(`div`,{className:V(CS,`max-h-72 overflow-y-auto`),children:(0,H.jsxs)(`table`,{className:`w-full min-w-max text-sm`,children:[(0,H.jsx)(`caption`,{className:wS,children:e(`Recent attempts`)}),(0,H.jsx)(`thead`,{className:V(TS,`sticky top-0`),children:(0,H.jsx)(`tr`,{children:[`Time`,`Host`,`Source`,`Session`,`Path`,`Model`,`Stop`,`Blocks`,`Prompt`,`Reply`,`Duration`,`Outcome`,`Reason`].map(t=>(0,H.jsx)(`th`,{scope:`col`,className:ES,children:e(t)},t))})}),(0,H.jsx)(`tbody`,{children:s?.recent.map((e,t)=>(0,H.jsx)(`tr`,{className:DS,children:[wp(e.timestamp),om(e.host),e.sourceType,e.sessionId,e.path,`${e.provider??``}/${e.model??``}`,e.stopReason,e.blockTypes?.join(`, `),e.promptChars,e.replyChars,e.durationMs,e.outcome,e.reason].map((e,t)=>(0,H.jsx)(`td`,{className:V(OS,`whitespace-nowrap`),children:e??``},t))},`${e.timestamp}-${t}`))})]})}),(0,H.jsxs)(`div`,{className:`space-y-2 border-t border-border pt-3 text-sm`,children:[(0,H.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`input`,{type:`checkbox`,checked:E?.value===!0,disabled:!d,onChange:t=>{t.target.checked&&!window.confirm(e(`Traces can contain conversation content after redaction. Keep tracing off unless you need it for debugging.`))||S({captureTrace:t.target.checked})}}),` `,e(`Save capture traces`)]}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`Traces can contain conversation content after redaction. Keep tracing off unless you need it for debugging.`)}),E?.source===`project`&&(0,H.jsx)(`p`,{className:`text-xs text-amber-600`,children:e(`This project turns tracing off. The global switch cannot turn it on here.`)}),[`captureTraceRetentionDays`,`captureAttemptRetentionDays`].map(t=>(0,H.jsxs)(`label`,{className:`block`,children:[e(t===`captureTraceRetentionDays`?`Trace retention (days)`:`Attempt retention (days)`),` `,(0,H.jsx)(`input`,{type:`number`,min:1,className:`ms-2 w-20 rounded border border-border bg-background p-1`,defaultValue:Number(d?.settings[t]?.value??30),onBlur:e=>{let n=Number(e.target.value);Number.isSafeInteger(n)&&n>0&&n!==d?.settings[t]?.value&&S({[t]:n})}},`${t}-${d?.settings[t]?.value}`)]},t)),(0,H.jsxs)(`label`,{className:`block`,children:[e(`Retry retention (hours)`),` `,(0,H.jsx)(`input`,{type:`number`,min:0,max:720,className:`ms-2 w-20 rounded border border-border bg-background p-1`,defaultValue:D,onBlur:e=>{let t=Number(e.target.value);Number.isSafeInteger(t)&&t>=0&&t<=720&&t!==D&&S({captureRetryRetentionHours:t})}},`captureRetryRetentionHours-${D}`)]}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`When the capture model cannot be reached, OMMS keeps the turn and tries again later. Queued turns can hold conversation content after redaction. 0 turns the queue off and deletes waiting turns.`)}),(0,H.jsx)(`h3`,{className:`text-subsection-title font-semibold`,children:e(`Turns waiting for retry`)}),[`pi`,`opencode`,`claude-code`].map(t=>{let n=s?.retryQueue?.[t]??0;return(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`w-24`,children:am(t)}),(0,H.jsx)(`span`,{className:`tabular-nums`,children:n}),(0,H.jsx)(`button`,{type:`button`,disabled:n===0||D===0,className:`disabled:opacity-50`,onClick:()=>void T(t),children:e(`Retry now`)})]},t)}),_&&(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:_}),(0,H.jsx)(`h3`,{className:`text-subsection-title font-semibold`,children:e(`Trace files`)}),l.map(t=>(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsxs)(`span`,{children:[t.file,` (`,t.size,` bytes)`]}),(0,H.jsx)(`button`,{type:`button`,onClick:()=>void C(t.file),children:e(`View`)}),(0,H.jsx)(`button`,{type:`button`,onClick:()=>void w(t.file),children:e(`Delete`)})]},t.file)),p&&(0,H.jsx)(`pre`,{className:`max-h-60 overflow-auto whitespace-pre-wrap break-words rounded bg-background p-2 text-xs`,children:p})]})]})}function WS(){let e=Y(),[t,n]=(0,v.useState)([]),[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(``);async function s(e){i(!0);try{let t=await X(`/api/settings/health`,{method:`POST`,body:JSON.stringify({testModels:e})});n(t.checks),o(``)}catch(e){o(e.message)}finally{i(!1)}}return(0,H.jsxs)(`section`,{id:`settings-health`,className:`space-y-3 rounded-xl border border-border bg-card p-4`,"aria-label":e(`Health`),children:[(0,H.jsx)(`h2`,{className:`text-section-title font-semibold`,children:e(`Health`)}),(0,H.jsxs)(`div`,{className:`flex gap-2`,children:[(0,H.jsx)(`button`,{className:`rounded-lg border border-border px-3 py-1.5 text-sm`,disabled:r,onClick:()=>void s(!1),children:e(`Run checks`)}),(0,H.jsx)(`button`,{className:`rounded-lg border border-border px-3 py-1.5 text-sm`,disabled:r,onClick:()=>void s(!0),children:e(`Run checks and test models`)})]}),r&&(0,H.jsx)(`p`,{role:`status`,children:e(`Checking…`)}),a&&(0,H.jsx)(`p`,{role:`alert`,children:a}),(0,H.jsx)(`ul`,{className:`space-y-2 text-sm`,children:t.map(t=>(0,H.jsxs)(`li`,{className:`rounded-lg border border-border p-2`,children:[(0,H.jsx)(`strong`,{className:t.status===`fail`?`text-red-600`:t.status===`warn`?`text-amber-600`:`text-green-600`,children:e(t.status).toUpperCase()}),` `,`· `,e(t.check),`: `,t.reason]},t.check))})]})}function GS(){let e=Y(),[t,n]=(0,v.useState)(),[r,i]=(0,v.useState)(),[a,o]=(0,v.useState)(),[s,c]=(0,v.useState)(``),[l,u]=(0,v.useState)(!1);(0,v.useEffect)(()=>{let e=!0;X(`/api/settings`).then(t=>{e&&n(t)}).catch(t=>{e&&c(t.message)}),X(`/api/settings/web-autostart`).then(t=>{e&&i(t)}).catch(t=>{e&&c(t.message)}),X(`/api/settings/version`).then(t=>{e&&o(t)}).catch(()=>{});let t=Cx(t=>{e&&n(t)});return()=>{e=!1,t()}},[]);async function d(n){if(t){u(!0);try{await X(`/api/settings`,{method:`PATCH`,body:JSON.stringify({edits:{webServerAutoStart:n},revision:t.revision})}),c(e(`Saved. The login item changes at the next Pi or OpenCode start.`))}catch(e){c(e.message)}await Sx(),u(!1)}}return(0,H.jsxs)(`section`,{className:`space-y-3 rounded-xl border border-border bg-card p-4`,"aria-label":e(`Web app`),children:[(0,H.jsx)(`h2`,{className:`text-section-title font-semibold`,children:e(`Web app`)}),(0,H.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,H.jsx)(`input`,{type:`checkbox`,checked:!!t?.settings.webServerAutoStart?.globalValue,disabled:l||!t,onChange:e=>void d(e.target.checked)}),e(`Start web app at login`)]}),(0,H.jsxs)(`p`,{className:`text-sm`,children:[e(`Login item`),`: `,e(r?.state??`not installed`)]}),r?.state===`unsupported`&&(0,H.jsx)(`p`,{role:`status`,children:e(`Login items are unsupported on this platform.`)}),r?.state===`no-runtime`&&(0,H.jsx)(`p`,{role:`status`,children:e(`Install Node or Bun to start the web app at login.`)}),a&&(0,H.jsx)(KS,{info:a}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`Use these commands to apply the change now:`)}),(0,H.jsxs)(`div`,{className:`space-y-1 font-mono text-xs`,children:[(0,H.jsx)(`p`,{children:`om-memory-system web`}),(0,H.jsx)(`p`,{children:`om-memory-system web install`}),(0,H.jsx)(`p`,{children:`om-memory-system web uninstall`}),(0,H.jsx)(`p`,{children:`om-memory-system web status`})]}),s&&(0,H.jsx)(`p`,{role:`status`,className:`text-sm`,children:s})]})}function KS({info:e}){let t=Y(),n=Ax(e);return(0,H.jsxs)(`div`,{className:`space-y-1 text-sm`,children:[(0,H.jsxs)(`p`,{children:[t(`Running version`),`: `,e.running,` · `,t(`Global command`),`:`,` `,e.global??t(`not installed globally`)]}),n.kind===`older`&&(0,H.jsx)(`p`,{role:`status`,children:t(`A newer OMMS copy runs in place of the global install. The global install is optional. To update it:`)}),n.kind===`newer`&&(0,H.jsx)(`p`,{role:`status`,className:`text-amber-600`,children:t(`The global install is newer than the running OMMS. The next Pi or OpenCode start replaces the web app.`)}),n.kind===`missing`&&(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t(`OMMS is not installed globally. A global install is optional.`)}),n.command&&(0,H.jsx)(`p`,{className:`font-mono text-xs`,children:n.command})]})}function qS(e){let t=e.trim();return t===``||t.startsWith(`~/`)||t.startsWith(`/`)||/^[A-Za-z]:[\\/]/.test(t)||t.startsWith(`\\\\`)}function JS(e,t,n){return n?t:typeof e==`string`?e:``}function YS(){let e=Y(),[t,n]=(0,v.useState)(),[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(!1),l=(0,v.useRef)(!1);(0,v.useEffect)(()=>{let e=!0,t=t=>{e&&(n(t),i(e=>JS(t.settings.claudeConfigDir?.globalValue,e,l.current)))},r=xx();X(`/api/settings`).then(e=>{r.isCurrent()&&t(e)}).catch(t=>{e&&o(t.message)});let a=Cx(e=>t(e));return()=>{e=!1,a()}},[]);async function u(){if(t){if(!qS(r)){o(e(`Enter a full path, or a path that starts with ~/.`));return}c(!0);try{await X(`/api/settings`,{method:`PATCH`,body:JSON.stringify({edits:{claudeConfigDir:r.trim()},revision:t.revision})}),l.current=!1,o(e(`Saved. Capture and import use this folder now.`))}catch(e){o(e.message)}await Sx(),c(!1)}}return(0,H.jsxs)(`section`,{className:`space-y-3 rounded-xl border border-border bg-card p-4`,"aria-label":e(`Claude Code folder`),children:[(0,H.jsx)(`h2`,{className:`text-section-title font-semibold`,children:e(`Claude Code folder`)}),(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`Set this when Claude Code does not use ~/.claude, for example when you start it with CLAUDE_CONFIG_DIR. Leave it empty to use the default.`)}),(0,H.jsxs)(`label`,{className:`block space-y-1 text-sm`,children:[(0,H.jsx)(`span`,{children:e(`Claude Code folder`)}),(0,H.jsx)(`input`,{className:`w-full rounded border border-border bg-background p-2 font-mono`,placeholder:`~/.claude`,value:r,disabled:s||!t,onChange:e=>{l.current=!0,i(e.target.value)}})]}),(0,H.jsx)(`button`,{type:`button`,className:`rounded border border-border px-3 py-1.5 text-sm`,disabled:s||!t,onClick:()=>void u(),children:e(`Save folder`)}),(0,H.jsx)(XS,{folder:t?.claudeFolder}),a&&(0,H.jsx)(`p`,{role:`status`,className:`text-sm`,children:a})]})}function XS({folder:e}){let t=Y();if(!e)return null;let n={setting:t(`this setting`),env:t(`the CLAUDE_CONFIG_DIR variable of the web app`),default:t(`the default folder`)};return(0,H.jsxs)(`div`,{className:`space-y-1 text-sm`,children:[(0,H.jsxs)(`p`,{children:[t(`Transcripts folder in use`),`: `,(0,H.jsx)(`span`,{className:`font-mono`,children:e.root})]}),(0,H.jsxs)(`p`,{children:[t(`From`),`: `,n[e.source]]}),!e.exists&&(0,H.jsxs)(`p`,{role:`status`,className:`text-amber-600`,children:[t(`This folder does not exist. Claude Code capture and import will not work:`),` `,(0,H.jsx)(`span`,{className:`font-mono`,children:e.root})]})]})}function ZS(e,t){return`/api/settings/log?lines=200${e===`all`?``:`&level=${e}`}${t?`&filter=capture`:``}`}function QS(e){let t=/^\d{4}-(\d{2}-\d{2})T(\d{2}:\d{2}:\d{2})/.exec(e);return t?`${t[1]} ${t[2]}`:e}function $S(e){return e.map(e=>{let t=e.message.replace(/\s*\n\s*/g,` `);return`${e.time} ${e.level.toUpperCase()} ${t}${e.data?`: ${e.data}`:``}`}).join(`
|
|
128
|
-
`)}function eC(e){return e.scrollHeight-e.scrollTop-e.clientHeight<24}var tC={info:`info`,warn:`warning`,error:`destructive`};function nC({level:e,guessed:t}){let n=Y(),r=(0,H.jsxs)(qd,{variant:tC[e],tabIndex:t?0:void 0,className:`w-14 justify-center`,children:[n(e),t&&(0,H.jsxs)(`span`,{className:`sr-only`,children:[`, `,n(`Level guessed from the message`)]})]});return t?(0,H.jsx)(bf,{content:n(`Level guessed from the message`),children:r}):r}function rC({records:e,emptyText:t,label:n}){let r=(0,v.useRef)(null),i=(0,v.useRef)(!0);return(0,v.useLayoutEffect)(()=>{let e=r.current;e&&i.current&&(e.scrollTop=e.scrollHeight)},[e]),(0,H.jsx)(`div`,{ref:r,role:`log`,"aria-live":`off`,"aria-label":n,tabIndex:0,onScroll:()=>{r.current&&(i.current=eC(r.current))},className:`max-h-80 overflow-auto rounded-lg bg-background p-3 text-xs`,children:e.length===0?(0,H.jsx)(`p`,{className:`text-muted-foreground`,children:t}):(0,H.jsx)(`ol`,{dir:`ltr`,className:`space-y-1.5 text-start`,children:e.map(e=>(0,H.jsxs)(`li`,{className:`flex flex-wrap items-start gap-x-2 gap-y-1`,children:[(0,H.jsx)(`time`,{dateTime:e.time,title:e.time,className:`shrink-0 font-mono text-muted-foreground`,children:QS(e.time)}),(0,H.jsx)(nC,{level:e.level,guessed:e.guessed}),(0,H.jsxs)(`span`,{className:`min-w-0 basis-full break-words whitespace-pre-wrap sm:basis-0 sm:flex-1`,children:[e.message,e.data&&(0,H.jsxs)(`span`,{className:`font-mono text-muted-foreground`,children:[` `,e.data]})]})]},e.seq))})})}var iC=5e3,aC=[{level:`all`,label:`All`},{level:`warn`,label:`Warning`},{level:`error`,label:`Error`}];function oC(e){let[t,n]=(0,v.useState)(!0);return(0,v.useEffect)(()=>{let t=e.current;if(!t)return;let r=!0,i=document.visibilityState===`visible`,a=()=>n(r&&i),o=typeof IntersectionObserver>`u`?void 0:new IntersectionObserver(([e])=>{r=e?.isIntersecting??!0,a()});o?.observe(t);let s=()=>{i=document.visibilityState===`visible`,a()};return document.addEventListener(`visibilitychange`,s),a(),()=>{o?.disconnect(),document.removeEventListener(`visibilitychange`,s)}},[e]),t}function sC(){let e=Y(),t=(0,v.useRef)(null),n=(0,v.useRef)(0),[r,i]=(0,v.useState)(`all`),[a,o]=(0,v.useState)(!1),[s,c]=(0,v.useState)(!1),[l,u]=(0,v.useState)(),[d,f]=(0,v.useState)(``),[p,m]=(0,v.useState)(!1),h=oC(t),g=(0,v.useCallback)(async()=>{let e=++n.current;try{let t=await X(ZS(r,a));if(e!==n.current)return;u(t),f(``)}catch(t){e===n.current&&f(t.message)}},[r,a]);(0,v.useEffect)(()=>{if(s){n.current++;return}g()},[g,s]),(0,v.useEffect)(()=>{if(s||!h)return;let e=setInterval(()=>void g(),iC);return()=>clearInterval(e)},[s,h,g]);async function _(e){try{await navigator.clipboard.writeText(e),m(!0),setTimeout(()=>m(!1),2e3)}catch{m(!1)}}let y=l?.records??[],b=e(r===`all`&&!a?`No log has been written yet.`:`No matching log records.`);return(0,H.jsxs)(`section`,{ref:t,className:`space-y-3 rounded-xl border border-border bg-card p-4`,"aria-label":e(`Log`),children:[(0,H.jsx)(`h2`,{className:`text-section-title font-semibold`,children:e(`Log`)}),(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 text-sm`,children:[(0,H.jsx)(`div`,{role:`group`,"aria-label":e(`Level`),className:`flex gap-1.5`,children:aC.map(t=>(0,H.jsx)(q,{type:`button`,size:`sm`,variant:r===t.level?`default`:`outline`,"aria-pressed":r===t.level,onClick:()=>i(t.level),children:e(t.label)},t.level))}),(0,H.jsxs)(`label`,{children:[(0,H.jsx)(`input`,{type:`checkbox`,checked:a,onChange:e=>o(e.target.checked)}),` `,e(`Capture attempts only`)]})]}),(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-sm`,children:[(0,H.jsx)(q,{type:`button`,size:`sm`,variant:`outline`,"aria-pressed":s,onClick:()=>c(!s),children:e(s?`Resume`:`Pause`)}),(0,H.jsx)(q,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>void g(),children:e(`Refresh`)}),(0,H.jsx)(q,{type:`button`,size:`sm`,variant:`outline`,disabled:y.length===0,onClick:()=>void _($S(y)),children:e(`Copy visible records`)}),l&&(0,H.jsx)(q,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>void _(l.path),children:e(`Copy log path`)}),(0,H.jsx)(`span`,{role:`status`,className:`text-xs text-muted-foreground`,children:p?e(`Copied`):s?e(`Paused`):``})]}),(0,H.jsx)(`p`,{dir:`ltr`,className:`break-all text-start font-mono text-xs text-muted-foreground`,children:l?.path}),d&&(0,H.jsx)(`p`,{role:`alert`,children:d}),(0,H.jsx)(rC,{records:y,label:e(`Log lines`),emptyText:l?b:e(`Loading log…`)})]})}var cC=[{code:`en`,name:`English`},{code:`id`,name:`Bahasa Indonesia`},{code:`zh`,name:`中文`},{code:`ja`,name:`日本語`},{code:`es`,name:`Español`},{code:`fr`,name:`Français`},{code:`de`,name:`Deutsch`},{code:`ru`,name:`Русский`},{code:`pt`,name:`Português`},{code:`ar`,name:`العربية`},{code:`ko`,name:`한국어`}];function lC(e){return typeof e==`string`&&e?e:`auto`}function uC(e){let t=[...cC];return e!==`auto`&&!t.some(t=>t.code===e)&&t.push({code:e}),t}function dC({value:e,onChange:t,disabled:n}){let r=Y();return(0,H.jsx)(`div`,{className:Lr,children:(0,H.jsxs)(Rr,{id:`capture-language`,className:`w-full rounded-lg border border-border bg-background p-2 text-sm`,value:e,disabled:n,onChange:e=>t(e.target.value),children:[(0,H.jsx)(`option`,{value:`auto`,children:r(`Automatic`)}),uC(e).map(e=>(0,H.jsx)(`option`,{value:e.code,children:e.name??e.code},e.code))]})})}function fC(){let e=Y(),[t,n]=(0,v.useState)(),[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(!1);(0,v.useEffect)(()=>{let e=!0,t=xx();X(`/api/settings`).then(r=>{e&&t.isCurrent()&&n(r)}).catch(t=>{e&&i(t.message)});let r=Cx(t=>{e&&n(t)});return()=>{e=!1,r()}},[]);async function s(n){if(t){o(!0);try{await X(`/api/settings`,{method:`PATCH`,body:JSON.stringify({edits:{autoCaptureLanguage:n},revision:t.revision})}),i(e(`Saved. New memories use this language.`))}catch(e){i(e.message)}await Sx(),o(!1)}}return(0,H.jsxs)(`section`,{className:`space-y-3 rounded-xl border border-border bg-card p-4`,"aria-label":e(`Memory language`),children:[(0,H.jsx)(`h2`,{className:`text-section-title font-semibold`,children:e(`Memory language`)}),(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`The language that new memory summaries are written in. Automatic detects it from your prompt, but a Latin-script prompt under 100 characters counts as English.`)}),(0,H.jsx)(`label`,{className:`block space-y-1 text-sm`,htmlFor:`capture-language`,children:e(`Summary language`)}),(0,H.jsx)(dC,{value:lC(t?.settings.autoCaptureLanguage?.value),disabled:a||!t,onChange:e=>void s(e)}),r&&(0,H.jsx)(`p`,{role:`status`,className:`text-sm`,children:r})]})}function pC({theme:e}){let{canvas:t,elevated:n,text:r,textSecondary:i,accent:a,border:o}=e.colours;return(0,H.jsxs)(`span`,{"aria-hidden":`true`,className:`flex h-9 w-14 shrink-0 flex-col justify-center gap-1 rounded-md border px-1.5`,style:{background:t,borderColor:o},children:[(0,H.jsx)(`span`,{className:`h-1.5 w-8 rounded-full`,style:{background:r}}),(0,H.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,H.jsx)(`span`,{className:`h-1.5 w-5 rounded-full`,style:{background:i}}),(0,H.jsx)(`span`,{className:`size-2.5 rounded-full`,style:{background:a,boxShadow:`0 0 0 2px ${n}`}})]})]})}function mC({variant:e,selected:t,filter:n,inUse:r,onSelect:i}){let a=Y(),o=a(e===`light`?`Light theme`:`Dark theme`),s=Dh(e).filter(e=>e.name.toLowerCase().includes(n));return(0,H.jsxs)(`fieldset`,{"aria-label":o,className:`flex min-w-0 flex-col gap-2`,children:[(0,H.jsxs)(`legend`,{className:`flex w-full items-center gap-2 pb-2`,children:[(0,H.jsx)(`span`,{className:`text-ui font-semibold`,children:o}),r?(0,H.jsx)(qd,{children:a(`On screen now`)}):null]}),s.length===0?(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:a(`No theme matches.`)}):(0,H.jsx)(`div`,{className:`relative flex max-h-80 min-w-0 flex-col overflow-y-auto rounded-[10px] border border-border p-1`,children:s.map(n=>{let r=n.id===t;return(0,H.jsxs)(`label`,{className:`flex min-h-11 cursor-pointer items-center gap-3 rounded-md px-2 py-1.5 transition-colors duration-150 hover:bg-interactive-hover has-[:checked]:bg-selection has-[:focus-visible]:outline-2 has-[:focus-visible]:outline-offset-[-2px] has-[:focus-visible]:outline-ring`,children:[(0,H.jsx)(`input`,{type:`radio`,name:`theme-${e}`,value:n.id,checked:r,onChange:()=>i(n.id),className:`sr-only`}),(0,H.jsx)(pC,{theme:n}),(0,H.jsx)(`bdi`,{className:`min-w-0 flex-1 truncate text-ui`,children:n.name}),kh(n)?(0,H.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:a(`Default`)}):null,r?(0,H.jsx)(le,{"aria-hidden":`true`,className:`size-4 shrink-0 text-primary-label`}):null]},n.id)})})]})}var hC=[{value:`system`,label:`System`,Icon:dt},{value:`light`,label:`Light`,Icon:Wt},{value:`dark`,label:`Dark`,Icon:ft}],gC={auto:`Automatic`,dmy:`Day month year`,mdy:`Month day year`,iso:`Year-month-day`},_C={auto:`Automatic`,h23:`24-hour`,h12:`12-hour`};function vC(){let e=Y(),t=ag(),n=rg(),[r,i]=(0,v.useState)(``),a=r.trim().toLowerCase();return(0,H.jsxs)(`div`,{className:`space-y-3`,children:[(0,H.jsx)(`h3`,{className:`text-subsection-title font-semibold`,children:e(`Theme`)}),(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`System follows your operating system and switches between the light and the dark theme. The choice stays in this browser.`)}),(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,H.jsx)(`fieldset`,{"aria-label":e(`Theme mode`),className:`inline-flex rounded-[10px] border border-border p-0.5`,children:hC.map(({value:n,label:r,Icon:i})=>(0,H.jsxs)(`label`,{className:`flex h-8 cursor-pointer items-center gap-1.5 rounded-md px-3 text-ui text-muted-foreground transition-colors duration-150 hover:bg-interactive-hover has-[:checked]:bg-selection has-[:checked]:text-foreground has-[:focus-visible]:outline-2 has-[:focus-visible]:outline-ring`,children:[(0,H.jsx)(`input`,{type:`radio`,name:`theme-mode`,value:n,checked:t.mode===n,onChange:()=>og(n),className:`sr-only`}),(0,H.jsx)(i,{"aria-hidden":`true`,className:`size-3.5`}),e(r)]},n))}),(0,H.jsx)(Jd,{type:`search`,"aria-label":e(`Filter themes`),placeholder:e(`Filter themes`),value:r,onChange:e=>i(e.target.value),className:`w-full sm:w-60`})]}),(0,H.jsxs)(`div`,{className:`grid min-w-0 grid-cols-1 gap-x-6 gap-y-4 md:grid-cols-2`,children:[(0,H.jsx)(mC,{variant:`light`,selected:t.light,filter:a,inUse:n===`light`,onSelect:e=>sg(`light`,e)}),(0,H.jsx)(mC,{variant:`dark`,selected:t.dark,filter:a,inUse:n===`dark`,onSelect:e=>sg(`dark`,e)})]})]})}function yC(){let e=Y(),{dateFormat:t}=G(),n=new Date;return(0,H.jsxs)(`div`,{className:`space-y-3`,children:[(0,H.jsx)(`h3`,{className:`text-subsection-title font-semibold`,children:e(`Date and time`)}),(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`How dates and times show in this web app. The choice stays in this browser.`)}),(0,H.jsxs)(`div`,{className:`flex flex-wrap gap-4`,children:[(0,H.jsxs)(`label`,{className:`block space-y-1 text-sm`,children:[(0,H.jsx)(`span`,{children:e(`Date format`)}),(0,H.jsx)(`div`,{className:Lr,children:(0,H.jsx)(Rr,{"aria-label":e(`Date format`),className:`w-full`,value:t.date,onChange:e=>qi({date:e.target.value}),children:ki.map(r=>(0,H.jsx)(`option`,{value:r,children:`${e(gC[r])} · ${kp(n,{...t,date:r})}`},r))})})]}),(0,H.jsxs)(`label`,{className:`block space-y-1 text-sm`,children:[(0,H.jsx)(`span`,{children:e(`Time format`)}),(0,H.jsx)(`div`,{className:Lr,children:(0,H.jsx)(Rr,{"aria-label":e(`Time format`),className:`w-full`,value:t.time,onChange:e=>qi({time:e.target.value}),children:Ai.map(r=>(0,H.jsx)(`option`,{value:r,children:`${e(_C[r])} · ${Dp(n,{...t,time:r})}`},r))})})]})]})]})}function bC(){let e=Y();return(0,H.jsxs)(`section`,{className:`space-y-6 rounded-xl border border-border bg-card p-4`,"aria-label":e(`Appearance`),children:[(0,H.jsx)(`h2`,{className:`text-section-title font-semibold`,children:e(`Appearance`)}),(0,H.jsx)(vC,{}),(0,H.jsx)(yC,{})]})}async function xC(e,t){try{let n=await fetch(e,{method:t?`POST`:`GET`,headers:{"x-omms-token":window.__OMMS_TOKEN__??``,...t?{"Content-Type":`application/json`}:{}},...t?{body:JSON.stringify(t)}:{}}),r=await n.json();return r.success?{ok:!0,code:r.code??`ok`,data:r.data,message:r.message}:{ok:!1,code:r.code??`error`,error:r.error??`Request failed (${n.status})`,...r.savedContent===void 0?{}:{savedContent:r.savedContent}}}catch(e){return{ok:!1,code:`network`,error:e instanceof Error?e.message:String(e)}}}var SC=(e,t)=>e?`path=${encodeURIComponent(e)}`:`name=${encodeURIComponent(t)}`,CC={overview:()=>xC(`/api/skills`),skill:(e,t,n)=>xC(`/api/skills/skill?${SC(e,t)}${n?`&turnLimit=${n.limit}&turnOffset=${n.offset}`:``}`),activity:(e={days:30})=>{let t=new URLSearchParams;for(let[n,r]of Object.entries(e))r!==void 0&&t.set(n,String(r));return xC(`/api/skills/activity?${t}`)},history:(e,t,n)=>xC(`/api/skills/history?${SC(e,t)}&limit=${n.limit}&offset=${n.offset}`),proposals:e=>xC(e?`/api/skills/proposals?state=${e}`:`/api/skills/proposals`),proposal:e=>xC(`/api/skills/proposals/${encodeURIComponent(e)}`),stats:()=>xC(`/api/skills/stats`),turnFailures:e=>xC(`/api/skills/turns/${e}/failures`),skillFailures:(e,t)=>xC(`/api/skills/failures?${SC(e,t)}`),explainFailures:(e,t)=>xC(`/api/skills/explain-failures`,{path:e??void 0,name:e?void 0:t}),draftImprovement:e=>xC(`/api/skills/draft`,{skill:e}),draftNew:(e,t)=>xC(`/api/skills/draft`,{idea:e,folder:t}),ideas:()=>xC(`/api/skills/ideas`,{}),apply:e=>xC(`/api/skills/apply`,{id:e}),reject:e=>xC(`/api/skills/reject`,{id:e}),undo:e=>xC(`/api/skills/undo`,{id:e}),setMode:(e,t)=>xC(`/api/skills/mode`,{skillPath:e,mode:t}),deleteTurns:()=>xC(`/api/skills/delete-turns`,{confirm:!0}),recordPast:()=>xC(`/api/skills/record-past`,{})};function wC(e){let[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(``),s=(0,v.useRef)(!0),c=(0,v.useRef)(!1),l=(0,v.useRef)(e);l.current=e;let u=t?.id,d=!!t&&!Yf(t);(0,v.useEffect)(()=>(s.current=!0,()=>{s.current=!1}),[]),(0,v.useEffect)(()=>{if(!d)return;c.current=!0;let e=setInterval(()=>{X(`/api/settings/imports/current`).then(e=>{!s.current||!e.job||e.job.id!==u||n(e.job)}).catch(e=>{s.current&&o(e.message)})},1e3);return()=>clearInterval(e)},[d,u]),(0,v.useEffect)(()=>{t&&Yf(t)&&c.current&&(c.current=!1,l.current())},[t]);async function f(){if(r||d)return;i(!0),o(``);let e=await CC.recordPast();if(s.current){if(i(!1),!e.ok){o(e.error);return}n(e.data.job)}}return{job:t,running:d,starting:r,error:a,start:f}}function TC({onEnd:e}){let{job:t,running:n,starting:r,error:i,start:a}=wC(e);return(0,H.jsx)(EC,{job:t,running:n,starting:r,error:i,onStart:()=>void a()})}function EC({job:e,running:t,starting:n,error:r,onStart:i}){let a=Y(),o=e?Zf(e):0;return(0,H.jsxs)(`div`,{className:`space-y-3`,children:[(0,H.jsxs)(q,{type:`button`,variant:`outline`,size:`sm`,disabled:t||n,onClick:i,children:[(0,H.jsx)(Nt,{"aria-hidden":`true`}),a(`Record past turns`)]}),n?(0,H.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,H.jsx)(at,{className:`size-4 animate-spin`,"aria-hidden":`true`}),a(`Finding past sessions…`)]}):null,t&&e?(0,H.jsxs)(`div`,{className:`space-y-1 text-sm`,children:[(0,H.jsx)(`div`,{role:`progressbar`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":o,"aria-label":a(`Record past turns`),className:`h-2 w-full overflow-hidden rounded bg-muted`,children:(0,H.jsx)(`div`,{className:`h-full bg-primary`,style:{width:`${o}%`}})}),(0,H.jsxs)(`p`,{className:`text-muted-foreground`,children:[a(`Skill turns`),`: `,Wf(e.processed??0),` / `,Wf(e.total??0),` ·`,` `,o,`%`]})]}):null,e&&Yf(e)?(0,H.jsx)(`p`,{role:`status`,className:`text-sm`,children:e.state===`done`?Ff(a(`Recorded {count} past turns.`),{count:Wf(Xf(e))}):a(`Record past turns did not finish.`)}):null,r?(0,H.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive-label`,children:r}):null]})}function DC(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(``),[i,a]=(0,v.useState)(!1),o=(0,v.useRef)(!0);(0,v.useEffect)(()=>{o.current=!0,X(`/api/settings`).then(e=>{o.current&&t(e)}).catch(e=>{o.current&&r(e.message)});let e=Cx(e=>{o.current&&t(e)});return()=>{o.current=!1,e()}},[]);async function s(t){if(!e)return n||`Settings are not loaded`;let r=null;return await Ex(a,async()=>{try{await X(`/api/settings`,{method:`PATCH`,body:JSON.stringify({edits:t,revision:e.revision})})}catch(e){r=e.message}await Sx()}),r}return{snapshot:e,loadError:n,busy:i,save:s}}function OC({label:e,checked:t,disabled:n,onChange:r}){return(0,H.jsxs)(`label`,{className:`flex min-w-0 items-start gap-2.5 text-sm`,children:[(0,H.jsx)(`input`,{type:`checkbox`,role:`switch`,className:`mt-1 size-4 shrink-0`,checked:t,disabled:n,onChange:e=>r(e.target.checked)}),(0,H.jsx)(`span`,{className:`min-w-0 break-words font-medium`,children:e})]})}function kC(e){let t=Y(),{recording:n,redact:r,stats:i,busy:a,confirm:o}=e;return(0,H.jsxs)(`section`,{className:`space-y-4 rounded-xl border border-border bg-card p-4`,"aria-label":t(`Skill learning`),children:[(0,H.jsx)(`h2`,{className:`text-section-title font-semibold`,children:t(`Skill learning`)}),(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t(`Record agent turns so OMMS can rank your skills and draft improvements.`)}),(0,H.jsxs)(`div`,{className:`space-y-3`,children:[(0,H.jsx)(OC,{label:t(`Record agent turns`),checked:n,disabled:a,onChange:e.onRecording}),e.projectOff?(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t(`A project config turns recording off for this project.`)}):null,n?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(Xp,{tone:`warning`,children:[(0,H.jsx)(`p`,{children:t(`OMMS stores full prompts, replies and tool calls in skills.db on this computer. Drafting sends recorded turns to the external API. The file holds whatever the turns hold.`)}),(0,H.jsx)(`p`,{children:t(`The memory chat sends skill counts and short change summaries to the external API, never turn text.`)})]}),(0,H.jsx)(TC,{onEnd:e.onRecordPastEnd})]}):null]}),(0,H.jsxs)(`div`,{className:`space-y-3`,children:[(0,H.jsx)(OC,{label:t(`Remove private text and secrets`),checked:r,disabled:a,onChange:e.onRedact}),o===`redact`?(0,H.jsxs)(Xp,{tone:`warning`,children:[(0,H.jsx)(`p`,{className:`font-medium`,children:t(`Stop removing private text and secrets?`)}),(0,H.jsx)(`p`,{children:t(`New turns will be stored as written.`)}),(0,H.jsxs)(`div`,{className:`flex flex-wrap gap-2 pt-1`,children:[(0,H.jsx)(q,{type:`button`,variant:`destructive`,size:`sm`,disabled:a,onClick:()=>e.onRedact(!1),children:t(`Turn off`)}),(0,H.jsx)(q,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>e.onConfirm(null),children:t(`Cancel`)})]})]}):null,r?null:(0,H.jsx)(Xp,{tone:`danger`,children:(0,H.jsx)(`p`,{children:t(`<private> text, API keys and passwords will be stored as written and sent to the external API when drafting.`)})})]}),(0,H.jsxs)(`dl`,{className:`grid max-w-md grid-cols-2 gap-3 text-sm`,children:[(0,H.jsxs)(`div`,{className:`rounded-xl border border-border px-3 py-2.5`,children:[(0,H.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:t(`Recorded turns`)}),(0,H.jsx)(`dd`,{className:`font-medium tabular-nums`,children:i?Wf(i.turns):`…`})]}),(0,H.jsxs)(`div`,{className:`rounded-xl border border-border px-3 py-2.5`,children:[(0,H.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:t(`File size`)}),(0,H.jsx)(`dd`,{className:`font-medium tabular-nums`,children:i?Gf(i.fileSize):`…`})]})]}),(0,H.jsxs)(`div`,{className:`space-y-3`,children:[(0,H.jsxs)(q,{type:`button`,variant:`destructive`,size:`sm`,disabled:a||!i||i.turns===0,onClick:()=>e.onConfirm(`delete`),children:[(0,H.jsx)(Jt,{"aria-hidden":`true`}),t(`Delete recorded turns`)]}),o===`delete`&&i?(0,H.jsxs)(Xp,{tone:`danger`,children:[(0,H.jsx)(`p`,{className:`font-medium`,children:Ff(t(`Delete {count} recorded turns? This cannot be undone.`),{count:Wf(i.turns)})}),(0,H.jsxs)(`div`,{className:`flex flex-wrap gap-2 pt-1`,children:[(0,H.jsx)(q,{type:`button`,variant:`destructive`,size:`sm`,onClick:e.onDeleteTurns,children:t(`Delete`)}),(0,H.jsx)(q,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>e.onConfirm(null),children:t(`Cancel`)})]})]}):null]}),e.message?(0,H.jsx)(`p`,{role:`status`,className:`text-sm`,children:e.message}):null,e.failure?(0,H.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive-label`,children:e.failure}):null]})}function AC(){let e=Y(),{snapshot:t,loadError:n,busy:r,save:i}=DC(),[a,o]=(0,v.useState)(null),[s,c]=(0,v.useState)(``),[l,u]=(0,v.useState)(``),[d,f]=(0,v.useState)(null),p=(0,v.useCallback)(async()=>{let e=await CC.stats();e.ok&&o(e.data)},[]);(0,v.useEffect)(()=>{p()},[p]);let m=t?.settings.skillLearning;async function h(t){c(``),u(``),f(null);let n=await i(t);n?u(n):c(e(`Saved.`)),await p()}async function g(){f(null),u(``);let t=await CC.deleteTurns();t.ok?c(Ff(e(`Deleted {count} recorded turns.`),{count:Wf(t.data.deleted)})):u(t.error),await p()}return(0,H.jsx)(kC,{recording:m?.globalValue===!0,redact:t?.settings.skillLearningRedact?.globalValue!==!1,projectOff:m?.source===`project`&&m.value===!1,stats:a,busy:r||!t,confirm:d,message:s,failure:l||n,onRecording:e=>void h({skillLearning:e}),onRedact:e=>{e||d===`redact`?h({skillLearningRedact:e}):f(`redact`)},onConfirm:f,onDeleteTurns:()=>void g(),onRecordPastEnd:()=>void p()})}var jC={"settings-section-external-api":eS,"settings-section-models":Nx,"settings-section-embedding":yS,"settings-section-keys":PS,"settings-section-diagnostics":US,"settings-section-health":WS,"settings-section-claude-folder":YS,"settings-section-capture-language":fC,"settings-section-appearance":bC,"settings-section-profiles":FS,"settings-section-web-app":GS,"settings-section-skill-learning":AC,"settings-section-log":sC};function MC(){return(0,v.useEffect)(()=>{gm(window.location.hash,document)},[]),(0,H.jsxs)(`div`,{className:`settings-view space-y-6`,children:[(0,H.jsx)(gx,{storageKey:`omms-settings-toc-open`,sections:px}),px.map(({id:e})=>{let t=jC[e];return(0,H.jsx)(`div`,{id:e,className:`scroll-mt-20 md:scroll-mt-4`,children:(0,H.jsx)(t,{})},e)})]})}function NC(e,t){return t?t.target:e.suggestion?.kind===`map`?e.suggestion.target:``}function PC(e,t){let n=new Map,r=new Map,i=[];for(let a of e){let e=t[a.directory],o=NC(a,e).trim();if(a.directory!==``&&o){let t=e||a.suggestion?.kind!==`map`?`exact`:a.suggestion.confidence,r=(n.get(a.directory)?.sessions??0)+a.sessions;n.set(a.directory,{from:a.directory,to:o,sessions:r,confidence:t})}else if(a.directory!==``&&!e&&a.suggestion?.kind===`ignore`){let e=(r.get(a.directory)?.sessions??0)+a.sessions;r.set(a.directory,{directory:a.directory,sessions:e,reason:a.suggestion.reason})}else i.push({...a})}return{maps:[...n.values()],ignores:[...r.values()],unmapped:i}}function FC(e){return new Set([...e.maps.filter(e=>e.confidence!==`guess`).map(e=>e.from),...e.ignores.map(e=>e.directory)])}function IC(e,t,n,r){let i={},a=n.maps.filter(e=>r.has(e.from));if(a.length){let t=new Map(e.map(e=>[e.from,{...e}]));for(let e of a)t.set(e.from,{from:e.from,to:e.to});i.importPathMaps=[...t.values()]}let o=n.ignores.filter(e=>r.has(e.directory));return o.length&&(i.importIgnoredDirectories=[...new Set([...t,...o.map(e=>e.directory)])]),i}function LC(e){let t=new Map;for(let n of e)t.set(n.to,[...t.get(n.to)??[],n]);return[...t].map(([e,t])=>({target:e,maps:t.sort((e,t)=>e.from.localeCompare(t.from))})).sort((e,t)=>t.maps.length-e.maps.length||e.target.localeCompare(t.target))}function RC(e){return e.filter(e=>e.directory!==``)}function zC(e,t){return[...new Set([...e,...RC(t).map(e=>e.directory)])]}function BC(e,t){return e(t===`exact`?`Exact`:t===`name`?`Name match`:`Guess`)}function VC(e,t){return e(t===`temporary`?`Temporary folder`:t===`node_modules`?`node_modules folder`:t===`app-data`?`App data folder`:`Skills folder`)}function HC({host:e,rows:t,decisions:n,busy:r,onDecide:i,onResolve:a,onIgnore:o,onIgnoreAll:s,open:c}){let l=Y(),u=t.filter(e=>e.directory!==``),d=u.filter(e=>NC(e,n[e.directory]).trim()).length;return(0,H.jsxs)(`details`,{className:`min-w-0 rounded-lg border border-border p-3`,open:c||void 0,children:[(0,H.jsxs)(`summary`,{id:`directory-maps-${e}`,className:`scroll-mt-20 cursor-pointer rounded font-medium focus-visible:outline-2 focus-visible:outline-ring`,children:[(0,H.jsxs)(`h3`,{className:`inline text-subsection-title font-semibold`,children:[am(e),`: `,l(`Unresolved directories`)]}),(0,H.jsxs)(`span`,{className:`mt-1 block text-xs font-normal text-muted-foreground`,children:[l(`Directories`),`: `,u.length,` · `,l(`Unresolved sessions`),`:`,` `,t.reduce((e,t)=>e+t.sessions,0),` · `,l(`Rows with a target`),`:`,` `,d]})]}),(0,H.jsxs)(`div`,{className:`mt-3 space-y-2`,children:[t.length===0?(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:l(`No unresolved directories in the latest run.`)}):(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsxs)(`div`,{className:`[&_button]:h-auto [&_button]:min-h-8 [&_button]:whitespace-normal [&_button]:py-1.5`,children:[(0,H.jsx)(q,{type:`button`,variant:`outline`,size:`sm`,disabled:r||u.length===0,onClick:a,children:l(`Smart resolve directories`)}),s&&u.length>0&&(0,H.jsx)(q,{type:`button`,variant:`outline`,size:`sm`,className:`ms-2`,disabled:r,onClick:s,children:l(`Ignore all`)})]}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:l(`Smart resolve shows each proposed map and ignore in a dialog. Tick the ones to keep, then press Confirm. Nothing is saved before that.`)})]}),t.map(e=>{if(e.directory===``)return(0,H.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[l(`No directory recorded`),` ·`,` `,e.sessions===1?l(`1 session`):`${e.sessions} ${l(`sessions`)}`,` ·`,` `,l(`These sessions cannot be mapped.`)]},`no-directory`);let t=n[e.directory],a=NC(e,t),s=!t&&e.suggestion?.kind===`ignore`?e.suggestion:null;return(0,H.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2 border-t border-border pt-2 text-sm`,children:[(0,H.jsxs)(`details`,{className:`min-w-0 flex-1`,open:c||void 0,children:[(0,H.jsxs)(`summary`,{className:`cursor-pointer rounded focus-visible:outline-2 focus-visible:outline-ring`,children:[(0,H.jsx)(`code`,{dir:`ltr`,className:`break-all`,children:e.directory}),` `,`· `,e.sessions===1?l(`1 session`):`${e.sessions} ${l(`sessions`)}`,(0,H.jsx)(`span`,{className:`mt-1 block text-xs text-muted-foreground`,children:s?(0,H.jsxs)(H.Fragment,{children:[l(`Suggested to ignore`),`: `,VC(l,s.reason)]}):(0,H.jsxs)(H.Fragment,{children:[l(`Target directory`),`:`,` `,a?(0,H.jsx)(`code`,{dir:`ltr`,className:`break-all`,children:a}):l(`No target chosen`)]})})]}),(0,H.jsxs)(`div`,{className:`mt-2 space-y-2`,children:[!e.suggestion&&(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:l(`No suggestion found.`)}),(0,H.jsx)(Jd,{"aria-label":`${e.directory} ${l(`Target directory`)}`,dir:`ltr`,placeholder:l(`Target directory`),value:a,disabled:r,onChange:t=>i(e,t.target.value)})]})]}),(0,H.jsx)(q,{type:`button`,variant:`outline`,size:`sm`,className:`shrink-0`,"aria-label":`${l(`Ignore`)} ${e.directory}`,disabled:r,onClick:()=>o(e),children:l(`Ignore`)})]},e.directory)})]})]})}function UC({host:e,review:t,busy:n,canConfirm:r,onRefresh:i,error:a,onClose:o,onConfirm:s}){let c=Y(),[l,u]=(0,v.useState)(()=>({review:t,ticked:FC(t)})),d=l.review===t?l.ticked:FC(t),f=(e,n)=>u(r=>{let i=new Set(r.review===t?r.ticked:FC(t));return n?i.add(e):i.delete(e),{review:t,ticked:i}}),p=[...t.maps.map(e=>e.from),...t.ignores.map(e=>e.directory)],m=p.filter(e=>d.has(e)).length,h=e=>(0,H.jsxs)(`div`,{className:`text-xs text-muted-foreground`,children:[c(`Sessions`),`: `,e]});return(0,H.jsx)(Du,{open:!0,onOpenChange:e=>{!e&&!n&&o()},children:(0,H.jsxs)(Au,{className:`sm:max-w-2xl flex flex-col overflow-hidden`,showCloseButton:!n,onEscapeKeyDown:e=>{n&&e.preventDefault()},onInteractOutside:e=>{n&&e.preventDefault()},children:[(0,H.jsxs)(ju,{children:[(0,H.jsxs)(Nu,{children:[c(`Review directory maps`),`: `,am(e)]}),(0,H.jsx)(Pu,{children:c(`Tick the maps and ignores to keep, then press Confirm to save them. Saved maps apply to every host on the next import or backfill run.`)})]}),(0,H.jsxs)(`div`,{className:`min-h-0 overflow-y-auto space-y-4`,children:[(0,H.jsxs)(`p`,{className:`text-sm`,children:[c(`Proposed maps`),`: `,t.maps.length,` · `,c(`Suggested to ignore`),`:`,` `,t.ignores.length,` · `,c(`No target`),`: `,t.unmapped.length]}),!p.length&&(0,H.jsx)(`p`,{className:`text-sm`,children:c(`Nothing to save. Type a target in a row, or press Ignore for folders that are not projects.`)}),t.maps.length>0&&(0,H.jsxs)(`section`,{className:`space-y-2`,children:[(0,H.jsx)(`h3`,{className:`text-subsection-title font-semibold`,children:c(`Proposed maps`)}),(0,H.jsx)(`ul`,{className:`space-y-3`,children:t.maps.map(e=>(0,H.jsxs)(`li`,{className:`flex min-w-0 items-start gap-2 border-t border-border pt-2 text-sm`,children:[(0,H.jsx)(`input`,{type:`checkbox`,className:`mt-1 shrink-0`,"aria-label":`${c(`Save this map`)} ${e.from}`,checked:d.has(e.from),disabled:n,onChange:t=>f(e.from,t.target.checked)}),(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`code`,{dir:`ltr`,className:`block break-all`,children:e.from}),(0,H.jsxs)(`div`,{className:`mt-1`,children:[c(`Target directory`),`:`,` `,(0,H.jsx)(`code`,{dir:`ltr`,className:`break-all`,children:e.to})]}),(0,H.jsxs)(`div`,{className:`text-xs`,children:[c(`Confidence`),`: `,BC(c,e.confidence)]}),h(e.sessions)]})]},e.from))})]}),t.ignores.length>0&&(0,H.jsxs)(`section`,{className:`space-y-2`,children:[(0,H.jsx)(`h3`,{className:`text-subsection-title font-semibold`,children:c(`Suggested to ignore`)}),(0,H.jsx)(`ul`,{className:`space-y-3`,children:t.ignores.map(e=>(0,H.jsxs)(`li`,{className:`flex min-w-0 items-start gap-2 border-t border-border pt-2 text-sm`,children:[(0,H.jsx)(`input`,{type:`checkbox`,className:`mt-1 shrink-0`,"aria-label":`${c(`Ignore`)} ${e.directory}`,checked:d.has(e.directory),disabled:n,onChange:t=>f(e.directory,t.target.checked)}),(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`code`,{dir:`ltr`,className:`block break-all`,children:e.directory}),(0,H.jsx)(`div`,{className:`mt-1`,children:VC(c,e.reason)}),h(e.sessions)]})]},e.directory))})]}),t.unmapped.length>0&&(0,H.jsxs)(`section`,{className:`space-y-2`,children:[(0,H.jsx)(`h3`,{className:`text-subsection-title font-semibold`,children:c(`No target`)}),(0,H.jsx)(`ul`,{className:`space-y-3`,children:t.unmapped.map((e,t)=>(0,H.jsxs)(`li`,{className:`min-w-0 border-t border-border pt-2 text-sm`,children:[e.directory===``?c(`No directory recorded`):(0,H.jsx)(`code`,{dir:`ltr`,className:`block break-all`,children:e.directory}),(0,H.jsx)(`div`,{children:e.directory===``?c(`These sessions cannot be mapped.`):c(`No target chosen`)}),h(e.sessions)]},`${e.directory}-${t}`))})]})]}),a&&(0,H.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:a}),(0,H.jsxs)(Mu,{children:[(0,H.jsx)(q,{type:`button`,variant:`outline`,disabled:n,onClick:o,children:c(`Cancel`)}),!r&&(0,H.jsx)(q,{type:`button`,variant:`outline`,disabled:n,onClick:i,children:c(`Refresh list`)}),(0,H.jsx)(q,{type:`button`,disabled:n||!r||m===0,onClick:()=>s(new Set(p.filter(e=>d.has(e)))),children:c(n?`Saving…`:`Confirm`)})]})]})})}function WC({host:e,rows:t,busy:n,onConfirm:r,onCancel:i}){let a=Y(),o=t.reduce((e,t)=>e+t.sessions,0);return(0,H.jsx)(Du,{open:!0,onOpenChange:e=>!e&&!n&&i(),children:(0,H.jsxs)(Au,{className:`sm:max-w-xl`,children:[(0,H.jsxs)(ju,{children:[(0,H.jsx)(Nu,{children:`${a(`Ignore all`)}: ${am(e)}`}),(0,H.jsx)(Pu,{children:`${a(`These directories stay unimported and leave the unresolved counts.`)} ${a(`Directories`)}: ${t.length} · ${a(`Sessions`)}: ${o}`})]}),(0,H.jsx)(`ul`,{className:`max-h-64 space-y-1 overflow-y-auto text-sm`,children:t.map(e=>(0,H.jsxs)(`li`,{className:`flex min-w-0 items-start gap-2`,children:[(0,H.jsx)(`code`,{dir:`ltr`,className:`min-w-0 flex-1 break-all`,children:e.directory}),(0,H.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:e.sessions})]},e.directory))}),(0,H.jsxs)(Mu,{children:[(0,H.jsx)(q,{type:`button`,variant:`outline`,disabled:n,onClick:i,children:a(`Cancel`)}),(0,H.jsx)(q,{type:`button`,disabled:n,onClick:r,children:a(`Ignore all`)})]})]})})}var GC=[`pi`,`opencode`,`claude-code`];function KC({hosts:e=GC,saved:t=!0,title:n,anchorId:r}={}){let i=Y(),[a,o]=(0,v.useState)(),[s,c]=(0,v.useState)(),[l,u]=(0,v.useState)(),[d,f]=(0,v.useState)(new Set),[p,m]=(0,v.useState)({}),[h,g]=(0,v.useState)(``),[_,y]=(0,v.useState)(!1),[b,x]=(0,v.useState)(),[S,C]=(0,v.useState)(``),[w,T]=(0,v.useState)(),E=(0,v.useRef)(!1),D=(0,v.useRef)(void 0),O=()=>X(`/api/settings/import-maps`).then(e=>{u(e),f(new Set),m({})}).catch(e=>g(e.message));(0,v.useEffect)(()=>{let e=!0;X(`/api/settings`).then(t=>{e&&(D.current=t.revision,c(t))}).catch(t=>{e&&g(t.message)}),O();let t=Cx(t=>{if(!e)return;let n=t;c(n),n.revision!==D.current&&(D.current=n.revision,X(`/api/settings/import-maps`).then(t=>{e&&D.current===n.revision&&u(t)}).catch(()=>{}))});return()=>{e=!1,t()}},[]);function k(e,t){E.current||w||(C(``),x({host:e,review:PC(t,p)}))}function A(e,t){m(n=>({...n,[e.directory]:{directory:e.directory,target:t}}))}let j=()=>s?.settings?.importPathMaps?.globalValue??l?.saved??[],M=()=>l?.ignored??[];async function N(e,t,n){if(!s||!l||E.current||w)return!E.current&&!w&&g(`The list is still loading. Try again in a moment.`),!1;E.current=!0,y(!0);try{await X(`/api/settings`,{method:`PATCH`,body:JSON.stringify({edits:e,revision:s.revision})})}catch(e){let t=e instanceof _x&&e.status===409;try{if(!t)return g(n),await Sx(),!1;g(`Settings changed elsewhere. Check the list and try again.`);try{await te()}catch{T(`conflict`),g(`Settings changed elsewhere and could not be refreshed. Refresh the list, then try again.`)}return!1}finally{E.current=!1,y(!1)}}g(t);try{await te()}catch{T(`saved`),g(`Saved, but the list could not be refreshed. Refresh the list without saving again.`)}finally{E.current=!1,y(!1)}return!0}function P(){N({importPathMaps:jx(l?.saved??[],d)},`Saved. Removed maps stop applying at the next import or backfill run.`,`Removals could not be saved. Try again.`).then(e=>{e&&f(new Set)})}function ee(e){N({importIgnoredDirectories:[...new Set([...M(),e.directory])]},`Ignored. The directory stays unimported.`,`The directory could not be ignored. Try again.`)}function F(){if(!a)return;let{rows:e}=a;N({importIgnoredDirectories:zC(M(),e)},`Ignored. The directories stay unimported.`,`The directories could not be ignored. Try again.`).then(e=>{e&&o(void 0)})}function I(e){N({importIgnoredDirectories:M().filter(t=>t!==e)},`Restored. The directory shows again in each host list that reported it.`,`The directory could not be restored. Try again.`)}async function te(){let[e,t]=await Promise.all([X(`/api/settings`),X(`/api/settings/import-maps`)]);D.current=e.revision,bx(e),u(t),T(void 0)}async function L(){if(E.current)return;E.current=!0,y(!0);let e=w===`saved`;try{await te(),e?g(`Saved. Maps apply to the next import or backfill run.`):b?C(`Settings changed elsewhere. Review these maps and confirm again.`):g(`Settings refreshed. No maps were saved.`)}catch{e?g(`Maps were saved, but the list could not be refreshed. Refresh the list without saving again.`):b?C(`Settings changed elsewhere and could not be refreshed. Refresh the list before confirming again.`):g(`Settings could not be refreshed. Try Refresh list again.`)}finally{E.current=!1,y(!1)}}async function ne(e){if(!s||!l||!b||E.current||w)return;let t=IC(j(),M(),b.review,e);if(!t.importPathMaps&&!t.importIgnoredDirectories)return;E.current=!0,y(!0),C(``);try{await X(`/api/settings`,{method:`PATCH`,body:JSON.stringify({edits:t,revision:s.revision})})}catch(e){let t=e instanceof _x&&e.status===409;if(C(t?`Settings changed elsewhere. Review these maps and confirm again.`:`Maps could not be saved. Review the targets and confirm again.`),t)try{await te()}catch{T(`conflict`),C(`Settings changed elsewhere and could not be refreshed. Refresh the list before confirming again.`)}E.current=!1,y(!1);return}let n=new Set(e);m(e=>Object.fromEntries(Object.entries(e).filter(([e])=>!n.has(e)))),f(e=>new Set([...e].filter(e=>!n.has(e)))),u(e=>e&&{...e,saved:t.importPathMaps??e.saved,ignored:t.importIgnoredDirectories??e.ignored}),x(void 0);let r=b.review.maps.filter(t=>e.has(t.from)).length,a=b.review.ignores.filter(t=>e.has(t.directory)).length;g(`${i(`Saved maps`)}: ${r} · ${i(`Ignored directories`)}: ${a}. ${i(`They apply to the next import or backfill run. No sessions were imported.`)}`);try{await te()}catch{T(`saved`),g(`Maps were saved, but the list could not be refreshed. Refresh the list without saving again.`)}finally{E.current=!1,y(!1)}}return(0,H.jsxs)(`section`,{id:r??`directory-maps`,className:`space-y-3 rounded-xl border border-border bg-card p-4`,"aria-label":i(n??`Resolve missing project folders`),children:[(0,H.jsx)(`h2`,{className:`text-section-title font-semibold`,children:i(n??`Resolve missing project folders`)}),(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:i(`A directory map links a recorded project folder to its current folder. Saved maps apply globally to every host at the next import or backfill run. Review changes before saving.`)}),(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:i(`Map a directory that was moved or deleted to the project it belongs to. A change applies to the next import or backfill run.`)}),t&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`details`,{className:`min-w-0 rounded-lg border border-border p-3`,children:[(0,H.jsxs)(`summary`,{className:`cursor-pointer rounded font-medium focus-visible:outline-2 focus-visible:outline-ring`,children:[(0,H.jsx)(`h3`,{className:`inline text-subsection-title font-semibold`,children:i(`Saved maps`)}),` ·`,` `,l?.saved.length??0,(0,H.jsx)(`span`,{className:`mt-1 block text-xs font-normal text-muted-foreground`,children:i(`Saved maps apply to every host.`)})]}),(0,H.jsxs)(`div`,{className:`mt-3 space-y-2`,children:[(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:i(`Keep a map after its sessions import. Every import checks the map before it skips a session, so removing a map makes its sessions unresolved again on the next run.`)}),(0,H.jsx)(q,{type:`button`,variant:`outline`,size:`sm`,disabled:_||!!w||!s||!l||d.size===0,onClick:P,children:i(`Save removals`)}),!l?.saved.length&&(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:i(`none`)}),LC(l?.saved??[]).map(e=>(0,H.jsxs)(`details`,{className:`min-w-0 border-t border-border pt-2`,children:[(0,H.jsxs)(`summary`,{className:`cursor-pointer rounded text-sm focus-visible:outline-2 focus-visible:outline-ring`,children:[(0,H.jsx)(`code`,{dir:`ltr`,className:`break-all`,children:e.target}),` `,`· `,e.maps.length]}),(0,H.jsx)(`ul`,{className:`mt-2 space-y-1 text-sm`,children:e.maps.map(e=>(0,H.jsxs)(`li`,{className:`flex min-w-0 items-start gap-2`,children:[(0,H.jsx)(`code`,{dir:`ltr`,className:`min-w-0 flex-1 break-all ${d.has(e.from)?`line-through`:``}`,children:e.from}),(0,H.jsx)(`button`,{type:`button`,className:`shrink-0 rounded border border-border px-2 py-0.5 text-xs`,"aria-label":`${d.has(e.from)?i(`Keep`):i(`Remove`)} ${e.from}`,disabled:_,onClick:()=>f(t=>{let n=new Set(t);return n.has(e.from)?n.delete(e.from):n.add(e.from),n}),children:d.has(e.from)?i(`Keep`):i(`Remove`)})]},e.from))})]},e.target))]})]}),(0,H.jsxs)(`details`,{className:`min-w-0 rounded-lg border border-border p-3`,children:[(0,H.jsxs)(`summary`,{className:`cursor-pointer rounded font-medium focus-visible:outline-2 focus-visible:outline-ring`,children:[(0,H.jsx)(`h3`,{className:`inline text-subsection-title font-semibold`,children:i(`Ignored directories`)}),` `,`· `,l?.ignored?.length??0,(0,H.jsx)(`span`,{className:`mt-1 block text-xs font-normal text-muted-foreground`,children:i(`Ignored directories stay unimported and leave the unresolved counts.`)})]}),(0,H.jsxs)(`ul`,{className:`mt-3 space-y-1 text-sm`,children:[!l?.ignored?.length&&(0,H.jsx)(`li`,{className:`text-muted-foreground`,children:i(`none`)}),l?.ignored?.map(e=>(0,H.jsxs)(`li`,{className:`flex min-w-0 items-start gap-2`,children:[(0,H.jsx)(`code`,{dir:`ltr`,className:`min-w-0 flex-1 break-all`,children:e}),(0,H.jsx)(`button`,{type:`button`,className:`shrink-0 rounded border border-border px-2 py-0.5 text-xs`,"aria-label":`${i(`Restore`)} ${e}`,disabled:_||!!w||!s,onClick:()=>I(e),children:i(`Restore`)})]},e))]})]})]}),e.map(t=>{let n=l?.[t]??[];return(0,H.jsx)(HC,{host:t,rows:n,decisions:p,busy:_||!!w||!s||!l,onDecide:A,onResolve:()=>k(t,n),onIgnore:ee,onIgnoreAll:()=>o({host:t,rows:RC(n)}),open:e.length===1},t)}),a&&(0,H.jsx)(WC,{host:a.host,rows:a.rows,busy:_,onConfirm:F,onCancel:()=>o(void 0)}),b&&(0,H.jsx)(UC,{host:b.host,review:b.review,busy:_,canConfirm:!w,error:i(S),onRefresh:()=>void L(),onClose:()=>{E.current||x(void 0)},onConfirm:e=>void ne(e)}),w&&!b&&(0,H.jsx)(`button`,{type:`button`,className:`rounded border border-border px-3 py-1.5 text-sm`,disabled:_,onClick:()=>void L(),children:i(`Refresh list`)}),h&&(0,H.jsx)(`p`,{role:`status`,className:`text-sm`,children:i(h)})]})}function qC(e){return!e||e.total<=0?null:{percent:e.percent,done:`${e.done.toLocaleString(`en-US`)} / ${e.total.toLocaleString(`en-US`)}`,minutesLeft:e.minutesLeft===null?`unknown`:`about ${e.minutesLeft}`}}function JC(e,t){return e??!t}function YC(e,t){let n=t.indexOf(`/`);if(t!==`inherit`&&t!==`external`&&(n<1||n===t.length-1))throw Error(`Enter a model as provider/model.`);return{[`${e}BackfillModel`]:t}}function XC(e,t){if(t?.state===`running`)return t.phase===`profile`?{kind:`learning-profile`,done:t.profileDone??0,total:t.profileTotal??0}:{kind:`running`};if(t?.paused)return{kind:`paused`};if(t?.state===`failed`&&(t.updatedAt??t.startedAt??0)>=(e?.updatedAt??0))return{kind:`failed`,error:t.error??e?.error??null};if(!e||e.state===`not-started`)return t?.state===`done`?{kind:`imported`}:{kind:`not-started`};let n=t?.state===`done`&&(e.counts.failed??0)>0;return e.state===`failed`&&!n?{kind:`failed`,error:e.error}:e.state===`running`?{kind:`running`}:e.counts.pending>0?{kind:`stopped`,pending:e.counts.pending}:e.counts.unresolved>0?{kind:`partly`,unresolved:e.counts.unresolved}:{kind:`imported`}}function ZC(e){return e?.state===`running`&&e.phase!==`profile`}function QC(e){return!e||e.state===`running`||!e.state||!e.updatedAt||!e.surface?null:{finishedAt:e.updatedAt,surface:e.surface,imported:e.imported??0,skipped:e.skipped??0,failed:e.failed??0,state:e.state}}function $C({host:e,backfill:t}){let n=Y(),{snapshot:r,lists:i,busy:a}=t,[o,s]=(0,v.useState)(),[c,l]=(0,v.useState)(),u=r?.settings??{},d=String(u[`${e}BackfillModel`]?.globalValue??`inherit`),f=o??d,p=i[e]?.models??[],m=JC(c,f===`inherit`||f===`external`||p.some(e=>`${e.provider}/${e.model}`===f)),h=Ox({memoryProvider:u.memoryProvider?.globalValue,memoryModel:u.memoryModel?.globalValue,memoryApiUrl:u.memoryApiUrl?.globalValue,keySet:!!r?.secrets?.memoryApiKey?.set});return(0,H.jsxs)(`section`,{className:`space-y-3 rounded-xl border border-border bg-card p-4`,"aria-label":`${am(e)} ${n(`settings`)}`,children:[(0,H.jsx)(`h2`,{className:`text-section-title font-semibold`,children:`${am(e)} ${n(`settings`)}`}),e===`claude-code`?(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n(`Claude Code backfill always uses the external API. It has no backfill model setting.`)}):(0,H.jsxs)(`div`,{className:`space-y-2 text-sm`,children:[(0,H.jsxs)(`label`,{className:`block`,children:[n(`Backfill model`),(0,H.jsx)(`div`,{dir:`ltr`,children:(0,H.jsxs)(Rr,{"aria-label":`${am(e)} ${n(`Backfill model`)}`,className:`mt-1 block w-full`,value:m?`typed`:f,onChange:e=>{l(e.target.value===`typed`),s(e.target.value)},children:[(0,H.jsx)(`option`,{value:`inherit`,children:n(`Same as live capture`)}),(0,H.jsx)(`option`,{value:`external`,disabled:h.length>0,children:n(`External API`)}),p.map(e=>(0,H.jsxs)(`option`,{value:`${e.provider}/${e.model}`,children:[e.name,` (`,e.provider,`/`,e.model,`)`]},`${e.provider}/${e.model}`)),(0,H.jsx)(`option`,{value:`typed`,children:n(`Manual provider/model`)})]})})]}),m&&(0,H.jsx)(`input`,{"aria-label":`${am(e)} ${n(`Manual provider/model`)}`,className:`w-full rounded-[10px] border border-border bg-card p-2`,dir:`ltr`,placeholder:`provider/model`,value:f===`typed`?``:f,onChange:e=>s(e.target.value)}),h.length>0&&(0,H.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[n(`External API needs`),`: `,h.join(`, `)]}),i[e]?.available===!1&&(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:i[e].reason?n(i[e].reason):n(`Model list unavailable. Enter provider/model manually.`)}),(0,H.jsx)(q,{type:`button`,variant:`outline`,size:`sm`,disabled:a||!r,onClick:()=>t.saveModel(e,f),children:n(`Save model`)})]}),(0,H.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,H.jsx)(`input`,{type:`checkbox`,checked:!!u.autoBackfill?.globalValue,disabled:a||!r,onChange:e=>void t.save({autoBackfill:e.target.checked})}),n(`Import past chats automatically`)]}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`This switch applies to every host. Automatic import makes model calls.`)})]})}var ew={pi:{kind:`default`},opencode:{kind:`default`},"claude-code":{kind:`default`}},tw=ew,nw=!1,rw=new Set,iw=e=>{tw=e;for(let e of rw)e()},aw=e=>(rw.add(e),()=>rw.delete(e));async function ow(e,t){let n=await X(e,t);iw({...ew,...n.hosts})}function sw(){let e=(0,v.useSyncExternalStore)(aw,()=>tw,()=>ew);return(0,v.useEffect)(()=>{nw||(nw=!0,ow(`/api/host-appearance`).catch(()=>{nw=!1}))},[]),{looks:e,setIcon:(e,t)=>ow(`/api/host-appearance/${e}`,{method:`PUT`,body:JSON.stringify({kind:`icon`,icon:t})}),setImage:(e,t)=>ow(`/api/host-appearance/${e}`,{method:`PUT`,body:JSON.stringify({kind:`image`,png:t})}),reset:e=>ow(`/api/host-appearance/${e}`,{method:`DELETE`})}}function cw({host:e,run:t,row:n}){let r=Y(),i=ZC(t)?qC(t):null,a=QC(t),o=XC(n,t),s=`${$d(e)}#host-unresolved`;return(0,H.jsxs)(`div`,{className:`space-y-2 text-sm`,children:[o.kind===`learning-profile`&&(0,H.jsxs)(`p`,{className:`text-muted-foreground`,children:[r(`All exchanges are done. Learning the profile from the imported prompts`),`:`,` `,o.done,` / `,o.total,` `,r(`batches`)]}),i&&(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsx)(`div`,{role:`progressbar`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":i.percent,"aria-label":r(`Import progress`),className:`h-2 w-full overflow-hidden rounded bg-muted`,children:(0,H.jsx)(`div`,{className:`h-full bg-primary`,style:{width:`${i.percent}%`}})}),(0,H.jsxs)(`p`,{className:`text-muted-foreground`,children:[i.percent,`% · `,i.done,` · `,r(`Minutes left`),`:`,` `,i.minutesLeft===`unknown`?r(`unknown`):i.minutesLeft.replace(`about`,r(`about`))]})]}),t?.state===`running`&&t.surface&&(0,H.jsx)(`p`,{className:`text-muted-foreground`,children:r(`started from ${t.surface}`)}),a&&(0,H.jsxs)(`p`,{className:`text-muted-foreground`,children:[r(`Last run`),`: `,wp(a.finishedAt),` · `,r(`started from ${a.surface}`),` `,`· `,r(a.state),` · `,r(`Imported`),`: `,a.imported,` · `,r(`Skipped`),`:`,` `,a.skipped,` · `,r(`Failed`),`: `,a.failed]}),n&&(0,H.jsxs)(`div`,{className:`space-y-1 text-muted-foreground`,children:[!a&&(0,H.jsxs)(`p`,{children:[r(`Imported`),`: `,n.counts.imported,` · `,r(`Skipped`),`: `,n.counts.skipped,` ·`,` `,r(`Failed`),`: `,n.counts.failed]}),(0,H.jsxs)(`p`,{children:[r(`Pending`),`: `,n.counts.pending,` · `,r(`Unresolved sessions`),`:`,` `,n.counts.unresolved,n.counts.unresolved>0&&(0,H.jsxs)(H.Fragment,{children:[` `,(0,H.jsx)(`a`,{className:`underline focus-visible:outline-2 focus-visible:outline-ring`,href:s,"aria-label":`${am(e)}: ${r(`Resolve missing project folders`)}`,onClick:e=>{e.preventDefault(),Em(s)},children:r(`Resolve missing project folders`)})]})]}),(0,H.jsxs)(`p`,{children:[r(`Model`),`: `,(0,H.jsx)(`bdi`,{dir:`ltr`,children:n.model??r(`none`)})]}),(0,H.jsxs)(`p`,{children:[r(`Cutoff`),`: `,wp(n.cutoff)]}),n.error&&(0,H.jsx)(`p`,{role:`alert`,children:n.error})]})]})}function lw(e){let{run:t,runNowUnavailable:n}=e,r=n===null,i=n!==null&&e.host!==`claude-code`,a={text:`{reason}`,params:{reason:n??``}},o=(e,t,n,r=!0)=>({state:e,action:{kind:t,enabled:r},sentence:n,offerExternal:!1});if(!e.setUp)return o(`not-set-up`,`setup`,{text:`This host is not set up on this machine.`});if(t?.state===`running`){if(t.paused)return o(`running`,`pause`,{text:`Pausing after the current exchange.`},!1);let e=t.minutesLeft;return o(`running`,`pause`,{text:e===null?`Importing {done} / {total}.`:`Importing {done} / {total}. About {minutes} min left.`,params:{done:t.done,total:t.total,...e===null?{}:{minutes:e}}})}if(t?.paused)return{...o(`paused`,`resume`,r?{text:`Paused. Resume to continue.`}:a,r),offerExternal:i};if(t?.state===`failed`)return{...o(`failed`,`retry`,r?{text:`Stopped: {error}`,params:{error:t.error??`unknown error`}}:a,r),offerExternal:i};if(!r||t?.state===`stopped`&&e.pending>0)return{...o(`stopped`,`resume`,r?{text:`{pending} still waiting to import.`,params:{pending:e.pending}}:a,r),offerExternal:i};let s=t?.state===`done`&&t.total===0,c;return c=s&&e.cutoff!==null?{text:`Automatic import is on. Nothing was waiting before {date}. Use Sessions below for newer chats.`,params:{date:e.formatDate(e.cutoff)}}:e.pending>0?{text:`{pending} still waiting to import.`,params:{pending:e.pending}}:{text:`Automatic import is on. Nothing is waiting.`},o(`running`,`pause`,c)}function uw(e){let{run:t}=e;if(!e.setUp)return{text:`Not set up`};if(t?.state===`running`)return{text:`Importing · {percent}%`,params:{percent:t.percent}};if(t?.paused)return{text:`Paused · {pending} pending`,params:{pending:e.pending}};if(t?.state===`failed`)return{text:`Failed`};if(e.runNowUnavailable!==null||t?.state===`stopped`&&e.pending>0)return{text:`Stopped · {pending} pending`,params:{pending:e.pending}};let n=t?.updatedAt&&t.state===`done`?e.formatDate(t.updatedAt):null,r=e.lastSaved===null?null:e.formatSaved(e.lastSaved);return n&&r?{text:`Running · history imported {date} · last saved {when}`,params:{date:n,when:r}}:n?{text:`Running · history imported {date}`,params:{date:n}}:r?{text:`Running · last saved {when}`,params:{when:r}}:{text:`Running`}}function dw(e,t){let n=e(t.text);return Object.entries(t.params??{}).reduce((e,[t,n])=>e.replaceAll(`{${t}}`,String(n)),n)}var fw={pi:`https://github.com/cmdaltctr/omms/blob/main/docs/pi-adapter.md`,opencode:`https://github.com/cmdaltctr/omms/blob/main/docs/opencode-adapter.md`,"claude-code":`https://github.com/cmdaltctr/omms/blob/main/docs/claude-code-adapter.md`},pw={"not-set-up":`Not set up`,running:`Running`,paused:`Paused`,failed:`Failed`,stopped:`Stopped`};function mw({host:e,statuses:t}){let n=Y(),{looks:r}=sw(),{backfill:i}=t,a=t.status(e),o=i.rows[e],s=i.runs?.[e]?.run??null,c=()=>{let t=a.action.kind;t===`pause`?i.control(e,`pause`):t===`resume`?i.control(e,`resume`):t===`retry`&&i.control(e,`run`)},l={setup:n(`How to set up`),pause:n(`Pause`),resume:n(`Resume`),retry:n(`Retry`)},u={pause:xt,resume:Et,retry:Ft,setup:Oe}[a.action.kind];return(0,H.jsxs)(`section`,{className:`space-y-3 rounded-xl border border-border bg-card p-4`,"aria-label":am(e),children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,H.jsx)(eh,{host:e,look:r[e]}),(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`h2`,{className:`text-page-title font-semibold`,children:am(e)}),(0,H.jsxs)(`p`,{className:V(`text-sm`,a.state===`failed`?`text-destructive-label`:`text-muted-foreground`),children:[n(`State`),`: `,n(pw[a.state])]})]})]}),(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[a.action.kind===`setup`?(0,H.jsx)(q,{asChild:!0,variant:`outline`,children:(0,H.jsxs)(`a`,{href:fw[e],target:`_blank`,rel:`noreferrer`,children:[(0,H.jsx)(Oe,{"aria-hidden":`true`}),l.setup]})}):(0,H.jsxs)(q,{type:`button`,disabled:i.busy||!a.action.enabled,onClick:c,children:[(0,H.jsx)(u,{"aria-hidden":`true`}),l[a.action.kind]]}),a.offerExternal&&(0,H.jsx)(q,{type:`button`,variant:`outline`,disabled:i.busy,onClick:()=>i.saveModel(e,`external`),children:n(`Use external API`)})]}),(0,H.jsx)(`p`,{className:`break-words text-sm text-muted-foreground`,role:`status`,children:dw(n,a.sentence)}),a.state!==`not-set-up`&&(0,H.jsx)(cw,{host:e,run:s,row:o}),i.message&&(0,H.jsx)(`p`,{role:`status`,className:`text-sm`,children:i.message}),a.action.kind!==`setup`&&(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`Importing makes model calls and can cost money.`)})]})}function hw(e,t,n){let r=!n&&e!==null&&e.revision===t.revision;return{page:r?{...t,listedAt:e.listedAt}:t,sameListing:r}}function gw(e,t){let n=0;return async r=>{let i=++n;try{let t=await r;i===n&&e(t)}catch(e){i===n&&t?.(e)}}}function _w(e){let t=document.getElementById(`directory-maps-${e}`),n=t?.parentElement;if(!t||!n){typeof window<`u`&&window.location&&Em(`${J.memory}#directory-maps-${e}`);return}n.open=!0,t.focus({preventScroll:!0}),t.scrollIntoView?.(mm)}function vw({badge:e,host:t}){let n=Y(),[r,i]=(()=>{switch(e.kind){case`imported`:return[`${n(`Imported`)} ✅`,`border-green-600/40 text-green-700`];case`partly`:return[`${n(`Partly imported`)} (${e.unresolved} ${n(`unresolved`)})`,`border-amber-500/50 text-amber-700`];case`running`:return[n(`Running`),`border-primary/50 text-primary`];case`learning-profile`:return[`${n(`Learning profile`)} ${e.done} / ${e.total}`,`border-primary/50 text-primary`];case`paused`:return[n(`Paused`),`border-border text-muted-foreground`];case`stopped`:return[`${n(`Stopped`)} (${e.pending} ${n(`pending`)})`,`border-amber-500/50 text-amber-700`];case`failed`:return[`${n(`Failed`)} ⛔️`,`border-red-600/40 text-red-700`];case`not-started`:return[n(`Not started`),`border-border text-muted-foreground`]}})(),a=V(`inline-block rounded-full border px-2 py-0.5 text-xs font-medium`,i);return e.kind===`partly`?(0,H.jsx)(`a`,{href:`/memory#directory-maps-${t}`,onClick:e=>{e.preventDefault(),_w(t)},"aria-label":`${am(t)}: ${n(`Resolve missing project folders`)}. ${r}`,className:V(a,`underline focus-visible:outline-2 focus-visible:outline-ring`),children:r}):(0,H.jsx)(`span`,{className:a,title:e.kind===`failed`&&e.error?e.error:void 0,children:r})}var yw=[`pi`,`opencode`,`claude-code`];function bw(){let e=Y(),[t,n]=(0,v.useState)({}),[r,i]=(0,v.useState)({});return(0,v.useEffect)(()=>{let e=gw(n),t=gw(i),r=()=>{e(X(`/api/settings/backfill`)),t(X(`/api/settings/backfill/runs`))};r();let a=setInterval(r,1e4),o=Cx(r);return()=>{clearInterval(a),o()}},[]),(0,H.jsx)(`div`,{className:`flex flex-wrap gap-2`,"aria-label":e(`Import status`),children:yw.map(e=>(0,H.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border border-border px-3 py-1.5 text-sm`,children:[(0,H.jsx)(`span`,{className:`font-medium`,children:am(e)}),(0,H.jsx)(vw,{host:e,badge:XC(t[e]??null,r[e]?.run??null)})]},e))})}function cee(e){let t=Y(),[n,r]=(0,v.useState)(``),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(null),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(``),f=`rounded border border-border px-3 py-1.5 text-sm disabled:opacity-50`;async function p(t){try{let n=await X(`/api/settings/imports/sources/validate`,{method:`POST`,body:JSON.stringify({host:e.host,path:t})});a(n),r(n.displayPath),e.onChoose(n),d(``)}catch(e){d(e.message)}}async function m(t){try{let n=await X(`/api/settings/imports/sources/browse`,{method:`POST`,body:JSON.stringify({host:e.host,...t?{path:t}:{}})});s(n),d(``)}catch(e){let t=e.message;/loopback/i.test(t)&&l(!0),d(t)}}function h(){a(null),r(``),s(null),e.onChoose(null)}return(0,H.jsxs)(`div`,{className:`space-y-2 text-sm`,children:[(0,H.jsxs)(`label`,{className:`block`,children:[e.host===`pi`?t(`Pi sessions folder or one .jsonl session file`):e.host===`claude-code`?t(`Claude Code transcripts folder`):t(`OpenCode database file`),(0,H.jsx)(`input`,{className:`mt-1 block w-full rounded border border-border bg-background p-2 font-mono`,dir:`ltr`,value:n,placeholder:t(`Absolute path, for example on a mounted volume`),onChange:e=>r(e.target.value)})]}),(0,H.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,H.jsx)(`button`,{type:`button`,className:f,disabled:!n.trim(),onClick:()=>void p(n.trim()),children:t(`Use this source`)}),!c&&(0,H.jsx)(`button`,{type:`button`,className:f,onClick:()=>void m(o?.path),children:t(`Browse`)}),i&&(0,H.jsx)(`button`,{type:`button`,className:f,onClick:h,children:t(`Use the default location`)})]}),i&&(0,H.jsxs)(`p`,{role:`status`,children:[t(`Chosen source`),`:`,` `,(0,H.jsx)(`bdi`,{dir:`ltr`,className:`font-mono break-all`,children:i.displayPath})]}),u&&(0,H.jsx)(`p`,{role:`alert`,children:u}),o&&(0,H.jsxs)(`div`,{className:`rounded border border-border p-2`,children:[(0,H.jsx)(`p`,{dir:`ltr`,className:`font-mono text-xs break-all`,children:o.path}),(0,H.jsxs)(`ul`,{className:`max-h-60 overflow-auto`,children:[o.parent&&(0,H.jsx)(`li`,{children:(0,H.jsx)(`button`,{type:`button`,className:`underline`,onClick:()=>void m(o.parent),children:`..`})}),o.entries.map(n=>(0,H.jsxs)(`li`,{className:`flex items-center gap-2`,children:[n.kind===`folder`?(0,H.jsx)(`button`,{type:`button`,className:`underline`,onClick:()=>void m(n.path),children:(0,H.jsxs)(`bdi`,{dir:`ltr`,children:[n.name,`/`]})}):(0,H.jsx)(`bdi`,{dir:`ltr`,className:`font-mono text-xs`,children:n.name}),(n.kind!==`folder`||e.host!==`opencode`)&&(0,H.jsx)(`button`,{type:`button`,className:`text-xs underline`,onClick:()=>void p(n.path),children:t(`Choose`)})]},n.path))]}),o.truncated&&(0,H.jsx)(`p`,{className:`text-xs`,children:t(`Only the first 500 entries are shown.`)})]})]})}function xw(e){let t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);return t?[Number(t[1]),Number(t[2])-1,Number(t[3])]:null}function Sw(e){let t=xw(e);return t?new Date(t[0],t[1],t[2],0,0,0,0).getTime():void 0}function Cw(e){let t=xw(e);return t?new Date(t[0],t[1],t[2],23,59,59,999).getTime():void 0}var ww=[`pi`,`opencode`,`claude-code`],Tw=()=>({mode:`ids`,picked:new Map});function lee(){let e=e=>({enabled:e,source:null,page:null,listedWith:``,selection:Tw(),modelChoice:`external`});return{hosts:{pi:e(!0),opencode:e(!1),"claude-code":e(!1)},scope:`current-project`,project:``,maps:``,since:``,until:``,profileBatch:``,force:!1,memories:!0,profile:!0,skills:!0,showHandled:!1}}var uee=[`scope`,`project`,`memories`,`profile`,`skills`,`force`,`showHandled`];function Ew(e,t){let n={...e,...t};if(uee.every(t=>n[t]===e[t]))return n;let r={...n.hosts};for(let e of ww)r[e]={...r[e],page:null,listedWith:``,selection:Tw()};return{...n,hosts:r}}function Dw(e,t){return JSON.stringify([e.hosts[t].source?.sourceToken,e.scope,e.project,e.maps,e.memories,e.profile,e.skills,e.force,e.showHandled])}function dee(e){return{skipMemories:e.skills||!e.memories,skipProfile:e.skills||!e.profile,force:e.force,includeHandled:e.showHandled||e.force,...e.skills&&!e.memories&&!e.profile?{skillTurnsOnly:!0}:{}}}function Ow(e,t){let n=e.hosts[t].page;return n?n.total-(e.scope===`all-projects`?n.unresolvedCount:0):0}function kw(e,t){let n=e.hosts[t].selection;return n.mode===`all`?Ow(e,t)-n.excluded.size:n.picked.size}function Aw(e,t){if(!t.selectable||!t.directory)return e;if(e.mode===`all`){let n=new Set(e.excluded);return n.has(t.key)?n.delete(t.key):n.add(t.key),{mode:`all`,excluded:n}}let n=new Map(e.picked);return n.has(t.key)?n.delete(t.key):n.set(t.key,t.directory),{mode:`ids`,picked:n}}function jw(e){return e.split(`
|
|
129
|
-
`).map(e=>e.trim()).filter(Boolean).map(e=>{let t=e.indexOf(`=`);if(t<1||t===e.length-1)throw Error(`Directory maps must be old=new, one per line`);return{from:e.slice(0,t),to:e.slice(t+1)}})}function Mw(e){if(!e.memories&&!e.profile&&!e.skills)return`Choose at least one output.`;if(!ww.some(t=>e.hosts[t].enabled))return`Choose at least one host.`;try{jw(e.maps);let t=e.since?Sw(e.since):void 0,n=e.until?Cw(e.until):void 0;if(t!==void 0&&n!==void 0&&t>n)return`Prompt date from must not be after Prompt date to.`}catch(e){return e.message}return e.profileBatch&&(!Number.isInteger(Number(e.profileBatch))||Number(e.profileBatch)<1)?`Profile batch size must be a positive integer.`:null}function Nw(e,t){let n=Mw(e);if(n)throw Error(n);return{hosts:ww.filter(t=>e.hosts[t].enabled).map(t=>{let n=e.hosts[t];if(!n.page||n.listedWith!==Dw(e,t))throw Error(`Options changed. Refresh the session list first.`);let r=n.selection;return{host:t,source:n.page.source.sourceToken,modelChoice:n.modelChoice||void 0,selection:r.mode===`all`||Ow(e,t)===0?{mode:`all`,excludedKeys:r.mode===`all`?[...r.excluded]:[],revision:n.page.revision,listedAt:n.page.listedAt,...e.showHandled||e.force?{includeHandled:!0}:{}}:{mode:`ids`,sessions:[...r.picked].map(([e,t])=>({key:e,directory:t})),listedAt:n.page.listedAt}}}),options:{dryRun:t,force:e.force,skipMemories:!e.memories,skipProfile:!e.profile,skipSkills:!e.skills,scope:e.scope,...e.scope===`current-project`&&e.project?{project:e.project}:{},...e.since?{since:Sw(e.since)}:{},...e.until?{until:Cw(e.until)}:{},...e.profileBatch?{profileBatch:Number(e.profileBatch)}:{},pathMaps:jw(e.maps)}}}function Pw(e){return JSON.stringify({...e,hosts:ww.filter(t=>e.hosts[t].enabled).map(t=>{let n=e.hosts[t];return{host:t,...n,selection:n.selection.mode===`all`?{mode:`all`,excluded:[...n.selection.excluded].sort()}:{mode:`ids`,picked:[...n.selection.picked].sort()}}})})}var Fw=`${J.settings}#settings-section-skill-learning`,Iw=`mt-1 block w-full min-w-0 rounded border border-border bg-background p-2`,Lw=`rounded border border-border px-3 py-1.5 text-sm disabled:opacity-50`;function Rw({draft:e,skillRecording:t,advanced:n,onChange:r,onAdvanced:i}){let a=Y();return(0,H.jsxs)(`div`,{className:`space-y-3`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap gap-4 text-sm`,children:[(0,H.jsxs)(`label`,{children:[(0,H.jsx)(`input`,{type:`checkbox`,"aria-label":a(`Project memories`),checked:e.memories,onChange:e=>r({memories:e.target.checked})}),` `,a(`Project memories`)]}),(0,H.jsxs)(`label`,{children:[(0,H.jsx)(`input`,{type:`checkbox`,"aria-label":a(`User profile`),checked:e.profile,onChange:e=>r({profile:e.target.checked})}),` `,a(`User profile`),` `,a(`(preferences, patterns, and workflows)`)]}),(0,H.jsxs)(`label`,{children:[(0,H.jsx)(`input`,{type:`checkbox`,"aria-label":a(`Skill turns`),checked:t&&e.skills,disabled:!t,onChange:e=>r({skills:e.target.checked})}),` `,a(`Skill turns`)]})]}),!t&&(0,H.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[a(`Skill turns are recorded only while Record agent turns is on.`),` `,(0,H.jsx)(`a`,{className:`underline`,href:Fw,onClick:e=>{e.preventDefault(),Em(Fw)},children:a(`Open the Skill learning card`)})]}),(0,H.jsxs)(`label`,{className:`block text-sm`,children:[a(`Scope`),(0,H.jsx)(`div`,{className:Lr,children:(0,H.jsxs)(Rr,{"aria-label":a(`Scope`),className:Iw,value:e.scope,onChange:e=>r({scope:e.target.value}),children:[(0,H.jsx)(`option`,{value:`current-project`,children:a(`Current project`)}),(0,H.jsx)(`option`,{value:`all-projects`,children:a(`All projects`)})]})})]}),(0,H.jsxs)(`label`,{className:`block text-sm`,children:[(0,H.jsx)(`input`,{type:`checkbox`,"aria-label":a(`Show handled sessions`),checked:e.showHandled,onChange:e=>r({showHandled:e.target.checked})}),` `,a(`Show handled sessions`)]}),(0,H.jsx)(`button`,{type:`button`,className:Lw,onClick:i,"aria-expanded":n,children:a(n?`Hide advanced options`:`Advanced options`)}),(0,H.jsxs)(`div`,{hidden:!n,className:`space-y-3 rounded-lg border border-border p-3`,children:[(0,H.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[e.scope===`current-project`&&(0,H.jsxs)(`label`,{className:`text-sm`,children:[a(`Project directory`),(0,H.jsx)(`input`,{"aria-label":a(`Project directory`),className:`mt-1 block w-full min-w-0 rounded border border-border bg-background p-2`,dir:`ltr`,value:e.project,placeholder:a(`Current directory`),onChange:e=>r({project:e.target.value})})]}),[[`Prompt date from`,`since`],[`Prompt date to`,`until`],[`Profile batch size`,`profileBatch`]].map(([t,n])=>(0,H.jsxs)(`label`,{className:`text-sm`,children:[a(t),(0,H.jsx)(`input`,{"aria-label":a(t),type:n===`profileBatch`?`text`:`date`,inputMode:n===`profileBatch`?`numeric`:void 0,className:Iw,value:e[n],onChange:e=>r({[n]:e.target.value})})]},n))]}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:a(`Prompt dates are inclusive, use your time zone, and filter the turns inside each session, not the list. Empty dates include every turn.`)}),(0,H.jsxs)(`label`,{className:`block text-sm`,children:[a(`Directory maps (old=new, one per line)`),(0,H.jsx)(`textarea`,{"aria-label":a(`Directory maps (old=new, one per line)`),dir:`ltr`,className:Iw,rows:2,value:e.maps,onChange:e=>r({maps:e.target.value})})]}),(0,H.jsxs)(`label`,{className:`block text-sm`,children:[(0,H.jsx)(`input`,{type:`checkbox`,"aria-label":a(`Re-analyse handled history`),checked:e.force,onChange:e=>r({force:e.target.checked})}),` `,a(`Re-analyse handled history`)]}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:a(`Re-analysis applies to the selected outputs. Each profile prompt can be forcibly re-analysed once. Findings merge into the existing profile.`)})]})]})}function zw({host:e,draft:t,readiness:n,advanced:r,listing:i,onChange:a,onList:o,onUnresolved:s}){let c=Y(),l=t.hosts[e],u=l.page,d=u&&l.listedWith!==Dw(t,e),f=Ow(t,e),p=e=>l.selection.mode===`all`?!l.selection.excluded.has(e.key):l.selection.picked.has(e.key),m={recorded:c(`recorded`),mapped:c(`mapped`),worktree:c(`project root`),unresolved:c(`missing`)},h=e===`pi`&&n?.piReader.available===!1;return(0,H.jsxs)(`section`,{hidden:!l.enabled,"aria-label":am(e),className:`space-y-3 rounded-lg border border-border p-3 min-w-0`,children:[(0,H.jsx)(`h3`,{className:`text-subsection-title font-semibold`,children:am(e)}),(0,H.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[c(`Source`),`:`,` `,(0,H.jsx)(`bdi`,{dir:`ltr`,className:`break-all`,children:l.source?.displayPath??u?.source.displayPath??c(`default location`)})]}),h&&(0,H.jsx)(`p`,{role:`alert`,children:c(n?.piReader.reason??`Pi session reader is unavailable. Fix the reader or deselect Pi.`)}),e===`claude-code`&&n?.claudeCode&&(0,H.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[c(`Claude Code transcripts`),`:`,` `,(0,H.jsx)(`bdi`,{dir:`ltr`,className:`font-mono break-all`,children:n.claudeCode.defaultRoot}),` `,`(`,c(n.claudeCode.defaultRootFound?`found`:`not found`),`).`,` `,c(`Claude Code imports always use the external API.`)]}),(0,H.jsx)(`div`,{hidden:!r,children:(0,H.jsx)(cee,{host:e,onChoose:e=>a({source:e})})}),(0,H.jsx)(`button`,{type:`button`,className:Lw,disabled:i||h,onClick:()=>o(0,!0),children:c(u?`Refresh list`:`List sessions`)}),d&&(0,H.jsx)(`p`,{role:`status`,className:`text-sm`,children:c(`Options changed. Refresh the session list first.`)}),u&&t.scope===`current-project`&&u.unresolvedCount>0&&(0,H.jsxs)(`p`,{className:`text-sm`,children:[c(`Sessions with directories that no longer exist`),`: `,u.unresolvedCount,`.`,` `,(0,H.jsx)(`button`,{type:`button`,className:`underline`,onClick:s,children:c(`Show them and add a directory map`)})]}),u&&(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-sm`,children:[(0,H.jsxs)(`span`,{role:`status`,children:[c(`Selected`),`: `,kw(t,e),` / `,f]}),(0,H.jsxs)(`button`,{type:`button`,className:`rounded border border-border px-3 py-1.5 text-sm disabled:opacity-50`,disabled:f===0,onClick:()=>a({selection:{mode:`all`,excluded:new Set}}),children:[c(`Select all matching`),` (`,f,`)`]}),(0,H.jsx)(`button`,{type:`button`,className:`rounded border border-border px-3 py-1.5 text-sm disabled:opacity-50`,onClick:()=>a({selection:Tw()}),children:c(`Clear selection`)})]}),(0,H.jsxs)(`div`,{className:`max-w-full overflow-x-auto`,children:[(0,H.jsxs)(`table`,{className:`w-full text-start text-sm`,children:[(0,H.jsx)(`thead`,{children:(0,H.jsx)(`tr`,{className:`text-muted-foreground`,children:[`Select`,`Created`,`Session`,`Project directory`,`Resolved by`].map(e=>(0,H.jsx)(`th`,{className:`p-1`,children:c(e)},e))})}),(0,H.jsx)(`tbody`,{children:u.rows.map(t=>(0,H.jsxs)(`tr`,{className:`border-t border-border`,children:[(0,H.jsx)(`td`,{className:`p-1`,children:(0,H.jsx)(`input`,{type:`checkbox`,"aria-label":`${am(e)}: ${c(`Select`)} ${t.sessionId??t.key}`,checked:t.selectable&&p(t),disabled:!t.selectable,onChange:()=>a({selection:Aw(l.selection,t)})})}),(0,H.jsx)(`td`,{className:`p-1 whitespace-nowrap`,children:t.createdAt?wp(t.createdAt):`—`}),(0,H.jsxs)(`td`,{className:`p-1 font-mono text-xs`,children:[(0,H.jsx)(`bdi`,{dir:`ltr`,children:t.sessionId??t.key}),t.handled&&(0,H.jsx)(`span`,{className:`ms-2 rounded border border-border px-1 font-sans text-muted-foreground`,children:c(`Handled`)})]}),(0,H.jsx)(`td`,{className:`p-1 font-mono text-xs break-all`,children:(0,H.jsx)(`bdi`,{dir:`ltr`,children:t.directory??t.recordedDirectory??`—`})}),(0,H.jsx)(`td`,{className:`p-1`,children:m[t.via]})]},t.key))})]}),u.total===0&&(0,H.jsx)(`p`,{className:`text-sm`,children:c(`No sessions match.`)}),(u.hiddenHandled??0)>0&&(0,H.jsxs)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:[c(`Handled sessions hidden`),`: `,u.hiddenHandled]})]}),(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-sm`,children:[(0,H.jsx)(`button`,{type:`button`,className:`rounded border border-border px-3 py-1.5 text-sm disabled:opacity-50`,disabled:i||u.offset===0,onClick:()=>o(Math.max(0,u.offset-50),!1),children:c(`Previous`)}),(0,H.jsxs)(`span`,{children:[u.total?u.offset+1:0,`–`,Math.min(u.offset+50,u.total),` /`,` `,u.total]}),(0,H.jsx)(`button`,{type:`button`,className:`rounded border border-border px-3 py-1.5 text-sm disabled:opacity-50`,disabled:i||u.offset+50>=u.total,onClick:()=>o(u.offset+50,!1),children:c(`Next`)})]})]}),(0,H.jsxs)(`label`,{className:`block text-sm`,children:[c(`Import model`),(0,H.jsx)(`div`,{dir:`ltr`,children:(0,H.jsxs)(Rr,{"aria-label":c(`Import model`),className:Iw,value:l.modelChoice,onChange:e=>a({modelChoice:e.target.value}),children:[(0,H.jsx)(`option`,{value:``,children:c(`None`)}),e!==`claude-code`&&n?.opencode.models.map(e=>(0,H.jsxs)(`option`,{value:`${e.provider}/${e.model}`,children:[e.name,` (`,e.provider,`/`,e.model,`)`]},`${e.provider}/${e.model}`)),(0,H.jsxs)(`option`,{value:`external`,children:[c(`Saved external API`),n&&n.external.state!==`ready`?` (${c(`not ready`)})`:``]})]})})]}),e!==`claude-code`&&n&&!n.opencode.available&&(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:c(`An import with an OpenCode signed-in model runs from the terminal or with /import in OpenCode.`)}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:c(`Configured, not tested.`)})]})}var Bw=`omms-memory-import-hosts`;function Vw(e,t){try{let n=t??localStorage,r=ww.filter(t=>e.hosts[t].enabled);n.setItem(Bw,JSON.stringify({hosts:r,scope:e.scope,skills:e.skills}))}catch{}}function Hw(e,t){try{let n=t??localStorage,r=JSON.parse(n.getItem(`omms-memory-import-hosts`)??`null`);if(!r||typeof r!=`object`)return e;let{hosts:i,scope:a,skills:o}=r;return Array.isArray(i)&&i.length>0&&i.every(e=>ww.includes(e))&&(a===`current-project`||a===`all-projects`)?{...e,scope:a,skills:typeof o==`boolean`?o:e.skills,hosts:Object.fromEntries(ww.map(t=>[t,{...e.hosts[t],enabled:i.includes(t)}]))}:e}catch{return e}}var Uw={"missing-model":`The external API has no memoryModel in the global config`,"missing-url":`The external API has no memoryApiUrl in the global config`,"missing-key":`The external API key is missing in the OpenCode process; check memoryApiKey and its env:// or file:// source`,"unsupported-provider":`The memoryProvider in the global config is not supported for imports`};function Ww(e,t,n,r){return!t.memories&&!t.profile?null:e.map(e=>{let i=t.hosts[e].modelChoice,a=null;return n?i?i===`external`&&n.external.state!==`ready`?a=Uw[n.external.state]??`The external API is not ready`:e===`claude-code`&&i!==`external`?a=`Claude Code imports use the external API. Complete the external API settings.`:i!==`external`&&!n.opencode.models.some(e=>`${e.provider}/${e.model}`===i)&&(a=`No import model is ready. Connect a model in OpenCode or complete the external API settings.`):a=`No import model is ready. Connect a model in OpenCode or complete the external API settings.`:a=`Model readiness is unknown. Reload the page.`,a?`${am(e)}: ${r(a)}`:null}).find(Boolean)??null}var Gw=[`running`,`cancelling`],Kw=[`done`,`failed`,`cancelled`];function qw(e){if(!e||e.dryRun||!Gw.includes(e.state))return null;let t=e.hosts?.find(e=>e.state===`running`);if(!t)return null;let n=t.phase===`profile`,r=(n?t.profileProcessed:t.processed)??0,i=(n?t.profileTotal:t.total)??0;return{host:t.host,phase:n?`profile`:t.phase===`skill-turns`?`skill-turns`:`memory`,done:r,total:i,percent:i>0?Math.min(100,Math.floor(r*100/i)):0}}function Jw(e,t,n){return!t||t.dryRun||!Kw.includes(t.state)||t.state===`cancelled`||t.id===n?`none`:e?e.id===t.id&&Kw.includes(e.state)?`none`:`dialog`:`banner`}function Yw(e){return e?e.hosts?.length?e.hosts.reduce((e,t)=>e+(t.summary?.unitsFailed??0),0):e.summary?.unitsFailed??0:0}function Xw(e){return e.hosts?.find(e=>e.error)?.error??e.error}var Zw=`Could not reload the settings. Reload the page.`;async function Qw(e,t){let[n]=await Promise.all([e(),t().catch(()=>{})]);return n===null?Zw:null}var $w=`omms.import.dismissedEnd`;function eT(){try{return window.localStorage.getItem($w)}catch{return null}}function tT(e){try{window.localStorage.setItem($w,e)}catch{}}function nT(e,t){let n=e.summary,r=n?.profile;return[[`sessions`,e.sessions],[`Memory units`,n?.unitsTotal??e.total],[`Pending memory units`,n?.unitsWouldImport],[`Imported memory units`,n?.unitsImported],[`Already handled memory units`,n?.unitsAlreadyHandled],[`Skipped memory units`,n?.unitsSkipped],[`Failed memory units`,n?.unitsFailed],[`Held-back turns`,n?.unitsHeldBack],[`Untimed turns`,n?.unitsUntimed],[`Skill turns to record`,n?.skillTurnsWouldRecord],[`Skill turns already recorded`,n?.skillTurnsAlreadyRecorded],[`Skill turns recorded`,n?.skillTurnsRecorded],[`Skill turns already present`,n?.skillTurnsAlreadyPresent],[`Load errors`,n?.loadErrors],[`Profile prompts`,r?r.promptsRecorded+r.promptsWouldRecord:void 0],[`Already handled profile prompts`,r?.promptsAlreadyHandled],[`Profile batches`,r?.batchesBuilt],[`Estimated profile analysis calls`,e.profileEstimate?.analysisCalls],[`Waiting prompts inside OMMS`,e.profileEstimate?.waitingPrompts],[`Unresolved sessions`,n?.unresolved]].filter(([,e])=>e!==void 0).map(([e,n])=>`${t(String(e))}: ${n}`).join(` · `)}function rT(e,t){let n=e.match(/^(Pi|OpenCode|Claude Code): /),r=n?e.slice(n[0].length):e,i=`Refresh the preview and retry.`,a=r.endsWith(` ${i}`),o=a?r.slice(0,-31):r,s=a&&/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*\.$/.test(o),c=t(o);return(0,H.jsxs)(H.Fragment,{children:[n&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`bdi`,{dir:`ltr`,children:n[1]}),`: `]}),s?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`bdi`,{dir:`ltr`,children:o.slice(0,-1)}),`.`]}):c===o?(0,H.jsx)(`bdi`,{dir:`ltr`,children:o}):c.split(/(Pi|OpenCode|Claude Code)/).map((e,t)=>/^(Pi|OpenCode|Claude Code)$/.test(e)?(0,H.jsx)(`bdi`,{dir:`ltr`,children:e},t):e),a&&(0,H.jsxs)(H.Fragment,{children:[` `,t(i)]})]})}function iT({job:e}){let t=Y();if(!e)return null;let n=e.hosts??(e.host?[{...e,host:e.host}]:[]);return(0,H.jsxs)(`div`,{role:`status`,className:`space-y-3 text-sm`,"aria-label":t(`Import results`),children:[(0,H.jsxs)(`p`,{children:[t(e.dryRun?`Preview (dry run)`:`Import`),` · `,t(e.state),e.activeHost&&(0,H.jsxs)(H.Fragment,{children:[` `,`· `,t(`Current host`),`: `,am(e.activeHost)]})]}),(0,H.jsxs)(`p`,{children:[t(`Combined counts`),`: `,nT(e,t)]}),(0,H.jsx)(`ul`,{className:`space-y-2`,children:n.map(e=>(0,H.jsxs)(`li`,{className:`rounded border border-border p-2`,children:[(0,H.jsxs)(`p`,{children:[am(e.host),` ·`,` `,t(e.state===`no-work`?`No work to process`:e.state),e.phase&&(0,H.jsxs)(H.Fragment,{children:[` `,`·`,` `,t(e.phase===`profile`?`Learning profile`:e.phase===`preparing`?`preparing`:e.phase===`skill-turns`?`Skill turns`:`Memory extraction`)]})]}),e.phase===`profile`?(0,H.jsxs)(`p`,{children:[t(`Profile batches`),`: `,e.profileProcessed??0,`/`,e.profileTotal??0]}):(e.phase===`memory`||e.phase===`skill-turns`)&&e.total!==void 0&&(0,H.jsxs)(`p`,{children:[t(e.phase===`skill-turns`?`Skill turns`:`Memory units`),`:`,` `,e.processed??0,`/`,e.total]}),(0,H.jsx)(`p`,{children:nT(e,t)}),(e.error||e.blocker)&&(0,H.jsx)(`p`,{role:`alert`,children:rT(e.error??e.blocker,t)}),e.report&&(0,H.jsx)(`pre`,{dir:`ltr`,className:`max-w-full overflow-auto whitespace-pre-wrap break-words rounded bg-background p-2 text-xs`,children:e.report})]},e.host))}),e.error&&(0,H.jsx)(`p`,{role:`alert`,children:rT(e.error,t)}),e.report&&(0,H.jsx)(`pre`,{dir:`ltr`,className:`max-w-full overflow-auto whitespace-pre-wrap break-words rounded bg-background p-2 text-xs`,children:e.report}),e.dryRun&&(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t(`Analysis calls are an estimate. Matching, deduplication, retries, and newly waiting prompts can add calls.`)})]})}function aT({job:e}){let t=Y(),n=e.state===`failed`,r=Xw(e),i=Yw(e);return(0,H.jsxs)(`div`,{className:`space-y-2 text-sm`,children:[n&&r&&(0,H.jsx)(`p`,{role:`alert`,children:rT(r,t)}),i>0&&(0,H.jsxs)(`p`,{children:[t(`Failed memory units`),`: `,i]}),!n&&(0,H.jsx)(`p`,{className:`text-muted-foreground`,children:nT({summary:{unitsImported:e.summary?.unitsImported,unitsFailed:e.summary?.unitsFailed??0}},t)})]})}function oT({job:e,onReload:t}){let n=Y(),r=(0,v.useRef)(null),[i,a]=(0,v.useState)(null);(0,v.useEffect)(()=>{if(!e)return;let t=Jw(r.current,e,eT());r.current=e,t!==`none`&&a({job:e,view:t})},[e]);let o=()=>{i&&tT(i.job.id),a(null)},s=i?n(i.job.state===`failed`?`Import failed`:`Import successful 🎉`):``;return(0,H.jsxs)(H.Fragment,{children:[e?.state===`cancelled`&&!e.dryRun&&(0,H.jsx)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:n(`Import cancelled`)}),i?.view===`banner`&&(0,H.jsxs)(`div`,{role:`status`,className:`flex flex-wrap items-start justify-between gap-2 rounded-lg border border-border bg-card p-3`,children:[(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsx)(`p`,{className:`text-sm font-semibold`,children:s}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`The import finished while you were away.`)}),(0,H.jsx)(aT,{job:i.job})]}),(0,H.jsx)(q,{variant:`outline`,size:`sm`,onClick:o,children:n(`Dismiss`)})]}),(0,H.jsx)(Du,{open:i?.view===`dialog`,onOpenChange:e=>{e||(o(),t())},children:(0,H.jsxs)(Au,{showCloseButton:!1,className:i?.job.state===`failed`?`border-destructive/40`:void 0,children:[(0,H.jsxs)(ju,{children:[(0,H.jsx)(Nu,{children:s}),(0,H.jsx)(Pu,{className:`sr-only`,children:s})]}),i&&(0,H.jsx)(aT,{job:i.job}),(0,H.jsx)(Mu,{children:(0,H.jsx)(q,{autoFocus:!0,onClick:()=>{o(),t()},children:n(`OK`)})})]})})]})}var sT={memory:`Memory units`,"skill-turns":`Skill turns`,profile:`Profile batches`};function cT({job:e}){let t=Y(),n=qw(e);return n?(0,H.jsxs)(`div`,{className:`space-y-1 text-sm`,children:[(0,H.jsx)(`div`,{role:`progressbar`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":n.percent,"aria-label":t(`Import progress`),className:`h-2 w-full overflow-hidden rounded bg-muted`,children:(0,H.jsx)(`div`,{className:`h-full bg-green-600`,style:{width:`${n.percent}%`}})}),(0,H.jsxs)(`p`,{className:`text-muted-foreground`,children:[(0,H.jsx)(`bdi`,{dir:`ltr`,children:am(n.host)}),` · `,t(sT[n.phase]),`: `,n.done,` /`,` `,n.total,` · `,n.percent,`%`]})]}):null}var lT=[`queued`,`preparing`,`running`,`cancelling`];function uT(e){return e&&lT.includes(e.state)?e:null}function dT(e,t){if(!e||!t)return e;if(!e.hosts)return e.host===t?e:null;let n=e.hosts.find(e=>e.host===t);if(!n)return null;if(e.hosts.length===1)return e;let r=e.hosts.some(e=>e.state===`failed`||e.error);return{...e,state:n.state,activeHost:e.activeHost===t?t:null,error:n.error??(r?void 0:e.error),sessions:n.sessions,processed:n.processed,total:n.total,summary:n.summary,profileEstimate:n.profileEstimate,hosts:[n]}}function fT(e){return Cx(()=>e())}function pT({profilePreset:e=0,host:t}={}){let n=Y(),[r,i]=(0,v.useState)(()=>{let e=lee();if(!t)return Hw(e);for(let n of ww)e.hosts[n].enabled=n===t;return e}),{snapshot:a}=DC(),o=a?.settings?.skillLearning?.value===!0,s=e=>o?e:{...e,skills:!1},c=s(r),[l,u]=(0,v.useState)(!1),[d,f]=(0,v.useState)(null),[p,m]=(0,v.useState)(null),[h,g]=(0,v.useState)(null),[_,y]=(0,v.useState)({}),[b,x]=(0,v.useState)(!1),[S,C]=(0,v.useState)(``),w=(0,v.useRef)(!1),T=(0,v.useRef)({pi:0,opencode:0,"claude-code":0}),E=(0,v.useRef)(!0),D=(0,v.useRef)(Tx()),O=Pw(c),k=(0,v.useRef)(O);k.current=O;let A=dT(p,t),j=ww.filter(e=>c.hosts[e].enabled),M=t?[t]:ww,N=(0,v.useRef)(r.skills);(0,v.useEffect)(()=>{t||Vw({...r,skills:N.current})},[r,t]);let P=p?.state===`running`||p?.state===`cancelling`||p?.state===`preparing`||p?.state===`queued`;function ee(e=!1){let t=D.current.begin();return X(`/api/settings/imports/current`).then(n=>{E.current&&t()&&m(e?uT(n.job):n.job)})}(0,v.useEffect)(()=>{E.current=!0;let e=()=>{g(null),X(`/api/settings/imports/readiness`).then(e=>{E.current&&f(e)}).catch(()=>{E.current&&f(null)})};e(),ee(!0).catch(()=>{});let t=fT(e);return()=>{E.current=!1,t()}},[]);function F(){Qw(Sx,ee).then(e=>{E.current&&e&&C(e)})}(0,v.useEffect)(()=>{if(!P)return;let e=setInterval(()=>{w.current||ee().catch(e=>{E.current&&C(e.message)})},1e3);return()=>clearInterval(e)},[P]),(0,v.useEffect)(()=>{e&&(i(e=>Ew(e,{memories:!1,profile:!0,skills:!1,force:!0})),g(null))},[e]);function I(e){e.skills!==void 0&&(N.current=e.skills),g(null),i(t=>Ew(t,e))}function te(e,t){g(null),i(n=>({...n,hosts:{...n.hosts,[e]:{...n.hosts[e],...t}}}))}async function L(e,t,n){let r=++T.current[e],a=Dw(c,e);g(null),y(t=>({...t,[e]:!0}));try{let o=await X(`/api/settings/imports/sessions`,{method:`POST`,body:JSON.stringify({host:e,...c.hosts[e].source?{source:c.hosts[e].source.sourceToken}:{},scope:c.scope,...c.scope===`current-project`&&c.project?{project:c.project}:{},pathMaps:jw(c.maps),offset:t,limit:50,refresh:n,...dee(c)})});if(!E.current||T.current[e]!==r)return;i(t=>{if(Dw(s(t),e)!==a)return t;let r=t.hosts[e],i=hw(r.page,o,n);return{...t,hosts:{...t.hosts,[e]:{...r,page:i.page,listedWith:a,selection:i.sameListing?r.selection:Tw()}}}}),C(``)}catch(t){E.current&&T.current[e]===r&&C(t.message)}finally{E.current&&T.current[e]===r&&y(t=>({...t,[e]:!1}))}}let ne=Mw(c),re=j.some(e=>e===`pi`&&d?.piReader.available===!1),R=j.map(e=>{let t=c.hosts[e];return t.page?t.listedWith===Dw(c,e)?Ow(c,e)>0&&kw(c,e)===0?`${am(e)}: ${n(`Select at least one session.`)}`:t.selection.mode===`ids`&&t.selection.picked.size>1e3?`${am(e)}: ${n(`Select at most 1000 sessions one by one, or use Select all matching.`)}`:null:`${am(e)}: ${n(`Options changed. Refresh the session list first.`)}`:`${am(e)}: ${n(`List sessions first.`)}`}).find(Boolean),ie=Ww(j,c,d,n),ae=!!(h&&h.fingerprint===O&&h.id===p?.id&&p.dryRun&&p.state===`done`&&!p.error&&!p.hosts?.some(e=>e.error||e.blocker||[`failed`,`cancelled`,`not-run`].includes(e.state))),oe=b||P||j.some(e=>_[e])||re||!!(ne||R);async function se(e){if(w.current||oe||!e&&(!ae||ie))return;if(!e){let e=[c.memories&&n(`Project memories`),c.profile&&n(`User profile`),c.skills&&n(`Skill turns`)].filter(Boolean).join(` · `),t=j.map(e=>`${am(e)}: ${c.hosts[e].modelChoice===`external`?`${n(`Saved external API`)} (${d?.external.provider}/${d?.external.model})`:c.hosts[e].modelChoice}`).join(`
|
|
130
|
-
`);if((c.memories||c.profile)&&!window.confirm([n(`This import makes model calls. Continue?`),j.map(am).join(` · `),n(c.scope===`current-project`?`Current project`:`All projects`),c.project,e,t,nT(p??{},n),...(p?.hosts??[]).map(e=>`${am(e.host)}: ${nT(e,n)}`)].filter(Boolean).join(`
|
|
131
|
-
`)))return}w.current=!0,D.current.begin(),x(!0);let t=O;g(null);try{let n=await X(`/api/settings/imports`,{method:`POST`,body:JSON.stringify(Nw(c,e))});if(!E.current)return;m(n),e&&t===k.current&&g({id:n.id,fingerprint:t}),C(``)}catch(e){E.current&&C(e.message),ee().catch(()=>{})}finally{w.current=!1,E.current&&x(!1)}}async function ce(){if(!w.current){w.current=!0,D.current.begin();try{let e=await X(`/api/settings/imports/current/cancel`,{method:`POST`,body:`{}`});E.current&&m(e.job)}catch(e){E.current&&C(e.message)}finally{w.current=!1}}}return(0,H.jsxs)(`section`,{className:`space-y-3 rounded-xl border border-border bg-card p-4 min-w-0`,"aria-label":n(t?`Sessions`:`Import chat history`),children:[(0,H.jsx)(`h2`,{className:`text-section-title font-semibold`,children:n(t?`Sessions`:`Import chat history`)}),!t&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n(`Conversations populate project facts. User prompts populate personal preferences, recurring patterns, and workflow steps.`)}),(0,H.jsxs)(`p`,{className:`flex flex-wrap gap-3 text-sm`,children:[(0,H.jsx)(`a`,{className:`underline`,href:J.project,onClick:e=>{e.preventDefault(),Em(J.project)},children:n(`Project memories`)}),(0,H.jsx)(`a`,{className:`underline`,href:J.profile,onClick:e=>{e.preventDefault(),Em(J.profile)},children:n(`User profile`)}),(0,H.jsx)(`a`,{className:`underline`,href:`${J.settings}#settings-section-profiles`,onClick:e=>{e.preventDefault(),Em(`${J.settings}#settings-section-profiles`)},children:n(`Profile identity in Settings`)})]}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`Hosts keep their existing user identities. All hosts does not merge profiles with different identities.`)}),(0,H.jsx)(bw,{}),(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 text-sm`,children:[ww.map(e=>(0,H.jsxs)(`label`,{children:[(0,H.jsx)(`input`,{type:`checkbox`,"aria-label":am(e),checked:c.hosts[e].enabled,onChange:t=>te(e,{enabled:t.target.checked})}),` `,am(e)]},e)),(0,H.jsx)(`button`,{type:`button`,className:`rounded border border-border px-3 py-1.5 text-sm disabled:opacity-50`,onClick:()=>I({hosts:{pi:{...c.hosts.pi,enabled:!0},opencode:{...c.hosts.opencode,enabled:!0},"claude-code":{...c.hosts[`claude-code`],enabled:!0}}}),children:n(`All hosts`)}),(0,H.jsxs)(`span`,{role:`status`,children:[n(`Selected hosts`),`: `,j.length]})]})]}),(0,H.jsx)(Rw,{draft:c,skillRecording:o,advanced:l,onChange:I,onAdvanced:()=>u(e=>!e)}),M.map(e=>(0,H.jsx)(zw,{host:e,draft:c,readiness:d,advanced:l,listing:!!_[e],onChange:t=>te(e,t),onList:(t,n)=>L(e,t,n),onUnresolved:()=>{I({scope:`all-projects`}),u(!0)}},e)),ne&&(0,H.jsx)(`p`,{role:`alert`,children:n(ne)}),!P&&(R||ie)&&(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:R??ie}),!ae&&!P&&(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`Preview the current selection before starting an import.`)}),(0,H.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,H.jsx)(`button`,{type:`button`,className:Lw,disabled:oe,onClick:()=>se(!0),children:n(`Preview (dry run)`)}),(0,H.jsx)(`button`,{type:`button`,className:Lw,disabled:oe||!ae||!!ie,onClick:()=>se(!1),children:n(`Start import`)}),P&&(0,H.jsx)(`button`,{type:`button`,className:`rounded border border-border px-3 py-1.5 text-sm disabled:opacity-50`,disabled:p?.state===`cancelling`,onClick:()=>ce(),children:n(`Cancel after current unit`)})]}),S&&(0,H.jsx)(`p`,{role:`alert`,children:rT(S,n)}),(0,H.jsx)(cT,{job:A}),(0,H.jsx)(oT,{job:A,onReload:F}),(0,H.jsx)(iT,{job:A})]})}var mT=3e5,hT=null,gT,_T=new Set,vT=new Set;async function yT(e){try{hT=await X(`/api/memory/write-health${e?`?fresh=1`:``}`)}catch{}for(let e of[..._T,...vT])e()}function bT(e){return _T.add(e),_T.size===1&&(yT(!1),gT=setInterval(()=>{document.hidden||yT(!1)},mT)),()=>{_T.delete(e),_T.size===0&&clearInterval(gT)}}function xT(){return{health:(0,v.useSyncExternalStore)(bT,()=>hT,()=>null),recheck:()=>yT(!0)}}function ST(e){return vT.add(e),()=>vT.delete(e)}function CT(){return(0,v.useSyncExternalStore)(ST,()=>hT,()=>null)}function wT({host:e,onClose:t}){let n=Y(),{looks:r,setIcon:i,setImage:a,reset:o}=sw();return(0,H.jsx)(Hm,{title:`${n(`Change icon`)}: ${am(e)}`,look:r[e],renderAvatar:t=>(0,H.jsx)(eh,{host:e,look:t}),onClose:t,onSave:async t=>{t!==null&&(t.kind===`reset`?await o(e):t.kind===`icon`?await i(e,t.icon):await a(e,t.png))}})}function TT({view:e,line:t,warning:n,notSetUp:r,current:i,compact:a}){let o=Y(),{looks:s}=sw(),[c,l]=(0,v.useState)(!1),u=e===`shared`?null:e,d=u?am(u):o(`Shared`),f=$d(e),p=u?(0,H.jsx)(eh,{host:u,look:s[u],className:a?`size-8`:void 0}):(0,H.jsx)(th,{className:a?`size-8`:void 0});return(0,H.jsxs)(`div`,{className:`relative h-full min-w-0`,children:[(0,H.jsxs)(`a`,{href:f,"aria-current":i?`page`:void 0,onClick:e=>{e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||(e.preventDefault(),Em(f))},className:V(`flex h-full min-w-0 flex-col gap-3 rounded-xl border bg-card p-4 text-start transition-colors duration-150 hover:bg-interactive-hover focus-visible:outline-2 focus-visible:outline-ring focus-visible:outline-offset-2`,a&&`flex-row items-center gap-2 p-2 pe-10`,n?`border-[var(--status-warning)]`:`border-border`,i&&`bg-sidebar-accent`,r&&`opacity-70`),children:[p,(0,H.jsxs)(`span`,{className:`min-w-0 space-y-1`,children:[(0,H.jsx)(`span`,{className:`block break-words text-subsection-title font-semibold`,children:d}),(0,H.jsx)(`span`,{className:`block break-words text-xs text-muted-foreground`,children:n?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`span`,{className:`font-medium text-status-warning`,children:o(`Memories not saved`)}),!a&&(0,H.jsx)(`span`,{className:`block`,children:n})]}):t})]})]}),u&&(0,H.jsx)(q,{type:`button`,variant:`ghost`,size:a?`icon-xs`:`icon-sm`,className:`absolute end-2 top-2`,"aria-label":`${o(`Change icon`)}: ${d}`,title:o(`Change icon`),onClick:()=>l(!0),children:(0,H.jsx)(wt,{"aria-hidden":`true`})}),c&&u&&(0,H.jsx)(wT,{host:u,onClose:()=>l(!1)})]})}function ET({current:e,statuses:t}){let n=Y(),{health:r}=xT(),i=r&&!r.ok?r.reason??``:null;return(0,H.jsx)(`nav`,{"aria-label":n(`Memory views`),children:(0,H.jsx)(`ul`,{className:`grid grid-cols-2 gap-2 lg:grid-cols-4`,children:Qd.map(r=>{let a=r===`shared`?null:r,o=a?t.line(a):{text:`Every host`};return(0,H.jsx)(`li`,{className:`min-w-0`,children:(0,H.jsx)(TT,{compact:!0,view:r,current:r===e,line:dw(n,o),warning:a&&t.input(a).setUp?i:null,notSetUp:a?!t.input(a).setUp:!1})},r)})})})}function DT({reason:e,checking:t,onCheck:n}){let r=Y();return(0,H.jsxs)(`div`,{role:`alert`,className:`flex flex-wrap items-center gap-x-3 gap-y-2 rounded-xl border border-[var(--status-warning)] bg-card p-3 text-sm`,children:[(0,H.jsx)(Xt,{className:`size-4 shrink-0 text-status-warning`,"aria-hidden":`true`}),(0,H.jsxs)(`p`,{className:`min-w-0 flex-1 break-words`,children:[(0,H.jsx)(`span`,{className:`font-medium`,children:r(`Memories are not being saved.`)}),` `,e?/[.!?]$/.test(e)?e:`${e}.`:``,` `,r(`Fix the service named here, then press Check again.`)]}),(0,H.jsx)(q,{type:`button`,variant:`outline`,size:`sm`,disabled:t,onClick:n,children:r(`Check again`)})]})}function OT(){let{health:e,recheck:t}=xT(),[n,r]=(0,v.useState)(!1);return!e||e.ok?null:(0,H.jsx)(DT,{reason:e.reason,checking:n,onCheck:()=>{r(!0),t().finally(()=>r(!1))}})}function kT({host:e,statuses:t,profilePreset:n}){let r=Y(),i=!t.input(e).setUp;return(0,H.jsxs)(`div`,{className:`space-y-6`,children:[(0,H.jsx)(ET,{current:e,statuses:t}),(0,H.jsx)(OT,{}),(0,H.jsx)(mw,{host:e,statuses:t}),i?(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`${am(e)}: ${r(`OMMS did not find this host's chat history on this computer. Install the host and use it once, then reload this page.`)}`}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(pT,{host:e,profilePreset:n}),(0,H.jsx)(KC,{hosts:[e],saved:!1,title:`Sessions that need a folder`,anchorId:`host-unresolved`}),(0,H.jsx)($C,{host:e,backfill:t.backfill})]})]})}var AT=`project architecture, setup, conventions and key decisions`,jT=10,MT={opening:!1,query:AT,subagent:!0,restore:!0,limit:String(jT)};function NT(e){let t=t=>e?.[t]?.globalValue,n=(e,n)=>typeof t(e)==`boolean`?t(e):n,r=t(`compaction.memoryLimit`),i=t(`openingContextQuery`);return{opening:n(`openingContext`,MT.opening),query:typeof i==`string`?i:MT.query,subagent:n(`subagentMemory`,MT.subagent),restore:n(`compaction.enabled`,MT.restore),limit:typeof r==`number`?String(r):MT.limit}}function PT(e){let t=e.trim();if(!/^\d+$/.test(t))return;let n=Number(t);return Number.isSafeInteger(n)&&n>0?n:void 0}function FT(e){return PT(e.limit)===void 0?`limit`:e.query.trim().length>500?`query`:null}function IT(e,t){if(FT(e))return{};let n={};e.opening!==t.opening&&(n.openingContext=e.opening===MT.opening?null:e.opening);let r=e.query.trim();r!==t.query.trim()&&(n.openingContextQuery=r===`project architecture, setup, conventions and key decisions`?null:r),e.subagent!==t.subagent&&(n.subagentMemory=e.subagent===MT.subagent?null:e.subagent),e.restore!==t.restore&&(n[`compaction.enabled`]=e.restore===MT.restore?null:e.restore);let i=PT(e.limit);return i!==PT(t.limit)&&(n[`compaction.memoryLimit`]=i===jT?null:i),n}function LT(e,t){return Object.keys(IT(e,t)).length>0}function RT(){let e=Y(),[t,n]=(0,v.useState)(),[r,i]=(0,v.useState)(MT),[a,o]=(0,v.useState)(!1),[s,c]=(0,v.useState)(),l=(0,v.useRef)(!1),u=(0,v.useRef)(MT),d=(0,v.useRef)(r);d.current=r,(0,v.useEffect)(()=>{let e=!0,t=e=>{let t=NT(e.settings),r=JSON.stringify(d.current)===JSON.stringify(u.current);u.current=t,n(e),r&&i(t)},r=xx();X(`/api/settings`).then(n=>{e&&r.isCurrent()&&t(n)}).catch(()=>{e&&c({kind:`load-failed`})});let a=Cx(n=>{e&&t(n)});return()=>{e=!1,a()}},[]);let f=FT(r),p=LT(r,u.current),m=e=>i(t=>({...t,...e}));async function h(){if(!t||!p||l.current)return;l.current=!0,o(!0);let e;try{await X(`/api/settings`,{method:`PATCH`,body:JSON.stringify({edits:IT(r,u.current),revision:t.revision})})}catch(t){e=t}let n=await Sx()!==null;o(!1),l.current=!1,c(e?{kind:`save-failed`,message:e.message,reloaded:n}:{kind:`saved`,reloaded:n})}function g(t){if(t.kind===`load-failed`)return e(`The memory injection settings could not be loaded. Reload the page to try again.`);if(t.kind===`saved`)return t.reloaded?e(`Saved. The next session uses these options.`):wx(e(`Saved. The next session uses these options.`),e(`Reload the page before saving again.`));let n=t.reloaded?e(`Current settings were reloaded; check the values and save again.`):e(`The current settings could not be reloaded. Reload the page.`);return wx(e(t.message),n)}let _=`${r.query.length} / 500`;return(0,H.jsxs)(`section`,{id:`memory-injection`,className:`scroll-mt-20 space-y-3 rounded-xl border border-border bg-card p-4`,"aria-label":e(`Memory injection`),children:[(0,H.jsx)(`h2`,{className:`text-section-title font-semibold`,children:e(`Memory injection`)}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`Sets how OMMS adds memories to the context the model sees.`)}),(0,H.jsxs)(Xp,{tone:`success`,children:[(0,H.jsx)(`p`,{children:e(`Memories are added at these moments:`)}),(0,H.jsxs)(`ul`,{className:`list-disc space-y-1 ps-5`,children:[(0,H.jsx)(`li`,{children:e(`With every message: the memories that match that message. On by default. chatMessage.enabled in the config file turns it off, and the first-message and subagent options with it.`)}),(0,H.jsx)(`li`,{children:e(`With the first message of a new session: the memories that match the query below. Needs the first switch.`)}),(0,H.jsx)(`li`,{children:e(`For a subagent: the memories that match its task. Claude Code adds them once, when the subagent starts. OpenCode V2 and Pi add them with each prompt the subagent gets. Needs the Subagent memory switch.`)}),(0,H.jsx)(`li`,{children:e(`After a compaction or resume: the memories that session captured. Needs the Restore switch.`)})]}),(0,H.jsx)(`p`,{children:e(`Nothing is added when a new session opens.`)})]}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`A project config can turn the first-message and subagent options off. It can turn restore on or off.`)}),(0,H.jsxs)(`form`,{className:`space-y-4`,onSubmit:e=>{e.preventDefault(),h()},children:[(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`input`,{type:`checkbox`,id:`injection-opening`,role:`switch`,checked:r.opening,disabled:a,"aria-describedby":`injection-opening-help`,onChange:e=>m({opening:e.target.checked})}),(0,H.jsx)(nm,{htmlFor:`injection-opening`,children:e(`Inject memories with the first message`)})]}),(0,H.jsx)(`p`,{id:`injection-opening-help`,className:`text-xs text-muted-foreground`,children:e(`Added once, with the first message of a new session. Nothing is added when a new session opens. OMMS searches the query below and adds only matching memories.`)}),(0,H.jsx)(Xp,{tone:`info`,children:(0,H.jsx)(`p`,{children:e(`Claude Code can add memories when a session opens. Pi and OpenCode V2 cannot. To keep all three the same, OMMS adds them with the first message on every host.`)})})]}),(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(nm,{htmlFor:`injection-query`,children:e(`First-message search query`)}),(0,H.jsx)(gg,{id:`injection-query`,maxLength:500,rows:3,disabled:a,value:r.query,"aria-invalid":f===`query`||void 0,"aria-describedby":`injection-query-count`,onChange:e=>m({query:e.target.value})}),(0,H.jsx)(`span`,{id:`injection-query-count`,dir:`ltr`,className:`block text-xs tabular-nums text-muted-foreground`,children:_})]}),(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`input`,{type:`checkbox`,id:`injection-subagent`,role:`switch`,checked:r.subagent,disabled:a,"aria-describedby":`injection-subagent-help`,onChange:e=>m({subagent:e.target.checked})}),(0,H.jsx)(nm,{htmlFor:`injection-subagent`,children:e(`Subagent memory`)})]}),(0,H.jsx)(`p`,{id:`injection-subagent-help`,className:`text-xs text-muted-foreground`,children:e(`Subagents get memories that match their task. Claude Code adds them once, at start. OpenCode V2 and Pi add them with each subagent prompt. No rows are shown for them.`)}),(0,H.jsx)(Xp,{tone:`warning`,children:(0,H.jsx)(`p`,{children:e(`Applies to OpenCode V2, Pi and Claude Code. On Pi, a subagent gets memory only when its agent maps the OMMS extension in om-pi-subagents. Turn it on in /omps-settings, Agent capabilities, Memory.`)})})]}),(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`input`,{type:`checkbox`,id:`injection-restore`,role:`switch`,checked:r.restore,disabled:a,onChange:e=>m({restore:e.target.checked})}),(0,H.jsx)(nm,{htmlFor:`injection-restore`,children:e(`Restore memories after compaction or resume`)})]}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`Added when a session resumes or compacts. Restores the memories that session captured.`)}),(0,H.jsx)(nm,{htmlFor:`injection-limit`,children:e(`Most memories to restore`)}),(0,H.jsx)(Jd,{type:`number`,id:`injection-limit`,className:`w-36 tabular-nums`,inputMode:`numeric`,step:1,min:1,disabled:a,value:r.limit,"aria-invalid":f===`limit`||void 0,"aria-describedby":`injection-limit-help`,onChange:e=>m({limit:e.target.value})}),(0,H.jsx)(`span`,{id:`injection-limit-help`,className:`block text-xs ${f===`limit`?`text-red-600`:`text-muted-foreground`}`,children:e(`Enter a positive whole number.`)})]}),(0,H.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,H.jsx)(q,{type:`submit`,disabled:a||!t||!p,children:e(`Save`)}),(0,H.jsx)(q,{type:`button`,variant:`outline`,disabled:a,onClick:()=>i(MT),children:e(`Reset to default`)})]})]}),s&&(0,H.jsx)(`p`,{role:`status`,className:`text-sm`,children:g(s)})]})}function zT({statuses:e,profilePreset:t}){let n=Y(),{health:r}=xT(),[i,a]=(0,v.useState)(!1),o=r&&!r.ok?r.reason??``:null;return(0,H.jsxs)(`div`,{className:`space-y-8`,children:[(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n(`Choose a host to see its history import, sessions and settings.`)}),(0,H.jsx)(`ul`,{className:`grid grid-cols-2 items-stretch gap-3 lg:grid-cols-4`,children:Qd.map(t=>{let r=t===`shared`?null:t,i=r?e.line(r):{text:`Settings for every host`};return(0,H.jsx)(`li`,{className:`min-w-0`,children:(0,H.jsx)(TT,{view:t,line:dw(n,i),warning:r&&e.input(r).setUp?o:null,notSetUp:r?!e.input(r).setUp:!1})},t)})}),(0,H.jsxs)(`section`,{className:`space-y-3`,"aria-label":n(`Import all hosts`),children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,H.jsx)(q,{type:`button`,variant:`outline`,"aria-expanded":i,"aria-controls":`memory-import-all`,onClick:()=>a(e=>!e),children:n(`Import all hosts`)}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`Runs one import for every host you tick. It makes model calls and can cost money.`)})]}),(0,H.jsx)(`div`,{id:`memory-import-all`,hidden:!i,children:i&&(0,H.jsx)(pT,{profilePreset:t})})]}),(0,H.jsx)(RT,{})]})}var BT=[{value:`boost`,label:`Boost (default)`},{value:`rrf`,label:`Rank fusion (experimental)`}];function VT(e){return e===`boost`||e===`rrf`}function HT(e){return VT(e)?e:`boost`}function UT(e){return{keywordMode:e}}function WT(e){let t=t=>{let n=e[t]?.value;return typeof n==`string`&&n.trim().length>0};return e.rerankerEnabled?.value===!0&&t(`rerankerApiUrl`)&&t(`rerankerModel`)}function GT(){let e=Y(),[t,n]=(0,v.useState)(),[r,i]=(0,v.useState)(`boost`),[a,o]=(0,v.useState)(!1),[s,c]=(0,v.useState)(),l=(0,v.useRef)(!1),u=(0,v.useRef)(void 0);(0,v.useEffect)(()=>{let e=!0,t=xx();X(`/api/settings`).then(r=>{e&&t.isCurrent()&&(u.current=r,n(r),i(HT(r.settings.keywordMode?.globalValue)))}).catch(()=>{e&&c({kind:`load-failed`})});let r=Cx(t=>{if(!e)return;let r=u.current,a=t;u.current=a,n(a),i(e=>!r||e===HT(r.settings.keywordMode?.globalValue)?HT(a.settings.keywordMode?.globalValue):e)});return()=>{e=!1,r()}},[]);let d=HT(t?.settings.keywordMode?.globalValue),f=t?.settings.keywordMode?.source===`project`,p=t?WT(t.settings):!1;async function m(){if(!t||l.current)return;l.current=!0,o(!0);let e=!1,n=!1;try{await X(`/api/settings`,{method:`PATCH`,body:JSON.stringify({edits:UT(r),revision:t.revision})}),e=!0}catch(e){n=e?.message?.includes(`Config changed`)===!0}let i=await Sx()!==null;o(!1),l.current=!1,c(n?{kind:`save`,ok:e,reloaded:i,stale:n}:{kind:`save`,ok:e,reloaded:i})}function h(t){if(t.kind===`load-failed`)return e(`The keyword matching setting could not be loaded. Reload the page to try again.`);let n=t.reloaded?e(`Current settings were reloaded; check the values and save again.`):e(`The current settings could not be reloaded. Reload the page.`);return t.stale?wx(e(`Config changed. Reload settings and save again.`),n):t.ok?e(`Saved. New searches use this mode.`):wx(e(`The keyword matching setting could not be saved. Reload the page to try again.`),n)}return(0,H.jsxs)(`section`,{className:`space-y-3 rounded-xl border border-border bg-card p-4`,"aria-label":e(`Keyword matching`),children:[(0,H.jsx)(`h2`,{className:`text-section-title font-semibold`,children:e(`Keyword matching`)}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`Search finds memories by meaning and by exact words from your prompt.`)}),(0,H.jsxs)(`form`,{className:`space-y-3`,onSubmit:e=>{e.preventDefault(),m()},children:[(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(nm,{htmlFor:`keyword-mode`,children:e(`Word matching mode`)}),(0,H.jsx)(`div`,{className:`w-72 max-w-full`,children:(0,H.jsx)(Rr,{id:`keyword-mode`,className:`w-full`,value:r,disabled:a,onChange:e=>{VT(e.target.value)&&i(e.target.value)},children:BT.map(t=>(0,H.jsx)(`option`,{value:t.value,children:e(t.label)},t.value))})}),(0,H.jsx)(`span`,{id:`keyword-mode-help`,className:`block text-xs text-muted-foreground`,children:`keywordMode`})]}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(r===`rrf`?`Rank fusion merges a list by meaning and a list by words. A memory that contains a word of your prompt can be returned even when its meaning score is below the similarity threshold. Experimental: it has not been shown to find more relevant memories.`:`Boost adds a small score bonus to memories that contain a word of your prompt.`)}),p&&r===`rrf`&&(0,H.jsx)(`p`,{className:`text-xs text-amber-600`,children:e(`Rank fusion is not used while the reranker is on. Search uses the boost.`)}),f&&(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`A project file can override this setting. This page edits the global value.`)}),(0,H.jsxs)(`div`,{className:`flex gap-2`,children:[(0,H.jsx)(q,{type:`submit`,disabled:a||!t||r===d,children:e(`Save`)}),(0,H.jsx)(q,{type:`button`,variant:`outline`,disabled:a||r===d,onClick:()=>i(d),children:e(`Cancel`)})]})]}),s&&(0,H.jsx)(`p`,{role:`status`,className:`text-sm`,children:h(s)})]})}var KT=[{key:`maxMemories`,id:`memory-maxMemories`,default:10,unit:`Results`,affects:`Maximum memory search results. Manual searches can request fewer; prompt retrieval uses this ceiling.`,min:1,max:2**53-1,accepted:`Enter a positive whole number.`,kind:`integer`},{key:`autoCaptureMaxContextBytes`,id:`memory-autoCaptureMaxContextBytes`,default:131072,unit:`Bytes`,affects:`Conversation input sent to the memory-summary model through the shared capture pipeline. Smaller values can omit conversation text.`,min:16384,max:16777216,accepted:`Enter a whole number from 16,384 to 16,777,216.`,kind:`integer`},{key:`userProfileMaxContextBytes`,id:`memory-userProfileMaxContextBytes`,default:32768,unit:`Bytes`,affects:`OpenCode profile-learning input. Smaller values can omit prompts from that input. This control does not limit the other hosts' profile input.`,min:1024,max:16777216,accepted:`Enter a whole number from 1,024 to 16,777,216.`,kind:`integer`},{key:`retrievalMaxTokens`,id:`memory-retrievalMaxTokens`,default:2e3,unit:`Approximate tokens`,affects:`Automatic memory context, including profile text and formatting, added to agent requests across all hosts. Smaller values can show fewer or shorter memories.`,min:256,max:65536,accepted:`Enter a whole number from 256 to 65,536.`,kind:`integer`},{key:`similarityThreshold`,id:`memory-similarityThreshold`,default:.6,unit:`Similarity score`,affects:`Lowest score a memory needs to be returned by search. Lower values return more memories, including less relevant ones. Higher values can return none. The default depends on the embedder.`,min:0,max:1,accepted:`Enter a number from 0 to 1.`,kind:`decimal`}];[...KT.flatMap(e=>[e.unit,e.affects,e.accepted])];function qT(e,t){let n=typeof t==`string`?t.trim():``;if(!n||!/^-?\d+(\.\d+)?$/.test(n))return;let r=Number(n);if(!(e.kind===`integer`&&!Number.isInteger(r)))return r>=e.min&&r<=e.max?r:void 0}function JT(e){return e.toLocaleString(`en-US`)}function YT(e,t,n){let r=t[e.key];return typeof r==`string`?r:String(n[e.key]??e.default)}function XT(e,t){let n=!1;for(let r of KT){let i=e[r.key];if(typeof i!=`string`)continue;let a=qT(r,i);if(a===void 0)return!1;a!==(t[r.key]??r.default)&&(n=!0)}return n}function ZT(e,t){let n={};if(!XT(e,t))return n;for(let r of KT){let i=e[r.key];if(typeof i!=`string`)continue;let a=qT(r,i);a!==(t[r.key]??r.default)&&(n[r.key]=a)}return n}var QT=`Config changed. Reload settings and save again.`;function $T(e){if(e===`Config changed. Reload settings and save again.`)return{kind:`stale`};let t=KT.map(e=>e.key.replace(/\./g,`\\.`)).join(`|`),n=RegExp(`^Invalid (${t}) setting\\b`).exec(e);return n?{kind:`invalid`,key:n[1]}:{kind:`unknown`}}function eE(){let e=Y(),[t,n]=(0,v.useState)(),[r,i]=(0,v.useState)({}),[a,o]=(0,v.useState)(!1),[s,c]=(0,v.useState)(),l=(0,v.useRef)(!1);(0,v.useEffect)(()=>{let e=!0,t=xx();X(`/api/settings`).then(r=>{e&&t.isCurrent()&&n(r)}).catch(()=>{e&&c({kind:`load-failed`})});let r=Cx(t=>{e&&n(t)});return()=>{e=!1,r()}},[]);let u={},d={};for(let e of KT){let n=t?.settings[e.key];u[e.key]=typeof n?.globalValue==`number`?n.globalValue:void 0,d[e.key]=typeof n?.default==`number`?n.default:e.default}let f=XT(r,u),p=`~/.config/omms/omms.jsonc`,m=e(`Edit ~/.config/omms/omms.jsonc directly to set these limits without the web UI.`).split(p);async function h(){if(!t||!f||l.current)return;let e=ZT(r,u);Object.keys(e).length&&await _(e)}async function g(e){!t||a||l.current||t.settings[e]?.hasGlobal&&await _({[e]:null})}async function _(e){if(!t||l.current)return;l.current=!0,o(!0);let n=!1,r;try{await X(`/api/settings`,{method:`PATCH`,body:JSON.stringify({edits:e,revision:t.revision})}),n=!0}catch(e){r=e}let a=await Sx()!==null;o(!1),l.current=!1,n?(i(t=>{let n={...t};for(let t of Object.keys(e))delete n[t];return n}),c({kind:`saved`,reloaded:a})):c({kind:`save-failed`,failure:$T(r?.message??``),reloaded:a})}function y(t){if(t.kind===`load-failed`)return e(`The memory settings could not be loaded. Reload the page to try again.`);if(t.kind===`saved`)return t.reloaded?e(`Saved. New memory operations use these limits.`):`${e(`Saved. New memory operations use these limits.`)} ${e(`Reload the page before saving again.`)}`;let n=t.reloaded?e(`Current settings were reloaded; check the values and save again.`):e(`The current settings could not be reloaded. Reload the page.`);if(t.failure.kind===`stale`)return wx(e(QT),n);if(t.failure.kind===`invalid`){let r=t.failure,i=KT.find(e=>e.key===r.key);return wx(`${e(`Invalid setting`)} ${i.key}: ${e(i.accepted)}`,n)}return wx(e(`The memory settings could not be saved.`),n)}return(0,H.jsxs)(`section`,{className:`space-y-3 rounded-xl border border-border bg-card p-4`,"aria-label":e(`Memory limits`),children:[(0,H.jsx)(`h2`,{className:`text-section-title font-semibold`,children:e(`Memory limits`)}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`Byte limits count UTF-8 bytes.`)}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`Approximate tokens are estimated as ceil(UTF-8 bytes / 4). A provider can count more or fewer tokens for the same text.`)}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`These controls do not delete stored data, set a spending limit, limit model replies, or control Graphify output.`)}),(0,H.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[m[0],(0,H.jsx)(`code`,{dir:`ltr`,children:p}),m[1]]}),(0,H.jsxs)(`form`,{className:`space-y-3`,onSubmit:e=>{e.preventDefault(),h()},children:[(0,H.jsx)(`div`,{className:CS,children:(0,H.jsxs)(`table`,{className:`w-full min-w-[56rem] text-sm`,children:[(0,H.jsx)(`caption`,{className:`sr-only`,children:e(`Memory limits`)}),(0,H.jsx)(`thead`,{className:TS,children:(0,H.jsx)(`tr`,{children:[`Setting`,`Value`,`Default`,`Unit`,`Affects`].map(t=>(0,H.jsx)(`th`,{className:ES,children:e(t)},t))})}),(0,H.jsx)(`tbody`,{children:KT.map(n=>{let o=r[n.key],s=YT(n,r,u),c=typeof o==`string`&&qT(n,o)===void 0,l=t?.settings[n.key],f=l?.source===`project`,p=l?.hasGlobal===!0,m=p&&typeof l?.globalValue==`number`&&l.globalValue!==d[n.key];return(0,H.jsxs)(`tr`,{className:DS,children:[(0,H.jsxs)(`td`,{className:OS,children:[(0,H.jsx)(`code`,{dir:`ltr`,children:n.key}),f&&(0,H.jsxs)(`div`,{className:`mt-1 space-y-0.5 text-xs text-amber-600`,children:[(0,H.jsxs)(`p`,{children:[e(`Effective value`),`: `,String(l?.value??``),` (`,e(`project`),`)`]}),(0,H.jsx)(`p`,{children:e(`Project override is active. Changes to the global file may not take effect here.`)}),(0,H.jsx)(`p`,{children:e(`The project value stays in force. Saving edits the global file only.`)})]})]}),(0,H.jsxs)(`td`,{className:OS,children:[(0,H.jsx)(`input`,{type:`number`,id:`${n.id}-input`,className:`w-36 tabular-nums`,inputMode:n.kind===`decimal`?`decimal`:`numeric`,step:n.kind===`decimal`?.01:1,min:n.min,max:n.max,"aria-label":`${n.key} ${e(`Value`)}`,"aria-describedby":`${n.id}-help`,"aria-invalid":c||void 0,disabled:a,value:s,onChange:e=>i(t=>({...t,[n.key]:e.target.value}))}),(0,H.jsx)(`span`,{id:`${n.id}-help`,className:`block text-xs ${c?`text-red-600`:`text-muted-foreground`}`,children:e(n.accepted)}),(0,H.jsx)(`button`,{type:`button`,"data-reset":n.key,className:`mt-1 block text-xs underline`,disabled:a||!p,"aria-label":`${n.key} ${e(`Reset to default`)}`,onClick:()=>void g(n.key),children:e(`Reset to default`)})]}),(0,H.jsxs)(`td`,{className:`${OS} tabular-nums`,children:[JT(d[n.key]),m&&(0,H.jsx)(`span`,{className:`block text-xs text-amber-600`,children:e(`Differs from default`)})]}),(0,H.jsx)(`td`,{className:OS,children:e(n.unit)}),(0,H.jsx)(`td`,{className:OS,children:e(n.affects)})]},n.key)})})]})}),(0,H.jsxs)(`div`,{className:`flex gap-2`,children:[(0,H.jsx)(`button`,{type:`submit`,disabled:a||!t||!f,onClick:()=>void h(),children:e(`Save memory limits`)}),(0,H.jsx)(`button`,{type:`button`,disabled:a,onClick:()=>i({}),children:e(`Cancel`)})]})]}),s&&(0,H.jsx)(`p`,{role:`status`,className:`text-sm`,children:y(s)})]})}var tE=`Enter a whole number from 50 to 100000.`;function nE(e){let t=e.trim();if(!/^\d+$/.test(t))return{ok:!1,message:tE};let n=Number(t);return n<50||n>1e5?{ok:!1,message:tE}:{ok:!0,value:n}}function rE(e,t){let n=nE(t);return n.ok?n.value===e?{kind:`none`}:{kind:`edit`,edits:{userProfileAutoCleanupInterval:n.value}}:{kind:`error`,message:n.message}}function iE(e,t){return e===t?null:{userProfileAutoCleanupEnabled:t}}var aE=500;function oE(){let e=Y(),[t,n]=(0,v.useState)(),[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(``),[l,u]=(0,v.useState)(!1),d=t?.settings.userProfileAutoCleanupEnabled?.globalValue!==!1,f=Number(t?.settings.userProfileAutoCleanupInterval?.globalValue??aE);(0,v.useEffect)(()=>{let e=!0;X(`/api/settings`).then(t=>{e&&n(t)}).catch(t=>{e&&c(t.message)});let t=Cx(t=>{e&&n(t)});return()=>{e=!1,t()}},[]),(0,v.useEffect)(()=>{t&&i(String(f))},[t,f]);async function p(n){if(t){u(!0);try{await X(`/api/settings`,{method:`PATCH`,body:JSON.stringify({edits:n,revision:t.revision})}),c(e(`Saved. Changes apply at the next learning pass.`))}catch(e){c(e.message)}await Sx(),u(!1)}}function m(){let t=rE(f,r);if(t.kind===`error`){o(e(t.message));return}o(``),t.kind===`edit`&&p(t.edits)}return(0,H.jsxs)(`div`,{className:`space-y-2 border-t border-border pt-3`,children:[(0,H.jsx)(`h3`,{className:`text-sm font-semibold`,children:e(`Automatic profile cleanup`)}),(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`After a learning pass, OMMS merges duplicate profile items and removes vague ones by itself, in the background. Each run makes about one model call for every 100 items and takes several minutes on a large profile. Undo last automatic cleanup on the Profile page puts the changes back.`)}),(0,H.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,H.jsx)(`input`,{type:`checkbox`,checked:d,disabled:l||!t,onChange:e=>{let t=iE(d,e.target.checked);t&&p(t)}}),e(`Clean up the profile automatically`)]}),(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-sm`,children:[(0,H.jsx)(`label`,{htmlFor:`auto-cleanup-interval`,children:e(`Run every this many analysed prompts`)}),(0,H.jsx)(`input`,{id:`auto-cleanup-interval`,className:`w-28 rounded border border-border bg-background px-2 py-1`,inputMode:`numeric`,value:r,disabled:l||!t,"aria-invalid":a?!0:void 0,"aria-describedby":a?`auto-cleanup-interval-error`:void 0,onChange:e=>{i(e.target.value),o(``)}}),(0,H.jsx)(`button`,{type:`button`,className:`rounded border border-border px-3 py-1.5`,disabled:l||!t||r.trim()===String(f),onClick:m,children:e(`Save interval`)})]}),a&&(0,H.jsx)(`p`,{id:`auto-cleanup-interval-error`,role:`alert`,className:`text-sm text-destructive`,children:a}),s&&(0,H.jsx)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:s})]})}function sE({preview:e,job:t,busy:n,onStart:r,onPause:i}){let a=Y(),o=t.state===`running`;return(0,H.jsxs)(`div`,{className:`space-y-2 text-sm`,children:[(0,H.jsxs)(`p`,{children:[a(`Prompts waiting for profile learning`),`: `,e.waiting,` ·`,` `,a(`Estimated profile analysis calls`),`: `,e.calls]}),t.state!==`idle`&&(0,H.jsxs)(`p`,{role:`status`,children:[a(`Batches done`),`: `,t.batchesBuilt,` · `,a(`Prompts waiting`),`: `,t.remaining,t.state===`paused`&&` · ${a(`Paused`)}`,t.state===`done`&&` · ${a(`Finished`)}`]}),t.state===`superseded`&&(0,H.jsx)(`p`,{children:a(`A newer catch-up run took over.`)}),t.state===`failed`&&(0,H.jsxs)(`p`,{className:`text-red-600`,children:[a(`Stopped`),`: `,t.reason??`error`]}),o?(0,H.jsx)(`button`,{type:`button`,className:`rounded border border-border px-3 py-1.5`,onClick:i,children:a(`Pause`)}):(0,H.jsx)(`button`,{type:`button`,className:`rounded border border-border px-3 py-1.5`,disabled:n||e.waiting===0,onClick:r,children:a(t.state===`idle`||t.state===`done`?`Analyse waiting prompts`:`Resume`)})]})}function cE({onReanalyse:e}={}){let t=Y(),[n,r]=(0,v.useState)(),[i,a]=(0,v.useState)({state:`idle`,batchesBuilt:0,remaining:0}),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(``);async function f(){let e=await X(`/api/settings/profile/catch-up`);r(e.preview),a(e.job)}(0,v.useEffect)(()=>{f().catch(e=>d(e.message)),X(`/api/web/status`).then(e=>s(!!e.isLocal)).catch(()=>{})},[]),(0,v.useEffect)(()=>{if(i.state!==`running`)return;let e=setInterval(()=>void f().catch(()=>{}),2e3);return()=>clearInterval(e)},[i.state]);async function p(){if(!n)return;let e=i.state!==`idle`&&i.state!==`done`;if(window.confirm(`${t(`Start profile learning for the waiting prompts? Model calls`)}: ${n.calls}`)){l(!0);try{a(await X(`/api/settings/profile/catch-up/${e?`resume`:`start`}`,{method:`POST`,body:`{}`})),d(``)}catch(e){d(e.message)}l(!1)}}async function m(){try{a(await X(`/api/settings/profile/catch-up/pause`,{method:`POST`,body:`{}`}))}catch(e){d(e.message)}}return(0,H.jsxs)(`section`,{className:`space-y-3 rounded-xl border border-border bg-card p-4`,"aria-label":t(`Profile learning`),children:[(0,H.jsx)(`h2`,{className:`text-section-title font-semibold`,children:t(`Profile learning`)}),(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t(`Analyse waiting prompts reads prompts already inside OMMS with the saved external API, 50 eligible prompts per analysis call. Completed history is not re-analysed. Preferences, patterns, and workflows are the outputs.`)}),(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t(`Analysis calls are an estimate. Matching, deduplication, retries, and newly waiting prompts can add calls.`)}),(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t(`Re-analyse chat history opens a forced profile-only import. It preserves your profile and project memories. Preview and confirmation are required. Each profile prompt can be forcibly re-analysed once.`)}),e&&(0,H.jsx)(`button`,{type:`button`,className:`rounded border border-border px-3 py-1.5 text-sm`,onClick:e,children:t(`Re-analyse chat history`)}),n&&(o?(0,H.jsx)(sE,{preview:n,job:i,busy:c,onStart:()=>void p(),onPause:()=>void m()}):(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t(`Open this page on the computer that runs OMMS to start a catch-up run.`)})),u&&(0,H.jsx)(`p`,{role:`alert`,children:u}),(0,H.jsx)(oE,{})]})}function lE(e){let t=typeof e==`string`?e.trim():``;if(!t||!/^\d+$/.test(t))return;let n=Number(t);return n>=500&&n<=3e4?n:void 0}function uE(e){return/^(env:\/\/[A-Za-z_][A-Za-z0-9_]*|file:\/\/.+)$/.test(e.trim())}function dE(e){try{let t=new URL(e.trim()).hostname.toLowerCase();return!(t===`localhost`||t===`::1`||t===`[::1]`||/^127\.\d+\.\d+\.\d+$/.test(t))}catch{return!1}}function fE(e){if(e.enabled&&(e.url.trim().length===0||e.model.trim().length===0))return{field:`url-model`};if(e.key.trim().length>0&&!uE(e.key))return{field:`key`};if(lE(e.timeout)===void 0)return{field:`timeout`}}function pE(e){return fE(e)===void 0}function mE(e){return{rerankerEnabled:e.enabled,rerankerApiUrl:e.url.trim()||null,rerankerModel:e.model.trim()||null,rerankerApiKey:e.key.trim()||null,rerankerTimeoutMs:lE(e.timeout)??4e3}}function hE(e){let t=e?.settings,n=e?.secrets.rerankerApiKey?.reference;return{enabled:t?.rerankerEnabled?.value===!0,url:typeof t?.rerankerApiUrl?.value==`string`?t.rerankerApiUrl.value:``,model:typeof t?.rerankerModel?.value==`string`?t.rerankerModel.value:``,key:e?.secrets.rerankerApiKey?.set?`${e.secrets.rerankerApiKey.source}://${n??``}`:``,timeout:typeof t?.rerankerTimeoutMs?.value==`number`?String(t.rerankerTimeoutMs.value):`4000`}}function gE(){let e=Y(),[t,n]=(0,v.useState)(),[r,i]=(0,v.useState)({enabled:!1,url:``,model:``,key:``,timeout:`4000`}),[a,o]=(0,v.useState)(!1),[s,c]=(0,v.useState)(),l=(0,v.useRef)(!1),u=(0,v.useRef)(void 0);(0,v.useEffect)(()=>{let e=!0,t=xx();X(`/api/settings`).then(r=>{e&&t.isCurrent()&&(u.current=r,n(r),i(hE(r)))}).catch(()=>{e&&c({kind:`load-failed`})});let r=Cx(t=>{if(!e)return;let r=u.current,a=t;u.current=a,n(a),i(e=>!r||JSON.stringify(e)===JSON.stringify(hE(r))?hE(a):e)});return()=>{e=!1,r()}},[]);let d=fE(r),f=pE(r),p=r.url.trim().length>0&&dE(r.url);function m(e){i(t=>({...t,...e}))}async function h(){if(a||l.current||!f)return;l.current=!0,o(!0);let e=!1,t;try{let n=await X(`/api/settings/reranker/test`,{method:`POST`,body:JSON.stringify({rerankerApiUrl:r.url.trim()||void 0,rerankerModel:r.model.trim()||void 0,rerankerApiKey:r.key.trim()||void 0,rerankerTimeoutMs:lE(r.timeout)??4e3})});e=n.success===!0,t=n.code}catch{t=`reranker_unreachable`}o(!1),l.current=!1,c({kind:`test`,ok:e,code:t})}async function g(){if(!t||!f||l.current)return;l.current=!0,o(!0);let e=!1,n=!1;try{await X(`/api/settings`,{method:`PATCH`,body:JSON.stringify({edits:mE(r),revision:t.revision})}),e=!0}catch(e){n=e?.message?.includes(`Config changed`)===!0}let i=await Sx()!==null;o(!1),l.current=!1,c(n?{kind:`save`,ok:e,reloaded:i,stale:n}:{kind:`save`,ok:e,reloaded:i})}function _(t){if(t.kind===`load-failed`)return e(`The reranker settings could not be loaded. Reload the page to try again.`);if(t.kind===`test`)return t.ok?e(`Test passed.`):`${e(`Test failed:`)} ${t.code??`reranker_unreachable`}`;let n=t.reloaded?e(`Current settings were reloaded; check the values and save again.`):e(`The current settings could not be reloaded. Reload the page.`);return t.stale?wx(e(`Config changed. Reload settings and save again.`),n):t.ok?e(`Saved. New searches use these settings.`):wx(e(`The reranker settings could not be saved. Reload the page to try again.`),n)}return(0,H.jsxs)(`section`,{className:`space-y-3 rounded-xl border border-border bg-card p-4`,"aria-label":e(`Reranker`),children:[(0,H.jsx)(`h2`,{className:`text-section-title font-semibold`,children:e(`Reranker`)}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`The reranker reorders the best memory search results with your reranker server and keeps the top results.`)}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`The reranker sends the prompt and the text of candidate memories to the server URL. A server on the same machine is recommended.`)}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`A project file cannot change these settings. The reranker settings are global only.`)}),!r.enabled&&(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`Search is unchanged while the switch is off.`)}),(0,H.jsxs)(`form`,{className:`space-y-3`,onSubmit:e=>{e.preventDefault(),g()},children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`input`,{type:`checkbox`,id:`reranker-enabled`,role:`switch`,checked:r.enabled,disabled:a,"aria-label":e(`Use a reranker`),onChange:e=>m({enabled:e.target.checked})}),(0,H.jsx)(nm,{htmlFor:`reranker-enabled`,children:e(`Use a reranker`)})]}),(0,H.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-2`,children:[(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(nm,{htmlFor:`reranker-url`,children:e(`Server URL`)}),(0,H.jsx)(Jd,{type:`url`,id:`reranker-url`,dir:`ltr`,placeholder:`http://127.0.0.1:3008/v1`,disabled:a,value:r.url,"aria-invalid":d?.field===`url-model`||void 0,"aria-describedby":`reranker-url-help`,onChange:e=>m({url:e.target.value})}),(0,H.jsx)(`span`,{id:`reranker-url-help`,className:`block text-xs text-muted-foreground`,children:d?.field===`url-model`?e(`Enter the server URL and model before turning the reranker on.`):`rerankerApiUrl`}),p&&(0,H.jsx)(`p`,{className:`text-xs text-amber-600`,children:e(`This URL is not on this machine: memory text leaves this machine.`)})]}),(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(nm,{htmlFor:`reranker-model`,children:e(`Model`)}),(0,H.jsx)(Jd,{type:`text`,id:`reranker-model`,dir:`ltr`,disabled:a,value:r.model,"aria-invalid":d?.field===`url-model`||void 0,onChange:e=>m({model:e.target.value})}),(0,H.jsx)(`span`,{className:`block text-xs text-muted-foreground`,children:`rerankerModel`})]}),(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(nm,{htmlFor:`reranker-key`,children:e(`Key`)}),(0,H.jsx)(Jd,{type:`text`,id:`reranker-key`,dir:`ltr`,disabled:a,value:r.key,"aria-invalid":d?.field===`key`||void 0,"aria-describedby":`reranker-key-help`,onChange:e=>m({key:e.target.value})}),(0,H.jsx)(`span`,{id:`reranker-key-help`,className:`block text-xs text-muted-foreground`,children:d?.field===`key`?e(`The key must be an env:// or file:// reference, or left empty.`):e(`Optional env:// or file:// key reference.`)})]}),(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(nm,{htmlFor:`reranker-timeout`,children:e(`Timeout`)}),(0,H.jsx)(Jd,{type:`number`,id:`reranker-timeout`,className:`tabular-nums`,inputMode:`numeric`,step:1,min:500,max:3e4,disabled:a,value:r.timeout,"aria-invalid":d?.field===`timeout`||void 0,"aria-describedby":`reranker-timeout-help`,onChange:e=>m({timeout:e.target.value})}),(0,H.jsx)(`span`,{id:`reranker-timeout-help`,className:`block text-xs text-muted-foreground`,children:d?.field===`timeout`?e(`Enter a whole number from 500 to 30,000.`):e(`milliseconds`)}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`The default of 4000 keeps the search inside OpenCode V2's 5-second wait. A value over 5000 can make OpenCode V2 send the request with no memory.`)})]})]}),(0,H.jsxs)(`div`,{className:`flex gap-2`,children:[(0,H.jsx)(q,{type:`submit`,disabled:a||!t||!f,onClick:()=>void g(),children:e(`Save`)}),(0,H.jsx)(q,{type:`button`,variant:`outline`,disabled:a||!f,onClick:()=>void h(),children:e(`Test`)}),(0,H.jsx)(q,{type:`button`,variant:`outline`,disabled:a,onClick:()=>i(hE(t)),children:e(`Cancel`)})]})]}),s&&(0,H.jsx)(`p`,{role:`status`,className:`text-sm`,children:_(s)})]})}var _E=e=>{let t=e?.value??e?.globalValue;return t==null||t===``?null:String(t)};function vE(e,t){let n=_E(e?.maxMemories),r=_E(e?.similarityThreshold),i=_E(e?.keywordMode),a=_E(e?.rerankerModel);return{profile:{text:`Prompts waiting for profile learning, and re-analysis of old chats`},limits:n&&r?{text:`Results {results} · Similarity {similarity}`,params:{results:n,similarity:r}}:{text:`How many memories a search returns`},keywords:i?{text:`Mode: {mode}`,params:{mode:i}}:{text:`Keyword matching`},reranker:_E(e?.rerankerApiUrl)?a?{text:`On · {model}`,params:{model:a}}:{text:`On`}:{text:`Off`},maps:t?{text:`{saved} saved · {ignored} ignored`,params:t}:{text:`Saved maps and ignored directories`}}}function yE({id:e,title:t,summary:n,children:r}){return(0,H.jsxs)(`details`,{id:e,"data-shared-row":!0,className:`scroll-mt-20 rounded-xl border border-border bg-card`,children:[(0,H.jsxs)(`summary`,{className:`flex min-h-11 cursor-pointer flex-wrap items-baseline gap-x-3 gap-y-1 rounded-xl p-4 focus-visible:outline-2 focus-visible:outline-ring`,children:[(0,H.jsx)(`h2`,{className:`text-subsection-title font-semibold`,children:t}),(0,H.jsx)(`span`,{className:`min-w-0 break-words text-xs text-muted-foreground`,children:n})]}),(0,H.jsx)(`div`,{className:`border-t border-border p-4`,children:r})]})}function bE({title:e,summary:t}){let n=`/memory#memory-injection`;return(0,H.jsxs)(`a`,{id:`shared-memory-injection`,href:n,onClick:e=>{e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||(e.preventDefault(),Em(n))},className:`flex min-h-11 flex-wrap items-baseline gap-x-3 gap-y-1 rounded-xl border border-border bg-card p-4 transition-colors duration-150 hover:bg-interactive-hover focus-visible:outline-2 focus-visible:outline-ring`,children:[(0,H.jsx)(`h2`,{className:`text-subsection-title font-semibold`,children:e}),(0,H.jsx)(`span`,{className:`min-w-0 break-words text-xs text-muted-foreground`,children:t})]})}function xE({statuses:e,onReanalyse:t}){let n=Y(),[r,i]=(0,v.useState)(),[a,o]=(0,v.useState)();(0,v.useEffect)(()=>{let e=!0,t=()=>{X(`/api/settings`).then(t=>e&&i(t.settings)).catch(()=>{}),X(`/api/settings/import-maps`).then(t=>e&&o({saved:t.saved.length,ignored:t.ignored?.length??0})).catch(()=>{})};t();let n=Cx(t);return()=>{e=!1,n()}},[]);let s=vE(r,a),c=e=>dw(n,s[e]),l=NT(r),u=e=>n(e?`On`:`Off`),d=dw(n,{text:`First message {opening} · Subagents {subagent} · Restore {restore}`,params:{opening:u(l.opening),subagent:u(l.subagent),restore:u(l.restore)}});return(0,H.jsxs)(`div`,{className:`space-y-6`,children:[(0,H.jsx)(ET,{current:`shared`,statuses:e}),(0,H.jsxs)(`header`,{className:`space-y-1`,children:[(0,H.jsx)(`h2`,{className:`text-page-title font-semibold`,children:n(`Shared`)}),(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n(`These settings apply to every host. Open a row to change it.`)})]}),(0,H.jsxs)(`div`,{className:`space-y-3`,children:[(0,H.jsx)(yE,{id:`shared-profile`,title:n(`Profile learning`),summary:c(`profile`),children:(0,H.jsx)(cE,{onReanalyse:t})}),(0,H.jsx)(yE,{id:`shared-limits`,title:n(`Memory limits`),summary:c(`limits`),children:(0,H.jsx)(eE,{})}),(0,H.jsx)(bE,{title:n(`Memory injection`),summary:d}),(0,H.jsx)(yE,{id:`shared-keywords`,title:n(`Keyword matching`),summary:c(`keywords`),children:(0,H.jsx)(GT,{})}),(0,H.jsx)(yE,{id:`shared-reranker`,title:n(`Reranker`),summary:c(`reranker`),children:(0,H.jsx)(gE,{})}),(0,H.jsx)(yE,{id:`shared-directory-maps`,title:n(`Directory maps`),summary:c(`maps`),children:(0,H.jsx)(KC,{hosts:[]})})]})]})}var SE=3e3;function CE(){let e=Y(),[t,n]=(0,v.useState)(),[r,i]=(0,v.useState)({pi:null,opencode:null,"claude-code":null}),[a,o]=(0,v.useState)(),[s,c]=(0,v.useState)({}),[l,u]=(0,v.useState)(``),[d,f]=(0,v.useState)(!1),p=(0,v.useRef)(gw(i,e=>u(e.message))),m=(0,v.useRef)(gw(o,e=>u(e.message))),h=()=>p.current(X(`/api/settings/backfill`)),g=()=>m.current(X(`/api/settings/backfill/runs`));(0,v.useEffect)(()=>{let e=!0;X(`/api/settings`).then(t=>e&&n(t)).catch(t=>e&&u(t.message)),h(),g();for(let t of[`pi`,`opencode`])X(`/api/settings/models?host=${t}`).then(n=>e&&c(e=>({...e,[t]:n}))).catch(()=>e&&c(e=>({...e,[t]:{available:!1}})));let t=Cx(t=>{e&&(n(t),h())}),r=setInterval(()=>{e&&(h(),g())},SE);return()=>{e=!1,clearInterval(r),t()}},[]);async function _(n){if(t){f(!0);try{await X(`/api/settings`,{method:`PATCH`,body:JSON.stringify({edits:n,revision:t.revision})}),u(e(`Saved. Changes apply at the next run.`))}catch(e){u(e.message)}await Sx(),f(!1)}}async function y(t,n){f(!0);let r=a?.[t]?.run?.state===`running`;try{await X(`/api/settings/backfill/${t}/${n}`,{method:`POST`,body:`{}`}),u(e(n===`pause`?r?`Pausing after the current exchange.`:`Paused. No import starts until you resume.`:`Backfill started.`))}catch(e){u(e.message)}await Promise.all([g(),h()]),f(!1)}function b(t,n){try{_(YC(t,n.trim()))}catch(t){u(e(t.message))}}return{snapshot:t,rows:r,runs:a,lists:s,message:l,busy:d,save:_,control:y,saveModel:b,setMessage:u}}var wE=6e4;function TE(){let e=CE(),[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(null),a=Y();(0,v.useEffect)(()=>{let e=!0,t=()=>void X(`/api/settings/imports/readiness`).then(t=>e&&n(t)).catch(()=>e&&n(null));t();let r=Cx(t);return()=>{e=!1,r()}},[]),(0,v.useEffect)(()=>{let e=!0,t=()=>void X(`/api/settings/last-saved`).then(t=>e&&i(t.hosts)).catch(()=>void 0);t();let n=Cx(t),r=setInterval(t,wE);return()=>{e=!1,n(),clearInterval(r)}},[]);let o=e=>{let t=Hi(new Date(e),new Date),n=Dp(e);return t===`earlier`?`${Ep(e)} ${n}`:a(t===`today`?`today {time}`:`yesterday {time}`).replaceAll(`{time}`,n)},s=n=>({host:n,run:e.runs?.[n]?.run??null,pending:e.rows[n]?.counts.pending??0,cutoff:e.rows[n]?.cutoff??null,runNowUnavailable:e.runs?.[n]?.runNowUnavailable??null,setUp:t?.defaultSourceFound?.[n]!==!1,formatDate:Ep,lastSaved:r?.[n]??null,formatSaved:o});return{backfill:e,readiness:t,input:s,status:e=>lw(s(e)),line:e=>uw(s(e))}}function EE(){let e=tf(Om().split(`#`)[0]),t=TE(),[n,r]=(0,v.useState)(0);(0,v.useEffect)(()=>{_m(window.location.hash)},[e]);function i(){r(e=>e+1),Em(J.memory)}return(0,H.jsxs)(`div`,{className:`settings-view`,children:[e===null&&(0,H.jsx)(zT,{statuses:t,profilePreset:n}),e===`shared`&&(0,H.jsx)(xE,{statuses:t,onReanalyse:i}),e!==null&&e!==`shared`&&(0,H.jsx)(kT,{host:e,statuses:t,profilePreset:n})]})}function DE({count:e,onConfirm:t,onClose:n}){let{t:r}=G(),[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)(!1);async function c(){a(!0),s(!1);let e=await t();a(!1),e?n():s(!0)}return(0,H.jsx)(Du,{open:!0,onOpenChange:e=>e||i?void 0:n(),children:(0,H.jsxs)(Au,{children:[(0,H.jsxs)(ju,{children:[(0,H.jsx)(Nu,{children:r(`memorisation-bulk-title`)}),(0,H.jsx)(Pu,{children:r(`memorisation-bulk-body`,{count:e})})]}),o?(0,H.jsx)(Xp,{tone:`danger`,children:r(`memorisation-bulk-failed`)}):null,i?(0,H.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-muted-foreground`,children:[(0,H.jsx)(at,{className:`size-4 animate-spin`,"aria-hidden":`true`}),r(`memorisation-bulk-deleting`)]}):null,(0,H.jsxs)(Mu,{children:[(0,H.jsx)(q,{type:`button`,variant:`outline`,disabled:i,onClick:n,children:r(`memorisation-delete-cancel`)}),(0,H.jsx)(q,{type:`button`,variant:`destructive`,disabled:i,onClick:()=>void c(),children:r(`memorisation-delete`)})]})]})})}function OE({result:e}){let{t}=G();return(0,H.jsxs)(`div`,{role:`status`,className:`space-y-1 text-sm`,children:[(0,H.jsx)(`p`,{children:t(`memorisation-bulk-deleted`,{count:e.deleted.length})}),e.skipped.map(e=>(0,H.jsx)(`p`,{className:`text-muted-foreground`,children:(0,H.jsx)(`bdi`,{children:t(`memorisation-skipped`,{id:e.id,reason:t(`memorisation-skipped-${e.reason}`)})})},e.id))]})}function kE({item:e,onConfirm:t,onClose:n}){let{t:r}=G(),[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)(!1);async function c(){a(!0),s(!1);let r=await t(e);a(!1),r?n():s(!0)}return(0,H.jsx)(Du,{open:!0,onOpenChange:e=>e||i?void 0:n(),children:(0,H.jsxs)(Au,{children:[(0,H.jsxs)(ju,{children:[(0,H.jsx)(Nu,{children:(0,H.jsx)(`bdi`,{children:r(`memorisation-delete-title`,{id:e.id})})}),(0,H.jsx)(Pu,{children:r(`memorisation-delete-body`)})]}),o?(0,H.jsx)(Xp,{tone:`danger`,children:r(`memorisation-delete-failed`,{id:e.id})}):null,i?(0,H.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-muted-foreground`,children:[(0,H.jsx)(at,{className:`size-4 animate-spin`,"aria-hidden":`true`}),r(`memorisation-deleting`,{id:e.id})]}):null,(0,H.jsxs)(Mu,{children:[(0,H.jsx)(q,{type:`button`,variant:`outline`,disabled:i,onClick:n,children:r(`memorisation-delete-cancel`)}),(0,H.jsx)(q,{type:`button`,variant:`destructive`,disabled:i,onClick:()=>void c(),children:r(`memorisation-delete`)})]})]})})}function AE({label:e,colourKey:t=e,className:n}){let r=Wd(t);return(0,H.jsx)(`span`,{className:V(`inline-flex min-h-6 max-w-full items-center rounded-[7px] border px-2 text-xs break-words`,`[color:oklch(0.42_0.13_var(--keyword-hue))] dark:[color:oklch(0.8_0.13_var(--keyword-hue))]`,n),style:{backgroundColor:`oklch(0.72 0.14 ${r} / 0.18)`,borderColor:`oklch(0.72 0.14 ${r} / 0.45)`,"--keyword-hue":String(r)},children:e})}function jE({labels:e,onRemove:t,onClear:n}){let{t:r}=G();return e.length===0?null:(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:r(`memorisation-filter-active`)}),e.map(e=>(0,H.jsxs)(`span`,{className:`inline-flex max-w-full items-center gap-0.5`,children:[(0,H.jsx)(AE,{label:e}),(0,H.jsx)(q,{type:`button`,variant:`ghost`,size:`icon-xs`,"aria-label":r(`memorisation-filter-remove`,{label:e}),onClick:()=>t(e),children:(0,H.jsx)(an,{"aria-hidden":`true`})})]},e)),(0,H.jsx)(q,{type:`button`,variant:`outline`,size:`xs`,onClick:n,children:r(`memorisation-filter-clear`)})]})}function ME({label:e,active:t,onAdd:n}){let{t:r}=G();return(0,H.jsx)(`button`,{type:`button`,"aria-label":r(`memorisation-label-add`,{label:e}),"aria-pressed":t,className:`max-w-full cursor-pointer rounded-[7px] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring`,onClick:()=>n(e),children:(0,H.jsx)(AE,{label:e,className:t?`ring-2 ring-offset-1 ring-offset-background ring-border`:void 0})})}var NE={characters:{min:100,max:2e4},tokens:{min:25,max:5e3}},PE=e=>e===`characters`||e===`tokens`,FE=e=>e===`add`||e===`replace`;function IE(e,t){let n=e.trim();if(!/^\d+$/.test(n))return null;let r=Number(n),{min:i,max:a}=NE[t];return Number.isSafeInteger(r)&&r>=i&&r<=a?r:null}function LE(e){let t=e.split(`
|
|
132
|
-
`).map(e=>e.trim());return t.find(e=>/^topic:/i.test(e))?.replace(/^topic:\s*/i,``)||t.find(Boolean)||e}function RE(e,t){let n=new Map(t.map(e=>[e.id,e]));return e.map(e=>({...e,host:e.host??n.get(e.id)?.host,kind:e.kind??n.get(e.id)?.kind}))}var zE=(e,t)=>(e.createdAt??``).localeCompare(t.createdAt??``),BE=[{value:`newest`,label:`Newest`,first:`desc`,flip:`oldest`,compare:zE},{value:`oldest`,label:`Oldest`,first:`asc`,flip:`newest`,compare:zE}];function VE({item:e,onDelete:t,onLabel:n,activeLabels:r=[],select:i}){let{t:a}=G(),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(`idle`),u=`memorisation-text-${e.id}`,d=`memorisation-linked-${e.id}`;async function f(){try{await navigator.clipboard.writeText(e.id),l(`done`)}catch{l(`failed`)}setTimeout(()=>l(`idle`),4e3)}return(0,H.jsxs)(`li`,{className:`min-w-0 space-y-3 rounded-xl border border-border bg-card p-4`,children:[(0,H.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,H.jsxs)(`div`,{className:`flex items-start gap-2`,children:[i?(0,H.jsx)(Bs,{className:`mt-1`,checked:i.checked,disabled:!!e.space,"aria-label":a(`memorisation-select-row`,{id:e.id}),"aria-describedby":e.space?d:void 0,onCheckedChange:e=>i.onChange(e===!0)}):null,(0,H.jsx)(`h3`,{className:`line-clamp-2 min-w-0 break-words text-subsection-title font-semibold text-foreground`,dir:`auto`,children:LE(e.content)})]}),(0,H.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted-foreground`,children:[(0,H.jsxs)(`span`,{children:[a(`memorisation-id-label`),` `,(0,H.jsx)(`bdi`,{className:`font-mono`,dir:`ltr`,children:e.id})]}),e.createdAt?(0,H.jsx)(`span`,{children:a(`memorisation-saved-at`,{date:wp(e.createdAt)})}):null]}),(0,H.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[e.kind===`snapshot`||e.kind===`explicit`?(0,H.jsx)(AE,{label:a(`memorisation-kind-${e.kind}`),colourKey:`memorisation-${e.kind}`}):null,e.host?(0,H.jsx)(AE,{label:om(e.host),colourKey:e.host}):null,e.space?(0,H.jsx)(AE,{label:a(`memorisation-linked-in`,{space:e.space}),colourKey:`linked`}):null,e.confidence===void 0?null:(0,H.jsx)(AE,{label:a(`memorisation-confidence`,{score:e.confidence}),colourKey:`confidence`}),(e.tags??[]).map(e=>(0,H.jsx)(ME,{label:e,active:r.some(t=>t.toLowerCase()===e.toLowerCase()),onAdd:n},e))]})]}),o?(0,H.jsx)(`div`,{id:u,className:`rounded-lg border border-border bg-muted p-3`,children:(0,H.jsx)(`pre`,{"aria-label":a(`memorisation-text-label`,{id:e.id}),className:`max-h-96 overflow-y-auto font-sans text-sm whitespace-pre-wrap [overflow-wrap:anywhere]`,dir:`auto`,children:e.content})}):null,(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,H.jsxs)(q,{type:`button`,variant:`outline`,size:`sm`,"aria-expanded":o,"aria-controls":u,onClick:()=>s(e=>!e),children:[o?(0,H.jsx)(pe,{"aria-hidden":`true`}):(0,H.jsx)(ue,{"aria-hidden":`true`}),a(o?`memorisation-close`:`memorisation-open`)]}),(0,H.jsxs)(q,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>void f(),children:[(0,H.jsx)(xe,{"aria-hidden":`true`}),a(`memorisation-copy`)]}),(0,H.jsxs)(q,{type:`button`,variant:`destructive`,size:`sm`,disabled:!!e.space,"aria-describedby":e.space?d:void 0,onClick:()=>t(e),children:[(0,H.jsx)(Jt,{"aria-hidden":`true`}),a(`memorisation-delete`)]})]}),e.space?(0,H.jsx)(`p`,{id:d,className:`text-xs text-muted-foreground`,children:a(`memorisation-delete-linked`,{space:e.space})}):null,c===`idle`?null:(0,H.jsx)(`p`,{role:`status`,className:`text-sm`,children:c===`done`?a(`memorisation-copied`,{id:e.id}):a(`memorisation-copy-failed`)})]})}function HE({on:e,count:t,onStart:n,onCancel:r,onSelectAll:i,onDelete:a}){let{t:o}=G();return e?(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,H.jsx)(q,{type:`button`,variant:`secondary`,size:`xs`,onClick:i,children:o(`memorisation-select-all`)}),(0,H.jsx)(`span`,{className:`text-xs text-muted-foreground`,"aria-live":`polite`,children:o(`memorisation-selected`,{count:t})}),(0,H.jsxs)(q,{type:`button`,variant:`destructive`,size:`xs`,disabled:t===0,onClick:a,children:[(0,H.jsx)(Jt,{"aria-hidden":`true`}),o(`memorisation-delete-selected`)]}),(0,H.jsx)(q,{type:`button`,variant:`ghost`,size:`xs`,onClick:r,children:o(`memorisation-select-cancel`)})]}):(0,H.jsx)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:(0,H.jsxs)(q,{type:`button`,variant:`outline`,size:`xs`,onClick:n,children:[(0,H.jsx)(Vt,{"aria-hidden":`true`}),o(`memorisation-select`)]})})}var UE=e=>!e.space;function WE(e){let[t,n]=(0,v.useState)({on:!1,ids:new Set}),r=(0,v.useMemo)(()=>{let n=new Set((e??[]).filter(UE).map(e=>e.id));return new Set([...t.ids].filter(e=>n.has(e)))},[e,t.ids]),i=(0,v.useCallback)(()=>n({on:!0,ids:new Set}),[]),a=(0,v.useCallback)(()=>n({on:!1,ids:new Set}),[]),o=(0,v.useCallback)((e,t)=>n(n=>{let r=new Set(n.ids);return t?r.add(e):r.delete(e),{...n,ids:r}}),[]),s=(0,v.useCallback)(e=>n(t=>({...t,ids:new Set([...t.ids,...e])})),[]);return{on:t.on,ids:r,start:i,cancel:a,toggle:o,addAll:s}}var GE=`om-memory-system memory memorise "your note"`;function KE({items:e,labels:t,onDelete:n,onLabel:r,selection:i,onDeleteSelected:a}){let{t:o}=G(),{view:s,pageItems:c}=xp({storageKey:`omms-list-memorisations`,items:e,sorts:BE,resetKey:t.join(`,`)});return e.length===0?t.length>0?(0,H.jsx)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:o(`memorisation-filter-empty`)}):(0,H.jsxs)(`div`,{className:`space-y-2 rounded-xl border border-border bg-card p-4`,children:[(0,H.jsx)(`p`,{className:`font-medium`,children:o(`memorisation-empty-title`)}),(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:o(`memorisation-empty-body`)}),(0,H.jsx)(`pre`,{dir:`ltr`,className:`overflow-x-auto rounded-lg border border-border bg-muted px-3 py-2 font-mono text-xs`,children:GE})]}):(0,H.jsxs)(`div`,{className:`space-y-3`,children:[(0,H.jsx)(HE,{on:i.on,count:i.ids.size,onStart:i.start,onCancel:i.cancel,onSelectAll:()=>i.addAll(c.filter(UE).map(e=>e.id)),onDelete:a}),(0,H.jsx)(_p,{view:s,totalLabel:o(`memorisation-total`,{count:s.total}),children:(0,H.jsx)(`ul`,{"aria-label":o(`memorisation-list-label`),className:`space-y-3`,children:c.map(e=>(0,H.jsx)(VE,{item:e,onDelete:n,onLabel:r,activeLabels:t,select:i.on?{checked:i.ids.has(e.id),onChange:t=>i.toggle(e.id,t)}:void 0},e.id))})})]})}var qE=/(^|\s)label:(?:"([^"]*)"|(\S*))/gi;function JE(e,t){let n=t.trim();return!n||e.some(e=>e.toLowerCase()===n.toLowerCase())?[...e]:[...e,n]}function YE(e){let t=[];return{q:e.replace(qE,(e,n,r,i)=>(t=JE(t,r??i??``),` `)).replace(/\s+/g,` `).trim(),labels:t}}function XE(e){return(new URLSearchParams(e).get(`labels`)??``).split(`,`).reduce((e,t)=>JE(e,t),[])}function ZE(e,t){let n=new URLSearchParams(e);n.delete(`labels`);let r=n.toString(),i=r?[r]:[];return t.length>0&&i.push(`labels=${t.map(encodeURIComponent).join(`,`)}`),i.length>0?`?${i.join(`&`)}`:``}function QE({recall:e,onSearch:t,onClear:n,onDelete:r,onLabel:i,activeLabels:a}){let{t:o}=G(),[s,c]=(0,v.useState)(``),l=e.kind===`running`,{q:u,labels:d}=YE(s);return(0,H.jsxs)(`section`,{"aria-labelledby":`memorisation-recall`,className:`space-y-3`,children:[(0,H.jsx)(`h2`,{id:`memorisation-recall`,className:`text-section-title font-semibold text-muted-foreground`,children:o(`memorisation-search-title`)}),(0,H.jsxs)(`form`,{className:`flex flex-wrap items-end gap-2`,onSubmit:e=>{e.preventDefault(),t(s)},children:[(0,H.jsxs)(`div`,{className:`min-w-0 max-w-full flex-1 basis-72 space-y-1`,children:[(0,H.jsx)(nm,{htmlFor:`memorisation-search-input`,children:o(`memorisation-search-label`)}),(0,H.jsx)(Jd,{id:`memorisation-search-input`,type:`search`,value:s,placeholder:o(`memorisation-search-placeholder`),"aria-describedby":`memorisation-search-help`,onChange:e=>c(e.target.value)})]}),(0,H.jsxs)(q,{type:`submit`,disabled:l||u===``&&d.length===0,children:[(0,H.jsx)(It,{"aria-hidden":`true`}),o(`memorisation-search-button`)]}),e.kind===`idle`?null:(0,H.jsxs)(q,{type:`button`,variant:`outline`,onClick:()=>{c(``),n()},children:[(0,H.jsx)(an,{"aria-hidden":`true`}),o(`memorisation-search-clear`)]})]}),(0,H.jsx)(`p`,{id:`memorisation-search-help`,className:`text-xs text-muted-foreground`,children:o(`memorisation-search-help`)}),l?(0,H.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,H.jsx)(at,{className:`size-4 animate-spin`,"aria-hidden":`true`}),o(`memorisation-searching`)]}):null,e.kind===`failed`?(0,H.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive-label`,children:e.missingId?o(`memorisation-no-id`,{id:e.query}):o(`memorisation-recall-failed`)}):null,e.kind===`done`?(0,H.jsxs)(`div`,{className:`space-y-3`,children:[(0,H.jsx)(`h3`,{className:`text-subsection-title font-semibold`,dir:`auto`,children:o(`memorisation-results-title`,{query:e.query})}),e.matches.length===0?(0,H.jsx)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:o(`memorisation-no-match`)}):(0,H.jsx)(`ul`,{"aria-label":o(`memorisation-results-title`,{query:e.query}),className:`space-y-3`,children:e.matches.map(e=>(0,H.jsx)(VE,{item:e,onDelete:r,onLabel:i,activeLabels:a},e.id))})]}):null]})}var $E=[{value:`add`,title:`memorisation-repeat-add`,detail:`memorisation-repeat-add-detail`},{value:`replace`,title:`memorisation-repeat-replace`,detail:`memorisation-repeat-replace-detail`}];function eD({value:e,disabled:t,onChoose:n}){let{t:r}=G();return(0,H.jsx)(`div`,{role:`radiogroup`,"aria-label":r(`memorisation-repeat-label`),className:`grid gap-3 sm:grid-cols-2`,children:$E.map(i=>(0,H.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":e===i.value,disabled:t,className:V(`min-w-0 space-y-1 rounded-[10px] border p-3 text-start transition-colors duration-150 focus-visible:outline-2 focus-visible:outline-ring disabled:opacity-50`,e===i.value?`border-primary/40 bg-selection text-foreground`:`border-input bg-card text-foreground hover:bg-interactive-hover`),onClick:()=>{e!==i.value&&n(i.value)},children:[(0,H.jsx)(`span`,{className:`block text-ui font-medium`,children:r(i.title)}),(0,H.jsx)(`span`,{className:`block text-xs text-muted-foreground`,children:r(i.detail)})]},i.value))})}function tD({value:e,ready:t,busy:n,onChange:r}){let{t:i}=G(),a=i(`memorisation-rerank-disabled`),o=(0,H.jsx)(Bs,{id:`memorisation-rerank`,role:`switch`,checked:e,disabled:n||!t,"aria-describedby":t?`memorisation-rerank-help`:`memorisation-rerank-reason`,onCheckedChange:e=>r(e===!0)});return(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[t?o:(0,H.jsx)(bf,{content:a,children:(0,H.jsxs)(`span`,{tabIndex:0,className:`inline-flex rounded-sm focus-visible:outline-2 focus-visible:outline-ring`,children:[o,(0,H.jsx)(`span`,{id:`memorisation-rerank-reason`,className:`sr-only`,children:a})]})}),(0,H.jsx)(nm,{htmlFor:`memorisation-rerank`,children:i(`memorisation-rerank-label`)})]}),(0,H.jsx)(`p`,{id:`memorisation-rerank-help`,className:`text-xs text-muted-foreground`,children:i(`memorisation-rerank-intro`)})]})}var nD=[`characters`,`tokens`];function rD({sizeText:e,unit:t,busy:n,changed:r,onSize:i,onUnit:a,onSave:o}){let{t:s}=G();return(0,H.jsxs)(`form`,{className:`space-y-3`,onSubmit:e=>{e.preventDefault(),o()},children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-end gap-3`,children:[(0,H.jsxs)(`div`,{className:`w-40 min-w-0 max-w-full space-y-1`,children:[(0,H.jsx)(nm,{htmlFor:`memorisation-size`,children:s(`memorisation-size-label`)}),(0,H.jsx)(Jd,{id:`memorisation-size`,type:`text`,inputMode:`numeric`,dir:`ltr`,value:e,disabled:n,"aria-describedby":`memorisation-size-note`,onChange:e=>i(e.target.value)})]}),(0,H.jsx)(`div`,{role:`radiogroup`,"aria-label":s(`memorisation-unit-label`),className:`inline-flex gap-1.5`,children:nD.map(e=>(0,H.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":t===e,disabled:n,className:V(`min-h-9 rounded-[10px] border px-3 text-ui transition-colors duration-150 focus-visible:outline-2 focus-visible:outline-ring disabled:opacity-50`,t===e?`border-primary/40 bg-selection text-foreground`:`border-input bg-card text-muted-foreground hover:bg-interactive-hover`),onClick:()=>PE(e)&&a(e),children:s(`memorisation-unit-${e}`)},e))}),(0,H.jsx)(q,{type:`submit`,disabled:n||!r,children:s(`memorisation-size-save`)})]}),(0,H.jsx)(`p`,{id:`memorisation-size-note`,className:`text-xs text-muted-foreground`,children:s(`memorisation-size-note`)})]})}var iD=(e,t)=>e?.settings[t]?.globalValue??e?.settings[t]?.value;function aD(){let[e,t]=(0,v.useState)(),[n,r]=(0,v.useState)(``),[i,a]=(0,v.useState)(`characters`),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(),u=(0,v.useRef)(!1);(0,v.useEffect)(()=>{let e=!0,n=e=>{t(e);let n=iD(e,`memorisationMaxSize`),i=iD(e,`memorisationSizeUnit`);r(typeof n==`number`?String(n):``),a(PE(i)?i:`characters`)},i=xx();X(`/api/settings`).then(t=>{e&&i.isCurrent()&&n(t)}).catch(()=>{e&&l({kind:`load-failed`})});let o=Cx(n=>{e&&t(n)});return()=>{e=!1,o()}},[]);let d=iD(e,`memorisationRepeat`),f=iD(e,`memorisationMaxSize`),p=iD(e,`memorisationSizeUnit`),m=iD(e,`memorisationRerank`),h=iD(e,`rerankerApiUrl`),g=iD(e,`rerankerModel`),_=typeof h==`string`&&h.trim().length>0&&typeof g==`string`&&g.trim().length>0;async function y(t,n,r,i){if(!(!e||u.current)){u.current=!0,s(!0),l(void 0);try{await X(`/api/settings`,{method:`PATCH`,body:JSON.stringify({edits:t,revision:e.revision})}),l(n)}catch(e){let t=e?.message??``;t.includes(`Config changed`)?l({kind:`stale`}):r&&t.includes(`memorisationMaxSize`)?l({kind:`out-of-range`,unit:r}):l(i?i(t):{kind:`failed`})}await Sx(),s(!1),u.current=!1}}return{loaded:e!==void 0,busy:o,status:c,repeat:FE(d)?d:`add`,rerank:m===!0,rerankerReady:_,savedSize:typeof f==`number`?f:void 0,savedUnit:PE(p)?p:`characters`,sizeText:n,unit:i,setSizeText:r,setUnit:a,chooseRepeat:e=>y({memorisationRepeat:e},{kind:`repeat-saved`}),chooseRerank:e=>y({memorisationRerank:e},{kind:`rerank-saved`},void 0,e=>({kind:`rerank-failed`,reason:e})),saveSize:()=>{let e=IE(n,i);return e===null?l({kind:`out-of-range`,unit:i}):y({memorisationMaxSize:e,memorisationSizeUnit:i},{kind:`size-saved`},i)}}}var oD=`space-y-3 rounded-xl border border-border bg-card p-4`,sD={"repeat-saved":`memorisation-repeat-saved`,"size-saved":`memorisation-size-saved`,"rerank-saved":`memorisation-rerank-saved`};function cD(){let{t:e,language:t}=G(),n=aD(),{status:r}=n,i=n.loaded&&(n.sizeText.trim()!==String(n.savedSize??``)||n.unit!==n.savedUnit),a=(()=>{if(!r)return null;if(r.kind===`out-of-range`){let{min:n,max:i}=NE[r.unit],a=new Intl.NumberFormat(t);return e(`memorisation-range-${r.unit}`,{min:a.format(n),max:a.format(i)})}return r.kind===`load-failed`?e(`memorisation-settings-load-failed`):r.kind===`stale`?e(`memorisation-settings-stale`):r.kind===`rerank-failed`?r.reason||e(`memorisation-settings-failed`):r.kind===`failed`?e(`memorisation-settings-failed`):null})();return(0,H.jsxs)(`section`,{"aria-labelledby":`memorisation-settings`,className:`space-y-3`,children:[(0,H.jsx)(`h2`,{id:`memorisation-settings`,className:`text-section-title font-semibold text-muted-foreground`,children:e(`memorisation-settings-title`)}),n.busy?(0,H.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,H.jsx)(at,{className:`size-4 animate-spin`,"aria-hidden":`true`}),e(`memorisation-settings-saving`)]}):r&&sD[r.kind]?(0,H.jsx)(`p`,{role:`status`,className:`text-sm`,children:e(sD[r.kind])}):null,a?(0,H.jsx)(Xp,{tone:`danger`,children:a}):null,(0,H.jsxs)(`div`,{className:`grid items-start gap-3 lg:grid-cols-2`,children:[(0,H.jsxs)(`div`,{className:oD,children:[(0,H.jsx)(`h3`,{className:`text-subsection-title font-semibold`,children:e(`memorisation-repeat-title`)}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`memorisation-repeat-intro`)}),(0,H.jsx)(eD,{value:n.repeat,disabled:n.busy||!n.loaded,onChoose:e=>void n.chooseRepeat(e)})]}),(0,H.jsxs)(`div`,{className:oD,children:[(0,H.jsx)(`h3`,{className:`text-subsection-title font-semibold`,children:e(`memorisation-size-title`)}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`memorisation-size-intro`)}),(0,H.jsx)(rD,{sizeText:n.sizeText,unit:n.unit,busy:n.busy||!n.loaded,changed:i,onSize:n.setSizeText,onUnit:n.setUnit,onSave:()=>void n.saveSize()})]}),(0,H.jsx)(`div`,{className:oD,children:(0,H.jsx)(tD,{value:n.rerank,ready:n.rerankerReady,busy:n.busy||!n.loaded,onChange:e=>void n.chooseRerank(e)})})]})]})}function lD(e){let{pathname:t,search:n,hash:r}=window.location;window.history.replaceState(window.history.state,``,`${t}${ZE(n,e)}${r}`)}function uD(){let[e,t]=(0,v.useState)(()=>typeof window>`u`?[]:XE(window.location.search??``)),n=(0,v.useCallback)(e=>{t(e),lD(e)},[]);return{labels:e,addLabel:(0,v.useCallback)(t=>{let r=JE(e,t);r.length!==e.length&&n(r)},[n,e]),removeLabel:(0,v.useCallback)(t=>n(e.filter(e=>e.toLowerCase()!==t.toLowerCase())),[n,e]),clearLabels:(0,v.useCallback)(()=>n([]),[n])}}var dD=e=>e.map(encodeURIComponent).join(`,`),fD={list:(e=[])=>W(e.length>0?`/api/memorisations?tags=${dD(e)}`:`/api/memorisations`),recall:(e,t=[])=>W(`/api/memorisations/recall?q=${encodeURIComponent(e)}${t.length>0?`&tags=${dD(t)}`:``}`),remove:e=>W(`/api/memories/${encodeURIComponent(e)}`,{method:`DELETE`}),removeMany:e=>W(`/api/memorisations/bulk-delete`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({ids:e})})};function pD(e){let[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)({kind:`idle`}),s=(0,v.useRef)(new Map),c=(0,v.useRef)(0),l=(0,v.useCallback)(async()=>{let t=++c.current,r=await fD.list(e);if(t===c.current){if(r.success&&r.data){for(let e of r.data.memorisations)s.current.set(e.id,e);n(r.data.memorisations),i(!1)}else i(!0)}},[e]),u=(0,v.useCallback)(async e=>{let t=e.trim(),{q:n,labels:r}=YE(t);if(!n&&r.length===0)return;o({kind:`running`,query:t});let i=await fD.recall(n,r);i.success&&i.data?o({kind:`done`,query:t,matches:RE(i.data.matches,[...s.current.values()])}):o({kind:`failed`,query:t,missingId:r.length===0&&/^ms-[a-z0-9]{6}$/.test(n)})},[]),d=(0,v.useCallback)(()=>o({kind:`idle`}),[]),f=(0,v.useCallback)(e=>{n(t=>t?.filter(t=>!e.includes(t.id))??t),o(t=>t.kind===`done`?{...t,matches:t.matches.filter(t=>!e.includes(t.id))}:t)},[]);return{items:t,loadFailed:r,recall:a,load:l,search:u,clearSearch:d,remove:(0,v.useCallback)(async e=>{let t=await fD.remove(e);return t.success&&f([e]),t},[f]),removeMany:(0,v.useCallback)(async e=>{let t=await fD.removeMany(e);return!t.success||!t.data?null:(f(t.data.deleted),t.data)},[f])}}function mD(){let{t:e}=G(),{labels:t,addLabel:n,removeLabel:r,clearLabels:i}=uD(),a=pD(t),{items:o,loadFailed:s,load:c}=a,l=WE(o),[u,d]=(0,v.useState)(null),[f,p]=(0,v.useState)(``),[m,h]=(0,v.useState)(!1),[g,_]=(0,v.useState)(null);(0,v.useEffect)(()=>{c()},[c]);async function y(e){let t=await a.remove(e.id);return t.success&&(p(e.id),_(null)),t.success}async function b(){let e=await a.removeMany([...l.ids]);return e?(_(e),p(``),l.cancel(),c(),!0):!1}return(0,H.jsxs)(`div`,{className:`space-y-8`,children:[(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`memorisation-intro`)}),(0,H.jsx)(QE,{recall:a.recall,onSearch:e=>void a.search(e),onClear:a.clearSearch,onDelete:d,onLabel:n,activeLabels:t}),(0,H.jsxs)(`section`,{"aria-labelledby":`memorisation-list`,className:`space-y-3`,children:[(0,H.jsx)(`h2`,{id:`memorisation-list`,className:`text-section-title font-semibold text-muted-foreground`,children:e(`memorisation-list-title`)}),f?(0,H.jsx)(`p`,{role:`status`,className:`text-sm`,children:e(`memorisation-deleted`,{id:f})}):null,g?(0,H.jsx)(OE,{result:g}):null,(0,H.jsx)(jE,{labels:t,onRemove:r,onClear:i}),s?(0,H.jsx)(Xp,{tone:`danger`,children:e(`memorisation-load-failed`)}):null,o===null&&!s?(0,H.jsx)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:e(`memorisation-loading`)}):null,o===null?null:(0,H.jsx)(KE,{items:o,labels:t,onDelete:d,onLabel:n,selection:l,onDeleteSelected:()=>h(!0)})]}),(0,H.jsx)(cD,{}),u?(0,H.jsx)(kE,{item:u,onConfirm:y,onClose:()=>d(null)}):null,m?(0,H.jsx)(DE,{count:l.ids.size,onConfirm:b,onClose:()=>h(!1)}):null]})}var hD=`/api/chat`,gD={"Content-Type":`application/json`},_D=15e4,vD=(e,t,n,r)=>W(`${hD}${e}`,{method:t,headers:gD,body:n===void 0?void 0:JSON.stringify(n),timeout:r}),yD={status:()=>W(`${hD}/status`),list:()=>W(`${hD}/conversations`),get:e=>W(`${hD}/conversations/${encodeURIComponent(e)}`),create:(e,t)=>vD(`/conversations`,`POST`,{folderId:e,scopeTag:t}),rename:(e,t)=>vD(`/conversations/${encodeURIComponent(e)}`,`PATCH`,{title:t}),move:(e,t)=>vD(`/conversations/${encodeURIComponent(e)}`,`PATCH`,{folderId:t}),remove:e=>vD(`/conversations/${encodeURIComponent(e)}`,`DELETE`),removeMany:e=>vD(`/conversations/bulk-delete`,`POST`,{ids:e}),ask:(e,t,n,r=!1)=>vD(`/conversations/${encodeURIComponent(e)}/messages`,`POST`,{question:t,scopeTag:n,retry:r},_D),createFolder:e=>vD(`/folders`,`POST`,{name:e}),renameFolder:(e,t)=>vD(`/folders/${encodeURIComponent(e)}`,`PATCH`,{name:t}),removeFolder:e=>vD(`/folders/${encodeURIComponent(e)}`,`DELETE`)},bD={conversations:[],folders:[],readOnly:!1};function xD(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(bD),[i,a]=(0,v.useState)([]),[o,s]=(0,v.useState)(null),[c,l]=(0,v.useState)(null),[u,d]=(0,v.useState)(null),[f,p]=(0,v.useState)(null),m=(0,v.useCallback)(async()=>{let e=await yD.list();e.success&&e.data&&r(e.data)},[]);(0,v.useEffect)(()=>{yD.status().then(e=>e.success&&e.data&&t(e.data)),W(`/api/tags`).then(e=>e.success&&e.data&&a(e.data.project)),m()},[m]);let h=(0,v.useCallback)(e=>e===null||i.some(t=>t.tag===e),[i]),g=(0,v.useCallback)(async e=>{let t=await yD.get(e);if(!t.success||!t.data)return void U.error(t.error??``);s(e),l(t.data);let n=t.data.conversation.scopeTag;d(h(n)?n:void 0)},[h]),_=(0,v.useCallback)(async(e=null)=>{let t=await yD.create(e,null);if(!t.success||!t.data)return void U.error(t.error??``);await m(),s(t.data.id),l({conversation:t.data,messages:[]}),d(null)},[m]),y=(0,v.useCallback)(async(e,t=!1)=>{if(u===void 0)return;let n=o;if(!n){let e=await yD.create(null,u);if(!e.success||!e.data)return void U.error(e.error??``);n=e.data.id,s(n),l({conversation:e.data,messages:[]})}p(e);let r=await yD.ask(n,e,u,t);if(p(null),!r.success||!r.data)return void U.error(r.error??``);await g(n),await m()},[o,u,g,m]),b=(0,v.useCallback)(e=>{let t=c?.messages??[],n=t[t.findIndex(t=>t.id===e.id)-1];n?.role===`user`&&y(n.content,!0)},[c,y]),x=(0,v.useCallback)(async e=>{o&&e.includes(o)&&(s(null),l(null),d(null)),await m()},[o,m]),S=(0,v.useCallback)(async e=>{let t=e.length===1?await yD.remove(e[0]):await yD.removeMany(e);if(!t.success)return void U.error(t.error??``);await x(e)},[x]),C=(0,v.useCallback)(async e=>{let t=n.conversations.filter(t=>t.folderId===e).map(e=>e.id),r=await yD.removeFolder(e);if(!r.success)return void U.error(r.error??``);await x(t)},[n,x]),w=(0,v.useCallback)(async e=>{let t=await e();return t.success?(await m(),o&&await g(o),null):t.code===`conflict`?`conflict`:t.error??`error`},[m,o,g]);return{status:e,list:n,projects:i,activeId:o,detail:c,scope:u,setScope:d,pending:f,scopeMissing:!!c&&u===void 0,open:g,newChat:_,ask:y,retry:b,deleteChats:S,deleteFolder:C,change:w}}function SD(e,t){return e||t?[`S`,`P`,`K`]:[`S`,`P`]}function CD(e,t,n){return e?e.kind===`memory`?t.has(e.id):e.kind===`skill`&&n.has(e.id):!1}function wD(e,t,n){return e.modified&&e.lastAppliedAt!==null?t(`chat-skill-modified-yes`,{date:n(e.lastAppliedAt)}):t(`chat-skill-modified-no`)}var TD=e=>`chat-skill-kind-${e}`;function ED(e,t){let n=[[t(`chat-search-phrases`),e.queries],[t(`chat-search-tags`),e.tags],[t(`chat-search-categories`),e.profileCategories]];return e.skills&&n.push([t(`chat-search-skills`),e.skills]),e.skillIntent&&n.push([t(`chat-search-skill-intent`),[t(`chat-intent-${e.skillIntent}`)]]),n}function DD(e){return e.startsWith(`P`)?`border-blue-600/40 bg-blue-500/10 text-blue-700 hover:bg-blue-500/20 dark:text-blue-400`:e.startsWith(`K`)?`border-violet-600/40 bg-violet-500/10 text-violet-700 hover:bg-violet-500/20 dark:text-violet-400`:`border-orange-600/40 bg-orange-500/10 text-orange-700 hover:bg-orange-500/20 dark:text-orange-400`}function OD({label:e,deleted:t,onOpen:n}){let{t:r}=G();return(0,H.jsx)(`button`,{type:`button`,"aria-haspopup":`dialog`,"aria-label":r(`chat-cite-label`,{label:e}),onClick:n,className:V(`mx-0.5 inline-flex h-5 cursor-pointer items-center rounded-md border px-1.5 align-baseline text-[11px] font-medium tabular-nums transition-colors duration-200 ease-in focus-visible:outline-2 focus-visible:outline-ring`,DD(e),t&&`line-through opacity-70`),children:e})}var kD={S:`chat-legend-memory`,P:`chat-legend-profile`,K:`chat-legend-skill`};function AD({label:e,text:t}){return(0,H.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,H.jsx)(`span`,{className:V(`inline-flex h-5 items-center rounded-md border px-1.5 text-[11px] font-medium`,DD(e)),children:e}),(0,H.jsx)(`span`,{dir:`auto`,children:t})]})}function jD({letters:e}){let{t}=G();return(0,H.jsx)(`p`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-muted-foreground`,children:e.map(e=>(0,H.jsx)(AD,{label:e,text:t(kD[e])},e))})}var MD=`__all__`,ND=`__choose__`;function PD({projects:e,scope:t,scopeMissing:n,disabled:r,onScope:i,onAsk:a}){let{t:o}=G(),[s,c]=(0,v.useState)(``),l=r||t===void 0;function u(e){e?.preventDefault(),!(l||!s.trim())&&(a(s.trim()),c(``))}function d(e){e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing&&(e.preventDefault(),u())}return(0,H.jsxs)(`form`,{onSubmit:u,className:`grid gap-2 rounded-2xl border border-border bg-card p-2.5 shadow-sm`,children:[(0,H.jsx)(gg,{value:s,disabled:r,rows:2,maxLength:4e3,placeholder:o(`chat-input-placeholder`),"aria-label":o(`chat-input-placeholder`),className:`min-h-14 resize-none bg-transparent`,onChange:e=>c(e.target.value),onKeyDown:d}),(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,H.jsxs)(`label`,{className:`flex min-w-0 flex-1 items-center gap-2 text-xs text-muted-foreground`,children:[(0,H.jsx)(`span`,{className:`shrink-0`,children:o(`chat-scope-label`)}),(0,H.jsxs)(Rr,{className:`h-8 min-w-0 max-w-64 flex-1 text-xs`,"aria-label":o(`chat-scope-label`),disabled:r,value:t===void 0?ND:t??MD,onChange:e=>{let t=e.target.value;t!==ND&&i(t===MD?null:t)},children:[t===void 0?(0,H.jsx)(`option`,{value:ND,children:o(`chat-scope-missing`)}):null,(0,H.jsx)(`option`,{value:MD,children:o(`chat-scope-all`)}),e.map(e=>(0,H.jsx)(`option`,{value:e.tag,children:e.projectName||e.displayName||e.tag},e.tag))]})]}),(0,H.jsxs)(q,{type:`submit`,size:`sm`,disabled:l||!s.trim(),"aria-label":o(`chat-send`),children:[(0,H.jsx)(te,{}),o(`chat-send`)]})]}),n?(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:o(`chat-scope-choose`)}):null]})}function FD({status:e}){let{t}=G();return(0,H.jsxs)(`div`,{role:`alert`,className:`grid gap-2 rounded-xl border border-border bg-card p-4`,children:[(0,H.jsxs)(`p`,{className:`flex items-center gap-2 text-sm font-medium`,children:[(0,H.jsx)(Xt,{className:`size-4 shrink-0`,"aria-hidden":`true`}),t(`chat-setup-title`)]}),(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t(`chat-setup-body`,{names:e.missing.join(`, `)})}),(0,H.jsxs)(`a`,{href:`/settings#settings-section-external-api`,className:`inline-flex w-fit items-center gap-1.5 text-sm text-primary-label underline-offset-4 hover:underline`,children:[(0,H.jsx)(Rt,{className:`size-3.5`,"aria-hidden":`true`}),t(`chat-setup-link`)]})]})}var ID=`__none__`;function LD({folders:e,folderId:t,onMove:n}){let{t:r}=G();return(0,H.jsxs)(Rr,{className:`h-8 w-full text-xs`,"aria-label":r(`chat-move`),value:t??ID,onChange:e=>n(e.target.value===ID?null:e.target.value),children:[(0,H.jsx)(`option`,{value:ID,children:r(`chat-no-folder`)}),e.map(e=>(0,H.jsx)(`option`,{value:e.id,children:e.name},e.id))]})}function RD(e){let{t}=G(),{conversation:n,active:r,selectMode:i}=e,a=n.title||t(`chat-new`);return i?(0,H.jsx)(`li`,{children:(0,H.jsxs)(`label`,{className:`flex min-h-11 md:min-h-9 cursor-pointer items-center gap-2 rounded-lg px-2 text-sm hover:bg-interactive-hover`,children:[(0,H.jsx)(Bs,{checked:e.selected,onCheckedChange:e.onToggleSelect,"aria-label":t(`chat-select-chat`,{title:a})}),(0,H.jsx)(`span`,{dir:`auto`,className:`min-w-0 flex-1 truncate`,title:a,children:a})]})}):(0,H.jsxs)(`li`,{children:[(0,H.jsxs)(`div`,{className:V(`group flex items-center gap-1 rounded-lg`,r?`bg-sidebar-accent text-sidebar-accent-foreground`:`hover:bg-interactive-hover`),children:[(0,H.jsx)(`button`,{type:`button`,className:`min-h-11 md:min-h-9 min-w-0 flex-1 cursor-pointer overflow-hidden rounded-lg px-2 text-start text-sm focus-visible:outline-2 focus-visible:outline-ring`,"aria-current":r?`true`:void 0,title:a,onClick:e.onOpen,children:(0,H.jsx)(`span`,{dir:`auto`,className:`block truncate`,children:a})}),e.readOnly?null:(0,H.jsx)(q,{type:`button`,variant:`ghost`,size:`icon-xs`,className:`me-1 shrink-0 text-muted-foreground`,"aria-label":t(`chat-chat-actions`),"aria-expanded":e.actionsOpen,onClick:e.onToggleActions,children:(0,H.jsx)(De,{})})]}),e.actionsOpen?(0,H.jsxs)(`div`,{className:`ms-2 mt-1 mb-2 grid gap-1.5 rounded-lg border border-border bg-card p-2`,children:[(0,H.jsx)(LD,{folders:e.folders,folderId:n.folderId,onMove:e.onMove}),(0,H.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,H.jsxs)(q,{type:`button`,variant:`outline`,size:`xs`,onClick:e.onRename,children:[(0,H.jsx)(wt,{}),t(`chat-rename`)]}),(0,H.jsxs)(q,{type:`button`,variant:`destructive`,size:`xs`,onClick:e.onDelete,children:[(0,H.jsx)(Jt,{}),t(`chat-delete`)]})]})]}):null]})}function zD({name:e,count:t,actions:n,onSelectAll:r,children:i}){let{t:a}=G(),[o,s]=(0,v.useState)(!0),c=o?Fe:Le;return(0,H.jsxs)(`section`,{className:`grid grid-cols-[minmax(0,1fr)] gap-0.5`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,H.jsxs)(`button`,{type:`button`,className:`flex min-h-11 md:min-h-8 min-w-0 flex-1 cursor-pointer items-center gap-1.5 rounded-lg px-1.5 text-xs font-medium text-muted-foreground transition-colors duration-200 ease-in hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring`,"aria-expanded":o,onClick:()=>s(!o),children:[(0,H.jsx)(fe,{className:V(`size-3.5 shrink-0 transition-transform rtl:-scale-x-100`,o&&`rotate-90`),"aria-hidden":`true`}),(0,H.jsx)(c,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),(0,H.jsx)(`span`,{className:`min-w-0 truncate uppercase tracking-wide`,children:e}),(0,H.jsx)(`span`,{className:`tabular-nums`,"aria-label":a(t===1?`chat-folder-count-one`:`chat-folder-count`,{count:t}),children:t})]}),r&&t>0?(0,H.jsx)(q,{type:`button`,variant:`ghost`,size:`xs`,onClick:r,children:a(`chat-select-all-folder`)}):null,n&&!r?(0,H.jsxs)(`div`,{className:`flex shrink-0 items-center`,role:`group`,"aria-label":a(`chat-folder-actions`),children:[(0,H.jsx)(q,{type:`button`,variant:`ghost`,size:`icon-xs`,"aria-label":a(`chat-new`),title:a(`chat-new`),onClick:n.onNewChat,children:(0,H.jsx)(Ot,{})}),(0,H.jsx)(q,{type:`button`,variant:`ghost`,size:`icon-xs`,"aria-label":a(`chat-rename`),title:a(`chat-rename`),onClick:n.onRename,children:(0,H.jsx)(wt,{})}),(0,H.jsx)(q,{type:`button`,variant:`ghost`,size:`icon-xs`,"aria-label":a(`chat-delete`),title:a(`chat-delete`),onClick:n.onDelete,children:(0,H.jsx)(Jt,{})})]}):null]}),o?(0,H.jsx)(`ul`,{className:`grid grid-cols-[minmax(0,1fr)] gap-0.5 ps-3`,children:i}):null]})}function BD(e){let{t}=G(),{chat:n,selectMode:r,selected:i}=e,[a,o]=(0,v.useState)(null),{conversations:s,folders:c,readOnly:l}=n.list,u=s.filter(e=>!e.folderId),d=e=>e===`conflict`?t(`chat-folder-exists`):e,f=t=>{let n=new Set(i);n.has(t)?n.delete(t):n.add(t),e.onSelected(n)},p=t=>e.onSelected(new Set([...i,...t])),m=r=>e.onName({title:t(`chat-chat-rename-title`),label:t(`chat-chat-title`),initial:r.title,submitLabel:t(`chat-save`),submit:e=>n.change(()=>yD.rename(r.id,e))}),h=t=>t.map(t=>(0,H.jsx)(RD,{conversation:t,folders:c,active:t.id===n.activeId,selectMode:r,selected:i.has(t.id),actionsOpen:a===t.id,readOnly:l,onOpen:()=>{n.open(t.id),e.onOpened?.()},onToggleSelect:()=>f(t.id),onToggleActions:()=>o(a===t.id?null:t.id),onRename:()=>m(t),onMove:e=>void n.change(()=>yD.move(t.id,e)),onDelete:()=>e.onDelete({kind:`chats`,ids:[t.id]})},t.id));return(0,H.jsxs)(`div`,{className:`flex min-h-0 flex-col gap-3`,children:[(0,H.jsx)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:r?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`span`,{className:`text-xs text-muted-foreground`,"aria-live":`polite`,children:t(`chat-selected-count`,{count:i.size})}),(0,H.jsxs)(q,{type:`button`,variant:`destructive`,size:`xs`,disabled:i.size===0,onClick:()=>e.onDelete({kind:`chats`,ids:[...i]}),children:[(0,H.jsx)(Jt,{}),t(`chat-delete-selected`)]}),(0,H.jsx)(q,{type:`button`,variant:`ghost`,size:`xs`,onClick:()=>e.onSelectMode(!1),children:t(`chat-select-done`)})]}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(q,{type:`button`,size:`xs`,disabled:l,onClick:()=>void n.newChat(),children:[(0,H.jsx)(Ot,{}),t(`chat-new`)]}),(0,H.jsxs)(q,{type:`button`,variant:`outline`,size:`xs`,disabled:l,onClick:()=>e.onName({title:t(`chat-folder-create-title`),label:t(`chat-folder-name`),initial:``,submitLabel:t(`chat-create`),submit:async e=>d(await n.change(()=>yD.createFolder(e)))}),children:[(0,H.jsx)(Ie,{}),t(`chat-new-folder`)]}),(0,H.jsxs)(q,{type:`button`,variant:`ghost`,size:`xs`,disabled:l||s.length===0,onClick:()=>e.onSelectMode(!0),children:[(0,H.jsx)(Vt,{}),t(`chat-select`)]})]})}),s.length===0&&c.length===0?(0,H.jsx)(`p`,{className:`px-1 text-xs text-muted-foreground`,children:t(`chat-empty-list`)}):null,c.map(i=>{let a=s.filter(e=>e.folderId===i.id);return(0,H.jsx)(zD,{name:i.name,count:a.length,onSelectAll:r?()=>p(a.map(e=>e.id)):void 0,actions:l?void 0:{onNewChat:()=>void n.newChat(i.id),onRename:()=>e.onName({title:t(`chat-folder-rename-title`),label:t(`chat-folder-name`),initial:i.name,submitLabel:t(`chat-save`),submit:async e=>d(await n.change(()=>yD.renameFolder(i.id,e)))}),onDelete:()=>e.onDelete({kind:`folder`,id:i.id,name:i.name,count:a.length})},children:h(a)},i.id)}),u.length>0?(0,H.jsx)(zD,{name:t(`chat-no-folder`),count:u.length,onSelectAll:r?()=>p(u.map(e=>e.id)):void 0,children:h(u)}):null]})}function VD({request:e,onConfirm:t,onCancel:n}){let{t:r}=G(),[i,a]=(0,v.useState)(!1);return(0,H.jsx)(Du,{open:e!==null,onOpenChange:e=>!e&&!i&&n(),children:(0,H.jsxs)(Au,{className:`sm:max-w-md`,children:[(0,H.jsxs)(ju,{children:[(0,H.jsx)(Nu,{children:e?.kind===`folder`?r(`chat-delete-folder-title`):r(`chat-delete-chats-title`)}),(0,H.jsx)(Pu,{children:e?HD(e,r):null})]}),(0,H.jsxs)(Mu,{children:[(0,H.jsx)(q,{type:`button`,variant:`secondary`,onClick:n,disabled:i,children:r(`chat-cancel`)}),(0,H.jsx)(q,{type:`button`,variant:`destructive`,disabled:i,onClick:async()=>{e&&(a(!0),await t(e),a(!1))},children:r(`chat-delete-confirm`)})]})]})})}function HD(e,t){if(e.kind===`folder`)return t(e.count===1?`chat-delete-folder-body-one`:`chat-delete-folder-body`,{name:e.name,count:e.count});let n=e.ids.length;return t(n===1?`chat-delete-chats-body-one`:`chat-delete-chats-body`,{count:n})}function UD({request:e,onClose:t}){let{t:n}=G(),[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(null),[s,c]=(0,v.useState)(!1);(0,v.useEffect)(()=>{i(e?.initial??``),o(null)},[e]);async function l(n){if(n.preventDefault(),!e||!r.trim())return;c(!0);let i=await e.submit(r.trim());c(!1),i?o(i):t()}return(0,H.jsx)(Du,{open:e!==null,onOpenChange:e=>!e&&t(),children:(0,H.jsx)(Au,{className:`sm:max-w-sm`,children:(0,H.jsxs)(`form`,{onSubmit:l,className:`grid gap-4`,children:[(0,H.jsx)(ju,{children:(0,H.jsx)(Nu,{children:e?.title})}),(0,H.jsxs)(`div`,{className:`grid gap-2`,children:[(0,H.jsx)(nm,{htmlFor:`chat-name-input`,children:e?.label}),(0,H.jsx)(Jd,{id:`chat-name-input`,value:r,maxLength:80,autoFocus:!0,"aria-invalid":a?!0:void 0,onChange:e=>i(e.target.value)}),a?(0,H.jsx)(`p`,{className:`text-xs text-destructive-label`,children:a}):null]}),(0,H.jsxs)(Mu,{children:[(0,H.jsx)(q,{type:`button`,variant:`secondary`,onClick:t,children:n(`chat-cancel`)}),(0,H.jsx)(q,{type:`submit`,disabled:s||!r.trim(),children:e?.submitLabel})]})]})})})}var WD=/\[([SPK]\d+)\]/g,GD=/<(?:[^>"']|"[^"]*"|'[^']*')*>/g,KD=/^<(\/?)([a-zA-Z][a-zA-Z0-9]*)/,qD=new Set([`a`,`code`,`pre`,`button`]);function JD(e,t,n,r){let i=new Set(t),a=(e,t)=>{if(!i.has(t))return e;let a=[`cite-chip`];t.startsWith(`P`)&&a.push(`cite-profile`),t.startsWith(`K`)&&a.push(`cite-skill`),n(t)&&a.push(`cite-deleted`);let o=r(t).replace(/["&<>]/g,e=>`&#${e.charCodeAt(0)};`);return`<button type="button" class="${a.join(` `)}" data-cite="${t}" aria-haspopup="dialog" aria-label="${o}">${t}</button>`},o=``,s=0,c=0,l=(t,n)=>{let r=e.slice(t,n);o+=c>0?r:r.replace(WD,a)};for(let t of e.matchAll(GD)){l(s,t.index),o+=t[0],s=t.index+t[0].length;let e=KD.exec(t[0]);!e||!qD.has(e[2].toLowerCase())||(e[1]?c=Math.max(0,c-1):c+=1)}return l(s,e.length),o}var YD=/\[([SPK]\d+)\]/g;function XD(e,t){let n=new Set(t),r=[],i=``,a=0;for(let t of e.matchAll(YD)){let o=t[1];n.has(o)&&(i+=e.slice(a,t.index),i&&r.push({kind:`text`,text:i}),i=``,r.push({kind:`cite`,label:o}),a=t.index+t[0].length)}return i+=e.slice(a),i&&r.push({kind:`text`,text:i}),r}function ZD(e,t){let n=[];for(let r of XD(e,t))r.kind===`cite`&&!n.includes(r.label)&&n.push(r.label);return n}function QD({plan:e}){let{t}=G(),n=ED(e,t);return(0,H.jsxs)(`details`,{className:`group text-xs text-muted-foreground`,children:[(0,H.jsxs)(`summary`,{className:`inline-flex cursor-pointer list-none items-center gap-1.5 rounded-md py-0.5 transition-colors duration-200 ease-in hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring`,children:[(0,H.jsx)(It,{className:`size-3`,"aria-hidden":`true`}),t(`chat-how-searched`)]}),(0,H.jsxs)(`div`,{className:`mt-2 grid gap-1.5 rounded-lg border border-border p-2.5`,children:[e.skipped?(0,H.jsx)(`p`,{children:t(`chat-plan-skipped`)}):null,e.skillFacts===`unavailable`?(0,H.jsx)(`p`,{children:t(`chat-skill-facts-unavailable`)}):null,(0,H.jsx)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-3 gap-y-1`,children:n.map(([e,n])=>(0,H.jsxs)(`div`,{className:`contents`,children:[(0,H.jsx)(`dt`,{children:e}),(0,H.jsx)(`dd`,{dir:`auto`,className:`min-w-0 break-words text-foreground`,children:n.length?n.join(` · `):t(`chat-none`)})]},e))})]})]})}var $D={no_sources:`chat-no-sources`,insufficient:`chat-insufficient`,uncited:`chat-uncited`};function eO({message:e,missingMemoryIds:t,missingSkillNames:n,readOnly:r,onOpenSource:i,onRetry:a}){let{t:o}=G(),s=e.sources.map(e=>e.label),c=new Map(e.sources.map(e=>[e.label,e])),l=e=>CD(e,t,n),u=(0,v.useMemo)(()=>JD(Ny(e.content),s,e=>l(c.get(e)),e=>o(`chat-cite-label`,{label:e})),[e.content,e.sources,t,n,o]),d=e=>{let t=e.target.closest(`[data-cite]`),n=t?c.get(t.dataset.cite??``):void 0;n&&i(n)},f=ZD(e.content,s).map(e=>c.get(e)).filter(e=>!!e);return(0,H.jsxs)(`article`,{className:`grid min-w-0 gap-2.5`,children:[e.errorCode?(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 rounded-lg border border-destructive/30 bg-destructive/10 p-2.5 text-sm text-destructive-label`,children:[(0,H.jsx)(Xt,{className:`size-4 shrink-0`,"aria-hidden":`true`}),(0,H.jsx)(`span`,{className:`min-w-0 flex-1`,children:o(`chat-error`,{code:e.errorCode})}),r?null:(0,H.jsxs)(q,{type:`button`,variant:`outline`,size:`xs`,onClick:()=>a(e),children:[(0,H.jsx)(Ft,{}),o(`chat-retry`)]})]}):null,e.content?(0,H.jsx)(`div`,{dir:`auto`,className:`markdown-content chat-answer break-words text-sm leading-7`,onClick:d,dangerouslySetInnerHTML:{__html:u}}):null,e.notice?(0,H.jsxs)(`p`,{className:`flex items-start gap-2 text-xs text-muted-foreground`,children:[(0,H.jsx)(qe,{className:`mt-0.5 size-3.5 shrink-0`,"aria-hidden":`true`}),o($D[e.notice])]}):null,f.length?(0,H.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,H.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:o(`chat-sources`)}),(0,H.jsx)(`ul`,{className:`grid gap-1`,children:f.map(e=>(0,H.jsxs)(`li`,{className:`flex min-w-0 items-start gap-2 text-xs`,children:[(0,H.jsx)(OD,{label:e.label,deleted:l(e),onOpen:()=>i(e)}),(0,H.jsx)(`span`,{dir:`auto`,className:`min-w-0 flex-1 truncate leading-5 text-muted-foreground`,children:e.kind===`skill`?e.id:`${e.projectName?`${e.projectName} · `:``}${e.text}`})]},e.label))})]}):null,e.plan?(0,H.jsx)(QD,{plan:e.plan}):null]})}function tO({text:e}){let{t}=G();return(0,H.jsx)(`div`,{className:`flex justify-end`,children:(0,H.jsxs)(`div`,{className:`max-w-[85%] rounded-2xl rounded-ee-md bg-secondary px-3.5 py-2.5`,children:[(0,H.jsxs)(`span`,{className:`sr-only`,children:[t(`chat-you`),`: `]}),(0,H.jsx)(`p`,{dir:`auto`,className:`whitespace-pre-wrap break-words text-sm leading-6`,children:e})]})})}function nO({messages:e,pending:t,missingMemoryIds:n,missingSkillNames:r,readOnly:i,onOpenSource:a,onRetry:o}){let{t:s}=G();return e.length===0&&!t?(0,H.jsx)(`p`,{className:`m-auto max-w-sm text-center text-sm text-muted-foreground`,children:s(`chat-empty-thread`)}):(0,H.jsxs)(`ol`,{className:`grid gap-6`,"aria-live":`polite`,children:[e.map(e=>(0,H.jsx)(`li`,{children:e.role===`user`?(0,H.jsx)(tO,{text:e.content}):(0,H.jsx)(eO,{message:e,missingMemoryIds:n,missingSkillNames:r,readOnly:i,onOpenSource:a,onRetry:o})},e.id)),t?(0,H.jsxs)(`li`,{className:`grid gap-4`,children:[e.at(-1)?.role===`user`&&e.at(-1)?.content===t?null:(0,H.jsx)(tO,{text:t}),(0,H.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,role:`status`,children:[(0,H.jsx)(at,{className:`size-4 animate-spin`,"aria-hidden":`true`}),s(`chat-thinking`)]})]}):null]})}var rO={person:`chat-skill-by-person`,agent:`chat-skill-by-agent`,automatic:`chat-skill-by-automatic`};function iO({skill:e}){let{t}=G(),n=[[t(`chat-skill-uses`),String(e.uses)],[t(`chat-skill-failed`),String(e.failedTurns)],[t(`chat-skill-attention`),e.attention.toFixed(2)],[t(`chat-skill-modified`),wD(e,t,Tp)]];return(0,H.jsxs)(`div`,{className:`grid min-w-0 gap-3`,children:[(0,H.jsx)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 rounded-lg border border-border p-2.5 text-xs text-muted-foreground`,children:n.map(([e,t])=>(0,H.jsxs)(`div`,{className:`contents`,children:[(0,H.jsx)(`dt`,{children:e}),(0,H.jsx)(`dd`,{className:`min-w-0 break-words text-foreground`,children:t})]},e))}),(0,H.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[t(`chat-skill-window`),` `,t(`chat-skill-modified-note`)]}),(0,H.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,H.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:t(`chat-skill-history`)}),e.history.length===0?(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t(`chat-skill-history-empty`)}):(0,H.jsx)(`ol`,{className:`grid gap-2`,children:e.history.map((e,n)=>(0,H.jsxs)(`li`,{className:`grid gap-0.5 rounded-lg border border-border p-2 text-xs`,children:[(0,H.jsxs)(`span`,{className:`flex flex-wrap gap-x-2 text-muted-foreground`,children:[(0,H.jsx)(`span`,{className:`font-medium text-foreground`,children:t(TD(e.kind))}),(0,H.jsx)(`span`,{children:wp(e.at)}),e.appliedBy&&e.appliedBy in rO?(0,H.jsx)(`span`,{children:t(rO[e.appliedBy])}):null]}),(0,H.jsx)(`span`,{dir:`auto`,className:`break-words`,children:e.summary})]},n))})]})]})}var aO={preferences:`profile-preferences`,patterns:`profile-patterns`,workflows:`profile-workflows`};function oO({source:e,deleted:t}){let{t:n,language:r}=G(),i=e.kind===`memory`;return e.kind===`skill`?(0,H.jsxs)(`div`,{className:`grid min-w-0 gap-3`,children:[t?(0,H.jsxs)(`p`,{className:`flex items-start gap-2 rounded-lg border border-border bg-muted/40 p-2.5 text-xs`,children:[(0,H.jsx)(Xt,{className:`mt-0.5 size-3.5 shrink-0`,"aria-hidden":`true`}),n(`chat-skill-missing`)]}):null,e.skill?(0,H.jsx)(iO,{skill:e.skill}):null,(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`chat-source-note`)})]}):(0,H.jsxs)(`div`,{className:`grid min-w-0 gap-3`,children:[t?(0,H.jsxs)(`p`,{className:`flex items-start gap-2 rounded-lg border border-border bg-muted/40 p-2.5 text-xs`,children:[(0,H.jsx)(Xt,{className:`mt-0.5 size-3.5 shrink-0`,"aria-hidden":`true`}),n(`chat-source-deleted`)]}):null,(0,H.jsxs)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-xs text-muted-foreground`,children:[i&&e.projectName?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`dt`,{children:n(`chat-source-project`)}),(0,H.jsx)(`dd`,{className:`min-w-0 break-words text-foreground`,children:e.projectName})]}):null,i&&e.createdAt?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`dt`,{children:n(`chat-source-date`)}),(0,H.jsx)(`dd`,{className:`text-foreground`,children:wp(new Date(e.createdAt).toISOString())})]}):null,!i&&e.section?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`dt`,{children:n(`chat-source-profile`)}),(0,H.jsxs)(`dd`,{className:`text-foreground`,children:[n(aO[e.section]),e.category?` · ${e.category}`:``]})]}):null]}),e.tags?.length?(0,H.jsx)(`div`,{className:`flex flex-wrap gap-1`,"aria-label":n(`chat-source-tags`),children:e.tags.map(e=>(0,H.jsx)(qd,{variant:`outline`,children:e},e))}):null,(0,H.jsx)(Zb,{dir:r===`ar`?`rtl`:`ltr`,className:`max-h-[45vh] rounded-lg border`,children:(0,H.jsx)(`p`,{dir:`auto`,className:`whitespace-pre-wrap break-words p-3 text-sm leading-6`,children:e.text})}),!i&&e.evidence?.length?(0,H.jsxs)(`div`,{className:`grid gap-1`,children:[(0,H.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:n(`chat-source-evidence`)}),(0,H.jsx)(`ul`,{className:`grid gap-1 text-xs`,children:e.evidence.map((e,t)=>(0,H.jsx)(`li`,{dir:`auto`,className:`break-words`,children:e},t))})]}):null,(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`chat-source-note`)}),i?(0,H.jsx)(`a`,{href:J.project,className:`text-xs text-primary-label underline-offset-4 hover:underline`,children:n(`chat-source-open-project`)}):null]})}function sO({source:e,deleted:t,onClose:n}){let{t:r}=G();return(0,H.jsx)(Du,{open:e!==null,onOpenChange:e=>!e&&n(),children:(0,H.jsxs)(Au,{className:`sm:max-w-lg`,children:[(0,H.jsxs)(ju,{children:[(0,H.jsx)(Nu,{children:e?`${e.label} · ${e.kind===`memory`?r(`chat-source-memory`):e.kind===`skill`?`${r(`chat-source-skill`)} ${e.id}`:r(`chat-source-profile`)}`:``}),(0,H.jsx)(Pu,{className:`sr-only`,children:e?.text.slice(0,120)})]}),e?(0,H.jsx)(oO,{source:e,deleted:t}):null]})})}function cO(){let{t:e}=G(),t=xD(),[n,r]=(0,v.useState)(!1),i=(0,v.useRef)(null),a=(0,v.useRef)(null),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(new Set),[u,d]=(0,v.useState)(null),[f,p]=(0,v.useState)(null),[m,h]=(0,v.useState)(null);(0,v.useEffect)(()=>{if(!n)return;let e=i.current;return a.current?.focus(),()=>e?.focus()},[n]);let g=new Set(t.detail?.missingMemoryIds??[]),_=new Set(t.detail?.missingSkillNames??[]),y=!!t.detail?.messages.some(e=>e.sources.some(e=>e.kind===`skill`)),b=t.list.readOnly,x=t.status?.ready??!1;function S(e){s(e),l(new Set)}async function C(e){e.kind===`folder`?await t.deleteFolder(e.id):await t.deleteChats(e.ids),d(null),S(!1)}let w=(0,H.jsx)(BD,{chat:t,selectMode:o,selected:c,onSelectMode:S,onSelected:l,onDelete:d,onName:p,onOpened:()=>r(!1)});return(0,H.jsxs)(`div`,{className:`grid min-h-[calc(100svh-9rem)] gap-4 md:grid-cols-[17rem_minmax(0,1fr)]`,children:[(0,H.jsx)(`aside`,{className:`hidden min-h-0 overflow-y-auto border-e border-border pe-4 md:sticky md:top-6 md:block md:max-h-[calc(100svh-3rem)] md:self-start`,children:w}),n?(0,H.jsxs)(`div`,{className:`fixed inset-0 z-40 md:hidden`,role:`dialog`,"aria-modal":`true`,"aria-label":e(`chat-show-list`),onKeyDown:e=>{e.key===`Escape`&&r(!1)},children:[(0,H.jsx)(`button`,{type:`button`,className:`absolute inset-0 bg-black/50`,"aria-label":e(`chat-cancel`),onClick:()=>r(!1)}),(0,H.jsxs)(`div`,{className:`absolute inset-y-0 start-0 flex w-[min(20rem,85vw)] flex-col gap-3 overflow-y-auto bg-background p-4 shadow-xl`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,H.jsx)(`span`,{className:`text-sm font-medium`,children:e(`chat-conversations`)}),(0,H.jsx)(q,{ref:a,type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":e(`chat-cancel`),onClick:()=>r(!1),children:(0,H.jsx)(an,{})})]}),w]})]}):null,(0,H.jsxs)(`section`,{className:`flex min-h-0 min-w-0 flex-col gap-4`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2 md:hidden`,children:[(0,H.jsxs)(q,{ref:i,type:`button`,variant:`outline`,size:`sm`,onClick:()=>r(!0),children:[(0,H.jsx)(lt,{}),e(`chat-show-list`)]}),t.detail?(0,H.jsx)(`span`,{dir:`auto`,className:`min-w-0 truncate text-sm text-muted-foreground`,children:t.detail.conversation.title}):null]}),(0,H.jsx)(jD,{letters:SD(t.status?.skillFacts===!0,y)}),t.status&&!x?(0,H.jsx)(FD,{status:t.status}):null,b?(0,H.jsx)(`p`,{role:`alert`,className:`rounded-xl border border-border bg-card p-3 text-sm`,children:e(`chat-read-only`)}):null,(0,H.jsx)(`div`,{className:V(`flex min-h-48 flex-1 flex-col overflow-y-auto`),children:(0,H.jsx)(nO,{messages:t.detail?.messages??[],pending:t.pending,missingMemoryIds:g,missingSkillNames:_,readOnly:b||!x,onOpenSource:h,onRetry:t.retry})}),(0,H.jsxs)(`div`,{className:`sticky bottom-0 grid gap-1.5 bg-background pb-1`,children:[(0,H.jsx)(PD,{projects:t.projects,scope:t.scope,scopeMissing:t.scopeMissing,disabled:!x||b||t.pending!==null,onScope:t.setScope,onAsk:e=>void t.ask(e)}),x&&t.status?.apiHost?(0,H.jsxs)(`p`,{className:`flex items-center gap-1.5 px-1 text-[11px] text-muted-foreground`,children:[(0,H.jsx)(qe,{className:`size-3 shrink-0`,"aria-hidden":`true`}),e(`chat-provider-note`,{host:t.status.apiHost})]}):null,x&&t.status?.skillFacts?(0,H.jsxs)(`p`,{className:`flex items-center gap-1.5 px-1 text-[11px] text-muted-foreground`,children:[(0,H.jsx)(qe,{className:`size-3 shrink-0`,"aria-hidden":`true`}),e(`chat-skill-privacy`)]}):null]})]}),(0,H.jsx)(VD,{request:u,onConfirm:C,onCancel:()=>d(null)}),(0,H.jsx)(UD,{request:f,onClose:()=>p(null)}),(0,H.jsx)(sO,{source:m,deleted:CD(m??void 0,g,_),onClose:()=>h(null)})]})}var lO=[{id:`skills-section-activity`,title:`Activity`},{id:`skills-section-ranked`,title:`Ranked skills`},{id:`skills-section-pending`,title:`Pending proposals`},{id:`skills-section-recent`,title:`Recent proposals`},{id:`skills-section-folders`,title:`Watched folders`}],uO=e=>lO.map(t=>({id:t.id,label:Pf(t.title,e)})),dO=[`all`,`not-modified`,`modified`,`suggested`],fO=`omms-skills-modified-filter`;function pO(e){let t=e.filter(e=>e.modified).length,n=e.filter(e=>e.suggested).length;return{all:e.length,"not-modified":e.length-t,modified:t,suggested:n}}function mO(e,t){return t===`all`?e:t===`suggested`?e.filter(e=>e.suggested):e.filter(e=>e.modified===(t===`modified`))}function hO(){try{let e=localStorage.getItem(fO);return dO.find(t=>t===e)??`all`}catch{return`all`}}function gO(e){try{localStorage.setItem(fO,e)}catch{}}var _O=e=>typeof e==`number`&&Number.isFinite(e)&&e>0?Math.floor(e):0,vO=e=>Array.isArray(e)?e:[],yO=e=>e&&typeof e==`object`?e:{};function bO(e){return vO(e).map(yO).filter(e=>typeof e.day==`string`).map(e=>({day:e.day,uses:_O(e.uses),failed:_O(e.failed)}))}var xO=e=>e.map(({day:e,uses:t,failed:n})=>({key:e,uses:t,failed:n})),SO=[`day`,`month`,`year`],CO=/^\d{4}-(0[1-9]|1[0-2])$/;function wO(e){let t=yO(e);return{months:vO(t.months).filter(e=>typeof e==`string`&&CO.test(e)),years:vO(t.years).filter(e=>Number.isInteger(e))}}function TO(e){let t=yO(e),n=yO(t.totals),r=bO(t.days),i=Array.isArray(t.series)?t.series.map(yO).filter(e=>typeof e.key==`string`).map(e=>({key:e.key,uses:_O(e.uses),failed:_O(e.failed)})):xO(r),a=vO(t.topSkills).map(yO).filter(e=>typeof e.name==`string`).map(e=>({name:e.name,path:typeof e.path==`string`?e.path:null,uses:_O(e.uses),failed:_O(e.failed)}));return{bucket:SO.includes(t.bucket)?t.bucket:`day`,series:i,days:r,topSkills:a,topTotal:Math.max(_O(t.topTotal),a.length),totals:{uses:_O(n.uses),failed:_O(n.failed),activeSkills:_O(n.activeSkills)},available:wO(t.available)}}var EO=[`created`,`applied`,`rejected`,`undone`,`stale`];function DO(e){let t=yO(e),n=vO(t.entries).map(yO).filter(e=>EO.includes(e.kind)&&typeof e.id==`string`).map(e=>({id:e.id,proposalId:typeof e.proposalId==`string`?e.proposalId:``,kind:e.kind,at:_O(e.at),summary:typeof e.summary==`string`?e.summary:``,appliedBy:typeof e.appliedBy==`string`?e.appliedBy:null,versionId:typeof e.versionId==`string`?e.versionId:null,canUndo:e.canUndo===!0,laterAppliedCount:_O(e.laterAppliedCount),added:_O(e.added),removed:_O(e.removed)}));return{total:Math.max(_O(t.total),n.length),entries:n}}var OO=e=>e.every(e=>e.uses===0),kO=e=>({...e,succeeded:Math.max(0,e.uses-e.failed),failed:Math.min(e.failed,e.uses)}),AO=[`pending`,`applied`,`rejected`,`stale`,`undone`];function jO(e){return AO.map(t=>({state:t,count:e.filter(e=>e.state===t).length}))}var MO=e=>Date.parse(`${e}T12:00:00`),NO={bucket:`day`,month:null},PO=`omms-skills-activity-range`,FO=`last-30`,IO=30,LO=(e,t)=>Math.min(t,e+8),RO={day:`Uses per day`,month:`Uses per month`,year:`Uses per year`},zO={day:`Day`,month:`Month`,year:`Year`};function BO(e){return e.bucket===`year`?{bucket:`year`}:e.bucket===`month`?{bucket:`month`,year:e.year}:e.month?{bucket:`day`,month:e.month}:{bucket:`day`,days:IO}}function VO(e){return e.bucket===`year`?`year`:e.bucket===`month`?`month:${e.year}`:e.month?`day:${e.month}`:`day`}function HO(e){if(e===`year`)return{bucket:`year`};let t=/^day:(\d{4}-\d{2})$/.exec(e??``)?.[1];if(t&&CO.test(t))return{bucket:`day`,month:t};let n=/^month:(\d{4})$/.exec(e??``)?.[1];return n?{bucket:`month`,year:Number(n)}:NO}function UO(e,t){return e.bucket===`day`&&e.month&&!t.months.includes(e.month)||e.bucket===`month`&&!t.years.includes(e.year)?NO:e}function WO(e,t){return e===`year`?{bucket:e}:e===`month`?{bucket:e,year:t}:NO}var GO=e=>e.bucket===`month`?String(e.year):e.bucket===`day`?e.month??`last-30`:``;function KO(e,t){return e.bucket===`month`?{bucket:`month`,year:Number(t)}:t===`last-30`?NO:{bucket:`day`,month:t}}function qO(e,t,n,r){if(e===`year`)return t;if(e===`day`){let e=new Date(MO(t));return n?Bi(e,r.choice,r.locale):zi(e,r.choice,r.locale)}let[i,a]=t.split(`-`).map(Number);return new Intl.DateTimeFormat(r.locale,{month:n?`long`:`short`,...n?{year:`numeric`}:{},timeZone:`UTC`,calendar:`gregory`}).format(Date.UTC(i,a-1,1))}function JO(e,t,n,r){if(e.bucket===`month`)return String(e.year);if(e.bucket===`day`)return e.month?qO(`month`,e.month,!0,n):r(`Last 30 days`);let i=t[0]?.key??``,a=t.at(-1)?.key??``;return i===a?a:Ff(r(`{from} to {to}`),{from:i,to:a})}function YO(e,t,n,r,i){if(e.bucket===`year`)return[];if(e.bucket===`month`)return[...new Set([n,e.year,...t.years])].sort((e,t)=>t-e).map(e=>({value:String(e),label:String(e)}));let a=[...new Set([...e.month?[e.month]:[],...t.months])];return[{value:FO,label:i},...a.sort((e,t)=>t.localeCompare(e)).map(e=>({value:e,label:qO(`month`,e,!0,r)}))]}var XO=[`day`,`month`,`year`],ZO={day:`Days`,month:`Months`,year:`Years`},QO={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1};function $O({range:e,available:t,currentYear:n,loading:r,onChange:i}){let a=Y(),o=(0,v.useRef)([]),s=t=>{let r=XO[t];o.current[t]?.focus(),r!==e.bucket&&i(WO(r,n))};return(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,H.jsx)(`div`,{role:`radiogroup`,"aria-label":a(`Show uses by`),className:`inline-flex gap-1.5`,onKeyDown:t=>{let n=QO[t.key];if(!n)return;t.preventDefault();let r=getComputedStyle(t.currentTarget).direction===`rtl`,i=t.key===`ArrowLeft`||t.key===`ArrowRight`,a=r&&i?-n:n,o=XO.indexOf(e.bucket);s((o+a+XO.length)%XO.length)},children:XO.map((t,n)=>(0,H.jsx)(`button`,{ref:e=>{o.current[n]=e},type:`button`,role:`radio`,"aria-checked":e.bucket===t,tabIndex:e.bucket===t?0:-1,className:V(`min-h-9 rounded-[10px] border px-3 text-ui transition-colors duration-150 focus-visible:outline-2 focus-visible:outline-ring`,e.bucket===t?`border-primary/40 bg-selection text-foreground`:`border-input bg-card text-muted-foreground hover:bg-interactive-hover`),onClick:()=>s(n),children:a(ZO[t])},t))}),e.bucket===`year`?(0,H.jsx)(`span`,{className:`h-9 w-44`,"aria-hidden":`true`}):(0,H.jsx)(Rr,{className:`w-44`,"aria-label":a(e.bucket===`day`?`Days to show`:`Year to show`),value:GO(e),onChange:t=>i(KO(e,t.target.value)),children:YO(e,t,n,Op(),a(`Last 30 days`)).map(e=>(0,H.jsx)(`option`,{value:e.value,children:e.label},e.value))}),(0,H.jsx)(at,{"aria-hidden":`true`,className:V(`size-4 animate-spin text-muted-foreground`,!r&&`invisible`)}),(0,H.jsx)(`span`,{role:`status`,className:`sr-only`,children:r?a(`Loading…`):``})]})}var ek=`dangerouslySetInnerHTML.onCopy.onCopyCapture.onCut.onCutCapture.onPaste.onPasteCapture.onCompositionEnd.onCompositionEndCapture.onCompositionStart.onCompositionStartCapture.onCompositionUpdate.onCompositionUpdateCapture.onFocus.onFocusCapture.onBlur.onBlurCapture.onChange.onChangeCapture.onBeforeInput.onBeforeInputCapture.onInput.onInputCapture.onReset.onResetCapture.onSubmit.onSubmitCapture.onInvalid.onInvalidCapture.onLoad.onLoadCapture.onError.onErrorCapture.onKeyDown.onKeyDownCapture.onKeyPress.onKeyPressCapture.onKeyUp.onKeyUpCapture.onAbort.onAbortCapture.onCanPlay.onCanPlayCapture.onCanPlayThrough.onCanPlayThroughCapture.onDurationChange.onDurationChangeCapture.onEmptied.onEmptiedCapture.onEncrypted.onEncryptedCapture.onEnded.onEndedCapture.onLoadedData.onLoadedDataCapture.onLoadedMetadata.onLoadedMetadataCapture.onLoadStart.onLoadStartCapture.onPause.onPauseCapture.onPlay.onPlayCapture.onPlaying.onPlayingCapture.onProgress.onProgressCapture.onRateChange.onRateChangeCapture.onSeeked.onSeekedCapture.onSeeking.onSeekingCapture.onStalled.onStalledCapture.onSuspend.onSuspendCapture.onTimeUpdate.onTimeUpdateCapture.onVolumeChange.onVolumeChangeCapture.onWaiting.onWaitingCapture.onAuxClick.onAuxClickCapture.onClick.onClickCapture.onContextMenu.onContextMenuCapture.onDoubleClick.onDoubleClickCapture.onDrag.onDragCapture.onDragEnd.onDragEndCapture.onDragEnter.onDragEnterCapture.onDragExit.onDragExitCapture.onDragLeave.onDragLeaveCapture.onDragOver.onDragOverCapture.onDragStart.onDragStartCapture.onDrop.onDropCapture.onMouseDown.onMouseDownCapture.onMouseEnter.onMouseLeave.onMouseMove.onMouseMoveCapture.onMouseOut.onMouseOutCapture.onMouseOver.onMouseOverCapture.onMouseUp.onMouseUpCapture.onSelect.onSelectCapture.onTouchCancel.onTouchCancelCapture.onTouchEnd.onTouchEndCapture.onTouchMove.onTouchMoveCapture.onTouchStart.onTouchStartCapture.onPointerDown.onPointerDownCapture.onPointerMove.onPointerMoveCapture.onPointerUp.onPointerUpCapture.onPointerCancel.onPointerCancelCapture.onPointerEnter.onPointerEnterCapture.onPointerLeave.onPointerLeaveCapture.onPointerOver.onPointerOverCapture.onPointerOut.onPointerOutCapture.onGotPointerCapture.onGotPointerCaptureCapture.onLostPointerCapture.onLostPointerCaptureCapture.onScroll.onScrollCapture.onWheel.onWheelCapture.onAnimationStart.onAnimationStartCapture.onAnimationEnd.onAnimationEndCapture.onAnimationIteration.onAnimationIterationCapture.onTransitionEnd.onTransitionEndCapture`.split(`.`);function tk(e){return typeof e==`string`&&ek.includes(e)}var nk=new Set(`aria-activedescendant.aria-atomic.aria-autocomplete.aria-busy.aria-checked.aria-colcount.aria-colindex.aria-colspan.aria-controls.aria-current.aria-describedby.aria-details.aria-disabled.aria-errormessage.aria-expanded.aria-flowto.aria-haspopup.aria-hidden.aria-invalid.aria-keyshortcuts.aria-label.aria-labelledby.aria-level.aria-live.aria-modal.aria-multiline.aria-multiselectable.aria-orientation.aria-owns.aria-placeholder.aria-posinset.aria-pressed.aria-readonly.aria-relevant.aria-required.aria-roledescription.aria-rowcount.aria-rowindex.aria-rowspan.aria-selected.aria-setsize.aria-sort.aria-valuemax.aria-valuemin.aria-valuenow.aria-valuetext.className.color.height.id.lang.max.media.method.min.name.style.target.width.role.tabIndex.accentHeight.accumulate.additive.alignmentBaseline.allowReorder.alphabetic.amplitude.arabicForm.ascent.attributeName.attributeType.autoReverse.azimuth.baseFrequency.baselineShift.baseProfile.bbox.begin.bias.by.calcMode.capHeight.clip.clipPath.clipPathUnits.clipRule.colorInterpolation.colorInterpolationFilters.colorProfile.colorRendering.contentScriptType.contentStyleType.cursor.cx.cy.d.decelerate.descent.diffuseConstant.direction.display.divisor.dominantBaseline.dur.dx.dy.edgeMode.elevation.enableBackground.end.exponent.externalResourcesRequired.fill.fillOpacity.fillRule.filter.filterRes.filterUnits.floodColor.floodOpacity.focusable.fontFamily.fontSize.fontSizeAdjust.fontStretch.fontStyle.fontVariant.fontWeight.format.from.fx.fy.g1.g2.glyphName.glyphOrientationHorizontal.glyphOrientationVertical.glyphRef.gradientTransform.gradientUnits.hanging.horizAdvX.horizOriginX.href.ideographic.imageRendering.in2.in.intercept.k1.k2.k3.k4.k.kernelMatrix.kernelUnitLength.kerning.keyPoints.keySplines.keyTimes.lengthAdjust.letterSpacing.lightingColor.limitingConeAngle.local.markerEnd.markerHeight.markerMid.markerStart.markerUnits.markerWidth.mask.maskContentUnits.maskUnits.mathematical.mode.numOctaves.offset.opacity.operator.order.orient.orientation.origin.overflow.overlinePosition.overlineThickness.paintOrder.panose1.pathLength.patternContentUnits.patternTransform.patternUnits.pointerEvents.pointsAtX.pointsAtY.pointsAtZ.preserveAlpha.preserveAspectRatio.primitiveUnits.r.radius.refX.refY.renderingIntent.repeatCount.repeatDur.requiredExtensions.requiredFeatures.restart.result.rotate.rx.ry.seed.shapeRendering.slope.spacing.specularConstant.specularExponent.speed.spreadMethod.startOffset.stdDeviation.stemh.stemv.stitchTiles.stopColor.stopOpacity.strikethroughPosition.strikethroughThickness.string.stroke.strokeDasharray.strokeDashoffset.strokeLinecap.strokeLinejoin.strokeMiterlimit.strokeOpacity.strokeWidth.surfaceScale.systemLanguage.tableValues.targetX.targetY.textAnchor.textDecoration.textLength.textRendering.to.transform.u1.u2.underlinePosition.underlineThickness.unicode.unicodeBidi.unicodeRange.unitsPerEm.vAlphabetic.values.vectorEffect.version.vertAdvY.vertOriginX.vertOriginY.vHanging.vIdeographic.viewTarget.visibility.vMathematical.widths.wordSpacing.writingMode.x1.x2.x.xChannelSelector.xHeight.xlinkActuate.xlinkArcrole.xlinkHref.xlinkRole.xlinkShow.xlinkTitle.xlinkType.xmlBase.xmlLang.xmlns.xmlnsXlink.xmlSpace.y1.y2.y.yChannelSelector.z.zoomAndPan.ref.key.angle`.split(`.`));function rk(e){return typeof e==`string`&&nk.has(e)}function ik(e){return typeof e==`string`&&e.startsWith(`data-`)}function ak(e){if(typeof e!=`object`||!e)return{};var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(rk(n)||ik(n))&&(t[n]=e[n]);return t}function ok(e){if(e==null)return null;if((0,v.isValidElement)(e)&&typeof e.props==`object`&&e.props!==null){var t=e.props;return ak(t)}return typeof e==`object`&&!Array.isArray(e)?ak(e):null}function sk(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(rk(n)||ik(n)||tk(n))&&(t[n]=e[n]);return t}var ck=[`children`,`width`,`height`,`viewBox`,`className`,`style`,`title`,`desc`];function lk(){return lk=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},lk.apply(null,arguments)}function uk(e,t){if(e==null)return{};var n,r,i=dk(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function dk(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var fk=(0,v.forwardRef)((e,t)=>{var{children:n,width:r,height:i,viewBox:a,className:o,style:s,title:c,desc:l}=e,u=uk(e,ck),d=a||{width:r,height:i,x:0,y:0},f=cn(`recharts-surface`,o);return v.createElement(`svg`,lk({},sk(u),{className:f,width:r,height:i,style:s,viewBox:`${d.x} ${d.y} ${d.width} ${d.height}`,ref:t}),v.createElement(`title`,null,c),v.createElement(`desc`,null,l),n)}),pk=[`children`,`className`];function mk(){return mk=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mk.apply(null,arguments)}function hk(e,t){if(e==null)return{};var n,r,i=gk(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function gk(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var _k=v.forwardRef((e,t)=>{var{children:n,className:r}=e,i=hk(e,pk),a=cn(`recharts-layer`,r);return v.createElement(`g`,mk({className:a},sk(i),{ref:t}),n)}),vk=(0,v.createContext)(null);function yk(e){return function(){return e}}var bk=Math.cos,xk=Math.sin,Sk=Math.sqrt,Ck=Math.PI;Ck/2;var wk=2*Ck,Tk=Math.PI,Ek=2*Tk,Dk=1e-6,Ok=Ek-Dk;function kk(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Ak(e){let t=Math.floor(e);if(!(t>=0))throw Error(`invalid digits: ${e}`);if(t>15)return kk;let n=10**t;return function(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=Math.round(arguments[t]*n)/n+e[t]}}var jk=class{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._=``,this._append=e==null?kk:Ak(e)}moveTo(e,t){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,t){this._append`L${this._x1=+e},${this._y1=+t}`}quadraticCurveTo(e,t,n,r){this._append`Q${+e},${+t},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(e,t,n,r,i,a){this._append`C${+e},${+t},${+n},${+r},${this._x1=+i},${this._y1=+a}`}arcTo(e,t,n,r,i){if(e=+e,t=+t,n=+n,r=+r,i=+i,i<0)throw Error(`negative radius: ${i}`);let a=this._x1,o=this._y1,s=n-e,c=r-t,l=a-e,u=o-t,d=l*l+u*u;if(this._x1===null)this._append`M${this._x1=e},${this._y1=t}`;else if(d>Dk){if(!(Math.abs(u*s-c*l)>Dk)||!i)this._append`L${this._x1=e},${this._y1=t}`;else{let f=n-a,p=r-o,m=s*s+c*c,h=f*f+p*p,g=Math.sqrt(m),_=Math.sqrt(d),v=i*Math.tan((Tk-Math.acos((m+d-h)/(2*g*_)))/2),y=v/_,b=v/g;Math.abs(y-1)>Dk&&this._append`L${e+y*l},${t+y*u}`,this._append`A${i},${i},0,0,${+(u*f>l*p)},${this._x1=e+b*s},${this._y1=t+b*c}`}}}arc(e,t,n,r,i,a){if(e=+e,t=+t,n=+n,a=!!a,n<0)throw Error(`negative radius: ${n}`);let o=n*Math.cos(r),s=n*Math.sin(r),c=e+o,l=t+s,u=1^a,d=a?r-i:i-r;this._x1===null?this._append`M${c},${l}`:(Math.abs(this._x1-c)>Dk||Math.abs(this._y1-l)>Dk)&&this._append`L${c},${l}`,n&&(d<0&&(d=d%Ek+Ek),d>Ok?this._append`A${n},${n},0,1,${u},${e-o},${t-s}A${n},${n},0,1,${u},${this._x1=c},${this._y1=l}`:d>Dk&&this._append`A${n},${n},0,${+(d>=Tk)},${u},${this._x1=e+n*Math.cos(i)},${this._y1=t+n*Math.sin(i)}`)}rect(e,t,n,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}};jk.prototype;function Mk(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{let e=Math.floor(n);if(!(e>=0))throw RangeError(`invalid digits: ${n}`);t=e}return e},()=>new jk(t)}Array.prototype.slice;function Nk(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function Pk(e){this._context=e}Pk.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}};function Fk(e){return new Pk(e)}function Ik(e){return e[0]}function Lk(e){return e[1]}function Rk(e,t){var n=yk(!0),r=null,i=Fk,a=null,o=Mk(s);e=typeof e==`function`?e:e===void 0?Ik:yk(e),t=typeof t==`function`?t:t===void 0?Lk:yk(t);function s(s){var c,l=(s=Nk(s)).length,u,d=!1,f;for(r??(a=i(f=o())),c=0;c<=l;++c)!(c<l&&n(u=s[c],c,s))===d&&((d=!d)?a.lineStart():a.lineEnd()),d&&a.point(+e(u,c,s),+t(u,c,s));if(f)return a=null,f+``||null}return s.x=function(t){return arguments.length?(e=typeof t==`function`?t:yk(+t),s):e},s.y=function(e){return arguments.length?(t=typeof e==`function`?e:yk(+e),s):t},s.defined=function(e){return arguments.length?(n=typeof e==`function`?e:yk(!!e),s):n},s.curve=function(e){return arguments.length?(i=e,r!=null&&(a=i(r)),s):i},s.context=function(e){return arguments.length?(e==null?r=a=null:a=i(r=e),s):r},s}function zk(e,t,n){var r=null,i=yk(!0),a=null,o=Fk,s=null,c=Mk(l);e=typeof e==`function`?e:e===void 0?Ik:yk(+e),t=typeof t==`function`?t:yk(t===void 0?0:+t),n=typeof n==`function`?n:n===void 0?Lk:yk(+n);function l(l){var u,d,f,p=(l=Nk(l)).length,m,h=!1,g,_=Array(p),v=Array(p);for(a??(s=o(g=c())),u=0;u<=p;++u){if(!(u<p&&i(m=l[u],u,l))===h){if(h=!h)d=u,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),f=u-1;f>=d;--f)s.point(_[f],v[f]);s.lineEnd(),s.areaEnd()}}h&&(_[u]=+e(m,u,l),v[u]=+t(m,u,l),s.point(r?+r(m,u,l):_[u],n?+n(m,u,l):v[u]))}if(g)return s=null,g+``||null}function u(){return Rk().defined(i).curve(o).context(a)}return l.x=function(t){return arguments.length?(e=typeof t==`function`?t:yk(+t),r=null,l):e},l.x0=function(t){return arguments.length?(e=typeof t==`function`?t:yk(+t),l):e},l.x1=function(e){return arguments.length?(r=e==null?null:typeof e==`function`?e:yk(+e),l):r},l.y=function(e){return arguments.length?(t=typeof e==`function`?e:yk(+e),n=null,l):t},l.y0=function(e){return arguments.length?(t=typeof e==`function`?e:yk(+e),l):t},l.y1=function(e){return arguments.length?(n=e==null?null:typeof e==`function`?e:yk(+e),l):n},l.lineX0=l.lineY0=function(){return u().x(e).y(t)},l.lineY1=function(){return u().x(e).y(n)},l.lineX1=function(){return u().x(r).y(t)},l.defined=function(e){return arguments.length?(i=typeof e==`function`?e:yk(!!e),l):i},l.curve=function(e){return arguments.length?(o=e,a!=null&&(s=o(a)),l):o},l.context=function(e){return arguments.length?(e==null?a=s=null:s=o(a=e),l):a},l}var Bk=class{constructor(e,t){this._context=e,this._x=t}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,t,e,t):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+t)/2,e,this._y0,e,t)}this._x0=e,this._y0=t}};function Vk(e){return new Bk(e,!0)}function Hk(e){return new Bk(e,!1)}var Uk={draw(e,t){let n=Sk(t/Ck);e.moveTo(n,0),e.arc(0,0,n,0,wk)}},Wk={draw(e,t){let n=Sk(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},Gk=Sk(1/3),Kk=Gk*2,qk={draw(e,t){let n=Sk(t/Kk),r=n*Gk;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},Jk={draw(e,t){let n=Sk(t),r=-n/2;e.rect(r,r,n,n)}},Yk=.8908130915292852,Xk=xk(Ck/10)/xk(7*Ck/10),Zk=xk(wk/10)*Xk,Qk=-bk(wk/10)*Xk,$k={draw(e,t){let n=Sk(t*Yk),r=Zk*n,i=Qk*n;e.moveTo(0,-n),e.lineTo(r,i);for(let t=1;t<5;++t){let a=wk*t/5,o=bk(a),s=xk(a);e.lineTo(s*n,-o*n),e.lineTo(o*r-s*i,s*r+o*i)}e.closePath()}},eA=Sk(3),tA={draw(e,t){let n=-Sk(t/(eA*3));e.moveTo(0,n*2),e.lineTo(-eA*n,-n),e.lineTo(eA*n,-n),e.closePath()}},nA=-.5,rA=Sk(3)/2,iA=1/Sk(12),aA=(iA/2+1)*3,oA={draw(e,t){let n=Sk(t/aA),r=n/2,i=n*iA,a=r,o=n*iA+n,s=-a,c=o;e.moveTo(r,i),e.lineTo(a,o),e.lineTo(s,c),e.lineTo(nA*r-rA*i,rA*r+nA*i),e.lineTo(nA*a-rA*o,rA*a+nA*o),e.lineTo(nA*s-rA*c,rA*s+nA*c),e.lineTo(nA*r+rA*i,nA*i-rA*r),e.lineTo(nA*a+rA*o,nA*o-rA*a),e.lineTo(nA*s+rA*c,nA*c-rA*s),e.closePath()}};function sA(e,t){let n=null,r=Mk(i);e=typeof e==`function`?e:yk(e||Uk),t=typeof t==`function`?t:yk(t===void 0?64:+t);function i(){let i;if(n||=i=r(),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),i)return n=null,i+``||null}return i.type=function(t){return arguments.length?(e=typeof t==`function`?t:yk(t),i):e},i.size=function(e){return arguments.length?(t=typeof e==`function`?e:yk(+e),i):t},i.context=function(e){return arguments.length?(n=e??null,i):n},i}function cA(){}function lA(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function uA(e){this._context=e}uA.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:lA(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:lA(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function dA(e){return new uA(e)}function fA(e){this._context=e}fA.prototype={areaStart:cA,areaEnd:cA,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:lA(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function pA(e){return new fA(e)}function mA(e){this._context=e}mA.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:lA(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function hA(e){return new mA(e)}function gA(e){this._context=e}gA.prototype={areaStart:cA,areaEnd:cA,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function _A(e){return new gA(e)}function vA(e){return e<0?-1:1}function yA(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return(vA(a)+vA(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function bA(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function xA(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-r)/3;e._context.bezierCurveTo(r+s,i+s*t,a-s,o-s*n,a,o)}function SA(e){this._context=e}SA.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:xA(this,this._t0,bA(this,this._t0))}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,e!==this._x1||t!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,xA(this,bA(this,n=yA(this,e,t)),n);break;default:xA(this,this._t0,n=yA(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function CA(e){this._context=new wA(e)}(CA.prototype=Object.create(SA.prototype)).point=function(e,t){SA.prototype.point.call(this,t,e)};function wA(e){this._context=e}wA.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function TA(e){return new SA(e)}function EA(e){return new CA(e)}function DA(e){this._context=e}DA.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n){if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=OA(e),i=OA(t),a=0,o=1;o<n;++a,++o)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[o],t[o])}(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function OA(e){var t,n=e.length-1,r,i=Array(n),a=Array(n),o=Array(n);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,o[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,o[t]-=r*o[t-1];for(i[n-1]=o[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function kA(e){return new DA(e)}function AA(e,t){this._context=e,this._t=t}AA.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}}this._x=e,this._y=t}};function jA(e){return new AA(e,.5)}function MA(e){return new AA(e,0)}function NA(e){return new AA(e,1)}function PA(e,t){if((o=e.length)>1)for(var n=1,r,i,a=e[t[0]],o,s=a.length;n<o;++n)for(i=a,a=e[t[n]],r=0;r<s;++r)a[r][1]+=a[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function FA(e){for(var t=e.length,n=Array(t);--t>=0;)n[t]=t;return n}function IA(e,t){return e[t]}function LA(e){let t=[];return t.key=e,t}function RA(){var e=yk([]),t=FA,n=PA,r=IA;function i(i){var a=Array.from(e.apply(this,arguments),LA),o,s=a.length,c=-1,l;for(let e of i)for(o=0,++c;o<s;++o)(a[o][c]=[0,+r(e,a[o].key,c,i)]).data=e;for(o=0,l=Nk(t(a));o<s;++o)a[l[o]].index=o;return n(a,l),a}return i.keys=function(t){return arguments.length?(e=typeof t==`function`?t:yk(Array.from(t)),i):e},i.value=function(e){return arguments.length?(r=typeof e==`function`?e:yk(+e),i):r},i.order=function(e){return arguments.length?(t=e==null?FA:typeof e==`function`?e:yk(Array.from(e)),i):t},i.offset=function(e){return arguments.length?(n=e??PA,i):n},i}function zA(e,t){if((r=e.length)>0){for(var n,r,i=0,a=e[0].length,o;i<a;++i){for(o=n=0;n<r;++n)o+=e[n][i][1]||0;if(o)for(n=0;n<r;++n)e[n][i][1]/=o}PA(e,t)}}function BA(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,a=r.length;n<a;++n){for(var o=0,s=0;o<i;++o)s+=e[o][n][1]||0;r[n][1]+=r[n][0]=-s/2}PA(e,t)}}function VA(e,t){if(!(!((o=e.length)>0)||!((a=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,a,o;r<a;++r){for(var s=0,c=0,l=0;s<o;++s){for(var u=e[t[s]],d=u[r][1]||0,f=(d-(u[r-1][1]||0))/2,p=0;p<s;++p){var m=e[t[p]],h=m[r][1]||0,g=m[r-1][1]||0;f+=h-g}c+=d,l+=f*d}i[r-1][1]+=i[r-1][0]=n,c&&(n-=l/c)}i[r-1][1]+=i[r-1][0]=n,PA(e,t)}}function HA(e){return e===`__proto__`}var UA=Object.prototype.hasOwnProperty;function WA(e,t){return UA.call(e,t)}var GA=/\.|(\[(?:[^[\]]*|(["'])(?:(?!\2)[^\\]|\\.)*?\2)\])/;function KA(e){switch(typeof e){case`number`:case`symbol`:return!1;case`string`:return e===``||e.startsWith(`.`)||e.endsWith(`.`)?!1:GA.test(e);default:return!1}}function qA(e){var t;return typeof e==`string`||typeof e==`symbol`?e:Object.is(e==null||(t=e.valueOf)==null?void 0:t.call(e),-0)?`-0`:String(e)}function JA(e){return typeof e==`symbol`||e instanceof Symbol}function YA(e){if(typeof e==`string`)return e;if(Array.isArray(e)){let t=``;for(let n=0;n<e.length;n++)n>0&&(t+=`,`),t+=YA(e[n]);return t}if(JA(e))return e.toString();let t=e+``;return t===`0`&&Object.is(Number(e),-0)?`-0`:t}function XA(e){return e==null?``:YA(e)}function ZA(e){if(Array.isArray(e))return e.map(qA);if(typeof e==`symbol`)return[e];e=XA(e);let t=[],n=e.length;if(n===0)return t;let r=0,i=``,a=``,o=!1,s=!1,c=/^-?\d+(?:\.\d+)?$/;for(e.charCodeAt(0)===46&&t.push(``);r<n;){let l=e[r];if(a)l===`\\`&&r+1<n?(r++,i+=e[r]):l===a?a=``:i+=l;else if(o){if(l===`"`||l===`'`)a=l,s=!0;else if(l===`]`){if(o=!1,!s&&i.includes(`.`)&&!c.test(i)){let e=i.split(`.`);for(let n=0;n<e.length;n++)e[n]!==``&&t.push(e[n])}else t.push(i);i=``}else i+=l}else if(l===`[`)o=!0,s=!1,i&&=(t.push(i),``);else if(l===`.`){i&&=(t.push(i),``);let n=e[r+1];(n===void 0||n===`.`)&&t.push(``)}else i+=l;r++}return i&&t.push(i),t}function QA(e,t,n){if(e==null)return n;switch(typeof t){case`string`:{if(HA(t))return n;let r=e[t];return r===void 0?KA(t)&&!WA(e,t)?QA(e,ZA(t),n):n:r}case`number`:case`symbol`:{typeof t==`number`&&(t=qA(t));let r=e[t];return r===void 0?n:r}default:{if(Array.isArray(t))return $A(e,t,n);if(t=Object.is(t?.valueOf(),-0)?`-0`:String(t),HA(t))return n;let r=e[t];return r===void 0?n:r}}}function $A(e,t,n){if(t.length===0)return n;let r=e;for(let e=0;e<t.length;e++){if(r==null||HA(t[e]))return n;r=r[t[e]]}return r===void 0?n:r}var ej=4;function tj(e){var t=10**(arguments.length>1&&arguments[1]!==void 0?arguments[1]:ej),n=Math.round(e*t)/t;return Object.is(n,-0)?0:n}function nj(e){var t=[...arguments].slice(1);return e.reduce((e,n,r)=>{var i=t[r-1];return typeof i==`string`?e+i+n:i===void 0?e+n:e+tj(i)+n},``)}var rj=e=>e===0?0:e>0?1:-1,ij=e=>typeof e==`number`&&e!=+e,aj=e=>typeof e==`string`&&e.indexOf(`%`)===e.length-1,Z=e=>(typeof e==`number`||e instanceof Number)&&!ij(e),oj=e=>Z(e)||typeof e==`string`,sj=0,cj=e=>{var t=++sj;return`${e||``}${t}`},lj=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,r=arguments.length>3&&arguments[3]!==void 0&&arguments[3];if(!Z(e)&&typeof e!=`string`)return n;var i;if(aj(e)){if(t==null)return n;var a=e.indexOf(`%`);i=t*parseFloat(e.slice(0,a))/100}else i=+e;return ij(i)&&(i=n),r&&t!=null&&i>t&&(i=t),i},uj=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,n={},r=0;r<t;r++)if(!n[String(e[r])])n[String(e[r])]=!0;else return!0;return!1};function dj(e,t,n){return Z(e)&&Z(t)?tj(e+n*(t-e)):t}function fj(e,t,n){if(!(!e||!e.length))return e.find(e=>e&&(typeof t==`function`?t(e):QA(e,t))===n)}var pj=e=>e==null,mj=e=>pj(e)?e:`${e.charAt(0).toUpperCase()}${e.slice(1)}`;function hj(e){return e!=null}function gj(){}var _j=[`type`,`size`,`sizeType`];function vj(){return vj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},vj.apply(null,arguments)}function yj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function bj(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?yj(Object(n),!0).forEach(function(t){xj(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yj(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function xj(e,t,n){return(t=Sj(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Sj(e){var t=Cj(e,`string`);return typeof t==`symbol`?t:t+``}function Cj(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function wj(e,t){if(e==null)return{};var n,r,i=Tj(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Tj(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Ej={symbolCircle:Uk,symbolCross:Wk,symbolDiamond:qk,symbolSquare:Jk,symbolStar:$k,symbolTriangle:tA,symbolWye:oA},Dj=Math.PI/180,Oj=e=>Ej[`symbol${mj(e)}`]||Uk,kj=(e,t,n)=>{if(t===`area`)return e;switch(n){case`cross`:return 5*e*e/9;case`diamond`:return .5*e*e/Math.sqrt(3);case`square`:return e*e;case`star`:var r=18*Dj;return 1.25*e*e*(Math.tan(r)-Math.tan(r*2)*Math.tan(r)**2);case`triangle`:return Math.sqrt(3)*e*e/4;case`wye`:return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},Aj=(e,t)=>{Ej[`symbol${mj(e)}`]=t},jj=e=>{var{type:t=`circle`,size:n=64,sizeType:r=`area`}=e,i=bj(bj({},wj(e,_j)),{},{type:t,size:n,sizeType:r}),a=`circle`;typeof t==`string`&&(a=t);var o=()=>{var e=Oj(a),t=sA().type(e).size(kj(n,r,a))();if(t!==null)return t},{className:s,cx:c,cy:l}=i,u=sk(i);return Z(c)&&Z(l)&&Z(n)?v.createElement(`path`,vj({},u,{className:cn(`recharts-symbols`,s),transform:`translate(${c}, ${l})`,d:o()})):null};jj.registerSymbol=Aj;var Mj=e=>`radius`in e&&`startAngle`in e&&`endAngle`in e,Nj=(e,t)=>{if(!e||typeof e==`function`||typeof e==`boolean`)return null;var n=e;if((0,v.isValidElement)(e)&&(n=e.props),typeof n!=`object`&&typeof n!=`function`)return null;var r={};return Object.keys(n).forEach(e=>{tk(e)&&typeof n[e]==`function`&&(r[e]=t||(t=>n[e](n,t)))}),r},Pj=(e,t,n)=>r=>(e(t,n,r),null),Fj=(e,t,n)=>{if(e===null||typeof e!=`object`&&typeof e!=`function`)return null;var r=null;return Object.keys(e).forEach(i=>{var a=e[i];tk(i)&&typeof a==`function`&&(r||={},r[i]=Pj(a,t,n))}),r};function Ij(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Lj(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Ij(Object(n),!0).forEach(function(t){Rj(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ij(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Rj(e,t,n){return(t=zj(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zj(e){var t=Bj(e,`string`);return typeof t==`symbol`?t:t+``}function Bj(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Vj(e,t){var n=Lj({},e),r=t;return Object.keys(t).reduce((e,t)=>(e[t]===void 0&&r[t]!==void 0&&(e[t]=r[t]),e),n)}function Hj(e,t){let n=new Map;for(let r=0;r<e.length;r++){let i=e[r],a=t(i,r,e);n.has(a)||n.set(a,i)}return Array.from(n.values())}function Uj(e,t){return function(...n){return e.apply(this,n.slice(0,t))}}function Wj(e){return e}function Gj(e){return Number.isSafeInteger(e)&&e>=0}function Kj(e){return e!=null&&typeof e!=`function`&&Gj(e.length)}function qj(e){return function(t){return QA(t,e)}}function Jj(e){return e==null||typeof e!=`object`&&typeof e!=`function`}function Yj(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e)}var Xj=`[object RegExp]`,Zj=`[object String]`,Qj=`[object Number]`,$j=`[object Boolean]`,eM=`[object Arguments]`,tM=`[object Symbol]`,nM=`[object Date]`,rM=`[object Map]`,iM=`[object Set]`,aM=`[object Array]`,oM=`[object ArrayBuffer]`,sM=`[object Object]`,cM=`[object DataView]`,lM=`[object Uint8Array]`,uM=`[object Uint8ClampedArray]`,dM=`[object Uint16Array]`,fM=`[object Uint32Array]`,pM=`[object Int8Array]`,mM=`[object Int16Array]`,hM=`[object Int32Array]`,gM=`[object Float32Array]`,_M=`[object Float64Array]`;function vM(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}function yM(e){return e!==null&&(typeof e==`object`||typeof e==`function`)}function bM(e,t,n){return typeof n==`function`?xM(e,t,function e(t,r,i,a,o,s){let c=n(t,r,i,a,o,s);return c===void 0?xM(t,r,e,s,!1):!!c},new Map,!0):bM(e,t,()=>void 0)}function xM(e,t,n,r,i=!1){if(t===e)return!0;switch(typeof t){case`object`:return SM(e,t,n,r,i);case`function`:return Object.keys(t).length>0?xM(e,Object.assign({},t),n,r,i):vM(e,t);default:return yM(e)&&i?typeof t!=`string`||t===``:vM(e,t)}}function SM(e,t,n,r,i=!1){if(t==null)return!0;if(Array.isArray(t))return wM(e,t,n,r);if(t instanceof Map)return CM(e,t,n,r);if(t instanceof Set)return TM(e,t,n,r);let a=Object.keys(t);if(e==null)return i&&a.length===0;if(i)Jj(e)&&(e=Object(e));else{if(Yj(t)===`[object Error]`)return Yj(e)===`[object Error]`&&e.name===t.name&&e.message===t.message;let n=Yj(e);if(n!==`[object Object]`&&n!==`[object Arguments]`)return!1}if(a.length===0)return!0;if(r?.has(t))return r.get(t)===e;r?.set(t,e);try{for(let i=0;i<a.length;i++){let o=a[i];if(!(o in e)||t[o]===void 0&&e[o]!==void 0||t[o]===null&&e[o]!==null||!n(e[o],t[o],o,e,t,r))return!1}return!0}finally{r?.delete(t)}}function CM(e,t,n,r){if(t.size===0)return!0;if(!(e instanceof Map))return!1;for(let[i,a]of t.entries())if(n(e.get(i),a,i,e,t,r)===!1)return!1;return!0}function wM(e,t,n,r){if(t.length===0)return!0;if(!Array.isArray(e))return!1;let i=new Set;for(let a=0;a<t.length;a++){let o=t[a],s=!1;for(let c=0;c<e.length;c++){if(i.has(c))continue;let l=e[c],u=!1;if(n(l,o,a,e,t,r)&&(u=!0),u){i.add(c),s=!0;break}}if(!s)return!1}return!0}function TM(e,t,n,r){return t.size===0||e instanceof Set&&wM([...e],[...t],n,r)}function EM(e,t){return bM(e,t,()=>void 0)}function DM(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}var OM=typeof globalThis==`object`&&globalThis||typeof window==`object`&&window||typeof self==`object`&&self||typeof global==`object`&&global||(function(){return this})();function kM(e){return OM.Buffer!==void 0&&OM.Buffer.isBuffer(e)}function AM(e){return kM(e)}function jM(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function MM(e){return jM(e)}function NM(e,t){return PM(e,void 0,e,new Map,t)}function PM(e,t,n,r,i){if(i!=null){let a=i(e,t,n,r);if(a!==void 0)return a}if(Jj(e))return e;if(r.has(e))return r.get(e);if(Array.isArray(e)){let t=Array(e.length);r.set(e,t);for(let a=0;a<e.length;a++)t[a]=PM(e[a],a,n,r,i);return WA(e,`index`)&&(t.index=e.index),WA(e,`input`)&&(t.input=e.input),t}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){let t=new RegExp(e.source,e.flags);return t.lastIndex=e.lastIndex,t}if(e instanceof Map){let t=new Map;return r.set(e,t),e.forEach((e,a)=>{t.set(a,PM(e,a,n,r,i))}),t}if(e instanceof Set){let t=new Set;return r.set(e,t),e.forEach(e=>{t.add(PM(e,void 0,n,r,i))}),t}if(AM(e))return e.subarray();if(MM(e)){let t=new(Object.getPrototypeOf(e)).constructor(e.length);r.set(e,t);for(let a=0;a<e.length;a++)t[a]=PM(e[a],a,n,r,i);return t}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){let t=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return r.set(e,t),FM(t,e,n,r,i),t}if(typeof File<`u`&&e instanceof File){let t=new File([e],e.name,{type:e.type});return r.set(e,t),FM(t,e,n,r,i),t}if(typeof Blob<`u`&&e instanceof Blob){let t=new Blob([e],{type:e.type});return r.set(e,t),FM(t,e,n,r,i),t}let a=Yj(e);if(a===`[object Error]`)return e===n?{}:e;switch(a){case Qj:case Zj:case $j:{let t=new e.constructor(e.valueOf());return r.set(e,t),FM(t,e,n,r,i),t}case eM:{let t={};return r.set(e,t),FM(t,e,n,r,i),t.length=e.length,t[Symbol.iterator]=e[Symbol.iterator],t}}if(typeof e==`object`&&IM(a)){let t=a===`[object Object]`&&typeof e.constructor!=`function`?{}:Object.create(Object.getPrototypeOf(e));return r.set(e,t),FM(t,e,n,r,i),t}return e}function FM(e,t,n,r,i){let a=[...Object.keys(t),...DM(t)];for(let o=0;o<a.length;o++){let s=a[o],c=Object.getOwnPropertyDescriptor(e,s);(c==null||c.writable)&&(e[s]=PM(t[s],s,n,r,i))}}function IM(e){switch(e){case eM:case aM:case oM:case cM:case $j:case nM:case gM:case _M:case pM:case mM:case hM:case rM:case Qj:case sM:case Xj:case iM:case Zj:case tM:case lM:case uM:case dM:case fM:return!0;default:return!1}}function LM(e){return NM(e)}function RM(e){return e=LM(e),t=>EM(t,e)}var zM=/^(?:0|[1-9]\d*)$/;function BM(e,t=2**53-1){switch(typeof e){case`number`:return Number.isInteger(e)&&e>=0&&e<t;case`symbol`:return!1;case`string`:return zM.test(e)}}function VM(e){return typeof e==`object`&&!!e&&Yj(e)===`[object Arguments]`}function HM(e,t){let n;if(n=Array.isArray(t)?t:typeof t==`string`&&KA(t)&&!(t in Object(e))?ZA(t):[t],n.length===0)return!1;let r=e;for(let e=0;e<n.length;e++){let t=qA(n[e]);if((r==null||!WA(r,t))&&!((Array.isArray(r)||VM(r))&&BM(t)&&Number(t)<r.length))return!1;r=r[t]}return!0}function UM(e,t){switch(typeof e){case`object`:Object.is(e?.valueOf(),-0)&&(e=`-0`);break;case`number`:e=qA(e)}return t=LM(t),function(n){let r=QA(n,e);return r===void 0?HM(n,e):t===void 0?r===void 0:EM(r,t)}}function WM(e){if(e==null)return Wj;switch(typeof e){case`function`:return e;case`object`:return Array.isArray(e)&&e.length===2?UM(e[0],e[1]):RM(e);default:return qj(e)}}function GM(e){return e===0?0:e}function KM(e,t=Wj){return Kj(e)?Hj(Array.from(e),Uj(WM(t),1)).map(GM):[]}function qM(e,t,n){return t===!0?KM(e,n):typeof t==`function`?KM(e,t):e}var JM=o((e=>{var t=d();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),YM=o(((e,t)=>{t.exports=JM()})),XM=o((e=>{var t=d(),n=YM();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),ZM=o(((e,t)=>{t.exports=XM()})),QM=(0,v.createContext)(null),$M=ZM(),eN=e=>e,tN=()=>{var e=(0,v.useContext)(QM);return e?e.store.dispatch:eN},nN=()=>{},rN=()=>nN,iN=(e,t)=>e===t;function Q(e){var t=(0,v.useContext)(QM),n=(0,v.useMemo)(()=>t?t=>{if(t!=null)return e(t)}:nN,[t,e]);return(0,$M.useSyncExternalStoreWithSelector)(t?t.subscription.addNestedSub:rN,t?t.store.getState:nN,t?t.store.getState:nN,n,iN)}function aN(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!=`function`)throw TypeError(t)}function oN(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!=`object`)throw TypeError(t)}function sN(e,t=`expected all items to be functions, instead received the following types: `){if(!e.every(e=>typeof e==`function`)){let n=e.map(e=>typeof e==`function`?`function ${e.name||`unnamed`}()`:typeof e).join(`, `);throw TypeError(`${t}[${n}]`)}}var cN=e=>Array.isArray(e)?e:[e];function lN(e){let t=Array.isArray(e[0])?e[0]:e;return sN(t,`createSelector expects all input-selectors to be functions, but received the following types: `),t}function uN(e,t){let n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var dN=class{constructor(e){this.value=e}deref(){return this.value}},fee=typeof WeakRef<`u`?WeakRef:dN,fN=0,pN=1;function mN(){return{s:fN,v:void 0,o:null,p:null}}function hN(e,t={}){let n=mN(),{resultEqualityCheck:r}=t,i,a=0;function o(){let t=n,{length:o}=arguments;for(let e=0,n=o;e<n;e++){let n=arguments[e];if(typeof n==`function`||typeof n==`object`&&n){let e=t.o;e===null&&(t.o=e=new WeakMap);let r=e.get(n);r===void 0?(t=mN(),e.set(n,t)):t=r}else{let e=t.p;e===null&&(t.p=e=new Map);let r=e.get(n);r===void 0?(t=mN(),e.set(n,t)):t=r}}let s=t,c;if(t.s===pN)c=t.v;else if(c=e.apply(null,arguments),a++,r){let e=i?.deref?.()??i;e!=null&&r(e,c)&&(c=e,a!==0&&a--),i=typeof c==`object`&&c||typeof c==`function`?new fee(c):c}return s.s=pN,s.v=c,c}return o.clearCache=()=>{n=mN(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function gN(e,...t){let n=typeof e==`function`?{memoize:e,memoizeOptions:t}:e,r=(...e)=>{let t=0,r=0,i,a={},o=e.pop();typeof o==`object`&&(a=o,o=e.pop()),aN(o,`createSelector expects an output function after the inputs, but received: [${typeof o}]`);let{memoize:s,memoizeOptions:c=[],argsMemoize:l=hN,argsMemoizeOptions:u=[],devModeChecks:d={}}={...n,...a},f=cN(c),p=cN(u),m=lN(e),h=s(function(){return t++,o.apply(null,arguments)},...f),g=l(function(){r++;let e=uN(m,arguments);return i=h.apply(null,e),i},...p);return Object.assign(g,{resultFunc:o,memoizedResultFunc:h,dependencies:m,dependencyRecomputations:()=>r,resetDependencyRecomputations:()=>{r=0},lastResult:()=>i,recomputations:()=>t,resetRecomputations:()=>{t=0},memoize:s,argsMemoize:l})};return Object.assign(r,{withTypes:()=>r}),r}var $=gN(hN),_N=Object.assign((e,t=$)=>{oN(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);let n=Object.keys(e);return t(n.map(t=>e[t]),(...e)=>e.reduce((e,t,r)=>(e[n[r]]=t,e),{}))},{withTypes:()=>_N});function vN(e,t=1){let n=[],r=Math.floor(t),i=(e,t)=>{for(let a=0;a<e.length;a++){let o=e[a];Array.isArray(o)&&t<r?i(o,t+1):n.push(o)}};return i(e,0),n}function yN(e,t,n){return yM(n)&&(typeof t==`number`&&Kj(n)&&BM(t)&&t<n.length||typeof t==`string`&&t in n)?vM(n[t],e):!1}function bN(e){let t=Object.keys(e),n=Array(t.length);for(let r=0;r<t.length;r++)n[r]=e[t[r]];return n}function xN(e){return typeof e==`symbol`?1:e===null?2:e===void 0?3:e===e?0:4}var SN=(e,t,n)=>{if(e!==t){let r=xN(e),i=xN(t);if(r===i&&r===0){if(e<t)return n===`desc`?1:-1;if(e>t)return n===`desc`?-1:1}return n===`desc`?i-r:r-i}return 0},CN=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,wN=/^\w*$/;function TN(e,t){return Array.isArray(e)?!1:typeof e==`number`||typeof e==`boolean`||e==null||JA(e)?!0:typeof e==`string`&&(wN.test(e)||!CN.test(e))||t!=null&&WA(t,e)}function EN(e,t,n,r){if(e==null)return[];n=r?void 0:n,Array.isArray(e)||(e=Kj(e)?Array.from(e):bN(e)),Array.isArray(t)||(t=t==null?[null]:[t]),t.length===0&&(t=[null]),Array.isArray(n)||(n=n==null?[]:[n]),n=n.map(e=>String(e));let i=(e,t)=>{let n=e,r=0;for(;r<t.length&&n!=null;++r)n=n[t[r]];return r>0&&r===t.length?n:void 0},a=(e,t)=>{if(e==null)return t;if(t!=null)return typeof e==`object`&&`key`in e?WA(t,e.key)?t[e.key]:i(t,e.path):typeof e==`function`?e(t):Array.isArray(e)?i(t,e):t[e]},o=t.map(e=>(Array.isArray(e)&&e.length===1&&(e=e[0]),e==null||typeof e==`function`||Array.isArray(e)||TN(e)?e:{key:e,path:ZA(e)}));return e.map(e=>({original:e,criteria:o.map(t=>a(t,e))})).slice().sort((e,t)=>{for(let r=0;r<o.length;r++){let i=SN(e.criteria[r],t.criteria[r],n[r]);if(i!==0)return i}return 0}).map(e=>e.original)}function DN(e,...t){let n=t.length;return n>1&&yN(e,t[0],t[1])?t=[]:n>2&&yN(t[0],t[1],t[2])&&(t=[t[0]]),EN(e,vN(t),[`asc`])}var ON=e=>e.legend.settings,kN=e=>e.legend.size;$([e=>e.legend.payload,ON],(e,t)=>{var{itemSorter:n}=t,r=e.flat(1);return n?DN(r,n):r});var AN=1;function jN(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],[t,n]=(0,v.useState)({height:0,left:0,top:0,width:0});return[t,(0,v.useCallback)(e=>{if(e!=null){var r=e.getBoundingClientRect(),i={height:r.height,left:r.left,top:r.top,width:r.width};(Math.abs(i.height-t.height)>AN||Math.abs(i.left-t.left)>AN||Math.abs(i.top-t.top)>AN||Math.abs(i.width-t.width)>AN)&&n({height:i.height,left:i.left,top:i.top,width:i.width})}},[t.width,t.height,t.top,t.left,...e])]}function MN(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var NN=typeof Symbol==`function`&&Symbol.observable||`@@observable`,PN=()=>Math.random().toString(36).substring(7).split(``).join(`.`),FN={INIT:`@@redux/INIT${PN()}`,REPLACE:`@@redux/REPLACE${PN()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${PN()}`};function IN(e){if(typeof e!=`object`||!e)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function LN(e,t,n){if(typeof e!=`function`)throw Error(MN(2));if(typeof t==`function`&&typeof n==`function`||typeof n==`function`&&typeof arguments[3]==`function`)throw Error(MN(0));if(typeof t==`function`&&n===void 0&&(n=t,t=void 0),n!==void 0){if(typeof n!=`function`)throw Error(MN(1));return n(LN)(e,t)}let r=e,i=t,a=new Map,o=a,s=0,c=!1;function l(){o===a&&(o=new Map,a.forEach((e,t)=>{o.set(t,e)}))}function u(){if(c)throw Error(MN(3));return i}function d(e){if(typeof e!=`function`)throw Error(MN(4));if(c)throw Error(MN(5));let t=!0;l();let n=s++;return o.set(n,e),function(){if(t){if(c)throw Error(MN(6));t=!1,l(),o.delete(n),a=null}}}function f(e){if(!IN(e))throw Error(MN(7));if(e.type===void 0)throw Error(MN(8));if(typeof e.type!=`string`)throw Error(MN(17));if(c)throw Error(MN(9));try{c=!0,i=r(i,e)}finally{c=!1}return(a=o).forEach(e=>{e()}),e}function p(e){if(typeof e!=`function`)throw Error(MN(10));r=e,f({type:FN.REPLACE})}function m(){let e=d;return{subscribe(t){if(typeof t!=`object`||!t)throw Error(MN(11));function n(){let e=t;e.next&&e.next(u())}return n(),{unsubscribe:e(n)}},[NN](){return this}}}return f({type:FN.INIT}),{dispatch:f,subscribe:d,getState:u,replaceReducer:p,[NN]:m}}function RN(e){Object.keys(e).forEach(t=>{let n=e[t];if(n(void 0,{type:FN.INIT})===void 0)throw Error(MN(12));if(n(void 0,{type:FN.PROBE_UNKNOWN_ACTION()})===void 0)throw Error(MN(13))})}function zN(e){let t=Object.keys(e),n={};for(let r=0;r<t.length;r++){let i=t[r];typeof e[i]==`function`&&(n[i]=e[i])}let r=Object.keys(n),i;try{RN(n)}catch(e){i=e}return function(e={},t){if(i)throw i;let a=!1,o={};for(let i=0;i<r.length;i++){let s=r[i],c=n[s],l=e[s],u=c(l,t);if(u===void 0)throw t&&t.type,Error(MN(14));o[s]=u,a||=u!==l}return a||=r.length!==Object.keys(e).length,a?o:e}}function BN(...e){return e.length===0?e=>e:e.length===1?e[0]:e.reduce((e,t)=>(...n)=>e(t(...n)))}function VN(...e){return t=>(n,r)=>{let i=t(n,r),a=()=>{throw Error(MN(15))},o={getState:i.getState,dispatch:(e,...t)=>a(e,...t)};return a=BN(...e.map(e=>e(o)))(i.dispatch),{...i,dispatch:a}}}function HN(e){return IN(e)&&`type`in e&&typeof e.type==`string`}var UN=Symbol.for(`immer-nothing`),WN=Symbol.for(`immer-draftable`),GN=Symbol.for(`immer-state`);function KN(e,...t){throw Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var qN=Object,JN=qN.getPrototypeOf,YN=`constructor`,XN=`prototype`,ZN=`configurable`,QN=`enumerable`,$N=`writable`,eP=`value`,tP=e=>!!e&&!!e[GN];function nP(e){return e?aP(e)||fP(e)||!!e[WN]||!!e[YN]?.[WN]||pP(e)||mP(e):!1}var rP=qN[XN][YN].toString(),iP=new WeakMap;function aP(e){if(!e||!hP(e))return!1;let t=JN(e);if(t===null||t===qN[XN])return!0;let n=qN.hasOwnProperty.call(t,YN)&&t[YN];if(n===Object)return!0;if(!gP(n))return!1;let r=iP.get(n);return r===void 0&&(r=Function.toString.call(n),iP.set(n,r)),r===rP}function oP(e,t,n=!0){sP(e)===0?(n?Reflect.ownKeys(e):qN.keys(e)).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function sP(e){let t=e[GN];return t?t.type_:fP(e)?1:pP(e)?2:mP(e)?3:0}var cP=(e,t,n=sP(e))=>n===2?e.has(t):qN[XN].hasOwnProperty.call(e,t),lP=(e,t,n=sP(e))=>n===2?e.get(t):e[t],uP=(e,t,n,r=sP(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function dP(e,t){return e===t?e!==0||1/e==1/t:e!==e&&t!==t}var fP=Array.isArray,pP=e=>e instanceof Map,mP=e=>e instanceof Set,hP=e=>typeof e==`object`,gP=e=>typeof e==`function`,_P=e=>typeof e==`boolean`;function vP(e){let t=+e;return Number.isInteger(t)&&String(t)===e}var yP=e=>e.copy_||e.base_,bP=e=>e.modified_?e.copy_:e.base_;function xP(e,t){if(pP(e))return new Map(e);if(mP(e))return new Set(e);if(fP(e))return Array[XN].slice.call(e);let n=aP(e);if(t===!0||t===`class_only`&&!n){let t=qN.getOwnPropertyDescriptors(e);delete t[GN];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){let i=n[r],a=t[i];a[$N]===!1&&(a[$N]=!0,a[ZN]=!0),(a.get||a.set)&&(t[i]={[ZN]:!0,[$N]:!0,[QN]:a[QN],[eP]:e[i]})}return qN.create(JN(e),t)}{let t=JN(e);if(t!==null&&n)return{...e};let r=qN.create(t);return qN.assign(r,e)}}function SP(e,t=!1){return TP(e)||tP(e)||!nP(e)?e:(sP(e)>1&&qN.defineProperties(e,{set:wP,add:wP,clear:wP,delete:wP}),qN.freeze(e),t&&oP(e,(e,t)=>{SP(t,!0)},!1),e)}function CP(){KN(2)}var wP={[eP]:CP};function TP(e){return e===null||!hP(e)||qN.isFrozen(e)}var EP=`MapSet`,DP=`Patches`,OP=`ArrayMethods`,kP={};function AP(e){let t=kP[e];return t||KN(0,e),t}var jP=e=>!!kP[e],MP,NP=()=>MP,PP=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:jP(EP)?AP(EP):void 0,arrayMethodsPlugin_:jP(OP)?AP(OP):void 0});function FP(e,t){t&&(e.patchPlugin_=AP(DP),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function IP(e){LP(e),e.drafts_.forEach(zP),e.drafts_=null}function LP(e){e===MP&&(MP=e.parent_)}var RP=e=>MP=PP(MP,e);function zP(e){let t=e[GN];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function BP(e,t){t.unfinalizedDrafts_=t.drafts_.length;let n=t.drafts_[0];if(e!==void 0&&e!==n){n[GN].modified_&&(IP(t),KN(4)),nP(e)&&(e=VP(t,e));let{patchPlugin_:r}=t;r&&r.generateReplacementPatches_(n[GN].base_,e,t)}else e=VP(t,n);return HP(t,e,!0),IP(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e===UN?void 0:e}function VP(e,t){if(TP(t))return t;let n=t[GN];if(!n)return XP(t,e.handledSet_,e);if(!WP(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){let{callbacks_:t}=n;if(t)for(;t.length>0;)t.pop()(e);JP(n,e)}return n.copy_}function HP(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&SP(t,n)}function UP(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var WP=(e,t)=>e.scope_===t,GP=[];function KP(e,t,n,r){let i=yP(e),a=e.type_;if(r!==void 0&&lP(i,r,a)===t){uP(i,r,n,a);return}if(!e.draftLocations_){let t=e.draftLocations_=new Map;oP(i,(e,n)=>{if(tP(n)){let r=t.get(n)||[];r.push(e),t.set(n,r)}})}let o=e.draftLocations_.get(t)??GP;for(let e of o)uP(i,e,n,a)}function qP(e,t,n){e.callbacks_.push(function(r){let i=t;if(!i||!WP(i,r))return;r.mapSetPlugin_?.fixSetContents(i);let a=bP(i);KP(e,i.draft_??i,a,n),JP(i,r)})}function JP(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){let{patchPlugin_:n}=t;if(n){let r=n.getPath(e);r&&n.generatePatches_(e,r,t)}UP(e)}}function YP(e,t,n){let{scope_:r}=e;if(tP(n)){let i=n[GN];WP(i,r)&&i.callbacks_.push(function(){aF(e),KP(e,n,bP(i),t)})}else nP(n)&&e.callbacks_.push(function(){let i=yP(e);e.type_===3?i.has(n)&&XP(n,r.handledSet_,r):lP(i,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&XP(lP(e.copy_,t,e.type_),r.handledSet_,r)})}function XP(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||tP(e)||t.has(e)||!nP(e)||TP(e)?e:(t.add(e),oP(e,(r,i)=>{if(tP(i)){let t=i[GN];WP(t,n)&&(uP(e,r,bP(t),e.type_),UP(t))}else nP(i)&&XP(i,t,n)}),e)}function ZP(e,t){let n=fP(e),r={type_:+!!n,scope_:t?t.scope_:NP(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},i=r,a=QP;n&&(i=[r],a=$P);let{revoke:o,proxy:s}=Proxy.revocable(i,a);return r.draft_=s,r.revoke_=o,[s,r]}var QP={get(e,t){if(t===GN)return e;let n=e.scope_.arrayMethodsPlugin_,r=e.type_===1&&typeof t==`string`;if(r&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);let i=yP(e);if(!cP(i,t,e.type_))return nF(e,i,t);let a=i[t];if(e.finalized_||!nP(a)||r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&vP(t))return a;if(a===eF(e.base_,t)||tF(e,t,a)){aF(e);let n=e.type_===1?+t:t,r=sF(e.scope_,a,e,n);return e.copy_[n]=r}return a},has(e,t){return t in yP(e)},ownKeys(e){return Reflect.ownKeys(yP(e))},set(e,t,n){let r=rF(yP(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){let r=eF(yP(e),t),i=r?.[GN];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_.delete(t),!0;if(dP(n,r)&&(n!==void 0||cP(e.base_,t,e.type_)))return!0;aF(e),iF(e)}return e.copy_[t]===n&&(n!==void 0||cP(e.copy_,t,e.type_))||Number.isNaN(n)&&Number.isNaN(e.copy_[t])?!0:(e.copy_[t]=n,e.assigned_.set(t,!0),YP(e,t,n),!0)},deleteProperty(e,t){return aF(e),eF(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),iF(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let n=yP(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[$N]:!0,[ZN]:e.type_!==1||t!==`length`,[QN]:r[QN],[eP]:n[t]}},defineProperty(){KN(11)},getPrototypeOf(e){return JN(e.base_)},setPrototypeOf(){KN(12)}},$P={};for(let e in QP){let t=QP[e];$P[e]=function(){let e=arguments;return e[0]=e[0][0],t.apply(this,e)}}$P.deleteProperty=function(e,t){return $P.set.call(this,e,t,void 0)},$P.set=function(e,t,n){return QP.set.call(this,e[0],t,n,e[0])};function eF(e,t){let n=e[GN];return(n?yP(n):e)[t]}function tF(e,t,n){return e.type_!==1||!e.allIndicesReassigned_||!nP(n)||n[GN]?!1:e.baseRefs_.has(n)}function nF(e,t,n){let r=rF(t,n);return r?eP in r?r[eP]:r.get?.call(e.draft_):void 0}function rF(e,t){if(!(t in e))return;let n=JN(e);for(;n;){let e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=JN(n)}}function iF(e){e.modified_||(e.modified_=!0,e.parent_&&iF(e.parent_))}function aF(e){e.copy_||=(e.assigned_=new Map,xP(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var oF=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,t,n)=>{if(gP(e)&&!gP(t)){let n=t;t=e;let r=this;return function(e=n,...i){return r.produce(e,e=>t.call(this,e,...i))}}gP(t)||KN(6),n!==void 0&&!gP(n)&&KN(7);let r;if(nP(e)){let i=RP(this),a=sF(i,e,void 0),o=!0;try{r=t(a),o=!1}finally{o?IP(i):LP(i)}return FP(i,n),BP(r,i)}if(!e||!hP(e)){if(r=t(e),r===void 0&&(r=e),r===UN&&(r=void 0),this.autoFreeze_&&SP(r,!0),n){let t=[],i=[];AP(DP).generateReplacementPatches_(e,r,{patches_:t,inversePatches_:i}),n(t,i)}return r}KN(1,e)},this.produceWithPatches=(e,t)=>{if(gP(e))return(t,...n)=>this.produceWithPatches(t,t=>e(t,...n));let n,r;return[this.produce(e,t,(e,t)=>{n=e,r=t}),n,r]},_P(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),_P(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),_P(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){nP(e)||KN(8),tP(e)&&(e=cF(e));let t=RP(this),n=sF(t,e,void 0);return n[GN].isManual_=!0,LP(t),n}finishDraft(e,t){let n=e&&e[GN];(!n||!n.isManual_)&&KN(9);let{scope_:r}=n;return FP(r,t),BP(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){let r=t[n];if(r.path.length===0&&r.op===`replace`){e=r.value;break}}n>-1&&(t=t.slice(n+1));let r=AP(DP).applyPatches_;return tP(e)?r(e,t):this.produce(e,e=>r(e,t))}};function sF(e,t,n,r){let[i,a]=pP(t)?AP(EP).proxyMap_(t,n):mP(t)?AP(EP).proxySet_(t,n):ZP(t,n);return(n?.scope_??NP()).drafts_.push(i),a.callbacks_=n?.callbacks_??[],a.key_=r,n&&r!==void 0?qP(n,a,r):a.callbacks_.push(function(e){e.mapSetPlugin_?.fixSetContents(a);let{patchPlugin_:t}=e;a.modified_&&t&&t.generatePatches_(a,[],e)}),i}function cF(e){return tP(e)||KN(10,e),lF(e)}function lF(e){if(!nP(e)||TP(e))return e;let t=e[GN],n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=xP(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=xP(e,!0);let i=n;return mP(n)&&(n=new Set),oP(i,(e,t)=>{uP(n,e,lF(t))},r),t&&(t.finalized_=!1),n}globalThis.Iterator?.from;var uF=new oF().produce;function dF(e){return({dispatch:t,getState:n})=>r=>i=>typeof i==`function`?i(t,n,e):r(i)}var fF=dF(),pF=dF,mF=typeof window<`u`&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]==`object`?BN:BN.apply(null,arguments)};typeof window<`u`&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;function hF(e,t){function n(...n){if(t){let r=t(...n);if(!r)throw Error(wI(0));return{type:e,payload:r.payload,...`meta`in r&&{meta:r.meta},...`error`in r&&{error:r.error}}}return{type:e,payload:n[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=t=>HN(t)&&t.type===e,n}var gF=class e extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,e.prototype)}static get[Symbol.species](){return e}concat(...e){return super.concat.apply(this,e)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new e(...t[0].concat(this)):new e(...t.concat(this))}};function _F(e){return nP(e)?uF(e,()=>{}):e}function vF(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function yF(e){return typeof e==`boolean`}var bF=()=>function(e){let{thunk:t=!0,immutableCheck:n=!0,serializableCheck:r=!0,actionCreatorCheck:i=!0}=e??{},a=new gF;return t&&(yF(t)?a.push(fF):a.push(pF(t.extraArgument))),a},xF=`RTK_autoBatch`,SF=()=>e=>({payload:e,meta:{[xF]:!0}}),CF=e=>t=>{setTimeout(t,e)},wF=(e,t)=>n=>{let r=!1,i,a,o=()=>{r||(r=!0,cancelAnimationFrame(i),clearTimeout(a),n())};i=e(o),a=setTimeout(o,t)},TF=(e={type:`raf`})=>t=>(...n)=>{let r=t(...n),i=!0,a=!1,o=!1,s=new Set,c=e.type===`tick`?queueMicrotask:e.type===`raf`?typeof window<`u`&&window.requestAnimationFrame?wF(window.requestAnimationFrame,100):CF(10):e.type===`callback`?e.queueNotification:CF(e.timeout),l=()=>{o=!1,a&&(a=!1,s.forEach(e=>e()))};return Object.assign({},r,{subscribe(e){let t=r.subscribe(()=>i&&e());return s.add(e),()=>{t(),s.delete(e)}},dispatch(e){try{return i=!e?.meta?.[xF],a=!i,a&&(o||(o=!0,c(l))),r.dispatch(e)}finally{i=!0}}})},EF=e=>function(t){let{autoBatch:n=!0}=t??{},r=new gF(e);return n&&r.push(TF(typeof n==`object`?n:void 0)),r};function DF(e){let t=bF(),{reducer:n=void 0,middleware:r,devTools:i=!0,duplicateMiddlewareCheck:a=!0,preloadedState:o=void 0,enhancers:s=void 0}=e||{},c;if(typeof n==`function`)c=n;else if(IN(n))c=zN(n);else throw Error(wI(1));let l;l=typeof r==`function`?r(t):t();let u=BN;i&&(u=mF({trace:!1,...typeof i==`object`&&i}));let d=EF(VN(...l)),f=typeof s==`function`?s(d):d(),p=u(...f);return LN(c,o,p)}function OF(e){let t={},n=[],r,i={addCase(e,n){let r=typeof e==`string`?e:e.type;if(!r)throw Error(wI(28));if(r in t)throw Error(wI(29));return t[r]=n,i},addAsyncThunk(e,r){return r.pending&&(t[e.pending.type]=r.pending),r.rejected&&(t[e.rejected.type]=r.rejected),r.fulfilled&&(t[e.fulfilled.type]=r.fulfilled),r.settled&&n.push({matcher:e.settled,reducer:r.settled}),i},addMatcher(e,t){return n.push({matcher:e,reducer:t}),i},addDefaultCase(e){return r=e,i}};return e(i),[t,n,r]}function kF(e){return typeof e==`function`}function AF(e,t){let[n,r,i]=OF(t),a;if(kF(e))a=()=>_F(e());else{let t=_F(e);a=()=>t}function o(e=a(),t){let o=[n[t.type],...r.filter(({matcher:e})=>e(t)).map(({reducer:e})=>e)];return o.filter(e=>!!e).length===0&&(o=[i]),o.reduce((e,n)=>{if(n){if(tP(e)){let r=n(e,t);return r===void 0?e:r}if(nP(e))return uF(e,e=>n(e,t));{let r=n(e,t);if(r===void 0){if(e===null)return e;throw Error(wI(9))}return r}}return e},e)}return o.getInitialState=a,o}var jF=`ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW`,MF=(e=21)=>{let t=``,n=e;for(;n--;)t+=jF[Math.random()*64|0];return t},NF=Symbol.for(`rtk-slice-createasyncthunk`);function PF(e,t){return`${e}/${t}`}function FF({creators:e}={}){let t=e?.asyncThunk?.[NF];return function(e){let{name:n,reducerPath:r=n}=e;if(!n)throw Error(wI(11));let i=(typeof e.reducers==`function`?e.reducers(RF()):e.reducers)||{},a=Object.keys(i),o={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},s={addCase(e,t){let n=typeof e==`string`?e:e.type;if(!n)throw Error(wI(12));if(n in o.sliceCaseReducersByType)throw Error(wI(13));return o.sliceCaseReducersByType[n]=t,s},addMatcher(e,t){return o.sliceMatchers.push({matcher:e,reducer:t}),s},exposeAction(e,t){return o.actionCreators[e]=t,s},exposeCaseReducer(e,t){return o.sliceCaseReducersByName[e]=t,s}};a.forEach(r=>{let a=i[r],o={reducerName:r,type:PF(n,r),createNotation:typeof e.reducers==`function`};BF(a)?HF(o,a,s,t):zF(o,a,s)});function c(){let[t={},n=[],r=void 0]=typeof e.extraReducers==`function`?OF(e.extraReducers):[e.extraReducers],i={...t,...o.sliceCaseReducersByType};return AF(e.initialState,e=>{for(let t in i)e.addCase(t,i[t]);for(let t of o.sliceMatchers)e.addMatcher(t.matcher,t.reducer);for(let t of n)e.addMatcher(t.matcher,t.reducer);r&&e.addDefaultCase(r)})}let l=e=>e,u=new Map,d=new WeakMap,f;function p(e,t){return f||=c(),f(e,t)}function m(){return f||=c(),f.getInitialState()}function h(t,n=!1){function r(e){let i=e[t];return i===void 0&&n&&(i=vF(d,r,m)),i}function i(t=l){return vF(vF(u,n,()=>new WeakMap),t,()=>{let r={};for(let[i,a]of Object.entries(e.selectors??{}))r[i]=IF(a,t,()=>vF(d,t,m),n);return r})}return{reducerPath:t,getSelectors:i,get selectors(){return i(r)},selectSlice:r}}let g={name:n,reducer:p,actions:o.actionCreators,caseReducers:o.sliceCaseReducersByName,getInitialState:m,...h(r),injectInto(e,{reducerPath:t,...n}={}){let i=t??r;return e.inject({reducerPath:i,reducer:p},n),{...g,...h(i,!0)}}};return g}}function IF(e,t,n,r){function i(i,...a){let o=t(i);return o===void 0&&r&&(o=n()),e(o,...a)}return i.unwrapped=e,i}var LF=FF();function RF(){function e(e,t){return{_reducerDefinitionType:`asyncThunk`,payloadCreator:e,...t}}return e.withTypes=()=>e,{reducer(e){return Object.assign({[e.name](...t){return e(...t)}}[e.name],{_reducerDefinitionType:`reducer`})},preparedReducer(e,t){return{_reducerDefinitionType:`reducerWithPrepare`,prepare:e,reducer:t}},asyncThunk:e}}function zF({type:e,reducerName:t,createNotation:n},r,i){let a,o;if(`reducer`in r){if(n&&!VF(r))throw Error(wI(17));a=r.reducer,o=r.prepare}else a=r;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,o?hF(e,o):hF(e))}function BF(e){return e._reducerDefinitionType===`asyncThunk`}function VF(e){return e._reducerDefinitionType===`reducerWithPrepare`}function HF({type:e,reducerName:t},n,r,i){if(!i)throw Error(wI(18));let{payloadCreator:a,fulfilled:o,pending:s,rejected:c,settled:l,options:u}=n,d=i(e,a,u);r.exposeAction(t,d),o&&r.addCase(d.fulfilled,o),s&&r.addCase(d.pending,s),c&&r.addCase(d.rejected,c),l&&r.addMatcher(d.settled,l),r.exposeCaseReducer(t,{fulfilled:o||UF,pending:s||UF,rejected:c||UF,settled:l||UF})}function UF(){}var WF=`task`,GF=`listener`,KF=`completed`,qF=`cancelled`,JF=`task-${qF}`,YF=`task-${KF}`,XF=`${GF}-${qF}`,ZF=`${GF}-${KF}`,QF=class{code;name=`TaskAbortError`;message;constructor(e){this.code=e,this.message=`${WF} ${qF} (reason: ${e})`}},$F=(e,t)=>{if(typeof e!=`function`)throw TypeError(wI(32))},eI=()=>{},tI=(e,t=eI)=>(e.catch(t),e),nI=(e,t)=>(e.addEventListener(`abort`,t,{once:!0}),()=>e.removeEventListener(`abort`,t)),rI=e=>{if(e.aborted)throw new QF(e.reason)};function iI(e,t){let n=eI;return new Promise((r,i)=>{let a=()=>i(new QF(e.reason));if(e.aborted){a();return}n=nI(e,a),t.finally(()=>n()).then(r,i)}).finally(()=>{n=eI})}var aI=async(e,t)=>{try{return await Promise.resolve(),{status:`ok`,value:await e()}}catch(e){return{status:e instanceof QF?`cancelled`:`rejected`,error:e}}finally{t?.()}},oI=e=>t=>tI(iI(e,t).then(t=>(rI(e),t))),sI=e=>{let t=oI(e);return e=>t(new Promise(t=>setTimeout(t,e)))},{assign:cI}=Object,lI={},uI=`listenerMiddleware`,dI=(e,t)=>{let n=t=>nI(e,()=>t.abort(e.reason));return(r,i)=>{$F(r,`taskExecutor`);let a=new AbortController;n(a);let o=aI(async()=>{rI(e),rI(a.signal);let t=await r({pause:oI(a.signal),delay:sI(a.signal),signal:a.signal});return rI(a.signal),t},()=>a.abort(YF));return i?.autoJoin&&t.push(o.catch(eI)),{result:oI(e)(o),cancel(){a.abort(JF)}}}},fI=(e,t)=>{let n=async(n,r)=>{rI(t);let i=()=>{},a=[new Promise((t,r)=>{let a=e({predicate:n,effect:(e,n)=>{n.unsubscribe(),t([e,n.getState(),n.getOriginalState()])}});i=()=>{a(),r()}})];r!=null&&a.push(new Promise(e=>setTimeout(e,r,null)));try{let e=await iI(t,Promise.race(a));return rI(t),e}finally{i()}};return((e,t)=>tI(n(e,t)))},pI=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:a}=e;if(t)i=hF(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw Error(wI(21));return $F(a,`options.listener`),{predicate:i,type:t,effect:a}},mI=cI(e=>{let{type:t,predicate:n,effect:r}=pI(e);return{id:MF(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw Error(wI(22))}}},{withTypes:()=>mI}),hI=(e,t)=>{let{type:n,effect:r,predicate:i}=pI(t);return Array.from(e.values()).find(e=>(typeof n==`string`?e.type===n:e.predicate===i)&&e.effect===r)},gI=e=>{e.pending.forEach(e=>{e.abort(XF)})},_I=(e,t)=>()=>{for(let e of t.keys())gI(e);e.clear()},vI=(e,t,n)=>{try{e(t,n)}catch(e){setTimeout(()=>{throw e},0)}},yI=cI(hF(`${uI}/add`),{withTypes:()=>yI}),bI=hF(`${uI}/removeAll`),xI=cI(hF(`${uI}/remove`),{withTypes:()=>xI}),SI=(...e)=>{console.error(`${uI}/error`,...e)},CI=(e={})=>{let t=new Map,n=new Map,r=e=>{let t=n.get(e)??0;n.set(e,t+1)},i=e=>{let t=n.get(e)??1;t===1?n.delete(e):n.set(e,t-1)},{extra:a,onError:o=SI}=e;$F(o,`onError`);let s=e=>(e.unsubscribe=()=>t.delete(e.id),t.set(e.id,e),t=>{e.unsubscribe(),t?.cancelActive&&gI(e)}),c=(e=>{let n=hI(t,e)??mI(e);return s(n)});cI(c,{withTypes:()=>c});let l=e=>{let n=hI(t,e);return n&&(n.unsubscribe(),e.cancelActive&&gI(n)),!!n};cI(l,{withTypes:()=>l});let u=async(e,n,s,l)=>{let u=new AbortController,d=fI(c,u.signal),f=[];try{e.pending.add(u),r(e),await Promise.resolve(e.effect(n,cI({},s,{getOriginalState:l,condition:(e,t)=>d(e,t).then(Boolean),take:d,delay:sI(u.signal),pause:oI(u.signal),extra:a,signal:u.signal,fork:dI(u.signal,f),unsubscribe:e.unsubscribe,subscribe:()=>{t.set(e.id,e)},cancelActiveListeners:()=>{e.pending.forEach((e,t,n)=>{e!==u&&(e.abort(XF),n.delete(e))})},cancel:()=>{u.abort(XF),e.pending.delete(u)},throwIfCancelled:()=>{rI(u.signal)}})))}catch(e){e instanceof QF||vI(o,e,{raisedBy:`effect`})}finally{await Promise.all(f),u.abort(ZF),i(e),e.pending.delete(u)}},d=_I(t,n);return{middleware:e=>n=>r=>{if(!HN(r))return n(r);if(yI.match(r))return c(r.payload);if(bI.match(r)){d();return}if(xI.match(r))return l(r.payload);let i=e.getState(),a=()=>{if(i===lI)throw Error(wI(23));return i},s;try{if(s=n(r),t.size>0){let n=e.getState(),s=Array.from(t.values());for(let t of s){let s=!1;try{s=t.predicate(r,n,i)}catch(e){s=!1,vI(o,e,{raisedBy:`predicate`})}s&&u(t,r,e,a)}}}finally{i=lI}return s},startListening:c,stopListening:l,clearListeners:d}};function wI(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var TI=LF({name:`chartLayout`,initialState:{layoutType:`horizontal`,width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},reducers:{setLayout(e,t){e.layoutType=t.payload},setChartSize(e,t){e.width=t.payload.width,e.height=t.payload.height},setMargin(e,t){e.margin.top=t.payload.top??0,e.margin.right=t.payload.right??0,e.margin.bottom=t.payload.bottom??0,e.margin.left=t.payload.left??0},setScale(e,t){e.scale=t.payload}}}),{setMargin:EI,setLayout:DI,setChartSize:OI,setScale:kI}=TI.actions,AI=TI.reducer;function jI(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function MI(e){return Number.isFinite(e)}function NI(e){return typeof e==`number`&&e>0&&Number.isFinite(e)}function PI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function FI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?PI(Object(n),!0).forEach(function(t){II(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PI(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function II(e,t,n){return(t=LI(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function LI(e){var t=RI(e,`string`);return typeof t==`symbol`?t:t+``}function RI(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function zI(e,t,n){return pj(e)||pj(t)?n:oj(t)?QA(e,t,n):typeof t==`function`?t(e):n}var BI=(e,t,n)=>{if(t&&n){var{width:r,height:i}=n,{align:a,verticalAlign:o,layout:s}=t;if((s===`vertical`||s===`horizontal`&&o===`middle`)&&a!==`center`&&Z(e[a]))return FI(FI({},e),{},{[a]:e[a]+(r||0)});if((s===`horizontal`||s===`vertical`&&a===`center`)&&o!==`middle`&&Z(e[o]))return FI(FI({},e),{},{[o]:e[o]+(i||0)})}return e},VI=(e,t)=>e===`horizontal`&&t===`xAxis`||e===`vertical`&&t===`yAxis`||e===`centric`&&t===`angleAxis`||e===`radial`&&t===`radiusAxis`,HI=(e,t,n,r)=>{if(r)return e.map(e=>e.coordinate);var i,a,o=e.map(e=>(e.coordinate===t&&(i=!0),e.coordinate===n&&(a=!0),e.coordinate));return i||o.push(t),a||o.push(n),o},UI=(e,t,n)=>{if(!e)return null;var{duplicateDomain:r,type:i,range:a,scale:o,realScaleType:s,isCategorical:c,categoricalDomain:l,tickCount:u,ticks:d,niceTicks:f,axisType:p}=e;if(!o)return null;var m=s===`scaleBand`&&o.bandwidth?o.bandwidth()/2:2,h=(t||n)&&i===`category`&&o.bandwidth?o.bandwidth()/m:0;return h=p===`angleAxis`&&a&&a.length>=2?rj(a[0]-a[1])*2*h:h,t&&(d||f)?(d||f||[]).map((e,t)=>{var n=r?r.indexOf(e):e,i=o.map(n);return MI(i)?{coordinate:i+h,value:e,offset:h,index:t}:null}).filter(hj):c&&l?l.map((e,t)=>{var n=o.map(e);return MI(n)?{coordinate:n+h,value:e,index:t,offset:h}:null}).filter(hj):o.ticks&&!n&&u!=null?o.ticks(u).map((e,t)=>{var n=o.map(e);return MI(n)?{coordinate:n+h,value:e,index:t,offset:h}:null}).filter(hj):o.domain().map((e,t)=>{var n=o.map(e);return MI(n)?{coordinate:n+h,value:r?r[e]:e,index:t,offset:h}:null}).filter(hj)},WI=(e,t)=>{if(!t||t.length!==2||!Z(t[0])||!Z(t[1]))return e;var n=Math.min(t[0],t[1]),r=Math.max(t[0],t[1]),i=[e[0],e[1]];return(!Z(e[0])||e[0]<n)&&(i[0]=n),(!Z(e[1])||e[1]>r)&&(i[1]=r),i[0]>r&&(i[0]=r),i[1]<n&&(i[1]=n),i},GI={sign:e=>{var t=e.length;if(!(t<=0)){var n=e[0]?.length;if(!(n==null||n<=0))for(var r=0;r<n;++r)for(var i=0,a=0,o=0;o<t;++o){var s=e[o]?.[r];if(s!=null){var c=s[1],l=s[0],u=ij(c)?l:c;u>=0?(s[0]=i,i+=u,s[1]=i):(s[0]=a,a+=u,s[1]=a)}}}},expand:zA,none:PA,silhouette:BA,wiggle:VA,positive:e=>{var t=e.length;if(!(t<=0)){var n=e[0]?.length;if(!(n==null||n<=0))for(var r=0;r<n;++r)for(var i=0,a=0;a<t;++a){var o=e[a]?.[r];if(o!=null){var s=ij(o[1])?o[0]:o[1];s>=0?(o[0]=i,i+=s,o[1]=i):(o[0]=0,o[1]=0)}}}}},KI=(e,t,n)=>{var r=GI[n]??PA,i=RA().keys(t).value((e,t)=>Number(zI(e,t,0))).order(FA).offset(r)(e);return i.forEach((n,r)=>{n.forEach((n,i)=>{var a=zI(e[i],t[r],0);Array.isArray(a)&&a.length===2&&Z(a[0])&&Z(a[1])&&(n[0]=a[0],n[1]=a[1])})}),i};function qI(e){return e==null?void 0:String(e)}var JI=e=>{var{axis:t,ticks:n,offset:r,bandSize:i,entry:a,index:o}=e;if(t.type===`category`)return n[o]?n[o].coordinate+r:null;var s=zI(a,t.dataKey,t.scale.domain()[o]);if(pj(s))return null;var c=t.scale.map(s);return Z(c)?c-i/2+r:null},YI=e=>{var{numericAxis:t}=e,n=t.scale.domain();if(t.type===`number`){var r=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]);return r<=0&&i>=0?0:i<0?i:r}return n[0]},XI=e=>{var t=e.flat(2).filter(Z);return[Math.min(...t),Math.max(...t)]},ZI=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],QI=(e,t,n)=>{if(e!=null)return ZI(Object.keys(e).reduce((r,i)=>{var a=e[i];if(!a)return r;var{stackedData:o}=a,s=o.reduce((e,r)=>{var i=XI(jI(r,t,n));return!MI(i[0])||!MI(i[1])?e:[Math.min(e[0],i[0]),Math.max(e[1],i[1])]},[1/0,-1/0]);return[Math.min(s[0],r[0]),Math.max(s[1],r[1])]},[1/0,-1/0]))},$I=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,eL=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,tL=(e,t,n)=>{if(e&&e.scale&&e.scale.bandwidth){var r=e.scale.bandwidth();if(!n||r>0)return r}if(e&&t&&t.length>=2){for(var i=DN(t,e=>e.coordinate),a=1/0,o=1,s=i.length;o<s;o++){var c=i[o],l=i[o-1];a=Math.min((c?.coordinate||0)-(l?.coordinate||0),a)}return a===1/0?0:a}return n?void 0:0};function nL(e){var{tooltipEntrySettings:t,dataKey:n,payload:r,value:i,name:a}=e;return FI(FI({},t),{},{dataKey:n,payload:r,value:i,name:a})}function rL(e,t){if(e)return String(e);if(typeof t==`string`)return t}var pee=(e,t)=>{if(t===`horizontal`)return e.relativeX;if(t===`vertical`)return e.relativeY},mee=(e,t)=>t===`centric`?e.angle:e.radius,iL=e=>e.layout.width,aL=e=>e.layout.height,hee=e=>e.layout.scale,oL=e=>e.layout.margin,sL=$(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),cL=$(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),gee=`data-recharts-item-index`;function lL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function uL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?lL(Object(n),!0).forEach(function(t){_ee(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lL(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function _ee(e,t,n){return(t=vee(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vee(e){var t=yee(e,`string`);return typeof t==`symbol`?t:t+``}function yee(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var bee=e=>e.brush.height;function dL(e){return cL(e).reduce((e,t)=>t.orientation===`left`&&!t.mirror&&!t.hide?e+(typeof t.width==`number`?t.width:60):e,0)}function fL(e){return cL(e).reduce((e,t)=>t.orientation===`right`&&!t.mirror&&!t.hide?e+(typeof t.width==`number`?t.width:60):e,0)}function pL(e){return sL(e).reduce((e,t)=>t.orientation===`top`&&!t.mirror&&!t.hide?e+t.height:e,0)}function mL(e){return sL(e).reduce((e,t)=>t.orientation===`bottom`&&!t.mirror&&!t.hide?e+t.height:e,0)}var hL=$([iL,aL,oL,bee,dL,fL,pL,mL,ON,kN],(e,t,n,r,i,a,o,s,c,l)=>{var u={left:(n.left||0)+i,right:(n.right||0)+a},d=uL(uL({},{top:(n.top||0)+o,bottom:(n.bottom||0)+s}),u),f=d.bottom;d.bottom+=r,d=BI(d,c,l);var p=e-d.left-d.right,m=t-d.top-d.bottom;return uL(uL({brushBottom:f},d),{},{width:Math.max(p,0),height:Math.max(m,0)})}),gL=$(hL,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),_L=$(iL,aL,(e,t)=>({x:0,y:0,width:e,height:t})),vL=(0,v.createContext)(null),yL=()=>(0,v.useContext)(vL)!=null,bL=e=>e.brush,xL=$([bL,hL,oL],(e,t,n)=>({height:e.height,x:Z(e.x)?e.x:t.left,y:Z(e.y)?e.y:t.top+t.height+t.brushBottom-(n?.bottom||0),width:Z(e.width)?e.width:t.width}));function SL(e,t,{signal:n,edges:r}={}){let i,a=null,o=r!=null&&r.includes(`leading`),s=r==null||r.includes(`trailing`),c=()=>{a!==null&&(e.apply(i,a),i=void 0,a=null)},l=()=>{s&&c(),p()},u=null,d=()=>{u!=null&&clearTimeout(u),u=setTimeout(()=>{u=null,l()},t)},f=()=>{u!==null&&(clearTimeout(u),u=null)},p=()=>{f(),i=void 0,a=null},m=()=>{c()},h=function(...e){if(n?.aborted)return;i=this,a=e;let t=u==null;d(),o&&t&&c()};return h.schedule=d,h.cancel=p,h.flush=m,n?.addEventListener(`abort`,p,{once:!0}),h}function CL(e,t=0,n={}){typeof n!=`object`&&(n={});let{leading:r=!1,trailing:i=!0,maxWait:a}=n,o=[,,];r&&(o[0]=`leading`),i&&(o[1]=`trailing`);let s,c=null,l=SL(function(...t){s=e.apply(this,t),c=null},t,{edges:o}),u=function(...t){return a!=null&&(c===null&&(c=Date.now()),Date.now()-c>=a)?((r||i)&&(s=e.apply(this,t)),c=Date.now(),l.cancel(),l.schedule(),s):(l.apply(this,t),s)};return u.cancel=l.cancel,u.flush=()=>(l.flush(),s),u}function wL(e,t=0,n={}){let{leading:r=!0,trailing:i=!0}=n;return CL(e,t,{leading:r,maxWait:t,trailing:i})}var TL=function(e,t){var n=[...arguments].slice(2);if(typeof console<`u`&&console.warn&&(t===void 0&&console.warn(`LogUtils requires an error message argument`),!e)){if(t===void 0)console.warn(`Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.`);else{var r=0;console.warn(t.replace(/%s/g,()=>n[r++]))}}},EL={width:`100%`,height:`100%`,debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},DL=(e,t,n)=>{var{width:r=EL.width,height:i=EL.height,aspect:a,maxHeight:o}=n,s=aj(r)?e:Number(r),c=aj(i)?t:Number(i);return a&&a>0&&(s?c=s/a:c&&(s=c*a),o&&c!=null&&c>o&&(c=o)),{calculatedWidth:s,calculatedHeight:c}},OL={width:0,height:0,overflow:`visible`},kL={width:0,overflowX:`visible`},AL={height:0,overflowY:`visible`},jL={},ML=e=>{var{width:t,height:n}=e,r=aj(t),i=aj(n);return r&&i?OL:r?kL:i?AL:jL};function NL(e){var{width:t,height:n,aspect:r}=e,i=t,a=n;return i===void 0&&a===void 0?(i=EL.width,a=EL.height):i===void 0?i=r&&r>0?void 0:EL.width:a===void 0&&(a=r&&r>0?void 0:EL.height),{width:i,height:a}}function PL(){return PL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},PL.apply(null,arguments)}function FL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function IL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?FL(Object(n),!0).forEach(function(t){LL(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):FL(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function LL(e,t,n){return(t=RL(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function RL(e){var t=zL(e,`string`);return typeof t==`symbol`?t:t+``}function zL(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var BL=(0,v.createContext)(EL.initialDimension);function VL(e){return NI(e.width)&&NI(e.height)}function HL(e){var{children:t,width:n,height:r}=e,i=(0,v.useMemo)(()=>({width:n,height:r}),[n,r]);return VL(i)?v.createElement(BL.Provider,{value:i},t):null}var UL=()=>(0,v.useContext)(BL),WL=(0,v.forwardRef)((e,t)=>{var{aspect:n,initialDimension:r=EL.initialDimension,width:i,height:a,minWidth:o=EL.minWidth,minHeight:s,maxHeight:c,children:l,debounce:u=EL.debounce,id:d,className:f,onResize:p,style:m={}}=e,h=(0,v.useRef)(null),g=(0,v.useRef)();g.current=p,(0,v.useImperativeHandle)(t,()=>h.current);var[_,y]=(0,v.useState)({containerWidth:r.width,containerHeight:r.height}),b=(0,v.useCallback)((e,t)=>{y(n=>{var r=Math.round(e),i=Math.round(t);return n.containerWidth===r&&n.containerHeight===i?n:{containerWidth:r,containerHeight:i}})},[]);(0,v.useEffect)(()=>{if(h.current==null||typeof ResizeObserver>`u`)return gj;var e=e=>{var t,n=e[0];if(n!=null){var{width:r,height:i}=n.contentRect;b(r,i),(t=g.current)==null||t.call(g,r,i)}};u>0&&(e=wL(e,u,{trailing:!0,leading:!1}));var t=new ResizeObserver(e),{width:n,height:r}=h.current.getBoundingClientRect();return b(n,r),t.observe(h.current),()=>{t.disconnect()}},[b,u]);var{containerWidth:x,containerHeight:S}=_;TL(!n||n>0,`The aspect(%s) must be greater than zero.`,n);var{calculatedWidth:C,calculatedHeight:w}=DL(x,S,{width:i,height:a,aspect:n,maxHeight:c});return TL(C!=null&&C>0||w!=null&&w>0,`The width(%s) and height(%s) of chart should be greater than 0,
|
|
133
|
-
please check the style of container, or the props width(%s) and height(%s),
|
|
134
|
-
or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
|
|
135
|
-
height and width.`,C,w,i,a,o,s,n),v.createElement(`div`,{id:d?`${d}`:void 0,className:cn(`recharts-responsive-container`,f),style:IL(IL({},m),{},{width:i,height:a,minWidth:o,minHeight:s,maxHeight:c}),ref:h},v.createElement(`div`,{style:ML({width:i,height:a})},v.createElement(HL,{width:C,height:w},l)))}),GL=(0,v.forwardRef)((e,t)=>{var n=UL();if(NI(n.width)&&NI(n.height))return e.children;var{width:r,height:i}=NL({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:a,calculatedHeight:o}=DL(void 0,void 0,{width:r,height:i,aspect:e.aspect,maxHeight:e.maxHeight});return Z(a)&&Z(o)?v.createElement(HL,{width:a,height:o},e.children):v.createElement(WL,PL({},e,{width:r,height:i,ref:t}))});function KL(e){if(e)return{x:e.x,y:e.y,upperWidth:`upperWidth`in e?e.upperWidth:e.width,lowerWidth:`lowerWidth`in e?e.lowerWidth:e.width,width:e.width,height:e.height}}var qL=()=>{var e=yL(),t=Q(gL),n=Q(xL),r=Q(bL)?.padding;return!e||!n||!r?t:{width:n.width-r.left-r.right,height:n.height-r.top-r.bottom,x:r.left,y:r.top}},JL={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},YL=()=>Q(hL)??JL,XL=()=>Q(iL),ZL=()=>Q(aL),QL=e=>e.layout.layoutType,$L=()=>Q(QL),eR=()=>{var e=$L();if(e===`horizontal`||e===`vertical`)return e},tR=e=>{var t=e.layout.layoutType;if(t===`centric`||t===`radial`)return t},nR=()=>$L()!==void 0,rR=e=>{var t=tN(),n=yL(),{width:r,height:i}=e,a=UL(),o=r,s=i;return a&&(o=a.width>0?a.width:r,s=a.height>0?a.height:i),(0,v.useEffect)(()=>{!n&&NI(o)&&NI(s)&&t(OI({width:o,height:s}))},[t,n,o,s]),null},iR=Symbol.for(`immer-nothing`),aR=Symbol.for(`immer-draftable`),oR=Symbol.for(`immer-state`);function sR(e,...t){throw Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var cR=Object.getPrototypeOf;function lR(e){return!!e&&!!e[oR]}function uR(e){return e?pR(e)||Array.isArray(e)||!!e[aR]||!!e.constructor?.[aR]||yR(e)||bR(e):!1}var dR=Object.prototype.constructor.toString(),fR=new WeakMap;function pR(e){if(!e||typeof e!=`object`)return!1;let t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;let n=Object.hasOwnProperty.call(t,`constructor`)&&t.constructor;if(n===Object)return!0;if(typeof n!=`function`)return!1;let r=fR.get(n);return r===void 0&&(r=Function.toString.call(n),fR.set(n,r)),r===dR}function mR(e,t,n=!0){hR(e)===0?(n?Reflect.ownKeys(e):Object.keys(e)).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function hR(e){let t=e[oR];return t?t.type_:Array.isArray(e)?1:yR(e)?2:bR(e)?3:0}function gR(e,t){return hR(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function _R(e,t,n){let r=hR(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function vR(e,t){return e===t?e!==0||1/e==1/t:e!==e&&t!==t}function yR(e){return e instanceof Map}function bR(e){return e instanceof Set}function xR(e){return e.copy_||e.base_}function SR(e,t){if(yR(e))return new Map(e);if(bR(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let n=pR(e);if(t===!0||t===`class_only`&&!n){let t=Object.getOwnPropertyDescriptors(e);delete t[oR];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){let i=n[r],a=t[i];a.writable===!1&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(t[i]={configurable:!0,writable:!0,enumerable:a.enumerable,value:e[i]})}return Object.create(cR(e),t)}{let t=cR(e);if(t!==null&&n)return{...e};let r=Object.create(t);return Object.assign(r,e)}}function CR(e,t=!1){return ER(e)||lR(e)||!uR(e)?e:(hR(e)>1&&Object.defineProperties(e,{set:TR,add:TR,clear:TR,delete:TR}),Object.freeze(e),t&&Object.values(e).forEach(e=>CR(e,!0)),e)}function wR(){sR(2)}var TR={value:wR};function ER(e){return typeof e!=`object`||!e||Object.isFrozen(e)}var DR={};function OR(e){let t=DR[e];return t||sR(0,e),t}var kR;function AR(){return kR}function jR(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function MR(e,t){t&&(OR(`Patches`),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function NR(e){PR(e),e.drafts_.forEach(IR),e.drafts_=null}function PR(e){e===kR&&(kR=e.parent_)}function FR(e){return kR=jR(kR,e)}function IR(e){let t=e[oR];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function LR(e,t){t.unfinalizedDrafts_=t.drafts_.length;let n=t.drafts_[0];return e!==void 0&&e!==n?(n[oR].modified_&&(NR(t),sR(4)),uR(e)&&(e=RR(t,e),t.parent_||BR(t,e)),t.patches_&&OR(`Patches`).generateReplacementPatches_(n[oR].base_,e,t.patches_,t.inversePatches_)):e=RR(t,n,[]),NR(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e===iR?void 0:e}function RR(e,t,n){if(ER(t))return t;let r=e.immer_.shouldUseStrictIteration(),i=t[oR];if(!i)return mR(t,(r,a)=>zR(e,i,t,r,a,n),r),t;if(i.scope_!==e)return t;if(!i.modified_)return BR(e,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;let t=i.copy_,a=t,o=!1;i.type_===3&&(a=new Set(t),t.clear(),o=!0),mR(a,(r,a)=>zR(e,i,t,r,a,n,o),r),BR(e,t,!1),n&&e.patches_&&OR(`Patches`).generatePatches_(i,n,e.patches_,e.inversePatches_)}return i.copy_}function zR(e,t,n,r,i,a,o){if(i==null||typeof i!=`object`&&!o)return;let s=ER(i);if(!(s&&!o)){if(lR(i)){let o=RR(e,i,a&&t&&t.type_!==3&&!gR(t.assigned_,r)?a.concat(r):void 0);if(_R(n,r,o),lR(o))e.canAutoFreeze_=!1;else return}else o&&n.add(i);if(uR(i)&&!s){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[r]===i&&s)return;RR(e,i),(!t||!t.scope_.parent_)&&typeof r!=`symbol`&&(yR(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))&&BR(e,i)}}}function BR(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&CR(t,n)}function VR(e,t){let n=Array.isArray(e),r={type_:+!!n,scope_:t?t.scope_:AR(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},i=r,a=HR;n&&(i=[r],a=UR);let{revoke:o,proxy:s}=Proxy.revocable(i,a);return r.draft_=s,r.revoke_=o,s}var HR={get(e,t){if(t===oR)return e;let n=xR(e);if(!gR(n,t))return GR(e,n,t);let r=n[t];return e.finalized_||!uR(r)?r:r===WR(e.base_,t)?(JR(e),e.copy_[t]=XR(r,e)):r},has(e,t){return t in xR(e)},ownKeys(e){return Reflect.ownKeys(xR(e))},set(e,t,n){let r=KR(xR(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){let r=WR(xR(e),t),i=r?.[oR];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(vR(n,r)&&(n!==void 0||gR(e.base_,t)))return!0;JR(e),qR(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])?!0:(e.copy_[t]=n,e.assigned_[t]=!0,!0)},deleteProperty(e,t){return WR(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,JR(e),qR(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let n=xR(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!==`length`,enumerable:r.enumerable,value:n[t]}},defineProperty(){sR(11)},getPrototypeOf(e){return cR(e.base_)},setPrototypeOf(){sR(12)}},UR={};mR(HR,(e,t)=>{UR[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),UR.deleteProperty=function(e,t){return UR.set.call(this,e,t,void 0)},UR.set=function(e,t,n){return HR.set.call(this,e[0],t,n,e[0])};function WR(e,t){let n=e[oR];return(n?xR(n):e)[t]}function GR(e,t,n){let r=KR(t,n);return r?`value`in r?r.value:r.get?.call(e.draft_):void 0}function KR(e,t){if(!(t in e))return;let n=cR(e);for(;n;){let e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=cR(n)}}function qR(e){e.modified_||(e.modified_=!0,e.parent_&&qR(e.parent_))}function JR(e){e.copy_||=SR(e.base_,e.scope_.immer_.useStrictShallowCopy_)}var YR=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(e,t,n)=>{if(typeof e==`function`&&typeof t!=`function`){let n=t;t=e;let r=this;return function(e=n,...i){return r.produce(e,e=>t.call(this,e,...i))}}typeof t!=`function`&&sR(6),n!==void 0&&typeof n!=`function`&&sR(7);let r;if(uR(e)){let i=FR(this),a=XR(e,void 0),o=!0;try{r=t(a),o=!1}finally{o?NR(i):PR(i)}return MR(i,n),LR(r,i)}if(!e||typeof e!=`object`){if(r=t(e),r===void 0&&(r=e),r===iR&&(r=void 0),this.autoFreeze_&&CR(r,!0),n){let t=[],i=[];OR(`Patches`).generateReplacementPatches_(e,r,t,i),n(t,i)}return r}sR(1,e)},this.produceWithPatches=(e,t)=>{if(typeof e==`function`)return(t,...n)=>this.produceWithPatches(t,t=>e(t,...n));let n,r;return[this.produce(e,t,(e,t)=>{n=e,r=t}),n,r]},typeof e?.autoFreeze==`boolean`&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy==`boolean`&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof e?.useStrictIteration==`boolean`&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){uR(e)||sR(8),lR(e)&&(e=ZR(e));let t=FR(this),n=XR(e,void 0);return n[oR].isManual_=!0,PR(t),n}finishDraft(e,t){let n=e&&e[oR];(!n||!n.isManual_)&&sR(9);let{scope_:r}=n;return MR(r,t),LR(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){let r=t[n];if(r.path.length===0&&r.op===`replace`){e=r.value;break}}n>-1&&(t=t.slice(n+1));let r=OR(`Patches`).applyPatches_;return lR(e)?r(e,t):this.produce(e,e=>r(e,t))}};function XR(e,t){let n=yR(e)?OR(`MapSet`).proxyMap_(e,t):bR(e)?OR(`MapSet`).proxySet_(e,t):VR(e,t);return(t?t.scope_:AR()).drafts_.push(n),n}function ZR(e){return lR(e)||sR(10,e),QR(e)}function QR(e){if(!uR(e)||ER(e))return e;let t=e[oR],n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=SR(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=SR(e,!0);return mR(n,(e,t)=>{_R(n,e,QR(t))},r),t&&(t.finalized_=!1),n}new YR().produce;function $R(e){return e}var ez=LF({name:`legend`,initialState:{settings:{layout:`horizontal`,align:`center`,verticalAlign:`middle`,itemSorter:`value`},size:{width:0,height:0},payload:[]},reducers:{setLegendSize(e,t){e.size.width=t.payload.width,e.size.height=t.payload.height},setLegendSettings(e,t){e.settings.align=t.payload.align,e.settings.layout=t.payload.layout,e.settings.verticalAlign=t.payload.verticalAlign,e.settings.itemSorter=t.payload.itemSorter},addLegendPayload:{reducer(e,t){e.payload.push($R(t.payload))},prepare:SF()},replaceLegendPayload:{reducer(e,t){var{prev:n,next:r}=t.payload,i=cF(e).payload.indexOf($R(n));i>-1&&(e.payload[i]=$R(r))},prepare:SF()},removeLegendPayload:{reducer(e,t){var n=cF(e).payload.indexOf($R(t.payload));n>-1&&e.payload.splice(n,1)},prepare:SF()}}}),{setLegendSize:xee,setLegendSettings:See,addLegendPayload:tz,replaceLegendPayload:nz,removeLegendPayload:rz}=ez.actions,iz=ez.reducer,az=o((e=>{var t=d();t.useSyncExternalStore,t.useRef,t.useEffect,t.useMemo,t.useDebugValue}));o(((e,t)=>{t.exports=az()}))();function oz(e){e()}function sz(){let e=null,t=null;return{clear(){e=null,t=null},notify(){oz(()=>{let t=e;for(;t;)t.callback(),t=t.next})},get(){let t=[],n=e;for(;n;)t.push(n),n=n.next;return t},subscribe(n){let r=!0,i=t={callback:n,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!r||e===null||(r=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var cz={notify(){},get:()=>[]};function lz(e,t){let n,r=cz,i=0,a=!1;function o(e){u();let t=r.subscribe(e),n=!1;return()=>{n||(n=!0,t(),d())}}function s(){r.notify()}function c(){m.onStateChange&&m.onStateChange()}function l(){return a}function u(){i++,n||(n=t?t.addNestedSub(c):e.subscribe(c),r=sz())}function d(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=cz)}function f(){a||(a=!0,u())}function p(){a&&(a=!1,d())}let m={addNestedSub:o,notifyNestedSubs:s,handleChangeWrapper:c,isSubscribed:l,trySubscribe:f,tryUnsubscribe:p,getListeners:()=>r};return m}var uz=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,dz=typeof navigator<`u`&&navigator.product===`ReactNative`,fz=uz||dz?v.useLayoutEffect:v.useEffect;function pz(e,t){return e===t?e!==0||t!==0||1/e==1/t:e!==e&&t!==t}function mz(e,t){if(pz(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!pz(e[n[r]],t[n[r]]))return!1;return!0}var hz=Symbol.for(`react-redux-context`),gz=typeof globalThis<`u`?globalThis:{};function _z(){if(!v.createContext)return{};let e=gz[hz]??=new Map,t=e.get(v.createContext);return t||(t=v.createContext(null),e.set(v.createContext,t)),t}var vz=_z();function yz(e){let{children:t,context:n,serverState:r,store:i}=e,a=v.useMemo(()=>{let e=lz(i);return{store:i,subscription:e,getServerState:r==null?void 0:()=>r}},[i,r]),o=v.useMemo(()=>i.getState(),[i]);fz(()=>{let{subscription:e}=a;return e.onStateChange=e.notifyNestedSubs,e.trySubscribe(),o!==i.getState()&&e.notifyNestedSubs(),()=>{e.tryUnsubscribe(),e.onStateChange=void 0}},[a,o]);let s=n||vz;return v.createElement(s.Provider,{value:a},t)}var bz=new Set([`axisLine`,`tickLine`,`activeBar`,`activeDot`,`activeLabel`,`activeShape`,`allowEscapeViewBox`,`background`,`cursor`,`dot`,`label`,`line`,`margin`,`padding`,`position`,`shape`,`style`,`tick`,`wrapperStyle`,`radius`,`throttledEvents`]);function xz(e,t){return e==null&&t==null?!0:typeof e==`number`&&typeof t==`number`?e===t||e!==e&&t!==t:e===t}function Sz(e,t){for(var n of new Set([...Object.keys(e),...Object.keys(t)]))if(bz.has(n)){if(e[n]==null&&t[n]==null)continue;if(!mz(e[n],t[n]))return!1}else if(!xz(e[n],t[n]))return!1;return!0}function Cz(){return Cz=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Cz.apply(null,arguments)}function wz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Tz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?wz(Object(n),!0).forEach(function(t){Ez(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wz(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Ez(e,t,n){return(t=Dz(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dz(e){var t=Oz(e,`string`);return typeof t==`symbol`?t:t+``}function Oz(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function kz(e){return Array.isArray(e)&&oj(e[0])&&oj(e[1])?e.join(` ~ `):e}var Az={separator:` : `,contentStyle:{margin:0,padding:10,backgroundColor:`#fff`,border:`1px solid #ccc`,whiteSpace:`nowrap`},itemStyle:{display:`block`,paddingTop:4,paddingBottom:4,color:`#000`},labelStyle:{},accessibilityLayer:!1};function jz(e,t){return t==null?e:DN(e,t)}var Mz=e=>{var{separator:t=Az.separator,contentStyle:n,itemStyle:r,labelStyle:i=Az.labelStyle,payload:a,formatter:o,itemSorter:s,wrapperClassName:c,labelClassName:l,label:u,labelFormatter:d,accessibilityLayer:f=Az.accessibilityLayer}=e,p=()=>{if(a&&a.length){var e={padding:0,margin:0},n=jz(a,s).map((e,n)=>{if(e.type===`none`)return null;var i=e.formatter||o||kz,{value:s,name:c}=e,l=s,u=c;if(i){var d=i(s,c,e,n,a);if(Array.isArray(d))[l,u]=d;else if(d!=null)l=d;else return null}var f=Tz(Tz({},Az.itemStyle),{},{color:e.color||Az.itemStyle.color},r);return v.createElement(`li`,{className:`recharts-tooltip-item`,key:`tooltip-item-${n}`,style:f},oj(u)?v.createElement(`span`,{className:`recharts-tooltip-item-name`},u):null,oj(u)?v.createElement(`span`,{className:`recharts-tooltip-item-separator`},t):null,v.createElement(`span`,{className:`recharts-tooltip-item-value`},l),v.createElement(`span`,{className:`recharts-tooltip-item-unit`},e.unit||``))});return v.createElement(`ul`,{className:`recharts-tooltip-item-list`,style:e},n)}return null},m=Tz(Tz({},Az.contentStyle),n),h=Tz({margin:0},i),g=!pj(u),_=g?u:``,y=cn(`recharts-default-tooltip`,c),b=cn(`recharts-tooltip-label`,l);g&&d&&a!=null&&(_=d(u,a));var x=f?{role:`status`,"aria-live":`assertive`}:{};return v.createElement(`div`,Cz({className:y,style:m},x),v.createElement(`p`,{className:b,style:h},v.isValidElement(_)?_:`${_}`),p())},Nz=`recharts-tooltip-wrapper`,Pz={visibility:`hidden`};function Fz(e){var{coordinate:t,translateX:n,translateY:r}=e;return cn(Nz,{[`${Nz}-right`]:Z(n)&&t&&Z(t.x)&&n>=t.x,[`${Nz}-left`]:Z(n)&&t&&Z(t.x)&&n<t.x,[`${Nz}-bottom`]:Z(r)&&t&&Z(t.y)&&r>=t.y,[`${Nz}-top`]:Z(r)&&t&&Z(t.y)&&r<t.y})}function Iz(e){var{allowEscapeViewBox:t,coordinate:n,key:r,offset:i,position:a,reverseDirection:o,tooltipDimension:s,viewBox:c,viewBoxDimension:l}=e;if(a&&Z(a[r]))return a[r];var u=n[r]-s-(i>0?i:0),d=n[r]+i;if(t[r])return o[r]?u:d;var f=c[r];return f==null?0:o[r]?Math.max(u<f?d:u,f):l==null?0:d+s>f+l?Math.max(u,f):Math.max(d,f)}function Lz(e){var{translateX:t,translateY:n,useTranslate3d:r}=e;return{transform:r?`translate3d(${t}px, ${n}px, 0)`:`translate(${t}px, ${n}px)`}}function Rz(e){var{allowEscapeViewBox:t,coordinate:n,offsetTop:r,offsetLeft:i,position:a,reverseDirection:o,tooltipBox:s,useTranslate3d:c,viewBox:l}=e,u,d,f;return s.height>0&&s.width>0&&n?(d=Iz({allowEscapeViewBox:t,coordinate:n,key:`x`,offset:i,position:a,reverseDirection:o,tooltipDimension:s.width,viewBox:l,viewBoxDimension:l.width}),f=Iz({allowEscapeViewBox:t,coordinate:n,key:`y`,offset:r,position:a,reverseDirection:o,tooltipDimension:s.height,viewBox:l,viewBoxDimension:l.height}),u=Lz({translateX:d,translateY:f,useTranslate3d:c})):u=Pz,{cssProperties:u,cssClasses:Fz({translateX:d,translateY:f,coordinate:n})}}var zz={devToolsEnabled:!0,isSsr:!(typeof window<`u`&&window.document&&window.document.createElement&&window.setTimeout)};function Bz(){var[e,t]=(0,v.useState)(()=>zz.isSsr||!window.matchMedia?!1:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches);return(0,v.useEffect)(()=>{if(window.matchMedia){var e=window.matchMedia(`(prefers-reduced-motion: reduce)`),n=()=>{t(e.matches)};return e.addEventListener(`change`,n),()=>{e.removeEventListener(`change`,n)}}},[]),e}function Vz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Hz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Vz(Object(n),!0).forEach(function(t){Uz(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Vz(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Uz(e,t,n){return(t=Wz(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Wz(e){var t=Gz(e,`string`);return typeof t==`symbol`?t:t+``}function Gz(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Kz(e){if(!(e.prefersReducedMotion&&e.isAnimationActive===`auto`)&&e.isAnimationActive&&e.active)return`transform ${e.animationDuration}ms ${e.animationEasing}`}function qz(e){var t=Bz(),[n,r]=v.useState(()=>({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}));v.useEffect(()=>{var t=t=>{t.key===`Escape`&&r({dismissed:!0,dismissedAtCoordinate:{x:e.coordinate?.x??0,y:e.coordinate?.y??0}})};return document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`keydown`,t)}},[e.coordinate?.x,e.coordinate?.y]),n.dismissed&&((e.coordinate?.x??0)!==n.dismissedAtCoordinate.x||(e.coordinate?.y??0)!==n.dismissedAtCoordinate.y)&&r(Hz(Hz({},n),{},{dismissed:!1}));var{cssClasses:i,cssProperties:a}=Rz({allowEscapeViewBox:e.allowEscapeViewBox,coordinate:e.coordinate,offsetLeft:typeof e.offset==`number`?e.offset:e.offset.x,offsetTop:typeof e.offset==`number`?e.offset:e.offset.y,position:e.position,reverseDirection:e.reverseDirection,tooltipBox:{height:e.lastBoundingBox.height,width:e.lastBoundingBox.width},useTranslate3d:e.useTranslate3d,viewBox:e.viewBox}),o=Hz(Hz({},e.hasPortalFromProps?{}:Hz(Hz({transition:Kz({prefersReducedMotion:t,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},a),{},{pointerEvents:`none`,position:`absolute`,top:0,left:0})),{},{visibility:!n.dismissed&&e.active&&e.hasPayload?`visible`:`hidden`},e.wrapperStyle);return v.createElement(`div`,{xmlns:`http://www.w3.org/1999/xhtml`,tabIndex:-1,className:i,style:o,ref:e.innerRef},e.children)}var Jz=v.memo(qz),Yz=()=>Q(e=>e.rootProps.accessibilityLayer)??!0;function Xz(){return Xz=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Xz.apply(null,arguments)}function Zz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Qz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Zz(Object(n),!0).forEach(function(t){$z(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Zz(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function $z(e,t,n){return(t=eB(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eB(e){var t=tB(e,`string`);return typeof t==`symbol`?t:t+``}function tB(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var nB={curveBasisClosed:pA,curveBasisOpen:hA,curveBasis:dA,curveBumpX:Vk,curveBumpY:Hk,curveLinearClosed:_A,curveLinear:Fk,curveMonotoneX:TA,curveMonotoneY:EA,curveNatural:kA,curveStep:jA,curveStepAfter:NA,curveStepBefore:MA},rB=e=>MI(e.x)&&MI(e.y),iB=e=>e.base!=null&&rB(e.base)&&rB(e),aB=e=>e.x,oB=e=>e.y,sB=(e,t)=>{if(typeof e==`function`)return e;var n=`curve${mj(e)}`;if((n===`curveMonotone`||n===`curveBump`)&&t){var r=nB[`${n}${t===`vertical`?`Y`:`X`}`];if(r)return r}return nB[n]||Fk},cB={connectNulls:!1,type:`linear`},lB=e=>{var{type:t=cB.type,points:n=[],baseLine:r,layout:i,connectNulls:a=cB.connectNulls}=e,o=sB(t,i),s=a?n.filter(rB):n;if(Array.isArray(r)){var c,l=n.map((e,t)=>Qz(Qz({},e),{},{base:r[t]}));return c=i===`vertical`?zk().y(oB).x1(aB).x0(e=>e.base.x):zk().x(aB).y1(oB).y0(e=>e.base.y),c.defined(iB).curve(o)(a?l.filter(iB):l)}return(i===`vertical`&&Z(r)?zk().y(oB).x1(aB).x0(r):Z(r)?zk().x(aB).y1(oB).y0(r):Rk().x(aB).y(oB)).defined(rB).curve(o)(s)},uB=e=>{var{className:t,points:n,path:r,pathRef:i}=e,a=$L();if((!n||!n.length)&&!r)return null;var o={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||a,connectNulls:e.connectNulls},s=n&&n.length?lB(o):r;return v.createElement(`path`,Xz({},ak(e),Nj(e),{className:cn(`recharts-curve`,t),d:s===null?void 0:s,ref:i}))},dB=[`x`,`y`,`top`,`left`,`width`,`height`,`className`];function fB(){return fB=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fB.apply(null,arguments)}function pB(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function mB(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?pB(Object(n),!0).forEach(function(t){hB(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pB(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function hB(e,t,n){return(t=gB(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gB(e){var t=_B(e,`string`);return typeof t==`symbol`?t:t+``}function _B(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function vB(e,t){if(e==null)return{};var n,r,i=yB(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function yB(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var bB=(e,t,n,r,i,a)=>`M${e},${i}v${r}M${a},${t}h${n}`,xB=e=>{var{x:t=0,y:n=0,top:r=0,left:i=0,width:a=0,height:o=0,className:s}=e,c=vB(e,dB),l=mB({x:t,y:n,top:r,left:i,width:a,height:o},c);return!Z(t)||!Z(n)||!Z(a)||!Z(o)||!Z(r)||!Z(i)?null:v.createElement(`path`,fB({},sk(l),{className:cn(`recharts-cross`,s),d:bB(t,n,a,o,r,i)}))};function SB(e,t,n,r){var i=r/2;return{stroke:`none`,fill:`#ccc`,x:e===`horizontal`?t.x-i:n.left+.5,y:e===`horizontal`?n.top+.5:t.y-i,width:e===`horizontal`?r:n.width-1,height:e===`horizontal`?n.height-1:r}}function CB(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function wB(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?CB(Object(n),!0).forEach(function(t){TB(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CB(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function TB(e,t,n){return(t=EB(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function EB(e){var t=DB(e,`string`);return typeof t==`symbol`?t:t+``}function DB(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var OB=e=>e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`),kB=(e,t,n)=>e.map(e=>`${OB(e)} ${t}ms ${n}`).join(`,`),AB=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((e,t)=>e.filter(e=>t.includes(e))),jB=(e,t)=>Object.keys(t).reduce((n,r)=>wB(wB({},n),{},{[r]:e(r,t[r])}),{});function MB(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function NB(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?MB(Object(n),!0).forEach(function(t){PB(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):MB(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function PB(e,t,n){return(t=FB(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function FB(e){var t=IB(e,`string`);return typeof t==`symbol`?t:t+``}function IB(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var LB=(e,t,n)=>e+(t-e)*n,RB=e=>{var{from:t,to:n}=e;return t!==n},zB=(e,t,n)=>{var r=jB((t,n)=>{if(RB(n)){var[r,i]=e(n.from,n.to,n.velocity);return NB(NB({},n),{},{from:r,velocity:i})}return n},t);return n<1?jB((e,t)=>RB(t)&&r[e]!=null?NB(NB({},t),{},{velocity:LB(t.velocity,r[e].velocity,n),from:LB(t.from,r[e].from,n)}):t,t):zB(e,r,n-1)};function BB(e,t,n,r,i,a){var o,s=r.reduce((n,r)=>NB(NB({},n),{},{[r]:{from:e[r],velocity:0,to:t[r]}}),{}),c=()=>jB((e,t)=>t.from,s),l=()=>!Object.values(s).filter(RB).length,u=null,d=r=>{o||=r;var f=(r-o)/n.dt;s=zB(n,s,f),i(NB(NB(NB({},e),t),c())),o=r,l()||(u=a.setTimeout(d))};return()=>(u=a.setTimeout(d),()=>{var e;(e=u)==null||e()})}function VB(e,t,n,r,i,a,o){var s=null,c=i.reduce((n,r)=>{var i=e[r],a=t[r];return i==null||a==null?n:NB(NB({},n),{},{[r]:[i,a]})},{}),l,u=i=>{l||=i;var d=(i-l)/r,f=jB((e,t)=>LB(...t,n(d)),c);if(a(NB(NB(NB({},e),t),f)),d<1)s=o.setTimeout(u);else{var p=jB((e,t)=>LB(...t,n(1)),c);a(NB(NB(NB({},e),t),p))}};return()=>(s=o.setTimeout(u),()=>{var e;(e=s)==null||e()})}var HB=(e,t,n,r,i,a)=>{var o=AB(e,t);return n==null?()=>(i(NB(NB({},e),t)),()=>{}):n.isStepper===!0?BB(e,t,n,o,i,a):VB(e,t,n,r,o,i,a)},UB=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],WB=(e,t)=>e.map((e,n)=>e*t**n).reduce((e,t)=>e+t),GB=(e,t)=>n=>WB(UB(e,t),n),KB=(e,t)=>n=>WB([...UB(e,t).map((e,t)=>e*t).slice(1),0],n),qB=e=>{var t,n=e.split(`(`);if(n.length!==2||n[0]!==`cubic-bezier`)return null;var r=(t=n[1])==null||(t=t.split(`)`)[0])==null?void 0:t.split(`,`);if(r==null||r.length!==4)return null;var i=r.map(e=>parseFloat(e));return[i[0],i[1],i[2],i[3]]},JB=function(){var e=[...arguments];if(e.length===1)switch(e[0]){case`linear`:return[0,0,1,1];case`ease`:return[.25,.1,.25,1];case`ease-in`:return[.42,0,1,1];case`ease-out`:return[.42,0,.58,1];case`ease-in-out`:return[0,0,.58,1];default:var t=qB(e[0]);if(t)return t}return e.length===4?e:[0,0,1,1]},YB=(e,t,n,r)=>{var i=GB(e,n),a=GB(t,r),o=KB(e,n),s=e=>e>1?1:e<0?0:e,c=e=>{for(var t=e>1?1:e,n=t,r=0;r<8;++r){var c=i(n)-t,l=o(n);if(Math.abs(c-t)<1e-4||l<1e-4)return a(n);n=s(n-c/l)}return a(n)};return c.isStepper=!1,c},XB=function(){return YB(...JB(...arguments))},ZB=function(){var{stiff:e=100,damping:t=8,dt:n=17}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=(r,i,a)=>{var o=a+(-(r-i)*e-a*t)*n/1e3,s=a*n/1e3+r;return Math.abs(s-i)<1e-4&&Math.abs(o)<1e-4?[i,0]:[s,o]};return r.isStepper=!0,r.dt=n,r},QB=e=>{if(typeof e==`string`)switch(e){case`ease`:case`ease-in-out`:case`ease-out`:case`ease-in`:case`linear`:return XB(e);case`spring`:return ZB();default:if(e.split(`(`)[0]===`cubic-bezier`)return XB(e)}return typeof e==`function`?e:null};function $B(e){var t,n=()=>null,r=!1,i=null,a=o=>{if(!r){if(Array.isArray(o)){if(!o.length)return;var[s,...c]=o;if(typeof s==`number`){i=e.setTimeout(a.bind(null,c),s);return}a(s),i=e.setTimeout(a.bind(null,c));return}typeof o==`string`&&(t=o,n(t)),typeof o==`object`&&(t=o,n(t)),typeof o==`function`&&o()}};return{stop:()=>{r=!0},start:e=>{r=!1,i&&=(i(),null),a(e)},subscribe:e=>(n=e,()=>{n=()=>null}),getTimeoutController:()=>e}}var eV=class{setTimeout(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=performance.now(),r=null,i=a=>{a-n>=t?e(a):typeof requestAnimationFrame==`function`&&(r=requestAnimationFrame(i))};return r=requestAnimationFrame(i),()=>{r!=null&&cancelAnimationFrame(r)}}};function tV(){return $B(new eV)}var nV=(0,v.createContext)(tV);function rV(e,t){var n=(0,v.useContext)(nV);return(0,v.useMemo)(()=>t??n(e),[e,t,n])}var iV={begin:0,duration:1e3,easing:`ease`,isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},aV={t:0},oV={t:1};function sV(e){var t=Vj(e,iV),{isActive:n,canBegin:r,duration:i,easing:a,begin:o,onAnimationEnd:s,onAnimationStart:c,children:l}=t,u=Bz(),d=n===`auto`?!zz.isSsr&&!u:n,f=rV(t.animationId,t.animationManager),[p,m]=(0,v.useState)(d?aV:oV),h=(0,v.useRef)(null);return(0,v.useEffect)(()=>{d||m(oV)},[d]),(0,v.useEffect)(()=>{if(!d||!r)return gj;var e=HB(aV,oV,QB(a),i,m,f.getTimeoutController());return f.start([c,o,()=>{h.current=e()},i,s]),()=>{f.stop(),h.current&&h.current(),s()}},[d,r,i,a,o,c,s,f]),l(p.t)}function cV(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`animation-`,n=(0,v.useRef)(cj(t)),r=(0,v.useRef)(e);return r.current!==e&&(n.current=cj(t),r.current=e),n.current}var lV=[`radius`],uV=[`radius`],dV,fV,pV,mV,hV,gV,_V,vV,yV,bV;function xV(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function SV(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?xV(Object(n),!0).forEach(function(t){CV(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xV(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function CV(e,t,n){return(t=wV(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wV(e){var t=TV(e,`string`);return typeof t==`symbol`?t:t+``}function TV(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function EV(){return EV=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},EV.apply(null,arguments)}function DV(e,t){if(e==null)return{};var n,r,i=OV(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function OV(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function kV(e,t){return t||=e.slice(0),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var AV=(e,t,n,r,i)=>{var a=tj(n),o=tj(r),s=Math.min(Math.abs(a)/2,Math.abs(o)/2),c=o>=0?1:-1,l=a>=0?1:-1,u=+(o>=0&&a>=0||o<0&&a<0),d;if(s>0&&Array.isArray(i)){for(var f=[0,0,0,0],p=0,m=4;p<m;p++){var h=i[p]??0;f[p]=h>s?s:h}d=nj(dV||=kV([`M`,`,`,``]),e,t+c*f[0]),f[0]>0&&(d+=nj(fV||=kV([`A `,`,`,`,0,0,`,`,`,`,`,``]),f[0],f[0],u,e+l*f[0],t)),d+=nj(pV||=kV([`L `,`,`,``]),e+n-l*f[1],t),f[1]>0&&(d+=nj(mV||=kV([`A `,`,`,`,0,0,`,`,
|
|
136
|
-
`,`,`,``]),f[1],f[1],u,e+n,t+c*f[1])),d+=nj(hV||=kV([`L `,`,`,``]),e+n,t+r-c*f[2]),f[2]>0&&(d+=nj(gV||=kV([`A `,`,`,`,0,0,`,`,
|
|
137
|
-
`,`,`,``]),f[2],f[2],u,e+n-l*f[2],t+r)),d+=nj(_V||=kV([`L `,`,`,``]),e+l*f[3],t+r),f[3]>0&&(d+=nj(vV||=kV([`A `,`,`,`,0,0,`,`,
|
|
138
|
-
`,`,`,``]),f[3],f[3],u,e,t+r-c*f[3])),d+=`Z`}else if(s>0&&i===+i&&i>0){var g=Math.min(s,i);d=nj(yV||=kV(`M .,.
|
|
139
|
-
A .,.,0,0,.,.,.
|
|
140
|
-
L .,.
|
|
141
|
-
A .,.,0,0,.,.,.
|
|
142
|
-
L .,.
|
|
143
|
-
A .,.,0,0,.,.,.
|
|
144
|
-
L .,.
|
|
145
|
-
A .,.,0,0,.,.,. Z`.split(`.`)),e,t+c*g,g,g,u,e+l*g,t,e+n-l*g,t,g,g,u,e+n,t+c*g,e+n,t+r-c*g,g,g,u,e+n-l*g,t+r,e+l*g,t+r,g,g,u,e,t+r-c*g)}else d=nj(bV||=kV([`M `,`,`,` h `,` v `,` h `,` Z`]),e,t,n,r,-n);return d},jV={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:`ease`},MV=e=>{var t=Vj(e,jV),n=(0,v.useRef)(null),[r,i]=(0,v.useState)(-1);(0,v.useEffect)(()=>{if(n.current&&n.current.getTotalLength)try{var e=n.current.getTotalLength();e&&i(e)}catch{}},[]);var{x:a,y:o,width:s,height:c,radius:l,className:u}=t,{animationEasing:d,animationDuration:f,animationBegin:p,isAnimationActive:m,isUpdateAnimationActive:h}=t,g=(0,v.useRef)(s),_=(0,v.useRef)(c),y=(0,v.useRef)(a),b=(0,v.useRef)(o),x=cV((0,v.useMemo)(()=>({x:a,y:o,width:s,height:c,radius:l}),[a,o,s,c,l]),`rectangle-`);if(a!==+a||o!==+o||s!==+s||c!==+c||s===0||c===0)return null;var S=cn(`recharts-rectangle`,u);if(!h){var C=sk(t),{radius:w}=C,T=DV(C,lV);return v.createElement(`path`,EV({},T,{x:tj(a),y:tj(o),width:tj(s),height:tj(c),radius:typeof l==`number`?l:void 0,className:S,d:AV(a,o,s,c,l)}))}var E=g.current,D=_.current,O=y.current,k=b.current,A=`0px ${r===-1?1:r}px`,j=`${r}px ${r}px`,M=kB([`strokeDasharray`],f,typeof d==`string`?d:jV.animationEasing);return v.createElement(sV,{animationId:x,key:x,canBegin:r>0,duration:f,easing:d,isActive:h,begin:p},e=>{var r=dj(E,s,e),i=dj(D,c,e),u=dj(O,a,e),d=dj(k,o,e);n.current&&(g.current=r,_.current=i,y.current=u,b.current=d);var f=m?e>0?{transition:M,strokeDasharray:j}:{strokeDasharray:A}:{strokeDasharray:j},p=sk(t),{radius:h}=p,x=DV(p,uV);return v.createElement(`path`,EV({},x,{radius:typeof l==`number`?l:void 0,className:S,d:AV(u,d,r,i,l),ref:n,style:SV(SV({},f),t.style)}))})};function NV(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function PV(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?NV(Object(n),!0).forEach(function(t){FV(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NV(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function FV(e,t,n){return(t=IV(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function IV(e){var t=LV(e,`string`);return typeof t==`symbol`?t:t+``}function LV(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var RV=Math.PI/180,zV=e=>e*180/Math.PI,BV=(e,t,n,r)=>({x:e+Math.cos(-RV*r)*n,y:t+Math.sin(-RV*r)*n}),VV=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0,width:0,height:0,brushBottom:0};return Math.min(Math.abs(e-(n.left||0)-(n.right||0)),Math.abs(t-(n.top||0)-(n.bottom||0)))/2},HV=(e,t)=>{var{x:n,y:r}=e,{x:i,y:a}=t;return Math.sqrt((n-i)**2+(r-a)**2)},UV=(e,t)=>{var{x:n,y:r}=e,{cx:i,cy:a}=t,o=HV({x:n,y:r},{x:i,y:a});if(o<=0)return{radius:o,angle:0};var s=(n-i)/o,c=Math.acos(s);return r>a&&(c=2*Math.PI-c),{radius:o,angle:zV(c),angleInRadian:c}},WV=e=>{var{startAngle:t,endAngle:n}=e,r=Math.floor(t/360),i=Math.floor(n/360),a=Math.min(r,i);return{startAngle:t-a*360,endAngle:n-a*360}},GV=(e,t)=>{var{startAngle:n,endAngle:r}=t,i=Math.floor(n/360),a=Math.floor(r/360);return e+Math.min(i,a)*360},KV=(e,t)=>{var{relativeX:n,relativeY:r}=e,{radius:i,angle:a}=UV({x:n,y:r},t),{innerRadius:o,outerRadius:s}=t;if(i<o||i>s||i===0)return null;var{startAngle:c,endAngle:l}=WV(t),u=a,d;if(c<=l){for(;u>l;)u-=360;for(;u<c;)u+=360;d=u>=c&&u<=l}else{for(;u>c;)u-=360;for(;u<l;)u+=360;d=u>=l&&u<=c}return d?PV(PV({},t),{},{radius:i,angle:GV(u,t)}):null};function qV(e){var{cx:t,cy:n,radius:r,startAngle:i,endAngle:a}=e;return{points:[BV(t,n,r,i),BV(t,n,r,a)],cx:t,cy:n,radius:r,startAngle:i,endAngle:a}}var JV,YV,XV,ZV,QV,$V,eH;function tH(){return tH=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},tH.apply(null,arguments)}function nH(e,t){return t||=e.slice(0),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var rH=(e,t)=>rj(t-e)*Math.min(Math.abs(t-e),359.999),iH=e=>{var{cx:t,cy:n,radius:r,angle:i,sign:a,isExternal:o,cornerRadius:s,cornerIsExternal:c}=e,l=s*(o?1:-1)+r,u=Math.asin(s/l)/RV,d=c?i:i+a*u,f=BV(t,n,l,d),p=BV(t,n,r,d),m=c?i-a*u:i;return{center:f,circleTangency:p,lineTangency:BV(t,n,l*Math.cos(u*RV),m),theta:u}},aH=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:a,endAngle:o}=e,s=rH(a,o),c=a+s,l=BV(t,n,i,a),u=BV(t,n,i,c),d=nj(JV||=nH([`M `,`,`,`
|
|
146
|
-
A `,`,`,`,0,
|
|
147
|
-
`,`,`,`,
|
|
148
|
-
`,`,`,`
|
|
149
|
-
`]),l.x,l.y,i,i,+(Math.abs(s)>180),+(a>c),u.x,u.y);if(r>0){var f=BV(t,n,r,a),p=BV(t,n,r,c);d+=nj(YV||=nH([`L `,`,`,`
|
|
150
|
-
A `,`,`,`,0,
|
|
151
|
-
`,`,`,`,
|
|
152
|
-
`,`,`,` Z`]),p.x,p.y,r,r,+(Math.abs(s)>180),+(a<=c),f.x,f.y)}else d+=nj(XV||=nH([`L `,`,`,` Z`]),t,n);return d},oH=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,cornerRadius:a,forceCornerRadius:o,cornerIsExternal:s,startAngle:c,endAngle:l}=e,u=rj(l-c),{circleTangency:d,lineTangency:f,theta:p}=iH({cx:t,cy:n,radius:i,angle:c,sign:u,cornerRadius:a,cornerIsExternal:s}),{circleTangency:m,lineTangency:h,theta:g}=iH({cx:t,cy:n,radius:i,angle:l,sign:-u,cornerRadius:a,cornerIsExternal:s}),_=s?Math.abs(c-l):Math.abs(c-l)-p-g;if(_<0)return o?nj(ZV||=nH([`M `,`,`,`
|
|
153
|
-
a`,`,`,`,0,0,1,`,`,0
|
|
154
|
-
a`,`,`,`,0,0,1,`,`,0
|
|
155
|
-
`]),f.x,f.y,a,a,a*2,a,a,-a*2):aH({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:c,endAngle:l});var v=nj(QV||=nH([`M `,`,`,`
|
|
156
|
-
A`,`,`,`,0,0,`,`,`,`,`,`
|
|
157
|
-
A`,`,`,`,0,`,`,`,`,`,`,`,`
|
|
158
|
-
A`,`,`,`,0,0,`,`,`,`,`,`
|
|
159
|
-
`]),f.x,f.y,a,a,+(u<0),d.x,d.y,i,i,+(_>180),+(u<0),m.x,m.y,a,a,+(u<0),h.x,h.y);if(r>0){var{circleTangency:y,lineTangency:b,theta:x}=iH({cx:t,cy:n,radius:r,angle:c,sign:u,isExternal:!0,cornerRadius:a,cornerIsExternal:s}),{circleTangency:S,lineTangency:C,theta:w}=iH({cx:t,cy:n,radius:r,angle:l,sign:-u,isExternal:!0,cornerRadius:a,cornerIsExternal:s}),T=s?Math.abs(c-l):Math.abs(c-l)-x-w;if(T<0&&a===0)return`${v}L${t},${n}Z`;v+=nj($V||=nH([`L`,`,`,`
|
|
160
|
-
A`,`,`,`,0,0,`,`,`,`,`,`
|
|
161
|
-
A`,`,`,`,0,`,`,`,`,`,`,`,`
|
|
162
|
-
A`,`,`,`,0,0,`,`,`,`,`,`Z`]),C.x,C.y,a,a,+(u<0),S.x,S.y,r,r,+(T>180),+(u>0),y.x,y.y,a,a,+(u<0),b.x,b.y)}else v+=nj(eH||=nH([`L`,`,`,`Z`]),t,n);return v},sH={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},cH=e=>{var t=Vj(e,sH),{cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:o,forceCornerRadius:s,cornerIsExternal:c,startAngle:l,endAngle:u,className:d}=t;if(a<i||l===u)return null;var f=cn(`recharts-sector`,d),p=a-i,m=lj(o,p,0,!0),h=m>0&&Math.abs(l-u)<360?oH({cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:Math.min(m,p/2),forceCornerRadius:s,cornerIsExternal:c,startAngle:l,endAngle:u}):aH({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:l,endAngle:u});return v.createElement(`path`,tH({},sk(t),{className:f,d:h}))};function lH(e,t,n){if(e===`horizontal`)return[{x:t.x,y:n.top},{x:t.x,y:n.top+n.height}];if(e===`vertical`)return[{x:n.left,y:t.y},{x:n.left+n.width,y:t.y}];if(Mj(t)){if(e===`centric`){var{cx:r,cy:i,innerRadius:a,outerRadius:o,angle:s}=t,c=BV(r,i,a,s),l=BV(r,i,o,s);return[{x:c.x,y:c.y},{x:l.x,y:l.y}]}return qV(t)}}function uH(e){return JA(e)?NaN:Number(e)}function dH(e){return e?(e=uH(e),e===1/0||e===-1/0?(e<0?-1:1)*Number.MAX_VALUE:e===e?e:0):e===0?e:0}function fH(e,t,n){n&&typeof n!=`number`&&yN(e,t,n)&&(t=n=void 0),e=dH(e),t===void 0?(t=e,e=0):t=dH(t),n=n===void 0?e<t?1:-1:dH(n);let r=Math.max(Math.ceil((t-e)/(n||1)),0),i=Array(r);for(let t=0;t<r;t++)i[t]=e,e+=n;return i}var pH=e=>e.chartData,mH=$([pH],e=>{var t=e.chartData==null?0:e.chartData.length-1;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),hH=(e,t,n,r)=>r?mH(e):pH(e),gH=(e,t,n)=>n?mH(e):pH(e);function _H(e){if(Array.isArray(e)&&e.length===2){var[t,n]=e;if(MI(t)&&MI(n))return!0}return!1}function vH(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function yH(e,t){if(t&&typeof e!=`function`&&Array.isArray(e)&&e.length===2){var[n,r]=e,i,a;if(MI(n))i=n;else if(typeof n==`function`)return;if(MI(r))a=r;else if(typeof r==`function`)return;var o=[i,a];if(_H(o))return o}}function bH(e,t,n){if(!(!n&&t==null)){if(typeof e==`function`&&t!=null)try{var r=e(t,n);if(_H(r))return vH(r,t,n)}catch{}if(Array.isArray(e)&&e.length===2){var[i,a]=e,o,s;if(i===`auto`)t!=null&&(o=Math.min(...t));else if(Z(i))o=i;else if(typeof i==`function`)try{t!=null&&(o=i(t?.[0]))}catch{}else if(typeof i==`string`&&$I.test(i)){var c=$I.exec(i);if(c==null||c[1]==null||t==null)o=void 0;else{var l=+c[1];o=t[0]-l}}else o=t?.[0];if(a===`auto`)t!=null&&(s=Math.max(...t));else if(Z(a))s=a;else if(typeof a==`function`)try{t!=null&&(s=a(t?.[1]))}catch{}else if(typeof a==`string`&&eL.test(a)){var u=eL.exec(a);if(u==null||u[1]==null||t==null)s=void 0;else{var d=+u[1];s=t[1]+d}}else s=t?.[1];var f=[o,s];if(_H(f))return t==null?f:vH(f,t,n)}}}var xH=l(o(((e,t)=>{(function(e){var n=1e9,r={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:`2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286`},i=!0,a=`[DecimalError] `,o=a+`Invalid argument: `,s=a+`Exponent out of range: `,c=Math.floor,l=Math.pow,u=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,d,f=1e7,p=7,m=9007199254740991,h=c(m/p),g={};g.absoluteValue=g.abs=function(){var e=new this.constructor(this);return e.s&&=1,e},g.comparedTo=g.cmp=function(e){var t,n,r,i,a=this;if(e=new a.constructor(e),a.s!==e.s)return a.s||-e.s;if(a.e!==e.e)return a.e>e.e^a.s<0?1:-1;for(r=a.d.length,i=e.d.length,t=0,n=r<i?r:i;t<n;++t)if(a.d[t]!==e.d[t])return a.d[t]>e.d[t]^a.s<0?1:-1;return r===i?0:r>i^a.s<0?1:-1},g.decimalPlaces=g.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*p;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n},g.dividedBy=g.div=function(e){return b(this,new this.constructor(e))},g.dividedToIntegerBy=g.idiv=function(e){var t=this,n=t.constructor;return D(b(t,new n(e),0,1),n.precision)},g.equals=g.eq=function(e){return!this.cmp(e)},g.exponent=function(){return S(this)},g.greaterThan=g.gt=function(e){return this.cmp(e)>0},g.greaterThanOrEqualTo=g.gte=function(e){return this.cmp(e)>=0},g.isInteger=g.isint=function(){return this.e>this.d.length-2},g.isNegative=g.isneg=function(){return this.s<0},g.isPositive=g.ispos=function(){return this.s>0},g.isZero=function(){return this.s===0},g.lessThan=g.lt=function(e){return this.cmp(e)<0},g.lessThanOrEqualTo=g.lte=function(e){return this.cmp(e)<1},g.logarithm=g.log=function(e){var t,n=this,r=n.constructor,o=r.precision,s=o+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(d))throw Error(a+`NaN`);if(n.s<1)throw Error(a+(n.s?`NaN`:`-Infinity`));return n.eq(d)?new r(0):(i=!1,t=b(T(n,s),T(e,s),s),i=!0,D(t,o))},g.minus=g.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?O(t,e):_(t,(e.s=-e.s,e))},g.modulo=g.mod=function(e){var t,n=this,r=n.constructor,o=r.precision;if(e=new r(e),!e.s)throw Error(a+`NaN`);return n.s?(i=!1,t=b(n,e,0,1).times(e),i=!0,n.minus(t)):D(new r(n),o)},g.naturalExponential=g.exp=function(){return x(this)},g.naturalLogarithm=g.ln=function(){return T(this)},g.negated=g.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e},g.plus=g.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?_(t,e):O(t,(e.s=-e.s,e))},g.precision=g.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(o+e);if(t=S(i)+1,r=i.d.length-1,n=r*p+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return e&&t>n?t:n},g.squareRoot=g.sqrt=function(){var e,t,n,r,o,s,l,u=this,d=u.constructor;if(u.s<1){if(!u.s)return new d(0);throw Error(a+`NaN`)}for(e=S(u),i=!1,o=Math.sqrt(+u),o==0||o==1/0?(t=y(u.d),(t.length+e)%2==0&&(t+=`0`),o=Math.sqrt(t),e=c((e+1)/2)-(e<0||e%2),o==1/0?t=`5e`+e:(t=o.toExponential(),t=t.slice(0,t.indexOf(`e`)+1)+e),r=new d(t)):r=new d(o.toString()),n=d.precision,o=l=n+3;;)if(s=r,r=s.plus(b(u,s,l+2)).times(.5),y(s.d).slice(0,l)===(t=y(r.d)).slice(0,l)){if(t=t.slice(l-3,l+1),o==l&&t==`4999`){if(D(s,n+1,0),s.times(s).eq(u)){r=s;break}}else if(t!=`9999`)break;l+=4}return i=!0,D(r,n)},g.times=g.mul=function(e){var t,n,r,a,o,s,c,l,u,d=this,p=d.constructor,m=d.d,h=(e=new p(e)).d;if(!d.s||!e.s)return new p(0);for(e.s*=d.s,n=d.e+e.e,l=m.length,u=h.length,l<u&&(o=m,m=h,h=o,s=l,l=u,u=s),o=[],s=l+u,r=s;r--;)o.push(0);for(r=u;--r>=0;){for(t=0,a=l+r;a>r;)c=o[a]+h[r]*m[a-r-1]+t,o[a--]=c%f|0,t=c/f|0;o[a]=(o[a]+t)%f|0}for(;!o[--s];)o.pop();return t?++n:o.shift(),e.d=o,e.e=n,i?D(e,p.precision):e},g.toDecimalPlaces=g.todp=function(e,t){var r=this,i=r.constructor;return r=new i(r),e===void 0?r:(v(e,0,n),t===void 0?t=i.rounding:v(t,0,8),D(r,e+S(r)+1,t))},g.toExponential=function(e,t){var r,i=this,a=i.constructor;return e===void 0?r=k(i,!0):(v(e,0,n),t===void 0?t=a.rounding:v(t,0,8),i=D(new a(i),e+1,t),r=k(i,!0,e+1)),r},g.toFixed=function(e,t){var r,i,a=this,o=a.constructor;return e===void 0?k(a):(v(e,0,n),t===void 0?t=o.rounding:v(t,0,8),i=D(new o(a),e+S(a)+1,t),r=k(i.abs(),!1,e+S(i)+1),a.isneg()&&!a.isZero()?`-`+r:r)},g.toInteger=g.toint=function(){var e=this,t=e.constructor;return D(new t(e),S(e)+1,t.rounding)},g.toNumber=function(){return+this},g.toPower=g.pow=function(e){var t,n,r,o,s,l,u=this,f=u.constructor,h=12,g=+(e=new f(e));if(!e.s)return new f(d);if(u=new f(u),!u.s){if(e.s<1)throw Error(a+`Infinity`);return u}if(u.eq(d))return u;if(r=f.precision,e.eq(d))return D(u,r);if(t=e.e,n=e.d.length-1,l=t>=n,s=u.s,!l){if(s<0)throw Error(a+`NaN`)}else if((n=g<0?-g:g)<=m){for(o=new f(d),t=Math.ceil(r/p+4),i=!1;n%2&&(o=o.times(u),A(o.d,t)),n=c(n/2),n!==0;)u=u.times(u),A(u.d,t);return i=!0,e.s<0?new f(d).div(o):D(o,r)}return s=s<0&&e.d[Math.max(t,n)]&1?-1:1,u.s=1,i=!1,o=e.times(T(u,r+h)),i=!0,o=x(o),o.s=s,o},g.toPrecision=function(e,t){var r,i,a=this,o=a.constructor;return e===void 0?(r=S(a),i=k(a,r<=o.toExpNeg||r>=o.toExpPos)):(v(e,1,n),t===void 0?t=o.rounding:v(t,0,8),a=D(new o(a),e,t),r=S(a),i=k(a,e<=r||r<=o.toExpNeg,e)),i},g.toSignificantDigits=g.tosd=function(e,t){var r=this,i=r.constructor;return e===void 0?(e=i.precision,t=i.rounding):(v(e,1,n),t===void 0?t=i.rounding:v(t,0,8)),D(new i(r),e,t)},g.toString=g.valueOf=g.val=g.toJSON=function(){var e=this,t=S(e),n=e.constructor;return k(e,t<=n.toExpNeg||t>=n.toExpPos)};function _(e,t){var n,r,a,o,s,c,l,u,d=e.constructor,m=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),i?D(t,m):t;if(l=e.d,u=t.d,s=e.e,a=t.e,l=l.slice(),o=s-a,o){for(o<0?(r=l,o=-o,c=u.length):(r=u,a=s,c=l.length),s=Math.ceil(m/p),c=s>c?s+1:c+1,o>c&&(o=c,r.length=1),r.reverse();o--;)r.push(0);r.reverse()}for(c=l.length,o=u.length,c-o<0&&(o=c,r=u,u=l,l=r),n=0;o;)n=(l[--o]=l[o]+u[o]+n)/f|0,l[o]%=f;for(n&&(l.unshift(n),++a),c=l.length;l[--c]==0;)l.pop();return t.d=l,t.e=a,i?D(t,m):t}function v(e,t,n){if(e!==~~e||e<t||e>n)throw Error(o+e)}function y(e){var t,n,r,i=e.length-1,a=``,o=e[0];if(i>0){for(a+=o,t=1;t<i;t++)r=e[t]+``,n=p-r.length,n&&(a+=w(n)),a+=r;o=e[t],r=o+``,n=p-r.length,n&&(a+=w(n))}else if(o===0)return`0`;for(;o%10==0;)o/=10;return a+o}var b=(function(){function e(e,t){var n,r=0,i=e.length;for(e=e.slice();i--;)n=e[i]*t+r,e[i]=n%f|0,r=n/f|0;return r&&e.unshift(r),e}function t(e,t,n,r){var i,a;if(n!=r)a=n>r?1:-1;else for(i=a=0;i<n;i++)if(e[i]!=t[i]){a=e[i]>t[i]?1:-1;break}return a}function n(e,t,n){for(var r=0;n--;)e[n]-=r,r=+(e[n]<t[n]),e[n]=r*f+e[n]-t[n];for(;!e[0]&&e.length>1;)e.shift()}return function(r,i,o,s){var c,l,u,d,m,h,g,_,v,y,b,x,C,w,T,E,O,k,A=r.constructor,j=r.s==i.s?1:-1,M=r.d,N=i.d;if(!r.s)return new A(r);if(!i.s)throw Error(a+`Division by zero`);for(l=r.e-i.e,O=N.length,T=M.length,g=new A(j),_=g.d=[],u=0;N[u]==(M[u]||0);)++u;if(N[u]>(M[u]||0)&&--l,x=o==null?o=A.precision:s?o+(S(r)-S(i))+1:o,x<0)return new A(0);if(x=x/p+2|0,u=0,O==1)for(d=0,N=N[0],x++;(u<T||d)&&x--;u++)C=d*f+(M[u]||0),_[u]=C/N|0,d=C%N|0;else{for(d=f/(N[0]+1)|0,d>1&&(N=e(N,d),M=e(M,d),O=N.length,T=M.length),w=O,v=M.slice(0,O),y=v.length;y<O;)v[y++]=0;k=N.slice(),k.unshift(0),E=N[0],N[1]>=f/2&&++E;do d=0,c=t(N,v,O,y),c<0?(b=v[0],O!=y&&(b=b*f+(v[1]||0)),d=b/E|0,d>1?(d>=f&&(d=f-1),m=e(N,d),h=m.length,y=v.length,c=t(m,v,h,y),c==1&&(d--,n(m,O<h?k:N,h))):(d==0&&(c=d=1),m=N.slice()),h=m.length,h<y&&m.unshift(0),n(v,m,y),c==-1&&(y=v.length,c=t(N,v,O,y),c<1&&(d++,n(v,O<y?k:N,y))),y=v.length):c===0&&(d++,v=[0]),_[u++]=d,c&&v[0]?v[y++]=M[w]||0:(v=[M[w]],y=1);while((w++<T||v[0]!==void 0)&&x--)}return _[0]||_.shift(),g.e=l,D(g,s?o+S(g)+1:o)}})();function x(e,t){var n,r,a,o,c,u,f=0,p=0,m=e.constructor,h=m.precision;if(S(e)>16)throw Error(s+S(e));if(!e.s)return new m(d);for(t==null?(i=!1,u=h):u=t,c=new m(.03125);e.abs().gte(.1);)e=e.times(c),p+=5;for(r=Math.log(l(2,p))/Math.LN10*2+5|0,u+=r,n=a=o=new m(d),m.precision=u;;){if(a=D(a.times(e),u),n=n.times(++f),c=o.plus(b(a,n,u)),y(c.d).slice(0,u)===y(o.d).slice(0,u)){for(;p--;)o=D(o.times(o),u);return m.precision=h,t==null?(i=!0,D(o,h)):o}o=c}}function S(e){for(var t=e.e*p,n=e.d[0];n>=10;n/=10)t++;return t}function C(e,t,n){if(t>e.LN10.sd())throw i=!0,n&&(e.precision=n),Error(a+`LN10 precision limit exceeded`);return D(new e(e.LN10),t)}function w(e){for(var t=``;e--;)t+=`0`;return t}function T(e,t){var n,r,o,s,c,l,u,f,p,m=1,h=10,g=e,_=g.d,v=g.constructor,x=v.precision;if(g.s<1)throw Error(a+(g.s?`NaN`:`-Infinity`));if(g.eq(d))return new v(0);if(t==null?(i=!1,f=x):f=t,g.eq(10))return t??(i=!0),C(v,f);if(f+=h,v.precision=f,n=y(_),r=n.charAt(0),s=S(g),Math.abs(s)<0x5543df729c000){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)g=g.times(e),n=y(g.d),r=n.charAt(0),m++;s=S(g),r>1?(g=new v(`0.`+n),s++):g=new v(r+`.`+n.slice(1))}else return u=C(v,f+2,x).times(s+``),g=T(new v(r+`.`+n.slice(1)),f-h).plus(u),v.precision=x,t==null?(i=!0,D(g,x)):g;for(l=c=g=b(g.minus(d),g.plus(d),f),p=D(g.times(g),f),o=3;;){if(c=D(c.times(p),f),u=l.plus(b(c,new v(o),f)),y(u.d).slice(0,f)===y(l.d).slice(0,f))return l=l.times(2),s!==0&&(l=l.plus(C(v,f+2,x).times(s+``))),l=b(l,new v(m),f),v.precision=x,t==null?(i=!0,D(l,x)):l;l=u,o+=2}}function E(e,t){var n,r,a;for((n=t.indexOf(`.`))>-1&&(t=t.replace(`.`,``)),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(a=t.length;t.charCodeAt(a-1)===48;)--a;if(t=t.slice(r,a),t){if(a-=r,n=n-r-1,e.e=c(n/p),e.d=[],r=(n+1)%p,n<0&&(r+=p),r<a){for(r&&e.d.push(+t.slice(0,r)),a-=p;r<a;)e.d.push(+t.slice(r,r+=p));t=t.slice(r),r=p-t.length}else r-=a;for(;r--;)t+=`0`;if(e.d.push(+t),i&&(e.e>h||e.e<-h))throw Error(s+n)}else e.s=0,e.e=0,e.d=[0];return e}function D(e,t,n){var r,a,o,u,d,m,g,_,v=e.d;for(u=1,o=v[0];o>=10;o/=10)u++;if(r=t-u,r<0)r+=p,a=t,g=v[_=0];else{if(_=Math.ceil((r+1)/p),o=v.length,_>=o)return e;for(g=o=v[_],u=1;o>=10;o/=10)u++;r%=p,a=r-p+u}if(n!==void 0&&(o=l(10,u-a-1),d=g/o%10|0,m=t<0||v[_+1]!==void 0||g%o,m=n<4?(d||m)&&(n==0||n==(e.s<0?3:2)):d>5||d==5&&(n==4||m||n==6&&(r>0?a>0?g/l(10,u-a):0:v[_-1])%10&1||n==(e.s<0?8:7))),t<1||!v[0])return m?(o=S(e),v.length=1,t=t-o-1,v[0]=l(10,(p-t%p)%p),e.e=c(-t/p)||0):(v.length=1,v[0]=e.e=e.s=0),e;if(r==0?(v.length=_,o=1,_--):(v.length=_+1,o=l(10,p-r),v[_]=a>0?(g/l(10,u-a)%l(10,a)|0)*o:0),m)for(;;)if(_==0){(v[0]+=o)==f&&(v[0]=1,++e.e);break}else{if(v[_]+=o,v[_]!=f)break;v[_--]=0,o=1}for(r=v.length;v[--r]===0;)v.pop();if(i&&(e.e>h||e.e<-h))throw Error(s+S(e));return e}function O(e,t){var n,r,a,o,s,c,l,u,d,m,h=e.constructor,g=h.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new h(e),i?D(t,g):t;if(l=e.d,m=t.d,r=t.e,u=e.e,l=l.slice(),s=u-r,s){for(d=s<0,d?(n=l,s=-s,c=m.length):(n=m,r=u,c=l.length),a=Math.max(Math.ceil(g/p),c)+2,s>a&&(s=a,n.length=1),n.reverse(),a=s;a--;)n.push(0);n.reverse()}else{for(a=l.length,c=m.length,d=a<c,d&&(c=a),a=0;a<c;a++)if(l[a]!=m[a]){d=l[a]<m[a];break}s=0}for(d&&(n=l,l=m,m=n,t.s=-t.s),c=l.length,a=m.length-c;a>0;--a)l[c++]=0;for(a=m.length;a>s;){if(l[--a]<m[a]){for(o=a;o&&l[--o]===0;)l[o]=f-1;--l[o],l[a]+=f}l[a]-=m[a]}for(;l[--c]===0;)l.pop();for(;l[0]===0;l.shift())--r;return l[0]?(t.d=l,t.e=r,i?D(t,g):t):new h(0)}function k(e,t,n){var r,i=S(e),a=y(e.d),o=a.length;return t?(n&&(r=n-o)>0?a=a.charAt(0)+`.`+a.slice(1)+w(r):o>1&&(a=a.charAt(0)+`.`+a.slice(1)),a=a+(i<0?`e`:`e+`)+i):i<0?(a=`0.`+w(-i-1)+a,n&&(r=n-o)>0&&(a+=w(r))):i>=o?(a+=w(i+1-o),n&&(r=n-i-1)>0&&(a=a+`.`+w(r))):((r=i+1)<o&&(a=a.slice(0,r)+`.`+a.slice(r)),n&&(r=n-o)>0&&(i+1===o&&(a+=`.`),a+=w(r))),e.s<0?`-`+a:a}function A(e,t){if(e.length>t)return e.length=t,!0}function j(e){var t,n,r;function i(e){var t=this;if(!(t instanceof i))return new i(e);if(t.constructor=i,e instanceof i){t.s=e.s,t.e=e.e,t.d=(e=e.d)?e.slice():e;return}if(typeof e==`number`){if(e*0!=0)throw Error(o+e);if(e>0)t.s=1;else if(e<0)e=-e,t.s=-1;else{t.s=0,t.e=0,t.d=[0];return}if(e===~~e&&e<1e7){t.e=0,t.d=[e];return}return E(t,e.toString())}if(typeof e!=`string`)throw Error(o+e);if(e.charCodeAt(0)===45?(e=e.slice(1),t.s=-1):t.s=1,u.test(e))E(t,e);else throw Error(o+e)}if(i.prototype=g,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=j,i.config=i.set=M,e===void 0&&(e={}),e)for(r=[`precision`,`rounding`,`toExpNeg`,`toExpPos`,`LN10`],t=0;t<r.length;)e.hasOwnProperty(n=r[t++])||(e[n]=this[n]);return i.config(e),i}function M(e){if(!e||typeof e!=`object`)throw Error(a+`Object expected`);var t,r,i,s=[`precision`,1,n,`rounding`,0,8,`toExpNeg`,-1/0,0,`toExpPos`,0,1/0];for(t=0;t<s.length;t+=3)if((i=e[r=s[t]])!==void 0){if(c(i)===i&&i>=s[t+1]&&i<=s[t+2])this[r]=i;else throw Error(o+r+`: `+i)}if((i=e[r=`LN10`])!==void 0){if(i==Math.LN10)this[r]=new this(i);else throw Error(o+r+`: `+i)}return this}r=j(r),r.default=r.Decimal=r,d=new r(1),typeof define==`function`&&define.amd?define(function(){return r}):t!==void 0&&t.exports?t.exports=r:(e||=typeof self<`u`&&self&&self.self==self?self:Function(`return this`)(),e.Decimal=r)})(e)}))());function SH(e){return e===0?1:Math.floor(new xH.default(e).abs().log(10).toNumber())+1}function CH(e,t,n){for(var r=new xH.default(e),i=0,a=[];r.lt(t)&&i<1e5;)a.push(r.toNumber()),r=r.add(n),i++;return a}var wH=e=>{var[t,n]=e,[r,i]=[t,n];return t>n&&([r,i]=[n,t]),[r,i]},TH=(e,t,n)=>{if(e.lte(0))return new xH.default(0);var r=SH(e.toNumber()),i=new xH.default(10).pow(r),a=e.div(i),o=r===1?.1:.05,s=new xH.default(Math.ceil(a.div(o).toNumber())).add(n).mul(o).mul(i);return t?new xH.default(s.toNumber()):new xH.default(Math.ceil(s.toNumber()))},EH=(e,t,n)=>{if(e.lte(0))return new xH.default(0);var r=[1,2,2.5,5],i=e.toNumber(),a=Math.floor(new xH.default(i).abs().log(10).toNumber()),o=new xH.default(10).pow(a),s=e.div(o).toNumber(),c=r.findIndex(e=>e>=s-1e-10);if(c===-1&&(o=o.mul(10),c=0),c+=n,c>=r.length){var l=Math.floor(c/r.length);c%=r.length,o=o.mul(new xH.default(10).pow(l))}var u=r[c]??1,d=new xH.default(u).mul(o);return t?d:new xH.default(Math.ceil(d.toNumber()))},DH=(e,t,n)=>{var r=new xH.default(1),i=new xH.default(e);if(!i.isint()&&n){var a=Math.abs(e);a<1?(r=new xH.default(10).pow(SH(e)-1),i=new xH.default(Math.floor(i.div(r).toNumber())).mul(r)):a>1&&(i=new xH.default(Math.floor(e)))}else e===0?i=new xH.default(Math.floor((t-1)/2)):n||(i=new xH.default(Math.floor(e)));for(var o=Math.floor((t-1)/2),s=[],c=0;c<t;c++)s.push(i.add(new xH.default(c-o).mul(r)).toNumber());return s},OH=function(e,t,n,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:TH;if(!Number.isFinite((t-e)/(n-1)))return{step:new xH.default(0),tickMin:new xH.default(0),tickMax:new xH.default(0)};var o=a(new xH.default(t).sub(e).div(n-1),r,i),s;e<=0&&t>=0?s=new xH.default(0):(s=new xH.default(e).add(t).div(2),s=s.sub(new xH.default(s).mod(o)));var c=Math.ceil(s.sub(e).div(o).toNumber()),l=Math.ceil(new xH.default(t).sub(s).div(o).toNumber()),u=c+l+1;return u>n?OH(e,t,n,r,i+1,a):(u<n&&(l=t>0?l+(n-u):l,c=t>0?c:c+(n-u)),{step:o,tickMin:s.sub(new xH.default(c).mul(o)),tickMax:s.add(new xH.default(l).mul(o))})},kH=function(e){var[t,n]=e,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:`auto`,o=Math.max(r,2),[s,c]=wH([t,n]);if(s===-1/0||c===1/0){var l=c===1/0?[s,...Array(r-1).fill(1/0)]:[...Array(r-1).fill(-1/0),c];return t>n?l.reverse():l}if(s===c)return DH(s,r,i);var{step:u,tickMin:d,tickMax:f}=OH(s,c,o,i,0,a===`snap125`?EH:TH),p=CH(d,f.add(new xH.default(.1).mul(u)),u);return t>n?p.reverse():p},AH=function(e,t){var[n,r]=e,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:`auto`,[o,s]=wH([n,r]);if(o===-1/0||s===1/0)return[n,r];if(o===s)return[o];var c=a===`snap125`?EH:TH,l=Math.max(t,2),u=c(new xH.default(s).sub(o).div(l-1),i,0),d=[...CH(new xH.default(o),new xH.default(s),u),s];return i===!1&&(d=d.map(e=>Math.round(e))),n>r?d.reverse():d},jH=e=>e.rootProps.maxBarSize,MH=e=>e.rootProps.barGap,NH=e=>e.rootProps.barCategoryGap,PH=e=>e.rootProps.barSize,FH=e=>e.rootProps.stackOffset,IH=e=>e.rootProps.reverseStackOrder,LH=e=>e.options.chartName,RH=e=>e.rootProps.syncId,zH=e=>e.rootProps.syncMethod,BH=e=>e.options.eventEmitter,VH={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},HH={allowDecimals:!1,allowDuplicatedCategory:!0,allowDataOverflow:!1,angle:0,angleAxisId:0,axisLine:!0,axisLineType:`polygon`,cx:0,cy:0,hide:!1,includeHidden:!1,label:!1,niceTicks:`auto`,orientation:`outer`,reversed:!1,scale:`auto`,tick:!0,tickLine:!0,tickSize:8,type:`auto`,zIndex:VH.axis},UH={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,angle:0,axisLine:!0,includeHidden:!1,hide:!1,niceTicks:`auto`,label:!1,orientation:`right`,radiusAxisId:0,reversed:!1,scale:`auto`,stroke:`#ccc`,tick:!0,tickCount:5,tickLine:!0,type:`auto`,zIndex:VH.axis},WH=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function GH(e,t,n){if(n!==`auto`)return n;if(e!=null)return VI(e,t)?`category`:`number`}function KH(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function qH(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?KH(Object(n),!0).forEach(function(t){JH(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):KH(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function JH(e,t,n){return(t=YH(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function YH(e){var t=XH(e,`string`);return typeof t==`symbol`?t:t+``}function XH(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var ZH={allowDataOverflow:HH.allowDataOverflow,allowDecimals:HH.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:HH.angleAxisId,includeHidden:!1,name:void 0,reversed:HH.reversed,scale:HH.scale,tick:HH.tick,tickCount:void 0,ticks:void 0,type:HH.type,unit:void 0,niceTicks:`auto`},QH={allowDataOverflow:UH.allowDataOverflow,allowDecimals:UH.allowDecimals,allowDuplicatedCategory:UH.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:UH.radiusAxisId,includeHidden:UH.includeHidden,name:void 0,reversed:UH.reversed,scale:UH.scale,tick:UH.tick,tickCount:UH.tickCount,ticks:void 0,type:UH.type,unit:void 0,niceTicks:`auto`},$H=$([(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},tR],(e,t)=>{if(e!=null)return e;var n=GH(t,`angleAxis`,ZH.type)??`category`;return qH(qH({},ZH),{},{type:n})}),eU=$([(e,t)=>e.polarAxis.radiusAxis[t],tR],(e,t)=>{if(e!=null)return e;var n=GH(t,`radiusAxis`,QH.type)??`category`;return qH(qH({},QH),{},{type:n})}),tU=e=>e.polarOptions,nU=$([iL,aL,hL],VV),rU=$([tU,nU],(e,t)=>{if(e!=null)return lj(e.innerRadius,t,0)}),iU=$([tU,nU],(e,t)=>{if(e!=null)return lj(e.outerRadius,t,t*.8)}),aU=$([tU],e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:n}=e;return[t,n]});$([$H,aU],WH);var oU=$([nU,rU,iU],(e,t,n)=>{if(e!=null&&t!=null&&n!=null)return[t,n]});$([eU,oU],WH);var sU=$([QL,tU,rU,iU,iL,aL],(e,t,n,r,i,a)=>{if(!(e!==`centric`&&e!==`radial`||t==null||n==null||r==null)){var{cx:o,cy:s,startAngle:c,endAngle:l}=t;return{cx:lj(o,i,i/2),cy:lj(s,a,a/2),innerRadius:n,outerRadius:r,startAngle:c,endAngle:l,clockWise:!1}}}),cU=(e,t)=>t,lU=(e,t,n)=>n;function uU(e){return e?.id}function dU(e,t,n){var{chartData:r=[]}=t,{allowDuplicatedCategory:i,dataKey:a}=n,o=new Map;return e.forEach(e=>{var t=e.data??r;if(t!=null&&t.length!==0){var n=uU(e);t.forEach((t,r)=>{var s=a==null||i?r:String(zI(t,a,null)),c=zI(t,e.dataKey,0),l=o.has(s)?o.get(s):{};Object.assign(l,{[n]:c}),o.set(s,l)})}}),Array.from(o.values())}function fU(e){return`stackId`in e&&e.stackId!=null&&e.dataKey!=null}var pU=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function mU(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function hU(e,t){if(e.length===t.length){for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return!1}var gU=e=>{var t=QL(e);return t===`horizontal`?`xAxis`:t===`vertical`?`yAxis`:t===`centric`?`angleAxis`:`radiusAxis`},_U=e=>e.tooltip.settings.axisId;function vU(e){if(e!=null){var t=e.ticks,n=e.bandwidth,r=e.range(),i=[Math.min(...r),Math.max(...r)];return{domain:()=>e.domain(),range:function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(()=>i),rangeMin:()=>i[0],rangeMax:()=>i[1],isInRange(e){var t=i[0],n=i[1];return t<=n?e>=t&&e<=n:e>=n&&e<=t},bandwidth:n?()=>n.call(e):void 0,ticks:t?n=>t.call(e,n):void 0,map:(t,n)=>{var r=e(t);if(r!=null){if(e.bandwidth&&n!=null&&n.position){var i=e.bandwidth();switch(n.position){case`middle`:r+=i/2;break;case`end`:r+=i}}return r}}}}}var yU=(e,t)=>{if(t!=null)switch(e){case`linear`:if(!_H(t)){for(var n,r,i=0;i<t.length;i++){var a=t[i];MI(a)&&((n===void 0||a<n)&&(n=a),(r===void 0||a>r)&&(r=a))}return n!==void 0&&r!==void 0?[n,r]:void 0}return t;default:return t}};function bU(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function xU(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function SU(e){let t,n,r;e.length===2?(t=e===bU||e===xU?e:CU,n=e,r=e):(t=bU,n=(t,n)=>bU(e(t),n),r=(t,n)=>e(t)-n);function i(e,r,i=0,a=e.length){if(i<a){if(t(r,r)!==0)return a;do{let t=i+a>>>1;n(e[t],r)<0?i=t+1:a=t}while(i<a)}return i}function a(e,r,i=0,a=e.length){if(i<a){if(t(r,r)!==0)return a;do{let t=i+a>>>1;n(e[t],r)<=0?i=t+1:a=t}while(i<a)}return i}function o(e,t,n=0,a=e.length){let o=i(e,t,n,a-1);return o>n&&r(e[o-1],t)>-r(e[o],t)?o-1:o}return{left:i,center:o,right:a}}function CU(){return 0}function wU(e){return e===null?NaN:+e}function*TU(e,t){if(t===void 0)for(let t of e)t!=null&&(t=+t)>=t&&(yield t);else{let n=-1;for(let r of e)(r=t(r,++n,e))!=null&&(r=+r)>=r&&(yield r)}}var EU=SU(bU),DU=EU.right;EU.left,SU(wU).center;var OU=class extends Map{constructor(e,t=MU){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),e!=null)for(let[t,n]of e)this.set(t,n)}get(e){return super.get(kU(this,e))}has(e){return super.has(kU(this,e))}set(e,t){return super.set(AU(this,e),t)}delete(e){return super.delete(jU(this,e))}};function kU({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):n}function AU({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function jU({_intern:e,_key:t},n){let r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function MU(e){return typeof e==`object`&&e?e.valueOf():e}function NU(e=bU){if(e===bU)return PU;if(typeof e!=`function`)throw TypeError(`compare is not a function`);return(t,n)=>{let r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function PU(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:+(e>t))}var FU=Math.sqrt(50),IU=Math.sqrt(10),LU=Math.sqrt(2);function RU(e,t,n){let r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/10**i,o=a>=FU?10:a>=IU?5:a>=LU?2:1,s,c,l;return i<0?(l=10**-i/o,s=Math.round(e*l),c=Math.round(t*l),s/l<e&&++s,c/l>t&&--c,l=-l):(l=10**i*o,s=Math.round(e/l),c=Math.round(t/l),s*l<e&&++s,c*l>t&&--c),c<s&&.5<=n&&n<2?RU(e,t,n*2):[s,c,l]}function zU(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];let r=t<e,[i,a,o]=r?RU(t,e,n):RU(e,t,n);if(!(a>=i))return[];let s=a-i+1,c=Array(s);if(r){if(o<0)for(let e=0;e<s;++e)c[e]=(a-e)/-o;else for(let e=0;e<s;++e)c[e]=(a-e)*o}else if(o<0)for(let e=0;e<s;++e)c[e]=(i+e)/-o;else for(let e=0;e<s;++e)c[e]=(i+e)*o;return c}function BU(e,t,n){return t=+t,e=+e,n=+n,RU(e,t,n)[2]}function VU(e,t,n){t=+t,e=+e,n=+n;let r=t<e,i=r?BU(t,e,n):BU(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function HU(e,t){let n;if(t===void 0)for(let t of e)t!=null&&(n<t||n===void 0&&t>=t)&&(n=t);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function UU(e,t){let n;if(t===void 0)for(let t of e)t!=null&&(n>t||n===void 0&&t>=t)&&(n=t);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function WU(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?PU:NU(i);r>n;){if(r-n>600){let a=r-n+1,o=t-n+1,s=Math.log(a),c=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*c*(a-c)/a)*(o-a/2<0?-1:1),u=Math.max(n,Math.floor(t-o*c/a+l)),d=Math.min(r,Math.floor(t+(a-o)*c/a+l));WU(e,t,u,d,i)}let a=e[t],o=n,s=r;for(GU(e,n,t),i(e[r],a)>0&&GU(e,n,r);o<s;){for(GU(e,o,s),++o,--s;i(e[o],a)<0;)++o;for(;i(e[s],a)>0;)--s}i(e[n],a)===0?GU(e,n,s):(++s,GU(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}return e}function GU(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}function KU(e,t,n){if(e=Float64Array.from(TU(e,n)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return UU(e);if(t>=1)return HU(e);var r,i=(r-1)*t,a=Math.floor(i),o=HU(WU(e,a).subarray(0,a+1));return o+(UU(e.subarray(a+1))-o)*(i-a)}}function qU(e,t,n=wU){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,a=Math.floor(i),o=+n(e[a],a,e);return o+(+n(e[a+1],a+1,e)-o)*(i-a)}}function JU(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,a=Array(i);++r<i;)a[r]=e+r*n;return a}function YU(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}function XU(e,t){switch(arguments.length){case 0:break;case 1:typeof e==`function`?this.interpolator(e):this.range(e);break;default:this.domain(e),typeof t==`function`?this.interpolator(t):this.range(t)}return this}var ZU=Symbol(`implicit`);function QU(){var e=new OU,t=[],n=[],r=ZU;function i(i){let a=e.get(i);if(a===void 0){if(r!==ZU)return r;e.set(i,a=t.push(i)-1)}return n[a%n.length]}return i.domain=function(n){if(!arguments.length)return t.slice();t=[],e=new OU;for(let r of n)e.has(r)||e.set(r,t.push(r)-1);return i},i.range=function(e){return arguments.length?(n=Array.from(e),i):n.slice()},i.unknown=function(e){return arguments.length?(r=e,i):r},i.copy=function(){return QU(t,n).unknown(r)},YU.apply(i,arguments),i}function $U(){var e=QU().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,o,s=!1,c=0,l=0,u=.5;delete e.unknown;function d(){var e=t().length,d=i<r,f=d?i:r,p=d?r:i;a=(p-f)/Math.max(1,e-c+l*2),s&&(a=Math.floor(a)),f+=(p-f-a*(e-c))*u,o=a*(1-c),s&&(f=Math.round(f),o=Math.round(o));var m=JU(e).map(function(e){return f+a*e});return n(d?m.reverse():m)}return e.domain=function(e){return arguments.length?(t(e),d()):t()},e.range=function(e){return arguments.length?([r,i]=e,r=+r,i=+i,d()):[r,i]},e.rangeRound=function(e){return[r,i]=e,r=+r,i=+i,s=!0,d()},e.bandwidth=function(){return o},e.step=function(){return a},e.round=function(e){return arguments.length?(s=!!e,d()):s},e.padding=function(e){return arguments.length?(c=Math.min(1,l=+e),d()):c},e.paddingInner=function(e){return arguments.length?(c=Math.min(1,e),d()):c},e.paddingOuter=function(e){return arguments.length?(l=+e,d()):l},e.align=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),d()):u},e.copy=function(){return $U(t(),[r,i]).round(s).paddingInner(c).paddingOuter(l).align(u)},YU.apply(d(),arguments)}function eW(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return eW(t())},e}function tW(){return eW($U.apply(null,arguments).paddingInner(1))}function nW(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function rW(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function iW(){}var aW=.7,oW=1/aW,sW=`\\s*([+-]?\\d+)\\s*`,cW=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,lW=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,uW=/^#([0-9a-f]{3,8})$/,dW=RegExp(`^rgb\\(${sW},${sW},${sW}\\)$`),fW=RegExp(`^rgb\\(${lW},${lW},${lW}\\)$`),pW=RegExp(`^rgba\\(${sW},${sW},${sW},${cW}\\)$`),mW=RegExp(`^rgba\\(${lW},${lW},${lW},${cW}\\)$`),hW=RegExp(`^hsl\\(${cW},${lW},${lW}\\)$`),gW=RegExp(`^hsla\\(${cW},${lW},${lW},${cW}\\)$`),_W={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};nW(iW,SW,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:vW,formatHex:vW,formatHex8:yW,formatHsl:bW,formatRgb:xW,toString:xW});function vW(){return this.rgb().formatHex()}function yW(){return this.rgb().formatHex8()}function bW(){return FW(this).formatHsl()}function xW(){return this.rgb().formatRgb()}function SW(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=uW.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?CW(t):n===3?new DW(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?wW(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?wW(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=dW.exec(e))?new DW(t[1],t[2],t[3],1):(t=fW.exec(e))?new DW(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=pW.exec(e))?wW(t[1],t[2],t[3],t[4]):(t=mW.exec(e))?wW(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=hW.exec(e))?PW(t[1],t[2]/100,t[3]/100,1):(t=gW.exec(e))?PW(t[1],t[2]/100,t[3]/100,t[4]):_W.hasOwnProperty(e)?CW(_W[e]):e===`transparent`?new DW(NaN,NaN,NaN,0):null}function CW(e){return new DW(e>>16&255,e>>8&255,e&255,1)}function wW(e,t,n,r){return r<=0&&(e=t=n=NaN),new DW(e,t,n,r)}function TW(e){return e instanceof iW||(e=SW(e)),e?(e=e.rgb(),new DW(e.r,e.g,e.b,e.opacity)):new DW}function EW(e,t,n,r){return arguments.length===1?TW(e):new DW(e,t,n,r??1)}function DW(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}nW(DW,EW,rW(iW,{brighter(e){return e=e==null?oW:oW**+e,new DW(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?aW:aW**+e,new DW(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new DW(MW(this.r),MW(this.g),MW(this.b),jW(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:OW,formatHex:OW,formatHex8:kW,formatRgb:AW,toString:AW}));function OW(){return`#${NW(this.r)}${NW(this.g)}${NW(this.b)}`}function kW(){return`#${NW(this.r)}${NW(this.g)}${NW(this.b)}${NW((isNaN(this.opacity)?1:this.opacity)*255)}`}function AW(){let e=jW(this.opacity);return`${e===1?`rgb(`:`rgba(`}${MW(this.r)}, ${MW(this.g)}, ${MW(this.b)}${e===1?`)`:`, ${e})`}`}function jW(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function MW(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function NW(e){return e=MW(e),(e<16?`0`:``)+e.toString(16)}function PW(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new LW(e,t,n,r)}function FW(e){if(e instanceof LW)return new LW(e.h,e.s,e.l,e.opacity);if(e instanceof iW||(e=SW(e)),!e)return new LW;if(e instanceof LW)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new LW(o,s,c,e.opacity)}function IW(e,t,n,r){return arguments.length===1?FW(e):new LW(e,t,n,r??1)}function LW(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}nW(LW,IW,rW(iW,{brighter(e){return e=e==null?oW:oW**+e,new LW(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?aW:aW**+e,new LW(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new DW(BW(e>=240?e-240:e+120,i,r),BW(e,i,r),BW(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new LW(RW(this.h),zW(this.s),zW(this.l),jW(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=jW(this.opacity);return`${e===1?`hsl(`:`hsla(`}${RW(this.h)}, ${zW(this.s)*100}%, ${zW(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function RW(e){return e=(e||0)%360,e<0?e+360:e}function zW(e){return Math.max(0,Math.min(1,e||0))}function BW(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var VW=e=>()=>e;function HW(e,t){return function(n){return e+n*t}}function UW(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function WW(e){return(e=+e)==1?GW:function(t,n){return n-t?UW(t,n,e):VW(isNaN(t)?n:t)}}function GW(e,t){var n=t-e;return n?HW(e,n):VW(isNaN(e)?t:e)}var KW=(function e(t){var n=WW(t);function r(e,t){var r=n((e=EW(e)).r,(t=EW(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=GW(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1);function qW(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function JW(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function YW(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o;for(o=0;o<r;++o)i[o]=iG(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(e){for(o=0;o<r;++o)a[o]=i[o](e);return a}}function XW(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function ZW(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function QW(e,t){var n={},r={},i;for(i in(typeof e!=`object`||!e)&&(e={}),(typeof t!=`object`||!t)&&(t={}),t)i in e?n[i]=iG(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var $W=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,eG=new RegExp($W.source,`g`);function tG(e){return function(){return e}}function nG(e){return function(t){return e(t)+``}}function rG(e,t){var n=$W.lastIndex=eG.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=$W.exec(e))&&(i=eG.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:ZW(r,i)})),n=eG.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?nG(c[0].x):tG(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}function iG(e,t){var n=typeof t,r;return t==null||n===`boolean`?VW(t):(n===`number`?ZW:n===`string`?(r=SW(t))?(t=r,KW):rG:t instanceof SW?KW:t instanceof Date?XW:JW(t)?qW:Array.isArray(t)?YW:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?QW:ZW)(e,t)}function aG(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function oG(e,t){t===void 0&&(t=e,e=iG);for(var n=0,r=t.length-1,i=t[0],a=Array(r<0?0:r);n<r;)a[n]=e(i,i=t[++n]);return function(e){var t=Math.max(0,Math.min(r-1,Math.floor(e*=r)));return a[t](e-t)}}function sG(e){return function(){return e}}function cG(e){return+e}var lG=[0,1];function uG(e){return e}function dG(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:sG(isNaN(t)?NaN:.5)}function fG(e,t){var n;return e>t&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}function pG(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i<r?(r=dG(i,r),a=n(o,a)):(r=dG(r,i),a=n(a,o)),function(e){return a(r(e))}}function mG(e,t,n){var r=Math.min(e.length,t.length)-1,i=Array(r),a=Array(r),o=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<r;)i[o]=dG(e[o],e[o+1]),a[o]=n(t[o],t[o+1]);return function(t){var n=DU(e,t,1,r)-1;return a[n](i[n](t))}}function hG(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function gG(){var e=lG,t=lG,n=iG,r,i,a,o=uG,s,c,l;function u(){var n=Math.min(e.length,t.length);return o!==uG&&(o=fG(e[0],e[n-1])),s=n>2?mG:pG,c=l=null,d}function d(i){return i==null||isNaN(i=+i)?a:(c||=s(e.map(r),t,n))(r(o(i)))}return d.invert=function(n){return o(i((l||=s(t,e.map(r),ZW))(n)))},d.domain=function(t){return arguments.length?(e=Array.from(t,cG),u()):e.slice()},d.range=function(e){return arguments.length?(t=Array.from(e),u()):t.slice()},d.rangeRound=function(e){return t=Array.from(e),n=aG,u()},d.clamp=function(e){return arguments.length?(o=e?!0:uG,u()):o!==uG},d.interpolate=function(e){return arguments.length?(n=e,u()):n},d.unknown=function(e){return arguments.length?(a=e,d):a},function(e,t){return r=e,i=t,u()}}function _G(){return gG()(uG,uG)}function vG(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString(`en`).replace(/,/g,``):e.toString(10)}function yG(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf(`e`),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function bG(e){return e=yG(Math.abs(e)),e?e[1]:NaN}function xG(e,t){return function(n,r){for(var i=n.length,a=[],o=0,s=e[0],c=0;i>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),a.push(n.substring(i-=s,i+s)),!((c+=s+1)>r));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}function SG(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}var CG=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function wG(e){if(!(t=CG.exec(e)))throw Error(`invalid format: `+e);var t;return new TG({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}wG.prototype=TG.prototype;function TG(e){this.fill=e.fill===void 0?` `:e.fill+``,this.align=e.align===void 0?`>`:e.align+``,this.sign=e.sign===void 0?`-`:e.sign+``,this.symbol=e.symbol===void 0?``:e.symbol+``,this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?``:e.type+``}TG.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?`0`:``)+(this.width===void 0?``:Math.max(1,this.width|0))+(this.comma?`,`:``)+(this.precision===void 0?``:`.`+Math.max(0,this.precision|0))+(this.trim?`~`:``)+this.type};function EG(e){out:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case`.`:r=i=n;break;case`0`:r===0&&(r=n),i=n;break;default:if(!+e[n])break out;r>0&&(r=0)}return r>0?e.slice(0,r)+e.slice(i+1):e}var DG;function OG(e,t){var n=yG(e,t);if(!n)return DG=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(DG=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return a===o?r:a>o?r+Array(a-o+1).join(`0`):a>0?r.slice(0,a)+`.`+r.slice(a):`0.`+Array(1-a).join(`0`)+yG(e,Math.max(0,t+a-1))[0]}function kG(e,t){var n=yG(e,t);if(!n)return e+``;var r=n[0],i=n[1];return i<0?`0.`+Array(-i).join(`0`)+r:r.length>i+1?r.slice(0,i+1)+`.`+r.slice(i+1):r+Array(i-r.length+2).join(`0`)}var AG={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+``,d:vG,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>kG(e*100,t),r:kG,s:OG,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function jG(e){return e}var MG=Array.prototype.map,NG=[`y`,`z`,`a`,`f`,`p`,`n`,`µ`,`m`,``,`k`,`M`,`G`,`T`,`P`,`E`,`Z`,`Y`];function PG(e){var t=e.grouping===void 0||e.thousands===void 0?jG:xG(MG.call(e.grouping,Number),e.thousands+``),n=e.currency===void 0?``:e.currency[0]+``,r=e.currency===void 0?``:e.currency[1]+``,i=e.decimal===void 0?`.`:e.decimal+``,a=e.numerals===void 0?jG:SG(MG.call(e.numerals,String)),o=e.percent===void 0?`%`:e.percent+``,s=e.minus===void 0?`−`:e.minus+``,c=e.nan===void 0?`NaN`:e.nan+``;function l(e,l){e=wG(e);var u=e.fill,d=e.align,f=e.sign,p=e.symbol,m=e.zero,h=e.width,g=e.comma,_=e.precision,v=e.trim,y=e.type;y===`n`?(g=!0,y=`g`):AG[y]||(_===void 0&&(_=12),v=!0,y=`g`),(m||u===`0`&&d===`=`)&&(m=!0,u=`0`,d=`=`);var b=(l&&l.prefix!==void 0?l.prefix:``)+(p===`$`?n:p===`#`&&/[boxX]/.test(y)?`0`+y.toLowerCase():``),x=(p===`$`?r:/[%p]/.test(y)?o:``)+(l&&l.suffix!==void 0?l.suffix:``),S=AG[y],C=/[defgprs%]/.test(y);_=_===void 0?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function w(e){var n=b,r=x,o,l,p;if(y===`c`)r=S(e)+r,e=``;else{e=+e;var w=e<0||1/e<0;if(e=isNaN(e)?c:S(Math.abs(e),_),v&&(e=EG(e)),w&&+e==0&&f!==`+`&&(w=!1),n=(w?f===`(`?f:s:f===`-`||f===`(`?``:f)+n,r=(y===`s`&&!isNaN(e)&&DG!==void 0?NG[8+DG/3]:``)+r+(w&&f===`(`?`)`:``),C){for(o=-1,l=e.length;++o<l;)if(p=e.charCodeAt(o),48>p||p>57){r=(p===46?i+e.slice(o+1):e.slice(o))+r,e=e.slice(0,o);break}}}g&&!m&&(e=t(e,1/0));var T=n.length+e.length+r.length,E=T<h?Array(h-T+1).join(u):``;switch(g&&m&&(e=t(E+e,E.length?h-r.length:1/0),E=``),d){case`<`:e=n+e+r+E;break;case`=`:e=n+E+e+r;break;case`^`:e=E.slice(0,T=E.length>>1)+n+e+r+E.slice(T);break;default:e=E+n+e+r}return a(e)}return w.toString=function(){return e+``},w}function u(e,t){var n=Math.max(-8,Math.min(8,Math.floor(bG(t)/3)))*3,r=10**-n,i=l((e=wG(e),e.type=`f`,e),{suffix:NG[8+n/3]});return function(e){return i(r*e)}}return{format:l,formatPrefix:u}}var FG,IG,LG;RG({thousands:`,`,grouping:[3],currency:[`$`,``]});function RG(e){return FG=PG(e),IG=FG.format,LG=FG.formatPrefix,FG}function zG(e){return Math.max(0,-bG(Math.abs(e)))}function BG(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(bG(t)/3)))*3-bG(Math.abs(e)))}function VG(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,bG(t)-bG(e))+1}function HG(e,t,n,r){var i=VU(e,t,n),a;switch(r=wG(r??`,f`),r.type){case`s`:var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=BG(i,o))&&(r.precision=a),LG(r,o);case``:case`e`:case`g`:case`p`:case`r`:r.precision==null&&!isNaN(a=VG(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type===`e`));break;case`f`:case`%`:r.precision==null&&!isNaN(a=zG(i))&&(r.precision=a-(r.type===`%`)*2)}return IG(r)}function UG(e){var t=e.domain;return e.ticks=function(e){var n=t();return zU(n[0],n[n.length-1],e??10)},e.tickFormat=function(e,n){var r=t();return HG(r[0],r[r.length-1],e??10,n)},e.nice=function(n){n??=10;var r=t(),i=0,a=r.length-1,o=r[i],s=r[a],c,l,u=10;for(s<o&&(l=o,o=s,s=l,l=i,i=a,a=l);u-->0;){if(l=BU(o,s,n),l===c)return r[i]=o,r[a]=s,t(r);if(l>0)o=Math.floor(o/l)*l,s=Math.ceil(s/l)*l;else if(l<0)o=Math.ceil(o*l)/l,s=Math.floor(s*l)/l;else break;c=l}return e},e}function WG(){var e=_G();return e.copy=function(){return hG(e,WG())},YU.apply(e,arguments),UG(e)}function GG(e){var t;function n(e){return e==null||isNaN(e=+e)?t:e}return n.invert=n,n.domain=n.range=function(t){return arguments.length?(e=Array.from(t,cG),n):e.slice()},n.unknown=function(e){return arguments.length?(t=e,n):t},n.copy=function(){return GG(e).unknown(t)},e=arguments.length?Array.from(e,cG):[0,1],UG(n)}function KG(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],a=e[r],o;return a<i&&(o=n,n=r,r=o,o=i,i=a,a=o),e[n]=t.floor(i),e[r]=t.ceil(a),e}function qG(e){return Math.log(e)}function JG(e){return Math.exp(e)}function YG(e){return-Math.log(-e)}function XG(e){return-Math.exp(-e)}function ZG(e){return isFinite(e)?+(`1e`+e):e<0?0:e}function QG(e){return e===10?ZG:e===Math.E?Math.exp:t=>e**+t}function $G(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function eK(e){return(t,n)=>-e(-t,n)}function tK(e){let t=e(qG,JG),n=t.domain,r=10,i,a;function o(){return i=$G(r),a=QG(r),n()[0]<0?(i=eK(i),a=eK(a),e(YG,XG)):e(qG,JG),t}return t.base=function(e){return arguments.length?(r=+e,o()):r},t.domain=function(e){return arguments.length?(n(e),o()):n()},t.ticks=e=>{let t=n(),o=t[0],s=t[t.length-1],c=s<o;c&&([o,s]=[s,o]);let l=i(o),u=i(s),d,f,p=e==null?10:+e,m=[];if(!(r%1)&&u-l<p){if(l=Math.floor(l),u=Math.ceil(u),o>0){for(;l<=u;++l)for(d=1;d<r;++d)if(f=l<0?d/a(-l):d*a(l),!(f<o)){if(f>s)break;m.push(f)}}else for(;l<=u;++l)for(d=r-1;d>=1;--d)if(f=l>0?d/a(-l):d*a(l),!(f<o)){if(f>s)break;m.push(f)}m.length*2<p&&(m=zU(o,s,p))}else m=zU(l,u,Math.min(u-l,p)).map(a);return c?m.reverse():m},t.tickFormat=(e,n)=>{if(e??=10,n??=r===10?`s`:`,`,typeof n!=`function`&&(!(r%1)&&(n=wG(n)).precision==null&&(n.trim=!0),n=IG(n)),e===1/0)return n;let o=Math.max(1,r*e/t.ticks().length);return e=>{let t=e/a(Math.round(i(e)));return t*r<r-.5&&(t*=r),t<=o?n(e):``}},t.nice=()=>n(KG(n(),{floor:e=>a(Math.floor(i(e))),ceil:e=>a(Math.ceil(i(e)))})),t}function nK(){let e=tK(gG()).domain([1,10]);return e.copy=()=>hG(e,nK()).base(e.base()),YU.apply(e,arguments),e}function rK(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function iK(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function aK(e){var t=1,n=e(rK(t),iK(t));return n.constant=function(n){return arguments.length?e(rK(t=+n),iK(t)):t},UG(n)}function oK(){var e=aK(gG());return e.copy=function(){return hG(e,oK()).constant(e.constant())},YU.apply(e,arguments)}function sK(e){return function(t){return t<0?-((-t)**+e):t**+e}}function cK(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function lK(e){return e<0?-e*e:e*e}function uK(e){var t=e(uG,uG),n=1;function r(){return n===1?e(uG,uG):n===.5?e(cK,lK):e(sK(n),sK(1/n))}return t.exponent=function(e){return arguments.length?(n=+e,r()):n},UG(t)}function dK(){var e=uK(gG());return e.copy=function(){return hG(e,dK()).exponent(e.exponent())},YU.apply(e,arguments),e}function fK(){return dK.apply(null,arguments).exponent(.5)}function pK(e){return Math.sign(e)*e*e}function mK(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function hK(){var e=_G(),t=[0,1],n=!1,r;function i(t){var i=mK(e(t));return isNaN(i)?r:n?Math.round(i):i}return i.invert=function(t){return e.invert(pK(t))},i.domain=function(t){return arguments.length?(e.domain(t),i):e.domain()},i.range=function(n){return arguments.length?(e.range((t=Array.from(n,cG)).map(pK)),i):t.slice()},i.rangeRound=function(e){return i.range(e).round(!0)},i.round=function(e){return arguments.length?(n=!!e,i):n},i.clamp=function(t){return arguments.length?(e.clamp(t),i):e.clamp()},i.unknown=function(e){return arguments.length?(r=e,i):r},i.copy=function(){return hK(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},YU.apply(i,arguments),UG(i)}function gK(){var e=[],t=[],n=[],r;function i(){var r=0,i=Math.max(1,t.length);for(n=Array(i-1);++r<i;)n[r-1]=qU(e,r/i);return a}function a(e){return e==null||isNaN(e=+e)?r:t[DU(n,e)]}return a.invertExtent=function(r){var i=t.indexOf(r);return i<0?[NaN,NaN]:[i>0?n[i-1]:e[0],i<n.length?n[i]:e[e.length-1]]},a.domain=function(t){if(!arguments.length)return e.slice();e=[];for(let n of t)n!=null&&!isNaN(n=+n)&&e.push(n);return e.sort(bU),i()},a.range=function(e){return arguments.length?(t=Array.from(e),i()):t.slice()},a.unknown=function(e){return arguments.length?(r=e,a):r},a.quantiles=function(){return n.slice()},a.copy=function(){return gK().domain(e).range(t).unknown(r)},YU.apply(a,arguments)}function _K(){var e=0,t=1,n=1,r=[.5],i=[0,1],a;function o(e){return e!=null&&e<=e?i[DU(r,e,0,n)]:a}function s(){var i=-1;for(r=Array(n);++i<n;)r[i]=((i+1)*t-(i-n)*e)/(n+1);return o}return o.domain=function(n){return arguments.length?([e,t]=n,e=+e,t=+t,s()):[e,t]},o.range=function(e){return arguments.length?(n=(i=Array.from(e)).length-1,s()):i.slice()},o.invertExtent=function(a){var o=i.indexOf(a);return o<0?[NaN,NaN]:o<1?[e,r[0]]:o>=n?[r[n-1],t]:[r[o-1],r[o]]},o.unknown=function(e){return arguments.length&&(a=e),o},o.thresholds=function(){return r.slice()},o.copy=function(){return _K().domain([e,t]).range(i).unknown(a)},YU.apply(UG(o),arguments)}function vK(){var e=[.5],t=[0,1],n,r=1;function i(i){return i!=null&&i<=i?t[DU(e,i,0,r)]:n}return i.domain=function(n){return arguments.length?(e=Array.from(n),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(n){return arguments.length?(t=Array.from(n),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(n){var r=t.indexOf(n);return[e[r-1],e[r]]},i.unknown=function(e){return arguments.length?(n=e,i):n},i.copy=function(){return vK().domain(e).range(t).unknown(n)},YU.apply(i,arguments)}var yK=new Date,bK=new Date;function xK(e,t,n,r){function i(t){return e(t=arguments.length===0?new Date:new Date(+t)),t}return i.floor=t=>(e(t=new Date(+t)),t),i.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),i.round=e=>{let t=i(e),n=i.ceil(e);return e-t<n-e?t:n},i.offset=(e,n)=>(t(e=new Date(+e),n==null?1:Math.floor(n)),e),i.range=(n,r,a)=>{let o=[];if(n=i.ceil(n),a=a==null?1:Math.floor(a),!(n<r)||!(a>0))return o;let s;do o.push(s=new Date(+n)),t(n,a),e(n);while(s<n&&n<r);return o},i.filter=n=>xK(t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)},(e,r)=>{if(e>=e){if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}}),n&&(i.count=(t,r)=>(yK.setTime(+t),bK.setTime(+r),e(yK),e(bK),Math.floor(n(yK,bK))),i.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?i.filter(r?t=>r(t)%e===0:t=>i.count(0,t)%e===0):i)),i}var SK=xK(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);SK.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?xK(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):SK),SK.range;var CK=1e3,wK=CK*60,TK=wK*60,EK=TK*24,DK=EK*7,OK=EK*30,kK=EK*365,AK=xK(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*CK)},(e,t)=>(t-e)/CK,e=>e.getUTCSeconds());AK.range;var jK=xK(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*CK)},(e,t)=>{e.setTime(+e+t*wK)},(e,t)=>(t-e)/wK,e=>e.getMinutes());jK.range;var MK=xK(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*wK)},(e,t)=>(t-e)/wK,e=>e.getUTCMinutes());MK.range;var NK=xK(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*CK-e.getMinutes()*wK)},(e,t)=>{e.setTime(+e+t*TK)},(e,t)=>(t-e)/TK,e=>e.getHours());NK.range;var PK=xK(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*TK)},(e,t)=>(t-e)/TK,e=>e.getUTCHours());PK.range;var FK=xK(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*wK)/EK,e=>e.getDate()-1);FK.range;var IK=xK(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/EK,e=>e.getUTCDate()-1);IK.range;var LK=xK(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/EK,e=>Math.floor(e/EK));LK.range;function RK(e){return xK(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(e,t)=>{e.setDate(e.getDate()+t*7)},(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*wK)/DK)}var zK=RK(0),BK=RK(1),VK=RK(2),HK=RK(3),UK=RK(4),WK=RK(5),GK=RK(6);zK.range,BK.range,VK.range,HK.range,UK.range,WK.range,GK.range;function KK(e){return xK(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t*7)},(e,t)=>(t-e)/DK)}var qK=KK(0),JK=KK(1),YK=KK(2),XK=KK(3),ZK=KK(4),QK=KK(5),$K=KK(6);qK.range,JK.range,YK.range,XK.range,ZK.range,QK.range,$K.range;var eq=xK(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());eq.range;var tq=xK(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());tq.range;var nq=xK(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());nq.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:xK(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}),nq.range;var rq=xK(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());rq.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:xK(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}),rq.range;function iq(e,t,n,r,i,a){let o=[[AK,1,CK],[AK,5,5*CK],[AK,15,15*CK],[AK,30,30*CK],[a,1,wK],[a,5,5*wK],[a,15,15*wK],[a,30,30*wK],[i,1,TK],[i,3,3*TK],[i,6,6*TK],[i,12,12*TK],[r,1,EK],[r,2,2*EK],[n,1,DK],[t,1,OK],[t,3,3*OK],[e,1,kK]];function s(e,t,n){let r=t<e;r&&([e,t]=[t,e]);let i=n&&typeof n.range==`function`?n:c(e,t,n),a=i?i.range(e,+t+1):[];return r?a.reverse():a}function c(t,n,r){let i=Math.abs(n-t)/r,a=SU(([,,e])=>e).right(o,i);if(a===o.length)return e.every(VU(t/kK,n/kK,r));if(a===0)return SK.every(Math.max(VU(t,n,r),1));let[s,c]=o[i/o[a-1][2]<o[a][2]/i?a-1:a];return s.every(c)}return[s,c]}var[aq,oq]=iq(rq,tq,qK,LK,PK,MK),[sq,cq]=iq(nq,eq,zK,FK,NK,jK);function lq(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function uq(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function dq(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function fq(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,o=e.shortDays,s=e.months,c=e.shortMonths,l=yq(i),u=bq(i),d=yq(a),f=bq(a),p=yq(o),m=bq(o),h=yq(s),g=bq(s),_=yq(c),v=bq(c),y={a:N,A:P,b:ee,B:F,c:null,d:Vq,e:Vq,f:Kq,g:rJ,G:aJ,H:Hq,I:Uq,j:Wq,L:Gq,m:qq,M:Jq,p:I,q:te,Q:OJ,s:kJ,S:Yq,u:Xq,U:Zq,V:$q,w:eJ,W:tJ,x:null,X:null,y:nJ,Y:iJ,Z:oJ,"%":DJ},b={a:L,A:ne,b:re,B:R,c:null,d:sJ,e:sJ,f:fJ,g:CJ,G:TJ,H:cJ,I:lJ,j:uJ,L:dJ,m:pJ,M:mJ,p:ie,q:ae,Q:OJ,s:kJ,S:hJ,u:gJ,U:_J,V:yJ,w:bJ,W:xJ,x:null,X:null,y:SJ,Y:wJ,Z:EJ,"%":DJ},x={a:E,A:D,b:O,B:k,c:A,d:jq,e:jq,f:Lq,g:Dq,G:Eq,H:Nq,I:Nq,j:Mq,L:Iq,m:Aq,M:Pq,p:T,q:kq,Q:zq,s:Bq,S:Fq,u:Sq,U:Cq,V:wq,w:xq,W:Tq,x:j,X:M,y:Dq,Y:Eq,Z:Oq,"%":Rq};y.x=S(n,y),y.X=S(r,y),y.c=S(t,y),b.x=S(n,b),b.X=S(r,b),b.c=S(t,b);function S(e,t){return function(n){var r=[],i=-1,a=0,o=e.length,s,c,l;for(n instanceof Date||(n=new Date(+n));++i<o;)e.charCodeAt(i)===37&&(r.push(e.slice(a,i)),(c=pq[s=e.charAt(++i)])==null?c=s===`e`?` `:`0`:s=e.charAt(++i),(l=t[s])&&(s=l(n,c)),r.push(s),a=i+1);return r.push(e.slice(a,i)),r.join(``)}}function C(e,t){return function(n){var r=dq(1900,void 0,1),i=w(r,e,n+=``,0),a,o;if(i!=n.length)return null;if(`Q`in r)return new Date(r.Q);if(`s`in r)return new Date(r.s*1e3+(`L`in r?r.L:0));if(t&&!(`Z`in r)&&(r.Z=0),`p`in r&&(r.H=r.H%12+r.p*12),r.m===void 0&&(r.m=`q`in r?r.q:0),`V`in r){if(r.V<1||r.V>53)return null;`w`in r||(r.w=1),`Z`in r?(a=uq(dq(r.y,0,1)),o=a.getUTCDay(),a=o>4||o===0?JK.ceil(a):JK(a),a=IK.offset(a,(r.V-1)*7),r.y=a.getUTCFullYear(),r.m=a.getUTCMonth(),r.d=a.getUTCDate()+(r.w+6)%7):(a=lq(dq(r.y,0,1)),o=a.getDay(),a=o>4||o===0?BK.ceil(a):BK(a),a=FK.offset(a,(r.V-1)*7),r.y=a.getFullYear(),r.m=a.getMonth(),r.d=a.getDate()+(r.w+6)%7)}else(`W`in r||`U`in r)&&(`w`in r||(r.w=`u`in r?r.u%7:+(`W`in r)),o=`Z`in r?uq(dq(r.y,0,1)).getUTCDay():lq(dq(r.y,0,1)).getDay(),r.m=0,r.d=`W`in r?(r.w+6)%7+r.W*7-(o+5)%7:r.w+r.U*7-(o+6)%7);return`Z`in r?(r.H+=r.Z/100|0,r.M+=r.Z%100,uq(r)):lq(r)}}function w(e,t,n,r){for(var i=0,a=t.length,o=n.length,s,c;i<a;){if(r>=o)return-1;if(s=t.charCodeAt(i++),s===37){if(s=t.charAt(i++),c=x[s in pq?t.charAt(i++):s],!c||(r=c(e,n,r))<0)return-1}else if(s!=n.charCodeAt(r++))return-1}return r}function T(e,t,n){var r=l.exec(t.slice(n));return r?(e.p=u.get(r[0].toLowerCase()),n+r[0].length):-1}function E(e,t,n){var r=p.exec(t.slice(n));return r?(e.w=m.get(r[0].toLowerCase()),n+r[0].length):-1}function D(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=f.get(r[0].toLowerCase()),n+r[0].length):-1}function O(e,t,n){var r=_.exec(t.slice(n));return r?(e.m=v.get(r[0].toLowerCase()),n+r[0].length):-1}function k(e,t,n){var r=h.exec(t.slice(n));return r?(e.m=g.get(r[0].toLowerCase()),n+r[0].length):-1}function A(e,n,r){return w(e,t,n,r)}function j(e,t,r){return w(e,n,t,r)}function M(e,t,n){return w(e,r,t,n)}function N(e){return o[e.getDay()]}function P(e){return a[e.getDay()]}function ee(e){return c[e.getMonth()]}function F(e){return s[e.getMonth()]}function I(e){return i[+(e.getHours()>=12)]}function te(e){return 1+~~(e.getMonth()/3)}function L(e){return o[e.getUTCDay()]}function ne(e){return a[e.getUTCDay()]}function re(e){return c[e.getUTCMonth()]}function R(e){return s[e.getUTCMonth()]}function ie(e){return i[+(e.getUTCHours()>=12)]}function ae(e){return 1+~~(e.getUTCMonth()/3)}return{format:function(e){var t=S(e+=``,y);return t.toString=function(){return e},t},parse:function(e){var t=C(e+=``,!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=S(e+=``,b);return t.toString=function(){return e},t},utcParse:function(e){var t=C(e+=``,!0);return t.toString=function(){return e},t}}}var pq={"-":``,_:` `,0:`0`},mq=/^\s*\d+/,hq=/^%/,gq=/[\\^$*+?|[\]().{}]/g;function _q(e,t,n){var r=e<0?`-`:``,i=(r?-e:e)+``,a=i.length;return r+(a<n?Array(n-a+1).join(t)+i:i)}function vq(e){return e.replace(gq,`\\$&`)}function yq(e){return RegExp(`^(?:`+e.map(vq).join(`|`)+`)`,`i`)}function bq(e){return new Map(e.map((e,t)=>[e.toLowerCase(),t]))}function xq(e,t,n){var r=mq.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Sq(e,t,n){var r=mq.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Cq(e,t,n){var r=mq.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function wq(e,t,n){var r=mq.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Tq(e,t,n){var r=mq.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function Eq(e,t,n){var r=mq.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function Dq(e,t,n){var r=mq.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Oq(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||`00`)),n+r[0].length):-1}function kq(e,t,n){var r=mq.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function Aq(e,t,n){var r=mq.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function jq(e,t,n){var r=mq.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Mq(e,t,n){var r=mq.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function Nq(e,t,n){var r=mq.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Pq(e,t,n){var r=mq.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Fq(e,t,n){var r=mq.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Iq(e,t,n){var r=mq.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Lq(e,t,n){var r=mq.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Rq(e,t,n){var r=hq.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function zq(e,t,n){var r=mq.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Bq(e,t,n){var r=mq.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function Vq(e,t){return _q(e.getDate(),t,2)}function Hq(e,t){return _q(e.getHours(),t,2)}function Uq(e,t){return _q(e.getHours()%12||12,t,2)}function Wq(e,t){return _q(1+FK.count(nq(e),e),t,3)}function Gq(e,t){return _q(e.getMilliseconds(),t,3)}function Kq(e,t){return Gq(e,t)+`000`}function qq(e,t){return _q(e.getMonth()+1,t,2)}function Jq(e,t){return _q(e.getMinutes(),t,2)}function Yq(e,t){return _q(e.getSeconds(),t,2)}function Xq(e){var t=e.getDay();return t===0?7:t}function Zq(e,t){return _q(zK.count(nq(e)-1,e),t,2)}function Qq(e){var t=e.getDay();return t>=4||t===0?UK(e):UK.ceil(e)}function $q(e,t){return e=Qq(e),_q(UK.count(nq(e),e)+(nq(e).getDay()===4),t,2)}function eJ(e){return e.getDay()}function tJ(e,t){return _q(BK.count(nq(e)-1,e),t,2)}function nJ(e,t){return _q(e.getFullYear()%100,t,2)}function rJ(e,t){return e=Qq(e),_q(e.getFullYear()%100,t,2)}function iJ(e,t){return _q(e.getFullYear()%1e4,t,4)}function aJ(e,t){var n=e.getDay();return e=n>=4||n===0?UK(e):UK.ceil(e),_q(e.getFullYear()%1e4,t,4)}function oJ(e){var t=e.getTimezoneOffset();return(t>0?`-`:(t*=-1,`+`))+_q(t/60|0,`0`,2)+_q(t%60,`0`,2)}function sJ(e,t){return _q(e.getUTCDate(),t,2)}function cJ(e,t){return _q(e.getUTCHours(),t,2)}function lJ(e,t){return _q(e.getUTCHours()%12||12,t,2)}function uJ(e,t){return _q(1+IK.count(rq(e),e),t,3)}function dJ(e,t){return _q(e.getUTCMilliseconds(),t,3)}function fJ(e,t){return dJ(e,t)+`000`}function pJ(e,t){return _q(e.getUTCMonth()+1,t,2)}function mJ(e,t){return _q(e.getUTCMinutes(),t,2)}function hJ(e,t){return _q(e.getUTCSeconds(),t,2)}function gJ(e){var t=e.getUTCDay();return t===0?7:t}function _J(e,t){return _q(qK.count(rq(e)-1,e),t,2)}function vJ(e){var t=e.getUTCDay();return t>=4||t===0?ZK(e):ZK.ceil(e)}function yJ(e,t){return e=vJ(e),_q(ZK.count(rq(e),e)+(rq(e).getUTCDay()===4),t,2)}function bJ(e){return e.getUTCDay()}function xJ(e,t){return _q(JK.count(rq(e)-1,e),t,2)}function SJ(e,t){return _q(e.getUTCFullYear()%100,t,2)}function CJ(e,t){return e=vJ(e),_q(e.getUTCFullYear()%100,t,2)}function wJ(e,t){return _q(e.getUTCFullYear()%1e4,t,4)}function TJ(e,t){var n=e.getUTCDay();return e=n>=4||n===0?ZK(e):ZK.ceil(e),_q(e.getUTCFullYear()%1e4,t,4)}function EJ(){return`+0000`}function DJ(){return`%`}function OJ(e){return+e}function kJ(e){return Math.floor(e/1e3)}var AJ,jJ,MJ;NJ({dateTime:`%x, %X`,date:`%-m/%-d/%Y`,time:`%-I:%M:%S %p`,periods:[`AM`,`PM`],days:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`],shortDays:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],months:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],shortMonths:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`]});function NJ(e){return AJ=fq(e),jJ=AJ.format,AJ.parse,MJ=AJ.utcFormat,AJ.utcParse,AJ}function PJ(e){return new Date(e)}function FJ(e){return e instanceof Date?+e:+new Date(+e)}function IJ(e,t,n,r,i,a,o,s,c,l){var u=_G(),d=u.invert,f=u.domain,p=l(`.%L`),m=l(`:%S`),h=l(`%I:%M`),g=l(`%I %p`),_=l(`%a %d`),v=l(`%b %d`),y=l(`%B`),b=l(`%Y`);function x(e){return(c(e)<e?p:s(e)<e?m:o(e)<e?h:a(e)<e?g:r(e)<e?i(e)<e?_:v:n(e)<e?y:b)(e)}return u.invert=function(e){return new Date(d(e))},u.domain=function(e){return arguments.length?f(Array.from(e,FJ)):f().map(PJ)},u.ticks=function(t){var n=f();return e(n[0],n[n.length-1],t??10)},u.tickFormat=function(e,t){return t==null?x:l(t)},u.nice=function(e){var n=f();return(!e||typeof e.range!=`function`)&&(e=t(n[0],n[n.length-1],e??10)),e?f(KG(n,e)):u},u.copy=function(){return hG(u,IJ(e,t,n,r,i,a,o,s,c,l))},u}function LJ(){return YU.apply(IJ(sq,cq,nq,eq,zK,FK,NK,jK,AK,jJ).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function RJ(){return YU.apply(IJ(aq,oq,rq,tq,qK,IK,PK,MK,AK,MJ).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function zJ(){var e=0,t=1,n,r,i,a,o=uG,s=!1,c;function l(e){return e==null||isNaN(e=+e)?c:o(i===0?.5:(e=(a(e)-n)*i,s?Math.max(0,Math.min(1,e)):e))}l.domain=function(o){return arguments.length?([e,t]=o,n=a(e=+e),r=a(t=+t),i=n===r?0:1/(r-n),l):[e,t]},l.clamp=function(e){return arguments.length?(s=!!e,l):s},l.interpolator=function(e){return arguments.length?(o=e,l):o};function u(e){return function(t){var n,r;return arguments.length?([n,r]=t,o=e(n,r),l):[o(0),o(1)]}}return l.range=u(iG),l.rangeRound=u(aG),l.unknown=function(e){return arguments.length?(c=e,l):c},function(o){return a=o,n=o(e),r=o(t),i=n===r?0:1/(r-n),l}}function BJ(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function VJ(){var e=UG(zJ()(uG));return e.copy=function(){return BJ(e,VJ())},XU.apply(e,arguments)}function HJ(){var e=tK(zJ()).domain([1,10]);return e.copy=function(){return BJ(e,HJ()).base(e.base())},XU.apply(e,arguments)}function UJ(){var e=aK(zJ());return e.copy=function(){return BJ(e,UJ()).constant(e.constant())},XU.apply(e,arguments)}function WJ(){var e=uK(zJ());return e.copy=function(){return BJ(e,WJ()).exponent(e.exponent())},XU.apply(e,arguments)}function GJ(){return WJ.apply(null,arguments).exponent(.5)}function KJ(){var e=[],t=uG;function n(n){if(n!=null&&!isNaN(n=+n))return t((DU(e,n,1)-1)/(e.length-1))}return n.domain=function(t){if(!arguments.length)return e.slice();e=[];for(let n of t)n!=null&&!isNaN(n=+n)&&e.push(n);return e.sort(bU),n},n.interpolator=function(e){return arguments.length?(t=e,n):t},n.range=function(){return e.map((n,r)=>t(r/(e.length-1)))},n.quantiles=function(t){return Array.from({length:t+1},(n,r)=>KU(e,r/t))},n.copy=function(){return KJ(t).domain(e)},XU.apply(n,arguments)}function qJ(){var e=0,t=.5,n=1,r=1,i,a,o,s,c,l=uG,u,d=!1,f;function p(e){return isNaN(e=+e)?f:(e=.5+((e=+u(e))-a)*(r*e<r*a?s:c),l(d?Math.max(0,Math.min(1,e)):e))}p.domain=function(l){return arguments.length?([e,t,n]=l,i=u(e=+e),a=u(t=+t),o=u(n=+n),s=i===a?0:.5/(a-i),c=a===o?0:.5/(o-a),r=a<i?-1:1,p):[e,t,n]},p.clamp=function(e){return arguments.length?(d=!!e,p):d},p.interpolator=function(e){return arguments.length?(l=e,p):l};function m(e){return function(t){var n,r,i;return arguments.length?([n,r,i]=t,l=oG(e,[n,r,i]),p):[l(0),l(.5),l(1)]}}return p.range=m(iG),p.rangeRound=m(aG),p.unknown=function(e){return arguments.length?(f=e,p):f},function(l){return u=l,i=l(e),a=l(t),o=l(n),s=i===a?0:.5/(a-i),c=a===o?0:.5/(o-a),r=a<i?-1:1,p}}function JJ(){var e=UG(qJ()(uG));return e.copy=function(){return BJ(e,JJ())},XU.apply(e,arguments)}function YJ(){var e=tK(qJ()).domain([.1,1,10]);return e.copy=function(){return BJ(e,YJ()).base(e.base())},XU.apply(e,arguments)}function XJ(){var e=aK(qJ());return e.copy=function(){return BJ(e,XJ()).constant(e.constant())},XU.apply(e,arguments)}function ZJ(){var e=uK(qJ());return e.copy=function(){return BJ(e,ZJ()).exponent(e.exponent())},XU.apply(e,arguments)}function QJ(){return ZJ.apply(null,arguments).exponent(.5)}var $J=s({scaleBand:()=>$U,scaleDiverging:()=>JJ,scaleDivergingLog:()=>YJ,scaleDivergingPow:()=>ZJ,scaleDivergingSqrt:()=>QJ,scaleDivergingSymlog:()=>XJ,scaleIdentity:()=>GG,scaleImplicit:()=>ZU,scaleLinear:()=>WG,scaleLog:()=>nK,scaleOrdinal:()=>QU,scalePoint:()=>tW,scalePow:()=>dK,scaleQuantile:()=>gK,scaleQuantize:()=>_K,scaleRadial:()=>hK,scaleSequential:()=>VJ,scaleSequentialLog:()=>HJ,scaleSequentialPow:()=>WJ,scaleSequentialQuantile:()=>KJ,scaleSequentialSqrt:()=>GJ,scaleSequentialSymlog:()=>UJ,scaleSqrt:()=>fK,scaleSymlog:()=>oK,scaleThreshold:()=>vK,scaleTime:()=>LJ,scaleUtc:()=>RJ,tickFormat:()=>HG});function eY(e){if(e in $J)return $J[e]();var t=`scale${mj(e)}`;if(t in $J)return $J[t]()}function tY(e,t,n){if(typeof e==`function`)return e.copy().domain(t).range(n);if(e!=null){var r=eY(e);if(r!=null)return r.domain(t).range(n),r}}function nY(e,t,n,r){if(n!=null&&r!=null)return typeof e.scale==`function`?tY(e.scale,n,r):tY(t,n,r)}function rY(e){return`scale${mj(e)}`}function iY(e){return rY(e)in $J}var aY=(e,t,n)=>{if(e!=null){var{scale:r,type:i}=e;if(r===`auto`)return i===`category`&&n&&(n.indexOf(`LineChart`)>=0||n.indexOf(`AreaChart`)>=0||n.indexOf(`ComposedChart`)>=0&&!t)?`point`:i===`category`?`band`:`linear`;if(typeof r==`string`)return iY(r)?r:`point`}};function oY(e,t){for(var n=0,r=e.length,i=e[0]<e[e.length-1];n<r;){var a=Math.floor((n+r)/2);(i?e[a]<t:e[a]>t)?n=a+1:r=a}return n}function sY(e,t){if(e){var n=t??e.domain(),r=n.map(t=>e(t)??0),i=e.range();if(!(n.length===0||i.length<2))return e=>{var t=oY(r,e);if(t<=0)return n[0];if(t>=n.length)return n[n.length-1];var i=r[t-1]??0,a=r[t]??0;return Math.abs(e-i)<=Math.abs(e-a)?n[t-1]:n[t]}}}function cY(e){if(e!=null)return`invert`in e&&typeof e.invert==`function`?e.invert.bind(e):sY(e,void 0)}function lY(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function uY(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?lY(Object(n),!0).forEach(function(t){dY(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lY(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function dY(e,t,n){return(t=fY(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fY(e){var t=pY(e,`string`);return typeof t==`symbol`?t:t+``}function pY(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var mY=[0,`auto`],hY={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:void 0,height:30,hide:!0,id:0,includeHidden:!1,interval:`preserveEnd`,minTickGap:5,mirror:!1,name:void 0,orientation:`bottom`,padding:{left:0,right:0},reversed:!1,scale:`auto`,tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:`category`,unit:void 0,niceTicks:`auto`},gY=(e,t)=>e.cartesianAxis.xAxis[t],_Y=(e,t)=>gY(e,t)??hY,vY={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:mY,hide:!0,id:0,includeHidden:!1,interval:`preserveEnd`,minTickGap:5,mirror:!1,name:void 0,orientation:`left`,padding:{top:0,bottom:0},reversed:!1,scale:`auto`,tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:`number`,unit:void 0,niceTicks:`auto`,width:60},yY=(e,t)=>e.cartesianAxis.yAxis[t],bY=(e,t)=>yY(e,t)??vY,xY={domain:[0,`auto`],includeHidden:!1,reversed:!1,allowDataOverflow:!1,allowDuplicatedCategory:!1,dataKey:void 0,id:0,name:``,range:[64,64],scale:`auto`,type:`number`,unit:``},SY=(e,t)=>e.cartesianAxis.zAxis[t]??xY,CY=(e,t,n)=>{switch(t){case`xAxis`:return _Y(e,n);case`yAxis`:return bY(e,n);case`zAxis`:return SY(e,n);case`angleAxis`:return $H(e,n);case`radiusAxis`:return eU(e,n);default:throw Error(`Unexpected axis type: ${t}`)}},wY=(e,t,n)=>{switch(t){case`xAxis`:return _Y(e,n);case`yAxis`:return bY(e,n);default:throw Error(`Unexpected axis type: ${t}`)}},TY=(e,t,n)=>{switch(t){case`xAxis`:return _Y(e,n);case`yAxis`:return bY(e,n);case`angleAxis`:return $H(e,n);case`radiusAxis`:return eU(e,n);default:throw Error(`Unexpected axis type: ${t}`)}},EY=e=>e.graphicalItems.cartesianItems.some(e=>e.type===`bar`)||e.graphicalItems.polarItems.some(e=>e.type===`radialBar`);function DY(e,t){return n=>{switch(e){case`xAxis`:return`xAxisId`in n&&n.xAxisId===t;case`yAxis`:return`yAxisId`in n&&n.yAxisId===t;case`zAxis`:return`zAxisId`in n&&n.zAxisId===t;case`angleAxis`:return`angleAxisId`in n&&n.angleAxisId===t;case`radiusAxis`:return`radiusAxisId`in n&&n.radiusAxisId===t;default:return!1}}}var OY=e=>e.graphicalItems.cartesianItems,kY=$([cU,lU],DY),AY=(e,t,n)=>e.filter(n).filter(e=>t?.includeHidden===!0||!e.hide),jY=$([OY,CY,kY],AY,{memoizeOptions:{resultEqualityCheck:mU}}),MY=$([jY],e=>e.filter(e=>e.type===`area`||e.type===`bar`).filter(fU)),NY=e=>e.filter(e=>!(`stackId`in e)||e.stackId===void 0),PY=$([jY],NY),FY=e=>e.map(e=>e.data).filter(Boolean).flat(1),IY=$([jY],FY,{memoizeOptions:{resultEqualityCheck:mU}}),LY=(e,t)=>{var{chartData:n=[],dataStartIndex:r,dataEndIndex:i}=t;return e.length>0?e:n.slice(r,i+1)},RY=$([IY,hH],LY),zY=(e,t,n)=>t?.dataKey==null?n.length>0?n.map(e=>e.dataKey).flatMap(t=>e.map(e=>({value:zI(e,t)}))):e.map(e=>({value:e})):e.map(e=>({value:zI(e,t.dataKey)})),BY=$([RY,CY,jY],zY);function VY(e){if(oj(e)||e instanceof Date){var t=Number(e);if(MI(t))return t}}function HY(e){if(Array.isArray(e)){var t=[VY(e[0]),VY(e[1])];return _H(t)?t:void 0}var n=VY(e);if(n!=null)return[n,n]}function UY(e){return e.map(VY).filter(hj)}function WY(e,t){var n=VY(e),r=VY(t);return n==null&&r==null?0:n==null?-1:r==null?1:n-r}var GY=$([BY],e=>e?.map(e=>e.value).sort(WY));function KY(e,t){switch(e){case`xAxis`:return t.direction===`x`;case`yAxis`:return t.direction===`y`;default:return!1}}function qY(e,t,n){return!n||typeof t!=`number`||ij(t)||!n.length?[]:UY(n.flatMap(n=>{var r=zI(e,n.dataKey),i,a;if(Array.isArray(r)?[i,a]=r:i=a=r,!(!MI(i)||!MI(a)))return[t-i,t+a]}))}var JY=e=>TY(e,gU(e),_U(e)),YY=$([JY],e=>e?.dataKey),XY=$([MY,hH,JY],dU),ZY=(e,t,n,r)=>{var i=t.reduce((e,t)=>{if(t.stackId==null)return e;var n=e[t.stackId];return n??=[],n.push(t),e[t.stackId]=n,e},{});return Object.fromEntries(Object.entries(i).map(t=>{var[i,a]=t,o=r?[...a].reverse():a;return[i,{stackedData:KI(e,o.map(uU),n),graphicalItems:o}]}))},QY=$([XY,MY,FH,IH],ZY),$Y=(e,t,n,r)=>{var{dataStartIndex:i,dataEndIndex:a}=t;if(r==null&&n!==`zAxis`){var o=QI(e,i,a);if(o==null||o[0]!==0||o[1]!==0)return o}},eX=$([CY],e=>e.allowDataOverflow),tX=e=>{if(e==null||!(`domain`in e))return mY;if(e.domain!=null)return e.domain;if(`ticks`in e&&e.ticks!=null){if(e.type===`number`){var t=UY(e.ticks);return[Math.min(...t),Math.max(...t)]}if(e.type===`category`)return e.ticks.map(String)}return e?.domain??mY},nX=$([CY],tX),rX=$([nX,eX],yH),iX=$([QY,pH,cU,rX],$Y,{memoizeOptions:{resultEqualityCheck:pU}}),aX=e=>e.errorBars,oX=(e,t,n)=>e.flatMap(e=>t[e.id]).filter(Boolean).filter(e=>KY(n,e)),sX=function(){var e=[...arguments].filter(Boolean);if(e.length!==0){var t=e.flat();return[Math.min(...t),Math.max(...t)]}},cX=(e,t,n,r,i)=>{var a,o;if(n.length>0&&e.forEach(e=>{n.forEach(n=>{var s=r[n.id]?.filter(e=>KY(i,e)),c=zI(e,t.dataKey??n.dataKey),l=qY(e,c,s);if(l.length>=2){var u=Math.min(...l),d=Math.max(...l);(a==null||u<a)&&(a=u),(o==null||d>o)&&(o=d)}var f=HY(c);f!=null&&(a=a==null?f[0]:Math.min(a,f[0]),o=o==null?f[1]:Math.max(o,f[1]))})}),t?.dataKey!=null&&e.forEach(e=>{var n=HY(zI(e,t.dataKey));n!=null&&(a=a==null?n[0]:Math.min(a,n[0]),o=o==null?n[1]:Math.max(o,n[1]))}),MI(a)&&MI(o))return[a,o]},lX=$([RY,CY,PY,aX,cU],cX,{memoizeOptions:{resultEqualityCheck:pU}});function uX(e){var{value:t}=e;if(oj(t)||t instanceof Date)return t}var dX=(e,t,n)=>{var r=e.map(uX).filter(e=>e!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&uj(r))?fH(0,e.length):t.allowDuplicatedCategory?r:Array.from(new Set(r))},fX=e=>e.referenceElements.dots,pX=(e,t,n)=>e.filter(e=>e.ifOverflow===`extendDomain`).filter(e=>t===`xAxis`?e.xAxisId===n:e.yAxisId===n),mX=$([fX,cU,lU],pX),hX=e=>e.referenceElements.areas,gX=$([hX,cU,lU],pX),_X=e=>e.referenceElements.lines,vX=$([_X,cU,lU],pX),yX=(e,t)=>{if(e!=null){var n=UY(e.map(e=>t===`xAxis`?e.x:e.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},bX=$(mX,cU,yX),xX=(e,t)=>{if(e!=null){var n=UY(e.flatMap(e=>[t===`xAxis`?e.x1:e.y1,t===`xAxis`?e.x2:e.y2]));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},SX=$([gX,cU],xX);function CX(e){if(e.x!=null)return UY([e.x]);var t=e.segment?.map(e=>e.x);return t==null||t.length===0?[]:UY(t)}function wX(e){if(e.y!=null)return UY([e.y]);var t=e.segment?.map(e=>e.y);return t==null||t.length===0?[]:UY(t)}var TX=(e,t)=>{if(e!=null){var n=e.flatMap(e=>t===`xAxis`?CX(e):wX(e));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},EX=$(bX,$([vX,cU],TX),SX,(e,t,n)=>sX(e,n,t)),DX=(e,t,n,r,i,a,o,s)=>n??bH(t,o===`vertical`&&s===`xAxis`||o===`horizontal`&&s===`yAxis`?sX(r,a,i):sX(a,i),e.allowDataOverflow),OX=$([CY,nX,rX,iX,lX,EX,QL,cU],DX,{memoizeOptions:{resultEqualityCheck:pU}}),kX=[0,1],AX=(e,t,n,r,i,a,o)=>{if(e!=null&&n!=null&&n.length!==0||o!==void 0){var{dataKey:s,type:c}=e,l=VI(t,a);return l&&s==null?fH(0,n?.length??0):c===`category`?dX(r,e,l):i===`expand`?kX:o}},jX=$([CY,QL,RY,BY,FH,cU,OX],AX),MX=$([CY,EY,LH],aY),NX=(e,t,n)=>{var{niceTicks:r}=t;if(r!==`none`){var i=tX(t),a=Array.isArray(i)&&(i[0]===`auto`||i[1]===`auto`);if((r===`snap125`||r===`adaptive`)&&t!=null&&t.tickCount&&_H(e)){if(a)return kH(e,t.tickCount,t.allowDecimals,r);if(t.type===`number`)return AH(e,t.tickCount,t.allowDecimals,r)}if(r===`auto`&&n===`linear`&&t!=null&&t.tickCount){if(a&&_H(e))return kH(e,t.tickCount,t.allowDecimals,`adaptive`);if(t.type===`number`&&_H(e))return AH(e,t.tickCount,t.allowDecimals,`adaptive`)}}},PX=$([jX,TY,MX],NX),FX=(e,t,n,r)=>{if(r!==`angleAxis`&&e?.type===`number`&&_H(t)&&Array.isArray(n)&&n.length>0){var i=t[0],a=n[0]??0,o=t[1],s=n[n.length-1]??0;return[Math.min(i,a),Math.max(o,s)]}return t},IX=$([CY,jX,PX,cU],FX),LX=$($(BY,CY,(e,t)=>{if(!(!t||t.type!==`number`)){var n=1/0,r=Array.from(UY(e.map(e=>e.value))).sort((e,t)=>e-t),i=r[0],a=r[r.length-1];if(i==null||a==null)return 1/0;var o=a-i;if(o===0)return 1/0;for(var s=0;s<r.length-1;s++){var c=r[s],l=r[s+1];if(c!=null&&l!=null){var u=l-c;n=Math.min(n,u)}}return n/o}}),QL,NH,hL,(e,t,n,r,i)=>i,(e,t,n,r,i)=>{if(!MI(e))return 0;var a=t===`vertical`?r.height:r.width;if(i===`gap`)return e*a/2;if(i===`no-gap`){var o=lj(n,e*a),s=e*a/2;return s-o-(s-o)/a*o}return 0}),RX=(e,t,n)=>{var r=_Y(e,t);return r==null||typeof r.padding!=`string`?0:LX(e,`xAxis`,t,n,r.padding)},zX=(e,t,n)=>{var r=bY(e,t);return r==null||typeof r.padding!=`string`?0:LX(e,`yAxis`,t,n,r.padding)},BX=$(_Y,RX,(e,t)=>{if(e==null)return{left:0,right:0};var{padding:n}=e;return typeof n==`string`?{left:t,right:t}:{left:(n.left??0)+t,right:(n.right??0)+t}}),VX=$(bY,zX,(e,t)=>{if(e==null)return{top:0,bottom:0};var{padding:n}=e;return typeof n==`string`?{top:t,bottom:t}:{top:(n.top??0)+t,bottom:(n.bottom??0)+t}}),HX=$([hL,BX,xL,bL,(e,t,n)=>n],(e,t,n,r,i)=>{var{padding:a}=r;return i?[a.left,n.width-a.right]:[e.left+t.left,e.left+e.width-t.right]}),UX=$([hL,QL,VX,xL,bL,(e,t,n)=>n],(e,t,n,r,i,a)=>{var{padding:o}=i;return a?[r.height-o.bottom,o.top]:t===`horizontal`?[e.top+e.height-n.bottom,e.top+n.top]:[e.top+n.top,e.top+e.height-n.bottom]}),WX=(e,t,n,r)=>{switch(t){case`xAxis`:return HX(e,n,r);case`yAxis`:return UX(e,n,r);case`zAxis`:return SY(e,n)?.range;case`angleAxis`:return aU(e);case`radiusAxis`:return oU(e,n);default:return}},GX=$([CY,WX],WH),KX=$([CY,MX,$([MX,IX],yU),GX],nY),qX=(e,t,n,r)=>{if(n!=null&&n.dataKey!=null){var{type:i,scale:a}=n;if(VI(e,r)&&(i===`number`||a!==`auto`))return t.map(e=>e.value)}},JX=$([QL,BY,TY,cU],qX),YX=$([KX],vU);$([KX],cY),$([KX,GY],sY),$([jY,aX,cU],oX);function XX(e,t){return e.id<t.id?-1:+(e.id>t.id)}var ZX=(e,t)=>t,QX=(e,t,n)=>n,$X=$(sL,ZX,QX,(e,t,n)=>e.filter(e=>e.orientation===t).filter(e=>e.mirror===n).sort(XX)),eZ=$(cL,ZX,QX,(e,t,n)=>e.filter(e=>e.orientation===t).filter(e=>e.mirror===n).sort(XX)),tZ=(e,t)=>({width:e.width,height:t.height}),nZ=(e,t)=>({width:typeof t.width==`number`?t.width:60,height:e.height}),rZ=$(hL,_Y,tZ),iZ=(e,t,n)=>{switch(t){case`top`:return e.top;case`bottom`:return n-e.bottom;default:return 0}},aZ=(e,t,n)=>{switch(t){case`left`:return e.left;case`right`:return n-e.right;default:return 0}},oZ=$(aL,hL,$X,ZX,QX,(e,t,n,r,i)=>{var a={},o;return n.forEach(n=>{var s=tZ(t,n);o??=iZ(t,r,e);var c=r===`top`&&!i||r===`bottom`&&i;a[n.id]=o-Number(c)*s.height,o+=(c?-1:1)*s.height}),a}),sZ=$(iL,hL,eZ,ZX,QX,(e,t,n,r,i)=>{var a={},o;return n.forEach(n=>{var s=nZ(t,n);o??=aZ(t,r,e);var c=r===`left`&&!i||r===`right`&&i;a[n.id]=o-Number(c)*s.width,o+=(c?-1:1)*s.width}),a}),cZ=$([hL,_Y,(e,t)=>{var n=_Y(e,t);if(n!=null)return oZ(e,n.orientation,n.mirror)},(e,t)=>t],(e,t,n,r)=>{if(t!=null){var i=n?.[r];return i==null?{x:e.left,y:0}:{x:e.left,y:i}}}),lZ=$([hL,bY,(e,t)=>{var n=bY(e,t);if(n!=null)return sZ(e,n.orientation,n.mirror)},(e,t)=>t],(e,t,n,r)=>{if(t!=null){var i=n?.[r];return i==null?{x:0,y:e.top}:{x:i,y:e.top}}}),uZ=$(hL,bY,(e,t)=>({width:typeof t.width==`number`?t.width:60,height:e.height})),dZ=(e,t,n)=>{switch(t){case`xAxis`:return rZ(e,n).width;case`yAxis`:return uZ(e,n).height;default:return}},fZ=(e,t,n,r)=>{if(n!=null){var{allowDuplicatedCategory:i,type:a,dataKey:o}=n,s=VI(e,r),c=t.map(e=>e.value);if(o&&s&&a===`category`&&i&&uj(c))return c}},pZ=$([QL,BY,CY,cU],fZ),mZ=$([QL,wY,MX,YX,pZ,JX,WX,PX,cU],(e,t,n,r,i,a,o,s,c)=>{if(t!=null){var l=VI(e,c);return{angle:t.angle,interval:t.interval,minTickGap:t.minTickGap,orientation:t.orientation,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,axisType:c,categoricalDomain:a,duplicateDomain:i,isCategorical:l,niceTicks:s,range:o,realScaleType:n,scale:r}}}),hZ=$([QL,TY,MX,YX,PX,WX,pZ,JX,cU],(e,t,n,r,i,a,o,s,c)=>{if(t!=null&&r!=null){var l=VI(e,c),{type:u,ticks:d,tickCount:f}=t,p=n===`scaleBand`&&typeof r.bandwidth==`function`?r.bandwidth()/2:2,m=u===`category`&&r.bandwidth?r.bandwidth()/p:0;m=c===`angleAxis`&&a!=null&&a.length>=2?rj(a[0]-a[1])*2*m:m;var h=d||i;return h?h.map((e,t)=>{var n=o?o.indexOf(e):e,i=r.map(n);return MI(i)?{index:t,coordinate:i+m,value:e,offset:m}:null}).filter(hj):l&&s?s.map((e,t)=>{var n=r.map(e);return MI(n)?{coordinate:n+m,value:e,index:t,offset:m}:null}).filter(hj):r.ticks?r.ticks(f).map((e,t)=>{var n=r.map(e);return MI(n)?{coordinate:n+m,value:e,index:t,offset:m}:null}).filter(hj):r.domain().map((e,t)=>{var n=r.map(e);return MI(n)?{coordinate:n+m,value:o?o[e]:e,index:t,offset:m}:null}).filter(hj)}}),gZ=$([QL,TY,YX,WX,pZ,JX,cU],(e,t,n,r,i,a,o)=>{if(t!=null&&n!=null&&r!=null&&r[0]!==r[1]){var s=VI(e,o),{tickCount:c}=t,l=0;return l=o===`angleAxis`&&r?.length>=2?rj(r[0]-r[1])*2*l:l,s&&a?a.map((e,t)=>{var r=n.map(e);return MI(r)?{coordinate:r+l,value:e,index:t,offset:l}:null}).filter(hj):n.ticks?n.ticks(c).map((e,t)=>{var r=n.map(e);return MI(r)?{coordinate:r+l,value:e,index:t,offset:l}:null}).filter(hj):n.domain().map((e,t)=>{var r=n.map(e);return MI(r)?{coordinate:r+l,value:i?i[e]:e,index:t,offset:l}:null}).filter(hj)}}),_Z=$(CY,YX,(e,t)=>{if(e!=null&&t!=null)return uY(uY({},e),{},{scale:t})});$((e,t,n)=>SY(e,n),$([$([CY,MX,jX,GX],nY)],vU),(e,t)=>{if(e!=null&&t!=null)return uY(uY({},e),{},{scale:t})});var vZ=$([QL,sL,cL],(e,t,n)=>{switch(e){case`horizontal`:return t.some(e=>e.reversed)?`right-to-left`:`left-to-right`;case`vertical`:return n.some(e=>e.reversed)?`bottom-to-top`:`top-to-bottom`;case`centric`:case`radial`:return`left-to-right`;default:return}});$([(e,t,n)=>e.renderedTicks[t]?.[n]],e=>{if(!(!e||e.length===0))return t=>{var n=1/0,r=e[0];for(var i of e){var a=Math.abs(i.coordinate-t);a<n&&(n=a,r=i)}return r?.value}});var yZ=e=>e.options.defaultTooltipEventType,bZ=e=>e.options.validateTooltipEventTypes;function xZ(e,t,n){if(e==null)return t;var r=e?`axis`:`item`;return n==null?t:n.includes(r)?r:t}function SZ(e,t){return xZ(t,yZ(e),bZ(e))}function CZ(e){return Q(t=>SZ(t,e))}var wZ=(e,t)=>{var n,r=Number(t);if(!(ij(r)||t==null))return r>=0?e==null||(n=e[r])==null?void 0:n.value:void 0},TZ=e=>e.tooltip.settings,EZ={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},DZ=LF({name:`tooltip`,initialState:{itemInteraction:{click:EZ,hover:EZ},axisInteraction:{click:EZ,hover:EZ},keyboardInteraction:EZ,syncInteraction:{active:!1,index:null,dataKey:void 0,label:void 0,coordinate:void 0,sourceViewBox:void 0,graphicalItemId:void 0},tooltipItemPayloads:[],settings:{shared:void 0,trigger:`hover`,axisId:0,active:!1,defaultIndex:void 0}},reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push($R(t.payload))},prepare:SF()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:n,next:r}=t.payload,i=cF(e).tooltipItemPayloads.indexOf($R(n));i>-1&&(e.tooltipItemPayloads[i]=$R(r))},prepare:SF()},removeTooltipEntrySettings:{reducer(e,t){var n=cF(e).tooltipItemPayloads.indexOf($R(t.payload));n>-1&&e.tooltipItemPayloads.splice(n,1)},prepare:SF()},setTooltipSettingsState(e,t){e.settings=t.payload},setActiveMouseOverItemIndex(e,t){e.syncInteraction.active=!1,e.keyboardInteraction.active=!1,e.itemInteraction.hover.active=!0,e.itemInteraction.hover.index=t.payload.activeIndex,e.itemInteraction.hover.dataKey=t.payload.activeDataKey,e.itemInteraction.hover.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.hover.coordinate=t.payload.activeCoordinate},mouseLeaveChart(e){e.itemInteraction.hover.active=!1,e.axisInteraction.hover.active=!1},mouseLeaveItem(e){e.itemInteraction.hover.active=!1},setActiveClickItemIndex(e,t){e.syncInteraction.active=!1,e.itemInteraction.click.active=!0,e.keyboardInteraction.active=!1,e.itemInteraction.click.index=t.payload.activeIndex,e.itemInteraction.click.dataKey=t.payload.activeDataKey,e.itemInteraction.click.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.click.coordinate=t.payload.activeCoordinate},setMouseOverAxisIndex(e,t){e.syncInteraction.active=!1,e.axisInteraction.hover.active=!0,e.keyboardInteraction.active=!1,e.axisInteraction.hover.index=t.payload.activeIndex,e.axisInteraction.hover.dataKey=t.payload.activeDataKey,e.axisInteraction.hover.coordinate=t.payload.activeCoordinate},setMouseClickAxisIndex(e,t){e.syncInteraction.active=!1,e.keyboardInteraction.active=!1,e.axisInteraction.click.active=!0,e.axisInteraction.click.index=t.payload.activeIndex,e.axisInteraction.click.dataKey=t.payload.activeDataKey,e.axisInteraction.click.coordinate=t.payload.activeCoordinate},setSyncInteraction(e,t){e.syncInteraction=t.payload},setKeyboardInteraction(e,t){e.keyboardInteraction.active=t.payload.active,e.keyboardInteraction.index=t.payload.activeIndex,e.keyboardInteraction.coordinate=t.payload.activeCoordinate}}}),{addTooltipEntrySettings:OZ,replaceTooltipEntrySettings:kZ,removeTooltipEntrySettings:AZ,setTooltipSettingsState:jZ,setActiveMouseOverItemIndex:MZ,mouseLeaveItem:NZ,mouseLeaveChart:PZ,setActiveClickItemIndex:FZ,setMouseOverAxisIndex:IZ,setMouseClickAxisIndex:LZ,setSyncInteraction:RZ,setKeyboardInteraction:zZ}=DZ.actions,BZ=DZ.reducer;function VZ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function HZ(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?VZ(Object(n),!0).forEach(function(t){UZ(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VZ(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function UZ(e,t,n){return(t=WZ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function WZ(e){var t=GZ(e,`string`);return typeof t==`symbol`?t:t+``}function GZ(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function KZ(e,t,n){return t===`axis`?n===`click`?e.axisInteraction.click:e.axisInteraction.hover:n===`click`?e.itemInteraction.click:e.itemInteraction.hover}function qZ(e){return e.index!=null}var JZ=(e,t,n,r)=>{if(t==null)return EZ;var i=KZ(e,t,n);if(i==null)return EZ;if(i.active)return i;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&e.syncInteraction.index!=null)return e.syncInteraction;var a=e.settings.active===!0;if(qZ(i)){if(a)return HZ(HZ({},i),{},{active:!0})}else if(r!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:r,graphicalItemId:void 0};return HZ(HZ({},EZ),{},{coordinate:i.coordinate})};function YZ(e){if(typeof e==`number`)return Number.isFinite(e)?e:void 0;if(e instanceof Date){var t=e.valueOf();return Number.isFinite(t)?t:void 0}var n=Number(e);return Number.isFinite(n)?n:void 0}function XZ(e,t){var n=YZ(e),r=t[0],i=t[1];return n!==void 0&&n>=Math.min(r,i)&&n<=Math.max(r,i)}function ZZ(e,t,n){if(n==null||t==null)return!0;var r=zI(e,t);return r==null||!_H(n)||XZ(r,n)}var QZ=(e,t,n,r)=>{var i=e?.index;if(i==null)return null;var a=Number(i);if(!MI(a))return i;var o=0,s=1/0;t.length>0&&(s=t.length-1);var c=Math.max(o,Math.min(a,s)),l=t[c];return l==null||ZZ(l,n,r)?String(c):null},$Z=(e,t,n,r,i,a,o)=>{if(a!=null){var s=o[0]?.getPosition(a);if(s!=null)return s;var c=i?.[Number(a)];if(c)switch(n){case`horizontal`:return{x:c.coordinate,y:(r.top+t)/2};default:return{x:(r.left+e)/2,y:c.coordinate}}}},eQ=(e,t,n,r)=>{if(t===`axis`)return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var i=n===`hover`?e.itemInteraction.hover.graphicalItemId:e.itemInteraction.click.graphicalItemId;if(e.syncInteraction.active&&i==null)return e.tooltipItemPayloads;if(i==null&&r!=null){var a=e.tooltipItemPayloads[0];return a==null?[]:[a]}return e.tooltipItemPayloads.filter(e=>e.settings?.graphicalItemId===i)},tQ=e=>e.options.tooltipPayloadSearcher,nQ=e=>e.tooltip;function rQ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function iQ(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?rQ(Object(n),!0).forEach(function(t){aQ(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rQ(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function aQ(e,t,n){return(t=oQ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oQ(e){var t=sQ(e,`string`);return typeof t==`symbol`?t:t+``}function sQ(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function cQ(e){if(typeof e==`string`||typeof e==`number`)return e}function lQ(e){if(typeof e==`string`||typeof e==`number`||typeof e==`boolean`)return e}function uQ(e){if(typeof e==`string`||typeof e==`number`)return e;if(typeof e==`function`)return t=>e(t)}function dQ(e){if(typeof e==`string`)return e}function fQ(e){if(!(typeof e!=`object`||!e))return{name:`name`in e?cQ(e.name):void 0,unit:`unit`in e?lQ(e.unit):void 0,dataKey:`dataKey`in e?uQ(e.dataKey):void 0,payload:`payload`in e?e.payload:void 0,color:`color`in e?dQ(e.color):void 0,fill:`fill`in e?dQ(e.fill):void 0}}function pQ(e,t){return e??t}var mQ=(e,t,n,r,i,a,o)=>{if(t!=null&&a!=null){var{chartData:s,computedData:c,dataStartIndex:l,dataEndIndex:u}=n;return e.reduce((e,n)=>{var{dataDefinedOnItem:d,settings:f}=n,p=pQ(d,s),m=Array.isArray(p)?jI(p,l,u):p,h=f?.dataKey??r,g=f?.nameKey,_=r&&Array.isArray(m)&&!Array.isArray(m[0])&&o===`axis`?fj(m,r,i):a(m,t,c,g);return Array.isArray(_)?_.forEach(t=>{var n=fQ(t),r=n?.name,i=n?.dataKey,a=n?.payload,o=iQ(iQ({},f),{},{name:r,unit:n?.unit,color:n?.color??f?.color,fill:n?.fill??f?.fill});e.push(nL({tooltipEntrySettings:o,dataKey:i,payload:a,value:zI(a,i),name:r==null?void 0:String(r)}))}):e.push(nL({tooltipEntrySettings:f,dataKey:h,payload:_,value:zI(_,h),name:zI(_,g)??f?.name})),e},[])}},hQ=$([JY,EY,LH],aY),gQ=$([$([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),JY,$([gU,_U],DY)],AY,{memoizeOptions:{resultEqualityCheck:mU}}),_Q=$([gQ],e=>e.filter(fU)),vQ=$([$([gQ],FY,{memoizeOptions:{resultEqualityCheck:mU}}),pH],LY),yQ=$([_Q,pH,JY],dU),bQ=$([vQ,JY,gQ],zY),xQ=$([JY],tX),SQ=$([xQ,$([JY],e=>e.allowDataOverflow)],yH),CQ=$([$([yQ,$([gQ],e=>e.filter(fU)),FH,IH],ZY),pH,gU,SQ],$Y),wQ=$([vQ,JY,$([gQ],NY),aX,gU],cX,{memoizeOptions:{resultEqualityCheck:pU}}),TQ=$([$([fX,gU,_U],pX),gU],yX),EQ=$([$([hX,gU,_U],pX),gU],xX),DQ=$([JY,QL,vQ,bQ,FH,gU,$([JY,xQ,SQ,CQ,wQ,$([TQ,$([$([_X,gU,_U],pX),gU],TX),EQ],sX),QL,gU],DX)],AX),OQ=$([JY,DQ,$([DQ,JY,hQ],NX),gU],FX),kQ=e=>WX(e,gU(e),_U(e),!1),AQ=$([JY,kQ],WH),jQ=$([$([JY,hQ,OQ,AQ],nY)],vU),MQ=$([QL,JY,hQ,jQ,kQ,$([QL,bQ,JY,gU],fZ),$([QL,bQ,JY,gU],qX),gU],(e,t,n,r,i,a,o,s)=>{if(t){var{type:c}=t,l=VI(e,s);if(r){var u=n===`scaleBand`&&r.bandwidth?r.bandwidth()/2:2,d=c===`category`&&r.bandwidth?r.bandwidth()/u:0;return d=s===`angleAxis`&&i!=null&&i?.length>=2?rj(i[0]-i[1])*2*d:d,l&&o?o.map((e,t)=>{var n=r.map(e);return MI(n)?{coordinate:n+d,value:e,index:t,offset:d}:null}).filter(hj):r.domain().map((e,t)=>{var n=r.map(e);return MI(n)?{coordinate:n+d,value:a?a[e]:e,index:t,offset:d}:null}).filter(hj)}}}),NQ=$([yZ,bZ,TZ],(e,t,n)=>xZ(n.shared,e,t)),PQ=e=>e.tooltip.settings.trigger,FQ=e=>e.tooltip.settings.defaultIndex,IQ=$([nQ,NQ,PQ,FQ],JZ),LQ=$([IQ,vQ,YY,DQ],QZ),RQ=$([MQ,LQ],wZ),zQ=$([IQ],e=>{if(e)return e.dataKey}),BQ=$([IQ],e=>{if(e)return e.graphicalItemId}),VQ=$([nQ,NQ,PQ,FQ],eQ),HQ=$([IQ,$([iL,aL,QL,hL,MQ,FQ,VQ],$Z)],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),UQ=$([IQ],e=>e?.active??!1);$([$([VQ,LQ,pH,YY,RQ,tQ,NQ],mQ)],e=>{if(e!=null){var t=e.map(e=>e.payload).filter(e=>e!=null);return Array.from(new Set(t))}});function WQ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function GQ(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?WQ(Object(n),!0).forEach(function(t){KQ(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):WQ(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function KQ(e,t,n){return(t=qQ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qQ(e){var t=JQ(e,`string`);return typeof t==`symbol`?t:t+``}function JQ(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var YQ=()=>Q(JY),XQ=()=>{var e=YQ(),t=Q(MQ),n=Q(jQ);return tL(!e||!n?void 0:GQ(GQ({},e),{},{scale:n}),t)};function ZQ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function QQ(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?ZQ(Object(n),!0).forEach(function(t){$Q(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ZQ(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function $Q(e,t,n){return(t=e$(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function e$(e){var t=t$(e,`string`);return typeof t==`symbol`?t:t+``}function t$(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var n$=(e,t,n,r)=>{var i=t.find(e=>e&&e.index===n);if(i){if(e===`horizontal`)return{x:i.coordinate,y:r.relativeY};if(e===`vertical`)return{x:r.relativeX,y:i.coordinate}}return{x:0,y:0}},r$=(e,t,n,r)=>{var i=t.find(e=>e&&e.index===n);if(i){if(e===`centric`){var a=i.coordinate,{radius:o}=r;return QQ(QQ(QQ({},r),BV(r.cx,r.cy,o,a)),{},{angle:a,radius:o})}var s=i.coordinate,{angle:c}=r;return QQ(QQ(QQ({},r),BV(r.cx,r.cy,s,c)),{},{angle:c,radius:s})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function i$(e,t){var{relativeX:n,relativeY:r}=e;return n>=t.left&&n<=t.left+t.width&&r>=t.top&&r<=t.top+t.height}var a$=(e,t,n,r,i)=>{var a=t?.length??0;if(a<=1||e==null)return 0;if(r===`angleAxis`&&i!=null&&Math.abs(Math.abs(i[1]-i[0])-360)<=1e-6)for(var o=0;o<a;o++){var s=o>0?n[o-1]?.coordinate:n[a-1]?.coordinate,c=n[o]?.coordinate,l=o>=a-1?n[0]?.coordinate:n[o+1]?.coordinate,u=void 0;if(s!=null&&c!=null&&l!=null){if(rj(c-s)!==rj(l-c)){var d=[];if(rj(l-c)===rj(i[1]-i[0])){u=l;var f=c+i[1]-i[0];d[0]=Math.min(f,(f+s)/2),d[1]=Math.max(f,(f+s)/2)}else{u=s;var p=l+i[1]-i[0];d[0]=Math.min(c,(p+c)/2),d[1]=Math.max(c,(p+c)/2)}var m=[Math.min(c,(u+c)/2),Math.max(c,(u+c)/2)];if(e>m[0]&&e<=m[1]||e>=d[0]&&e<=d[1])return n[o]?.index}else{var h=Math.min(s,l),g=Math.max(s,l);if(e>(h+c)/2&&e<=(g+c)/2)return n[o]?.index}}}else if(t)for(var _=0;_<a;_++){var v=t[_];if(v!=null){var y=t[_+1],b=t[_-1];if(_===0&&y!=null&&e<=(v.coordinate+y.coordinate)/2||_===a-1&&b!=null&&e>(v.coordinate+b.coordinate)/2||_>0&&_<a-1&&b!=null&&y!=null&&e>(v.coordinate+b.coordinate)/2&&e<=(v.coordinate+y.coordinate)/2)return v.index}}return-1},o$=()=>Q(LH),s$=(e,t)=>t,c$=(e,t,n)=>n,l$=(e,t,n,r)=>r,u$=$(MQ,e=>DN(e,e=>e.coordinate)),d$=$([nQ,s$,c$,l$],JZ),f$=$([d$,vQ,YY,DQ],QZ),p$=(e,t,n)=>{if(t!=null){var r=nQ(e);return t===`axis`?n===`hover`?r.axisInteraction.hover.dataKey:r.axisInteraction.click.dataKey:n===`hover`?r.itemInteraction.hover.dataKey:r.itemInteraction.click.dataKey}},m$=$([nQ,s$,c$,l$],eQ),h$=$([iL,aL,QL,hL,MQ,l$,m$],$Z),g$=$([d$,h$],(e,t)=>e.coordinate??t),_$=$([MQ,f$],wZ),v$=$([m$,f$,pH,YY,_$,tQ,s$],mQ),y$=$([d$,f$],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),b$=(e,t,n,r,i,a,o)=>{if(!(!e||!n||!r||!i)&&i$(e,o)){var s=a$(pee(e,t),a,i,n,r),c=n$(t,i,s,e);return{activeIndex:String(s),activeCoordinate:c}}},x$=(e,t,n,r,i,a,o)=>{if(!(!e||!r||!i||!a||!n)){var s=KV(e,n);if(s){var c=a$(mee(s,t),o,a,r,i),l=r$(t,a,c,s);return{activeIndex:String(c),activeCoordinate:l}}}},S$=(e,t,n,r,i,a,o,s)=>{if(!(!e||!t||!r||!i||!a))return t===`horizontal`||t===`vertical`?b$(e,t,r,i,a,o,s):x$(e,t,n,r,i,a,o)},C$=$(e=>e.zIndex.zIndexMap,(e,t)=>t,(e,t,n)=>n,(e,t,n)=>{if(t!=null){var r=e[t];if(r!=null)return n?r.panoramaElement:r.element}}),w$=$(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(e=>parseInt(e,10)).concat(Object.values(VH));return Array.from(new Set(t)).sort((e,t)=>e-t)},{memoizeOptions:{resultEqualityCheck:hU}});function T$(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function E$(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?T$(Object(n),!0).forEach(function(t){D$(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):T$(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function D$(e,t,n){return(t=O$(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function O$(e){var t=k$(e,`string`);return typeof t==`symbol`?t:t+``}function k$(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var A$={zIndexMap:Object.values(VH).reduce((e,t)=>E$(E$({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),{})},j$=new Set(Object.values(VH));function M$(e){return j$.has(e)}var N$=LF({name:`zIndex`,initialState:A$,reducers:{registerZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]?e.zIndexMap[n].consumers+=1:e.zIndexMap[n]={consumers:1,element:void 0,panoramaElement:void 0}},prepare:SF()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(--e.zIndexMap[n].consumers,e.zIndexMap[n].consumers<=0&&!M$(n)&&delete e.zIndexMap[n])},prepare:SF()},registerZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:n,element:r,isPanorama:i}=t.payload;e.zIndexMap[n]?i?e.zIndexMap[n].panoramaElement=$R(r):e.zIndexMap[n].element=$R(r):e.zIndexMap[n]={consumers:0,element:i?void 0:$R(r),panoramaElement:i?$R(r):void 0}},prepare:SF()},unregisterZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(t.payload.isPanorama?e.zIndexMap[n].panoramaElement=void 0:e.zIndexMap[n].element=void 0)},prepare:SF()}}}),{registerZIndexPortal:P$,unregisterZIndexPortal:F$,registerZIndexPortalElement:I$,unregisterZIndexPortalElement:L$}=N$.actions,R$=N$.reducer;function z$(e){var{zIndex:t,children:n}=e,r=nR()&&t!==void 0&&t!==0,i=yL(),a=tN();(0,v.useLayoutEffect)(()=>r?(a(P$({zIndex:t})),()=>{a(F$({zIndex:t}))}):gj,[a,t,r]);var o=Q(e=>C$(e,t,i));return r?o?(0,zr.createPortal)(n,o):null:n}function B$(){return B$=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},B$.apply(null,arguments)}function V$(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function H$(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?V$(Object(n),!0).forEach(function(t){U$(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):V$(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function U$(e,t,n){return(t=W$(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function W$(e){var t=G$(e,`string`);return typeof t==`symbol`?t:t+``}function G$(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function K$(e){var{cursor:t,cursorComp:n,cursorProps:r}=e;return(0,v.isValidElement)(t)?(0,v.cloneElement)(t,r):(0,v.createElement)(n,r)}function q$(e){var{coordinate:t,payload:n,index:r,offset:i,tooltipAxisBandSize:a,layout:o,cursor:s,tooltipEventType:c,chartName:l}=e,u=t,d=n,f=r;if(!s||!u||l!==`ScatterChart`&&c!==`axis`)return null;var p,m,h;if(l===`ScatterChart`)p=u,m=xB,h=VH.cursorLine;else if(l===`BarChart`)p=SB(o,u,i,a),m=MV,h=VH.cursorRectangle;else if(o===`radial`&&Mj(u)){var{cx:g,cy:_,radius:y,startAngle:b,endAngle:x}=qV(u);p={cx:g,cy:_,startAngle:b,endAngle:x,innerRadius:y,outerRadius:y},m=cH,h=VH.cursorLine}else p={points:lH(o,u,i)},m=uB,h=VH.cursorLine;var S=typeof s==`object`&&`className`in s?s.className:void 0,C=H$(H$(H$(H$({stroke:`#ccc`,pointerEvents:`none`},i),p),ok(s)),{},{payload:d,payloadIndex:f,className:cn(`recharts-tooltip-cursor`,S)});return v.createElement(z$,{zIndex:e.zIndex??h},v.createElement(K$,{cursor:s,cursorComp:m,cursorProps:C}))}function J$(e){var t=XQ(),n=YL(),r=$L(),i=o$();return t==null||n==null||r==null||i==null?null:v.createElement(q$,B$({},e,{offset:n,layout:r,tooltipAxisBandSize:t,chartName:i}))}var Y$=(0,v.createContext)(null),X$=()=>(0,v.useContext)(Y$),Z$=l(o(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=`~`;function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(r=!1));function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,n,i,o){if(typeof n!=`function`)throw TypeError(`The listener must be a function`);var s=new a(n,i||e,o),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function s(e,t){--e._eventsCount===0?e._events=new i:delete e._events[t]}function c(){this._events=new i,this._eventsCount=0}c.prototype.eventNames=function(){var e=[],t,i;if(this._eventsCount===0)return e;for(i in t=this._events)n.call(t,i)&&e.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e},c.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,a=n.length,o=Array(a);i<a;i++)o[i]=n[i].fn;return o},c.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},c.prototype.emit=function(e,t,n,i,a,o){var s=r?r+e:e;if(!this._events[s])return!1;var c=this._events[s],l=arguments.length,u,d;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),l){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,i),!0;case 5:return c.fn.call(c.context,t,n,i,a),!0;case 6:return c.fn.call(c.context,t,n,i,a,o),!0}for(d=1,u=Array(l-1);d<l;d++)u[d-1]=arguments[d];c.fn.apply(c.context,u)}else{var f=c.length,p;for(d=0;d<f;d++)switch(c[d].once&&this.removeListener(e,c[d].fn,void 0,!0),l){case 1:c[d].fn.call(c[d].context);break;case 2:c[d].fn.call(c[d].context,t);break;case 3:c[d].fn.call(c[d].context,t,n);break;case 4:c[d].fn.call(c[d].context,t,n,i);break;default:if(!u)for(p=1,u=Array(l-1);p<l;p++)u[p-1]=arguments[p];c[d].fn.apply(c[d].context,u)}}return!0},c.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},c.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},c.prototype.removeListener=function(e,t,n,i){var a=r?r+e:e;if(!this._events[a])return this;if(!t)return s(this,a),this;var o=this._events[a];if(o.fn)o.fn===t&&(!i||o.once)&&(!n||o.context===n)&&s(this,a);else{for(var c=0,l=[],u=o.length;c<u;c++)(o[c].fn!==t||i&&!o[c].once||n&&o[c].context!==n)&&l.push(o[c]);l.length?this._events[a]=l.length===1?l[0]:l:s(this,a)}return this},c.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&s(this,t)):(this._events=new i,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=r,c.EventEmitter=c,t!==void 0&&(t.exports=c)}))(),1).default,Q$=new Z$,$$=`recharts.syncEvent.tooltip`,e1=`recharts.syncEvent.brush`,t1=(e,t)=>{if(t&&Array.isArray(e)){var n=Number.parseInt(t,10);if(!ij(n))return e[n]}},n1=LF({name:`options`,initialState:{chartName:``,tooltipPayloadSearcher:()=>void 0,eventEmitter:void 0,defaultTooltipEventType:`axis`},reducers:{createEventEmitter:e=>{e.eventEmitter??=Symbol(`rechartsEventEmitter`)}}}),r1=n1.reducer,{createEventEmitter:i1}=n1.actions;function a1(e){return e.tooltip.syncInteraction}var o1=LF({name:`chartData`,initialState:{chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},reducers:{setChartData(e,t){if(e.chartData=$R(t.payload),t.payload==null){e.dataStartIndex=0,e.dataEndIndex=0;return}t.payload.length>0&&e.dataEndIndex!==t.payload.length-1&&(e.dataEndIndex=t.payload.length-1)},setComputedData(e,t){e.computedData=t.payload},setDataStartEndIndexes(e,t){var{startIndex:n,endIndex:r}=t.payload;n!=null&&(e.dataStartIndex=n),r!=null&&(e.dataEndIndex=r)}}}),{setChartData:s1,setDataStartEndIndexes:c1,setComputedData:Cee}=o1.actions,l1=o1.reducer,u1=[`x`,`y`];function d1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function f1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?d1(Object(n),!0).forEach(function(t){p1(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d1(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function p1(e,t,n){return(t=m1(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function m1(e){var t=h1(e,`string`);return typeof t==`symbol`?t:t+``}function h1(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function g1(e,t){if(e==null)return{};var n,r,i=_1(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function _1(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function v1(){var e=Q(RH),t=Q(BH),n=tN(),r=Q(zH),i=Q(MQ),a=$L(),o=qL(),s=Q(e=>e.rootProps.className);(0,v.useEffect)(()=>{if(e==null)return gj;var s=(s,c,l)=>{if(t!==l&&e===s){if(r===`index`){var u;if(o&&c!=null&&(u=c.payload)!=null&&u.coordinate&&c.payload.sourceViewBox){var d=c.payload.coordinate,{x:f,y:p}=d,m=g1(d,u1),{x:h,y:g,width:_,height:v}=c.payload.sourceViewBox,y=f1(f1({},m),{},{x:o.x+(_?(f-h)/_:0)*o.width,y:o.y+(v?(p-g)/v:0)*o.height});n(f1(f1({},c),{},{payload:f1(f1({},c.payload),{},{coordinate:y})}))}else n(c);return}if(i!=null){var b;typeof r==`function`?b=i[r(i,{activeTooltipIndex:c.payload.index==null?void 0:Number(c.payload.index),isTooltipActive:c.payload.active,activeIndex:c.payload.index==null?void 0:Number(c.payload.index),activeLabel:c.payload.label,activeDataKey:c.payload.dataKey,activeCoordinate:c.payload.coordinate})]:r===`value`&&(b=i.find(e=>String(e.value)===c.payload.label));var{coordinate:x}=c.payload;if(b==null||c.payload.active===!1||x==null||o==null){n(RZ({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}var{x:S,y:C}=x,w=Math.min(S,o.x+o.width),T=Math.min(C,o.y+o.height),E={x:a===`horizontal`?b.coordinate:w,y:a===`horizontal`?T:b.coordinate};n(RZ({active:c.payload.active,coordinate:E,dataKey:c.payload.dataKey,index:String(b.index),label:c.payload.label,sourceViewBox:c.payload.sourceViewBox,graphicalItemId:c.payload.graphicalItemId}))}}};return Q$.on($$,s),()=>{Q$.off($$,s)}},[s,n,t,e,r,i,a,o])}function y1(){var e=Q(RH),t=Q(BH),n=tN();(0,v.useEffect)(()=>{if(e==null)return gj;var r=(r,i,a)=>{t!==a&&e===r&&n(c1(i))};return Q$.on(e1,r),()=>{Q$.off(e1,r)}},[n,t,e])}function b1(){var e=tN();(0,v.useEffect)(()=>{e(i1())},[e]),v1(),y1()}function x1(e,t,n,r,i,a){var o=Q(n=>p$(n,e,t)),s=Q(BQ),c=Q(BH),l=Q(RH),u=Q(zH),d=Q(a1)?.active,f=qL();(0,v.useEffect)(()=>{if(!d&&l!=null&&c!=null){var e=RZ({active:a,coordinate:n,dataKey:o,index:i,label:typeof r==`number`?String(r):r,sourceViewBox:f,graphicalItemId:s});Q$.emit($$,l,e,c)}},[d,n,o,s,i,r,c,l,u,a,f])}function S1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function C1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?S1(Object(n),!0).forEach(function(t){w1(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):S1(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function w1(e,t,n){return(t=T1(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function T1(e){var t=E1(e,`string`);return typeof t==`symbol`?t:t+``}function E1(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function D1(e){return e.dataKey}function O1(e,t){return v.isValidElement(e)?v.cloneElement(e,t):typeof e==`function`?v.createElement(e,t):v.createElement(Mz,t)}var k1=[],A1={allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:`ease`,axisId:0,contentStyle:{},cursor:!0,filterNull:!0,includeHidden:!1,isAnimationActive:`auto`,itemSorter:`name`,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:` : `,trigger:`hover`,useTranslate3d:!1,wrapperStyle:{}};function j1(e){var t=Vj(e,A1),{active:n,allowEscapeViewBox:r,animationDuration:i,animationEasing:a,content:o,filterNull:s,isAnimationActive:c,offset:l,payloadUniqBy:u,position:d,reverseDirection:f,useTranslate3d:p,wrapperStyle:m,cursor:h,shared:g,trigger:_,defaultIndex:y,portal:b,axisId:x}=t,S=tN(),C=typeof y==`number`?String(y):y;(0,v.useEffect)(()=>{S(jZ({shared:g,trigger:_,axisId:x,active:n,defaultIndex:C}))},[S,g,_,x,n,C]);var w=qL(),T=Yz(),E=CZ(g),{activeIndex:D,isActive:O}=Q(e=>y$(e,E,_,C))??{},k=Q(e=>v$(e,E,_,C)),A=Q(e=>_$(e,E,_,C)),j=Q(e=>g$(e,E,_,C)),M=k,N=X$(),P=n??O??!1,[ee,F]=jN([M,P]),I=E===`axis`?A:void 0;x1(E,_,j,I,D,P);var te=b??N;if(te==null||w==null||E==null)return null;var L=M??k1;P||(L=k1),s&&L.length&&(L=qM(L.filter(e=>e.value!=null&&(e.hide!==!0||t.includeHidden)),u,D1));var ne=L.length>0,re=C1(C1({},t),{},{payload:L,label:I,active:P,activeIndex:D,coordinate:j,accessibilityLayer:T}),R=v.createElement(Jz,{allowEscapeViewBox:r,animationDuration:i,animationEasing:a,isAnimationActive:c,active:P,coordinate:j,hasPayload:ne,offset:l,position:d,reverseDirection:f,useTranslate3d:p,viewBox:w,wrapperStyle:m,lastBoundingBox:ee,innerRef:F,hasPortalFromProps:!!b},O1(o,re));return v.createElement(v.Fragment,null,(0,zr.createPortal)(R,te),P&&v.createElement(J$,{cursor:h,tooltipEventType:E,coordinate:j,payload:L,index:D}))}var M1=e=>null;M1.displayName=`Cell`;function N1(e,t,n){return(t=P1(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function P1(e){var t=F1(e,`string`);return typeof t==`symbol`?t:t+``}function F1(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var I1=class{constructor(e){N1(this,`cache`,new Map),this.maxSize=e}get(e){var t=this.cache.get(e);return t!==void 0&&(this.cache.delete(e),this.cache.set(e,t)),t}set(e,t){if(this.cache.has(e))this.cache.delete(e);else if(this.cache.size>=this.maxSize){var n=this.cache.keys().next().value;n!=null&&this.cache.delete(n)}this.cache.set(e,t)}clear(){this.cache.clear()}size(){return this.cache.size}};function L1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function R1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?L1(Object(n),!0).forEach(function(t){z1(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):L1(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function z1(e,t,n){return(t=B1(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function B1(e){var t=V1(e,`string`);return typeof t==`symbol`?t:t+``}function V1(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var H1=R1({},{cacheSize:2e3,enableCache:!0}),U1=new I1(H1.cacheSize),W1={position:`absolute`,top:`-20000px`,left:0,padding:0,margin:0,border:`none`,whiteSpace:`pre`},G1=`recharts_measurement_span`;function K1(e,t){return`${e}|${t.fontSize||``}|${t.fontFamily||``}|${t.fontWeight||``}|${t.fontStyle||``}|${t.letterSpacing||``}|${t.textTransform||``}`}var q1=(e,t)=>{try{var n=document.getElementById(G1);n||(n=document.createElement(`span`),n.setAttribute(`id`,G1),n.setAttribute(`aria-hidden`,`true`),document.body.appendChild(n)),Object.assign(n.style,W1,t),n.textContent=`${e}`;var r=n.getBoundingClientRect();return{width:r.width,height:r.height}}catch{return{width:0,height:0}}},J1=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(e==null||zz.isSsr)return{width:0,height:0};if(!H1.enableCache)return q1(e,t);var n=K1(e,t),r=U1.get(n);if(r)return r;var i=q1(e,t);return U1.set(n,i),i},Y1;function X1(e,t,n){return(t=Z1(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Z1(e){var t=Q1(e,`string`);return typeof t==`symbol`?t:t+``}function Q1(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var $1=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,e0=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,t0=/^(px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q)$/,n0=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,r0={cm:96/2.54,mm:96/25.4,pt:96/72,pc:16,in:96,Q:96/101.6,px:1},i0=[`cm`,`mm`,`pt`,`pc`,`in`,`Q`,`px`];function a0(e){return i0.includes(e)}var o0=`NaN`;function s0(e,t){return e*r0[t]}var c0=class e{static parse(t){var[,n,r]=n0.exec(t)??[];return n==null?e.NaN:new e(parseFloat(n),r??``)}constructor(e,t){this.num=e,this.unit=t,this.num=e,this.unit=t,ij(e)&&(this.unit=``),t!==``&&!t0.test(t)&&(this.num=NaN,this.unit=``),a0(t)&&(this.num=s0(e,t),this.unit=`px`)}add(t){return this.unit===t.unit?new e(this.num+t.num,this.unit):new e(NaN,``)}subtract(t){return this.unit===t.unit?new e(this.num-t.num,this.unit):new e(NaN,``)}multiply(t){return this.unit!==``&&t.unit!==``&&this.unit!==t.unit?new e(NaN,``):new e(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==``&&t.unit!==``&&this.unit!==t.unit?new e(NaN,``):new e(this.num/t.num,this.unit||t.unit)}toString(){return`${this.num}${this.unit}`}isNaN(){return ij(this.num)}};Y1=c0,X1(c0,`NaN`,new Y1(NaN,``));function l0(e){if(e==null||e.includes(o0))return o0;for(var t=e;t.includes(`*`)||t.includes(`/`);){var[,n,r,i]=$1.exec(t)??[],a=c0.parse(n??``),o=c0.parse(i??``),s=r===`*`?a.multiply(o):a.divide(o);if(s.isNaN())return o0;t=t.replace($1,s.toString())}for(;t.includes(`+`)||/.-\d+(?:\.\d+)?/.test(t);){var[,c,l,u]=e0.exec(t)??[],d=c0.parse(c??``),f=c0.parse(u??``),p=l===`+`?d.add(f):d.subtract(f);if(p.isNaN())return o0;t=t.replace(e0,p.toString())}return t}var u0=/\(([^()]*)\)/;function d0(e){for(var t=e,n;(n=u0.exec(t))!=null;){var[,r]=n;t=t.replace(u0,l0(r))}return t}function f0(e){var t=e.replace(/\s+/g,``);return t=d0(t),t=l0(t),t}function p0(e){try{return f0(e)}catch{return o0}}function m0(e){var t=p0(e.slice(5,-1));return t===o0?``:t}var h0=[`x`,`y`,`lineHeight`,`capHeight`,`fill`,`scaleToFit`,`textAnchor`,`verticalAnchor`],g0=[`dx`,`dy`,`angle`,`className`,`breakAll`];function _0(){return _0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_0.apply(null,arguments)}function v0(e,t){if(e==null)return{};var n,r,i=y0(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function y0(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var b0=/[ \f\n\r\t\v\u2028\u2029]+/,x0=e=>{var{children:t,breakAll:n,style:r}=e;try{var i=[];return pj(t)||(i=n?t.toString().split(``):t.toString().split(b0)),{wordsWithComputedWidth:i.map(e=>({word:e,width:J1(e,r).width})),spaceWidth:n?0:J1(`\xA0`,r).width}}catch{return null}};function S0(e){return e===`start`||e===`middle`||e===`end`||e===`inherit`}function C0(e){return pj(e)||typeof e==`string`||typeof e==`number`||typeof e==`boolean`}var w0=(e,t,n,r)=>e.reduce((e,i)=>{var{word:a,width:o}=i,s=e[e.length-1];if(s&&o!=null&&(t==null||r||s.width+o+n<Number(t)))s.words.push(a),s.width+=o+n;else{var c={words:[a],width:o};e.push(c)}return e},[]),T0=e=>e.reduce((e,t)=>e.width>t.width?e:t),E0=`…`,D0=(e,t,n,r,i,a,o,s)=>{var c=x0({breakAll:n,style:r,children:e.slice(0,t)+E0});if(!c)return[!1,[]];var l=w0(c.wordsWithComputedWidth,a,o,s);return[l.length>i||T0(l).width>Number(a),l]},O0=(e,t,n,r,i)=>{var{maxLines:a,children:o,style:s,breakAll:c}=e,l=Z(a),u=String(o),d=w0(t,r,n,i);if(!l||i||!(d.length>a||T0(d).width>Number(r)))return d;for(var f=0,p=u.length-1,m=0,h;f<=p&&m<=u.length-1;){var g=Math.floor((f+p)/2),[_,v]=D0(u,g-1,c,s,a,r,n,i),[y]=D0(u,g,c,s,a,r,n,i);if(!_&&!y&&(f=g+1),_&&y&&(p=g-1),!_&&y){h=v;break}m++}return h||d},k0=e=>[{words:pj(e)?[]:e.toString().split(b0),width:void 0}],A0=e=>{var{width:t,scaleToFit:n,children:r,style:i,breakAll:a,maxLines:o}=e;if((t||n)&&!zz.isSsr){var s,c,l=x0({breakAll:a,children:r,style:i});if(l){var{wordsWithComputedWidth:u,spaceWidth:d}=l;s=u,c=d}else return k0(r);return O0({breakAll:a,children:r,maxLines:o,style:i},s,c,t,!!n)}return k0(r)},j0=`#808080`,M0={angle:0,breakAll:!1,capHeight:`0.71em`,fill:j0,lineHeight:`1em`,scaleToFit:!1,textAnchor:`start`,verticalAnchor:`end`,x:0,y:0},N0=(0,v.forwardRef)((e,t)=>{var n=Vj(e,M0),{x:r,y:i,lineHeight:a,capHeight:o,fill:s,scaleToFit:c,textAnchor:l,verticalAnchor:u}=n,d=v0(n,h0),f=(0,v.useMemo)(()=>A0({breakAll:d.breakAll,children:d.children,maxLines:d.maxLines,scaleToFit:c,style:d.style,width:d.width}),[d.breakAll,d.children,d.maxLines,c,d.style,d.width]),{dx:p,dy:m,angle:h,className:g,breakAll:_}=d,y=v0(d,g0);if(!oj(r)||!oj(i)||f.length===0)return null;var b=Number(r)+(Z(p)?p:0),x=Number(i)+(Z(m)?m:0);if(!MI(b)||!MI(x))return null;var S;switch(u){case`start`:S=m0(`calc(${o})`);break;case`middle`:S=m0(`calc(${(f.length-1)/2} * -${a} + (${o} / 2))`);break;default:S=m0(`calc(${f.length-1} * -${a})`)}var C=[],w=f[0];if(c&&w!=null){var T=w.width,{width:E}=d;C.push(`scale(${Z(E)&&Z(T)?E/T:1})`)}return h&&C.push(`rotate(${h}, ${b}, ${x})`),C.length&&(y.transform=C.join(` `)),v.createElement(`text`,_0({},sk(y),{ref:t,x:b,y:x,className:cn(`recharts-text`,g),textAnchor:l,fill:s.includes(`url`)?j0:s}),f.map((e,t)=>{var n=e.words.join(_?``:` `);return v.createElement(`tspan`,{x:b,dy:t===0?S:a,key:`${n}-${t}`},n)}))});N0.displayName=`Text`;function P0(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function F0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?P0(Object(n),!0).forEach(function(t){I0(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):P0(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function I0(e,t,n){return(t=L0(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function L0(e){var t=R0(e,`string`);return typeof t==`symbol`?t:t+``}function R0(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var z0=e=>{var{viewBox:t,position:n,offset:r=0,parentViewBox:i,clamp:a}=e,{x:o,y:s,height:c,upperWidth:l,lowerWidth:u}=KL(t),d=o,f=o+(l-u)/2,p=(d+f)/2,m=(l+u)/2,h=d+l/2,g=c>=0?1:-1,_=g*r,v=g>0?`end`:`start`,y=g>0?`start`:`end`,b=l>=0?1:-1,x=b*r,S=b>0?`end`:`start`,C=b>0?`start`:`end`,w=i;if(n===`top`){var T={x:d+l/2,y:s-_,horizontalAnchor:`middle`,verticalAnchor:v};return a&&w&&(T.height=Math.max(s-w.y,0),T.width=l),T}if(n===`bottom`){var E={x:f+u/2,y:s+c+_,horizontalAnchor:`middle`,verticalAnchor:y};return a&&w&&(E.height=Math.max(w.y+w.height-(s+c),0),E.width=u),E}if(n===`left`){var D={x:p-x,y:s+c/2,horizontalAnchor:S,verticalAnchor:`middle`};return a&&w&&(D.width=Math.max(D.x-w.x,0),D.height=c),D}if(n===`right`){var O={x:p+m+x,y:s+c/2,horizontalAnchor:C,verticalAnchor:`middle`};return a&&w&&(O.width=Math.max(w.x+w.width-O.x,0),O.height=c),O}var k=a&&w?{width:m,height:c}:{};return n===`insideLeft`?F0({x:p+x,y:s+c/2,horizontalAnchor:C,verticalAnchor:`middle`},k):n===`insideRight`?F0({x:p+m-x,y:s+c/2,horizontalAnchor:S,verticalAnchor:`middle`},k):n===`insideTop`?F0({x:d+l/2,y:s+_,horizontalAnchor:`middle`,verticalAnchor:y},k):n===`insideBottom`?F0({x:f+u/2,y:s+c-_,horizontalAnchor:`middle`,verticalAnchor:v},k):n===`insideTopLeft`?F0({x:d+x,y:s+_,horizontalAnchor:C,verticalAnchor:y},k):n===`insideTopRight`?F0({x:d+l-x,y:s+_,horizontalAnchor:S,verticalAnchor:y},k):n===`insideBottomLeft`?F0({x:f+x,y:s+c-_,horizontalAnchor:C,verticalAnchor:v},k):n===`insideBottomRight`?F0({x:f+u-x,y:s+c-_,horizontalAnchor:S,verticalAnchor:v},k):n&&typeof n==`object`&&(Z(n.x)||aj(n.x))&&(Z(n.y)||aj(n.y))?F0({x:o+lj(n.x,m),y:s+lj(n.y,c),horizontalAnchor:`end`,verticalAnchor:`end`},k):F0({x:h,y:s+c/2,horizontalAnchor:`middle`,verticalAnchor:`middle`},k)},B0=[`labelRef`],V0=[`content`];function H0(e,t){if(e==null)return{};var n,r,i=U0(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function U0(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function W0(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function G0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?W0(Object(n),!0).forEach(function(t){K0(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):W0(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function K0(e,t,n){return(t=q0(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function q0(e){var t=J0(e,`string`);return typeof t==`symbol`?t:t+``}function J0(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Y0(){return Y0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Y0.apply(null,arguments)}var X0=(0,v.createContext)(null),Z0=e=>{var{x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:o,children:s}=e,c=(0,v.useMemo)(()=>({x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:o}),[t,n,r,i,a,o]);return v.createElement(X0.Provider,{value:c},s)},Q0=()=>{var e=(0,v.useContext)(X0),t=qL();return e||(t?KL(t):void 0)},$0=(0,v.createContext)(null),e2=()=>{var e=(0,v.useContext)($0),t=Q(sU);return e||t},t2=e=>{var{value:t,formatter:n}=e,r=pj(e.children)?t:e.children;return typeof n==`function`?n(r):r},n2=e=>e!=null&&typeof e==`function`,r2=(e,t)=>rj(t-e)*Math.min(Math.abs(t-e),360),i2=(e,t,n,r,i)=>{var{offset:a,className:o}=e,{cx:s,cy:c,innerRadius:l,outerRadius:u,startAngle:d,endAngle:f,clockWise:p}=i,m=(l+u)/2,h=r2(d,f),g=h>=0?1:-1,_,y;switch(t){case`insideStart`:_=d+g*a,y=p;break;case`insideEnd`:_=f-g*a,y=!p;break;case`end`:_=f+g*a,y=p;break;default:throw Error(`Unsupported position ${t}`)}y=h<=0?y:!y;var b=BV(s,c,m,_),x=BV(s,c,m,_+(y?1:-1)*359),S=`M${b.x},${b.y}
|
|
163
|
-
A${m},${m},0,1,${+!y},
|
|
164
|
-
${x.x},${x.y}`,C=pj(e.id)?cj(`recharts-radial-line-`):e.id;return v.createElement(`text`,Y0({},r,{dominantBaseline:`central`,className:cn(`recharts-radial-bar-label`,o)}),v.createElement(`defs`,null,v.createElement(`path`,{id:C,d:S})),v.createElement(`textPath`,{xlinkHref:`#${C}`},n))},a2=(e,t,n)=>{var{cx:r,cy:i,innerRadius:a,outerRadius:o,startAngle:s,endAngle:c}=e,l=(s+c)/2;if(n===`outside`){var{x:u,y:d}=BV(r,i,o+t,l);return{x:u,y:d,textAnchor:u>=r?`start`:`end`,verticalAnchor:`middle`}}if(n===`center`)return{x:r,y:i,textAnchor:`middle`,verticalAnchor:`middle`};if(n===`centerTop`)return{x:r,y:i,textAnchor:`middle`,verticalAnchor:`start`};if(n===`centerBottom`)return{x:r,y:i,textAnchor:`middle`,verticalAnchor:`end`};var{x:f,y:p}=BV(r,i,(a+o)/2,l);return{x:f,y:p,textAnchor:`middle`,verticalAnchor:`middle`}},o2=e=>e!=null&&`cx`in e&&Z(e.cx),s2={angle:0,offset:5,zIndex:VH.label,position:`middle`,textBreakAll:!1};function c2(e){if(!o2(e))return e;var{cx:t,cy:n,outerRadius:r}=e,i=r*2;return{x:t-r,y:n-r,width:i,upperWidth:i,lowerWidth:i,height:i}}function l2(e){var t=Vj(e,s2),{viewBox:n,parentViewBox:r,position:i,value:a,children:o,content:s,className:c=``,textBreakAll:l,labelRef:u}=t,d=e2(),f=Q0(),p=n==null?i===`center`?f:d??f:o2(n)?n:KL(n),m,h,g=c2(p);if(!p||pj(a)&&pj(o)&&!(0,v.isValidElement)(s)&&typeof s!=`function`)return null;var _=G0(G0({},t),{},{viewBox:p});if((0,v.isValidElement)(s)){var{labelRef:y}=_,b=H0(_,B0);return(0,v.cloneElement)(s,b)}if(typeof s==`function`){var{content:x}=_,S=H0(_,V0);if(m=(0,v.createElement)(s,S),(0,v.isValidElement)(m))return m}else m=t2(t);var C=sk(t);if(o2(p)){if(i===`insideStart`||i===`insideEnd`||i===`end`)return i2(t,i,m,C,p);h=a2(p,t.offset,t.position)}else{if(!g)return null;var w=z0({viewBox:g,position:i,offset:t.offset,parentViewBox:o2(r)?void 0:r,clamp:!0});h=G0(G0({x:w.x,y:w.y,textAnchor:w.horizontalAnchor,verticalAnchor:w.verticalAnchor},w.width===void 0?{}:{width:w.width}),w.height===void 0?{}:{height:w.height})}return v.createElement(z$,{zIndex:t.zIndex},v.createElement(N0,Y0({ref:u,className:cn(`recharts-label`,c)},C,h,{textAnchor:S0(C.textAnchor)?C.textAnchor:h.textAnchor,breakAll:l}),m))}l2.displayName=`Label`;var u2=(e,t,n)=>{if(!e)return null;var r={viewBox:t,labelRef:n};return e===!0?v.createElement(l2,Y0({key:`label-implicit`},r)):oj(e)?v.createElement(l2,Y0({key:`label-implicit`,value:e},r)):(0,v.isValidElement)(e)?e.type===l2?(0,v.cloneElement)(e,G0({key:`label-implicit`},r)):v.createElement(l2,Y0({key:`label-implicit`,content:e},r)):n2(e)?v.createElement(l2,Y0({key:`label-implicit`,content:e},r)):e&&typeof e==`object`?v.createElement(l2,Y0({},e,{key:`label-implicit`},r)):null};function d2(e){var{label:t,labelRef:n}=e;return u2(t,Q0(),n)||null}var f2=[`valueAccessor`],p2=[`dataKey`,`clockWise`,`id`,`textBreakAll`,`zIndex`];function m2(){return m2=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},m2.apply(null,arguments)}function h2(e,t){if(e==null)return{};var n,r,i=g2(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function g2(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var _2=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(C0(t))return t},v2=(0,v.createContext)(void 0),y2=v2.Provider,b2=(0,v.createContext)(void 0);b2.Provider;function x2(){return(0,v.useContext)(v2)}function S2(){return(0,v.useContext)(b2)}function C2(e){var{valueAccessor:t=_2}=e,n=h2(e,f2),{dataKey:r,clockWise:i,id:a,textBreakAll:o,zIndex:s}=n,c=h2(n,p2),l=x2(),u=S2(),d=l||u;return!d||!d.length?null:v.createElement(z$,{zIndex:s??VH.label},v.createElement(_k,{className:`recharts-label-list`},d.map((e,i)=>{var s=pj(r)?t(e,i):zI(e.payload,r),l=pj(a)?{}:{id:`${a}-${i}`};return v.createElement(l2,m2({key:`label-${i}`},sk(e),c,l,{fill:n.fill??e.fill,parentViewBox:e.parentViewBox,value:s,textBreakAll:o,viewBox:e.viewBox,index:i,zIndex:0}))})))}C2.displayName=`LabelList`;function w2(e){var{label:t}=e;return t?t===!0?v.createElement(C2,{key:`labelList-implicit`}):v.isValidElement(t)||n2(t)?v.createElement(C2,{key:`labelList-implicit`,content:t}):typeof t==`object`?v.createElement(C2,m2({key:`labelList-implicit`},t,{type:String(t.type)})):null:null}var T2=LF({name:`polarAxis`,initialState:{radiusAxis:{},angleAxis:{}},reducers:{addRadiusAxis(e,t){e.radiusAxis[t.payload.id]=$R(t.payload)},removeRadiusAxis(e,t){delete e.radiusAxis[t.payload.id]},addAngleAxis(e,t){e.angleAxis[t.payload.id]=$R(t.payload)},removeAngleAxis(e,t){delete e.angleAxis[t.payload.id]}}}),{addRadiusAxis:wee,removeRadiusAxis:Tee,addAngleAxis:Eee,removeAngleAxis:Dee}=T2.actions,E2=T2.reducer;function D2(e){return e&&typeof e==`object`&&`className`in e&&typeof e.className==`string`?e.className:``}var O2=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.suspense_list`),d=Symbol.for(`react.memo`),f=Symbol.for(`react.lazy`),p=Symbol.for(`react.view_transition`);function m(e){if(typeof e==`object`&&e){var m=e.$$typeof;switch(m){case t:switch(e=e.type,e){case r:case a:case i:case l:case u:case p:return e;default:switch(e&&=e.$$typeof,e){case s:case c:case f:case d:return e;case o:return e;default:return m}}case n:return m}}}e.isFragment=function(e){return m(e)===r}})),k2=o(((e,t)=>{t.exports=O2()}))(),A2=e=>typeof e==`string`?e:e?e.displayName||e.name||`Component`:``,j2=null,M2=null,N2=e=>{if(e===j2&&Array.isArray(M2))return M2;var t=[];return v.Children.forEach(e,e=>{pj(e)||((0,k2.isFragment)(e)?t=t.concat(N2(e.props.children)):t.push(e))}),M2=t,j2=e,t};function P2(e,t){var n=[],r=[];return r=Array.isArray(t)?t.map(e=>A2(e)):[A2(t)],N2(e).forEach(e=>{var t=QA(e,`type.displayName`)||QA(e,`type.name`);t&&r.indexOf(t)!==-1&&n.push(e)}),n}function F2(e){if(typeof e!=`object`||!e)return!1;if(Object.getPrototypeOf(e)===null)return!0;if(Object.prototype.toString.call(e)!==`[object Object]`){let t=e[Symbol.toStringTag];return t==null||!Object.getOwnPropertyDescriptor(e,Symbol.toStringTag)?.writable?!1:e.toString()===`[object ${t}]`}let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}var I2,L2,R2,z2,B2;function V2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function H2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?V2(Object(n),!0).forEach(function(t){U2(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):V2(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function U2(e,t,n){return(t=W2(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function W2(e){var t=G2(e,`string`);return typeof t==`symbol`?t:t+``}function G2(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function K2(){return K2=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},K2.apply(null,arguments)}function q2(e,t){return t||=e.slice(0),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var J2=(e,t,n,r,i)=>{var a=n-r,o=nj(I2||=q2([`M `,`,`,``]),e,t);return o+=nj(L2||=q2([`L `,`,`,``]),e+n,t),o+=nj(R2||=q2([`L `,`,`,``]),e+n-a/2,t+i),o+=nj(z2||=q2([`L `,`,`,``]),e+n-a/2-r,t+i),o+=nj(B2||=q2([`L `,`,`,` Z`]),e,t),o},Y2={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:`ease`},X2=e=>{var t=Vj(e,Y2),{x:n,y:r,upperWidth:i,lowerWidth:a,height:o,className:s}=t,{animationEasing:c,animationDuration:l,animationBegin:u,isUpdateAnimationActive:d}=t,f=(0,v.useRef)(null),[p,m]=(0,v.useState)(-1),h=(0,v.useRef)(i),g=(0,v.useRef)(a),_=(0,v.useRef)(o),y=(0,v.useRef)(n),b=(0,v.useRef)(r),x=cV(e,`trapezoid-`);if((0,v.useEffect)(()=>{if(f.current&&f.current.getTotalLength)try{var e=f.current.getTotalLength();e&&m(e)}catch{}},[]),n!==+n||r!==+r||i!==+i||a!==+a||o!==+o||i===0&&a===0||o===0)return null;var S=cn(`recharts-trapezoid`,s);if(!d)return v.createElement(`g`,null,v.createElement(`path`,K2({},sk(t),{className:S,d:J2(n,r,i,a,o)})));var C=h.current,w=g.current,T=_.current,E=y.current,D=b.current,O=`0px ${p===-1?1:p}px`,k=`${p}px ${p}px`,A=kB([`strokeDasharray`],l,c);return v.createElement(sV,{animationId:x,key:x,canBegin:p>0,duration:l,easing:c,isActive:d,begin:u},e=>{var s=dj(C,i,e),c=dj(w,a,e),l=dj(T,o,e),u=dj(E,n,e),d=dj(D,r,e);f.current&&(h.current=s,g.current=c,_.current=l,y.current=u,b.current=d);var p=e>0?{transition:A,strokeDasharray:k}:{strokeDasharray:O};return v.createElement(`path`,K2({},sk(t),{className:S,d:J2(u,d,s,c,l),ref:f,style:H2(H2({},p),t.style)}))})},Z2=[`option`,`shapeType`,`activeClassName`,`inActiveClassName`];function Q2(e,t){if(e==null)return{};var n,r,i=$2(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function $2(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function e4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function t4(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?e4(Object(n),!0).forEach(function(t){n4(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):e4(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function n4(e,t,n){return(t=r4(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r4(e){var t=i4(e,`string`);return typeof t==`symbol`?t:t+``}function i4(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function a4(e,t){return t4(t4({},t),e)}function o4(e,t){return e===`symbols`}function s4(e){var{shapeType:t,elementProps:n}=e;switch(t){case`rectangle`:return v.createElement(MV,n);case`trapezoid`:return v.createElement(X2,n);case`sector`:return v.createElement(cH,n);case`symbols`:if(o4(t,n))return v.createElement(jj,n);break;case`curve`:return v.createElement(uB,n);default:return null}}function c4(e){return(0,v.isValidElement)(e)?e.props:e}function l4(e){var{option:t,shapeType:n,activeClassName:r=`recharts-active-shape`,inActiveClassName:i=`recharts-shape`}=e,a=Q2(e,Z2),o;if((0,v.isValidElement)(t))o=(0,v.cloneElement)(t,t4(t4({},a),c4(t)));else if(typeof t==`function`)o=t(a,a.index);else if(F2(t)&&typeof t!=`boolean`){var s=a4(t,a);o=v.createElement(s4,{shapeType:n,elementProps:s})}else{var c=a;o=v.createElement(s4,{shapeType:n,elementProps:c})}return a.isActive?v.createElement(_k,{className:r},o):v.createElement(_k,{className:i},o)}var u4=(e,t,n)=>{var r=tN();return(i,a)=>o=>{e?.(i,a,o),r(MZ({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}},d4=e=>{var t=tN();return(n,r)=>i=>{e?.(n,r,i),t(NZ())}},f4=(e,t,n)=>{var r=tN();return(i,a)=>o=>{e?.(i,a,o),r(FZ({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}};function p4(e){var{tooltipEntrySettings:t}=e,n=tN(),r=yL(),i=(0,v.useRef)(null);return(0,v.useLayoutEffect)(()=>{r||(i.current===null?n(OZ(t)):i.current!==t&&n(kZ({prev:i.current,next:t})),i.current=t)},[t,n,r]),(0,v.useLayoutEffect)(()=>()=>{i.current&&=(n(AZ(i.current)),null)},[n]),null}function m4(e){var{legendPayload:t}=e,n=tN(),r=yL(),i=(0,v.useRef)(null);return(0,v.useLayoutEffect)(()=>{r||(i.current===null?n(tz(t)):i.current!==t&&n(nz({prev:i.current,next:t})),i.current=t)},[n,r,t]),(0,v.useLayoutEffect)(()=>()=>{i.current&&=(n(rz(i.current)),null)},[n]),null}var h4=v.useId??(()=>{var[e]=v.useState(()=>cj(`uid-`));return e});function g4(e,t){var n=h4();return t||(e?`${e}-${n}`:n)}var _4=(0,v.createContext)(void 0),v4=e=>{var{id:t,type:n,children:r}=e,i=g4(`recharts-${n}`,t);return v.createElement(_4.Provider,{value:i},r(i))},y4=LF({name:`graphicalItems`,initialState:{cartesianItems:[],polarItems:[]},reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push($R(t.payload))},prepare:SF()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=cF(e).cartesianItems.indexOf($R(n));i>-1&&(e.cartesianItems[i]=$R(r))},prepare:SF()},removeCartesianGraphicalItem:{reducer(e,t){var n=cF(e).cartesianItems.indexOf($R(t.payload));n>-1&&e.cartesianItems.splice(n,1)},prepare:SF()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push($R(t.payload))},prepare:SF()},removePolarGraphicalItem:{reducer(e,t){var n=cF(e).polarItems.indexOf($R(t.payload));n>-1&&e.polarItems.splice(n,1)},prepare:SF()},replacePolarGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=cF(e).polarItems.indexOf($R(n));i>-1&&(e.polarItems[i]=$R(r))},prepare:SF()}}}),{addCartesianGraphicalItem:b4,replaceCartesianGraphicalItem:x4,removeCartesianGraphicalItem:S4,addPolarGraphicalItem:Oee,removePolarGraphicalItem:kee,replacePolarGraphicalItem:Aee}=y4.actions,C4=y4.reducer,w4=(0,v.memo)(e=>{var t=tN(),n=(0,v.useRef)(null);return(0,v.useLayoutEffect)(()=>{n.current===null?t(b4(e)):n.current!==e&&t(x4({prev:n.current,next:e})),n.current=e},[t,e]),(0,v.useLayoutEffect)(()=>()=>{n.current&&=(t(S4(n.current)),null)},[t]),null});function T4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function E4(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?T4(Object(n),!0).forEach(function(t){D4(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):T4(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function D4(e,t,n){return(t=O4(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function O4(e){var t=k4(e,`string`);return typeof t==`symbol`?t:t+``}function k4(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var A4=LF({name:`cartesianAxis`,initialState:{xAxis:{},yAxis:{},zAxis:{}},reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=$R(t.payload)},prepare:SF()},replaceXAxis:{reducer(e,t){var{prev:n,next:r}=t.payload;e.xAxis[n.id]!==void 0&&(n.id!==r.id&&delete e.xAxis[n.id],e.xAxis[r.id]=$R(r))},prepare:SF()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:SF()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=$R(t.payload)},prepare:SF()},replaceYAxis:{reducer(e,t){var{prev:n,next:r}=t.payload;e.yAxis[n.id]!==void 0&&(n.id!==r.id&&delete e.yAxis[n.id],e.yAxis[r.id]=$R(r))},prepare:SF()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:SF()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=$R(t.payload)},prepare:SF()},replaceZAxis:{reducer(e,t){var{prev:n,next:r}=t.payload;e.zAxis[n.id]!==void 0&&(n.id!==r.id&&delete e.zAxis[n.id],e.zAxis[r.id]=$R(r))},prepare:SF()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:SF()},updateYAxisWidth(e,t){var{id:n,width:r}=t.payload,i=e.yAxis[n];if(i){var a=i.widthHistory||[];if(a.length===3&&a[0]===a[2]&&r===a[1]&&r!==i.width&&Math.abs(r-(a[0]??0))<=1)return;var o=[...a,r].slice(-3);e.yAxis[n]=E4(E4({},i),{},{width:r,widthHistory:o})}}}}),{addXAxis:j4,replaceXAxis:M4,removeXAxis:N4,addYAxis:P4,replaceYAxis:F4,removeYAxis:I4,addZAxis:jee,replaceZAxis:Mee,removeZAxis:Nee,updateYAxisWidth:L4}=A4.actions,R4=A4.reducer,z4=$([$([hL],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),iL,aL],(e,t,n)=>{if(!(!e||t==null||n==null))return{x:e.left,y:e.top,width:Math.max(0,t-e.left-e.right),height:Math.max(0,n-e.top-e.bottom)}}),B4=()=>Q(z4),V4=(e,t,n)=>{var r=n??e;if(!pj(r))return lj(r,t,0)},H4=(e,t,n)=>{var r={},i=e.filter(fU),a=e.filter(e=>e.stackId==null),o=i.reduce((e,t)=>{var n=e[t.stackId];return n??=[],n.push(t),e[t.stackId]=n,e},r),s=Object.entries(o).map(e=>{var[r,i]=e;return{stackId:r,dataKeys:i.map(e=>e.dataKey),barSize:V4(t,n,i[0]?.barSize)}}),c=a.map(e=>({stackId:void 0,dataKeys:[e.dataKey].filter(e=>e!=null),barSize:V4(t,n,e.barSize)}));return[...s,...c]};function U4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function W4(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?U4(Object(n),!0).forEach(function(t){G4(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):U4(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function G4(e,t,n){return(t=K4(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function K4(e){var t=q4(e,`string`);return typeof t==`symbol`?t:t+``}function q4(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function J4(e,t,n,r,i){var a=r.length;if(!(a<1)){var o=lj(e,n,0,!0),s,c=[];if(MI(r[0]?.barSize)){var l=!1,u=n/a,d=r.reduce((e,t)=>e+(t.barSize||0),0);d+=(a-1)*o,d>=n&&(d-=(a-1)*o,o=0),d>=n&&u>0&&(l=!0,u*=.9,d=a*u);var f={offset:((n-d)/2>>0)-o,size:0};s=r.reduce((e,t)=>{var n={stackId:t.stackId,dataKeys:t.dataKeys,position:{offset:f.offset+f.size+o,size:l?u:t.barSize??0}},r=[...e,n];return f=n.position,r},c)}else{var p=lj(t,n,0,!0);n-2*p-(a-1)*o<=0&&(o=0);var m=(n-2*p-(a-1)*o)/a;m>1&&(m>>=0);var h=MI(i)?Math.min(m,i):m;s=r.reduce((e,t,n)=>[...e,{stackId:t.stackId,dataKeys:t.dataKeys,position:{offset:p+(m+o)*n+(m-h)/2,size:h}}],c)}return s}}var Y4=(e,t,n,r,i,a,o)=>{var s=pj(o)?t:o,c=J4(n,r,i===a?a:i,e,s);return i!==a&&c!=null&&(c=c.map(e=>W4(W4({},e),{},{position:W4(W4({},e.position),{},{offset:e.position.offset-i/2})}))),c},X4=(e,t)=>{var n=uU(t);if(!(!e||n==null||t==null)){var{stackId:r}=t;if(r!=null){var i=e[r];if(i){var{stackedData:a}=i;if(a)return a.find(e=>e.key===n)}}}},Z4=(e,t)=>{if(e!=null&&t!=null){var n=e.find(e=>e.stackId===t.stackId&&t.dataKey!=null&&e.dataKeys.includes(t.dataKey));if(n!=null)return n.position}};function Q4(e,t){return e&&typeof e==`object`&&`zIndex`in e&&typeof e.zIndex==`number`&&MI(e.zIndex)?e.zIndex:t}var $4=e=>{var{chartData:t}=e,n=tN(),r=yL();return(0,v.useEffect)(()=>r?()=>{}:(n(s1(t)),()=>{n(s1(void 0))}),[t,n,r]),null},e3={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},t3=LF({name:`brush`,initialState:e3,reducers:{setBrushSettings(e,t){return t.payload==null?e3:t.payload}}}),{setBrushSettings:Pee}=t3.actions,n3=t3.reducer;function r3(e){return(e%180+180)%180}var i3=function(e){var{width:t,height:n}=e,r=r3(arguments.length>1&&arguments[1]!==void 0?arguments[1]:0)*Math.PI/180,i=Math.atan(n/t),a=r>i&&r<Math.PI-i?n/Math.sin(r):t/Math.cos(r);return Math.abs(a)},a3=LF({name:`referenceElements`,initialState:{dots:[],areas:[],lines:[]},reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=cF(e).dots.findIndex(e=>e===t.payload);n!==-1&&e.dots.splice(n,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var n=cF(e).areas.findIndex(e=>e===t.payload);n!==-1&&e.areas.splice(n,1)},addLine:(e,t)=>{e.lines.push($R(t.payload))},removeLine:(e,t)=>{var n=cF(e).lines.findIndex(e=>e===t.payload);n!==-1&&e.lines.splice(n,1)}}}),{addDot:Fee,removeDot:Iee,addArea:Lee,removeArea:Ree,addLine:zee,removeLine:Bee}=a3.actions,o3=a3.reducer,s3=(0,v.createContext)(void 0),c3=e=>{var{children:t}=e,[n]=(0,v.useState)(`${cj(`recharts`)}-clip`),r=B4();if(r==null)return null;var{x:i,y:a,width:o,height:s}=r;return v.createElement(s3.Provider,{value:n},v.createElement(`defs`,null,v.createElement(`clipPath`,{id:n},v.createElement(`rect`,{x:i,y:a,height:s,width:o}))),t)};function l3(e,t){if(t<1)return[];if(t===1)return e;for(var n=[],r=0;r<e.length;r+=t){var i=e[r];i!==void 0&&n.push(i)}return n}function u3(e,t,n){return i3({width:e.width+t.width,height:e.height+t.height},n)}function d3(e,t,n){var r=n===`width`,{x:i,y:a,width:o,height:s}=e;return t===1?{start:r?i:a,end:r?i+o:a+s}:{start:r?i+o:a+s,end:r?i:a}}function f3(e,t,n,r,i){if(e*t<e*r||e*t>e*i)return!1;var a=n();return e*(t-e*a/2-r)>=0&&e*(t+e*a/2-i)<=0}function p3(e,t){return l3(e,t+1)}function m3(e,t,n,r,i){for(var a=(r||[]).slice(),{start:o,end:s}=t,c=0,l=1,u=o,d=function(){var t=r?.[c];if(t===void 0)return{v:l3(r,l)};var a=c,d,f=()=>(d===void 0&&(d=n(t,a)),d),p=t.coordinate,m=c===0||f3(e,p,f,u,s);m||(c=0,u=o,l+=1),m&&(u=p+e*(f()/2+i),c+=l)},f;l<=a.length;)if(f=d(),f)return f.v;return[]}function h3(e,t,n,r,i){var a=(r||[]).slice().length;if(a===0)return[];for(var{start:o,end:s}=t,c=1;c<=a;c++){for(var l=(a-1)%c,u=o,d=!0,f=function(){var t=r[m];if(t==null)return 0;var a=m,o,c=()=>(o===void 0&&(o=n(t,a)),o),f=t.coordinate,p=m===l||f3(e,f,c,u,s);if(!p)return d=!1,1;p&&(u=f+e*(c()/2+i))},p,m=l;m<a&&(p=f(),p===0||p!==1);m+=c);if(d){for(var h=[],g=l;g<a;g+=c){var _=r[g];_!=null&&h.push(_)}return h}}return[]}function g3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _3(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?g3(Object(n),!0).forEach(function(t){v3(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g3(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function v3(e,t,n){return(t=y3(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y3(e){var t=b3(e,`string`);return typeof t==`symbol`?t:t+``}function b3(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function x3(e,t,n,r,i){for(var a=(r||[]).slice(),o=a.length,{start:s}=t,{end:c}=t,l=function(t){var r=a[t];if(r==null)return 1;var l=r,u,d=()=>(u===void 0&&(u=n(r,t)),u);if(t===o-1){var f=e*(l.coordinate+e*d()/2-c);a[t]=l=_3(_3({},l),{},{tickCoord:f>0?l.coordinate-f*e:l.coordinate})}else a[t]=l=_3(_3({},l),{},{tickCoord:l.coordinate});l.tickCoord!=null&&f3(e,l.tickCoord,d,s,c)&&(c=l.tickCoord-e*(d()/2+i),a[t]=_3(_3({},l),{},{isShow:!0}))},u=o-1;u>=0;u--)if(l(u))continue;return a}function S3(e,t,n,r,i,a){var o=(r||[]).slice(),s=o.length,{start:c,end:l}=t;if(a){var u=r[s-1];if(u!=null){var d=n(u,s-1),f=e*(u.coordinate+e*d/2-l);o[s-1]=u=_3(_3({},u),{},{tickCoord:f>0?u.coordinate-f*e:u.coordinate}),u.tickCoord!=null&&f3(e,u.tickCoord,()=>d,c,l)&&(l=u.tickCoord-e*(d/2+i),o[s-1]=_3(_3({},u),{},{isShow:!0}))}}for(var p=a?s-1:s,m=function(t){var r=o[t];if(r==null)return 1;var a=r,s,u=()=>(s===void 0&&(s=n(r,t)),s);if(t===0){var d=e*(a.coordinate-e*u()/2-c);o[t]=a=_3(_3({},a),{},{tickCoord:d<0?a.coordinate-d*e:a.coordinate})}else o[t]=a=_3(_3({},a),{},{tickCoord:a.coordinate});a.tickCoord!=null&&f3(e,a.tickCoord,u,c,l)&&(c=a.tickCoord+e*(u()/2+i),o[t]=_3(_3({},a),{},{isShow:!0}))},h=0;h<p;h++)if(m(h))continue;return o}function C3(e,t,n){var{tick:r,ticks:i,viewBox:a,minTickGap:o,orientation:s,interval:c,tickFormatter:l,unit:u,angle:d}=e;if(!i||!i.length||!r)return[];if(Z(c)||zz.isSsr)return p3(i,Z(c)?c:0)??[];var f=[],p=s===`top`||s===`bottom`?`width`:`height`,m=u&&p===`width`?J1(u,{fontSize:t,letterSpacing:n}):{width:0,height:0},h=(e,r)=>{var i=typeof l==`function`?l(e.value,r):e.value;return p===`width`?u3(J1(i,{fontSize:t,letterSpacing:n}),m,d):J1(i,{fontSize:t,letterSpacing:n})[p]},g=i[0],_=i[1],v=i.length>=2&&g!=null&&_!=null?rj(_.coordinate-g.coordinate):1,y=d3(a,v,p);return c===`equidistantPreserveStart`?m3(v,y,h,i,o):c===`equidistantPreserveEnd`?h3(v,y,h,i,o):(f=c===`preserveStart`||c===`preserveStartEnd`?S3(v,y,h,i,o,c===`preserveStartEnd`):x3(v,y,h,i,o),f.filter(e=>e.isShow))}var w3=e=>{var{ticks:t,label:n,labelGapWithTick:r=5,tickSize:i=0,tickMargin:a=0}=e,o=0;if(t){Array.from(t).forEach(e=>{if(e){var t=e.getBoundingClientRect();t.width>o&&(o=t.width)}});var s=n?n.getBoundingClientRect().width:0,c=i+a,l=o+c+s+(n?r:0);return Math.round(l)}return 0},T3=LF({name:`renderedTicks`,initialState:{xAxis:{},yAxis:{}},reducers:{setRenderedTicks:(e,t)=>{var{axisType:n,axisId:r,ticks:i}=t.payload;e[n][r]=$R(i)},removeRenderedTicks:(e,t)=>{var{axisType:n,axisId:r}=t.payload;delete e[n][r]}}}),{setRenderedTicks:E3,removeRenderedTicks:D3}=T3.actions,O3=T3.reducer,k3=[`axisLine`,`width`,`height`,`className`,`hide`,`ticks`,`axisType`,`axisId`];function A3(e,t){if(e==null)return{};var n,r,i=j3(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function j3(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function M3(){return M3=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},M3.apply(null,arguments)}function N3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function P3(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?N3(Object(n),!0).forEach(function(t){F3(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N3(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function F3(e,t,n){return(t=I3(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function I3(e){var t=L3(e,`string`);return typeof t==`symbol`?t:t+``}function L3(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var R3={x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:`bottom`,ticks:[],stroke:`#666`,tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:`preserveEnd`,zIndex:VH.axis};function z3(e){var{x:t,y:n,width:r,height:i,orientation:a,mirror:o,axisLine:s,otherSvgProps:c}=e;if(!s)return null;var l=P3(P3(P3({},c),ak(s)),{},{fill:`none`});if(a===`top`||a===`bottom`){var u=+(a===`top`&&!o||a===`bottom`&&o);l=P3(P3({},l),{},{x1:t,y1:n+u*i,x2:t+r,y2:n+u*i})}else{var d=+(a===`left`&&!o||a===`right`&&o);l=P3(P3({},l),{},{x1:t+d*r,y1:n,x2:t+d*r,y2:n+i})}return v.createElement(`line`,M3({},l,{className:cn(`recharts-cartesian-axis-line`,QA(s,`className`))}))}function B3(e,t,n,r,i,a,o,s,c){var l,u,d,f,p,m,h=s?-1:1,g=e.tickSize||o,_=Z(e.tickCoord)?e.tickCoord:e.coordinate;switch(a){case`top`:l=u=e.coordinate,f=n+ +!s*i,d=f-h*g,m=d-h*c,p=_;break;case`left`:d=f=e.coordinate,u=t+ +!s*r,l=u-h*g,p=l-h*c,m=_;break;case`right`:d=f=e.coordinate,u=t+ +s*r,l=u+h*g,p=l+h*c,m=_;break;default:l=u=e.coordinate,f=n+ +s*i,d=f+h*g,m=d+h*c,p=_}return{line:{x1:l,y1:d,x2:u,y2:f},tick:{x:p,y:m}}}function V3(e,t){switch(e){case`left`:return t?`start`:`end`;case`right`:return t?`end`:`start`;default:return`middle`}}function H3(e,t){switch(e){case`left`:case`right`:return`middle`;case`top`:return t?`start`:`end`;default:return t?`end`:`start`}}function U3(e){var{option:t,tickProps:n,value:r}=e,i,a=cn(n.className,`recharts-cartesian-axis-tick-value`);if(v.isValidElement(t))i=v.cloneElement(t,P3(P3({},n),{},{className:a}));else if(typeof t==`function`)i=t(P3(P3({},n),{},{className:a}));else{var o=`recharts-cartesian-axis-tick-value`;typeof t!=`boolean`&&(o=cn(o,D2(t))),i=v.createElement(N0,M3({},n,{className:o}),r)}return i}function W3(e){var{ticks:t,axisType:n,axisId:r}=e,i=tN();return(0,v.useEffect)(()=>r==null||n==null?gj:(i(E3({ticks:t.map(e=>({value:e.value,coordinate:e.coordinate,offset:e.offset,index:e.index})),axisId:r,axisType:n})),()=>{i(D3({axisId:r,axisType:n}))}),[i,t,r,n]),null}var G3=(0,v.forwardRef)((e,t)=>{var{ticks:n=[],tick:r,tickLine:i,stroke:a,tickFormatter:o,unit:s,padding:c,tickTextProps:l,orientation:u,mirror:d,x:f,y:p,width:m,height:h,tickSize:g,tickMargin:_,fontSize:y,letterSpacing:b,getTicksConfig:x,events:S,axisType:C,axisId:w}=e,T=C3(P3(P3({},x),{},{ticks:n}),y,b),E=ak(x),D=ok(r),O=S0(E.textAnchor)?E.textAnchor:V3(u,d),k=H3(u,d),A={};typeof i==`object`&&(A=i);var j=P3(P3({},E),{},{fill:`none`},A),M=T.map(e=>P3({entry:e},B3(e,f,p,m,h,u,g,d,_))),N=M.map(e=>{var{entry:t,line:n}=e;return v.createElement(_k,{className:`recharts-cartesian-axis-tick`,key:`tick-${t.value}-${t.coordinate}-${t.tickCoord}`},i&&v.createElement(`line`,M3({},j,n,{className:cn(`recharts-cartesian-axis-tick-line`,QA(i,`className`))})))}),P=M.map((e,t)=>{var{entry:n,tick:i}=e,u=P3(P3({},P3(P3(P3(P3({verticalAnchor:k},E),{},{textAnchor:O,stroke:`none`,fill:a},i),{},{index:t,payload:n,visibleTicksCount:T.length,tickFormatter:o,padding:c},l),{},{angle:l?.angle??E.angle??0})),D);return v.createElement(_k,M3({className:`recharts-cartesian-axis-tick-label`,key:`tick-label-${n.value}-${n.coordinate}-${n.tickCoord}`},Fj(S,n,t)),r&&v.createElement(U3,{option:r,tickProps:u,value:`${typeof o==`function`?o(n.value,t):n.value}${s||``}`}))});return v.createElement(`g`,{className:`recharts-cartesian-axis-ticks recharts-${C}-ticks`},v.createElement(W3,{ticks:T,axisId:w,axisType:C}),P.length>0&&v.createElement(z$,{zIndex:VH.label},v.createElement(`g`,{className:`recharts-cartesian-axis-tick-labels recharts-${C}-tick-labels`,ref:t},P)),N.length>0&&v.createElement(`g`,{className:`recharts-cartesian-axis-tick-lines recharts-${C}-tick-lines`},N))}),K3=(0,v.forwardRef)((e,t)=>{var{axisLine:n,width:r,height:i,className:a,hide:o,ticks:s,axisType:c,axisId:l}=e,u=A3(e,k3),[d,f]=(0,v.useState)(``),[p,m]=(0,v.useState)(``),h=(0,v.useRef)(null);(0,v.useImperativeHandle)(t,()=>({getCalculatedWidth:()=>w3({ticks:h.current,label:e.labelRef?.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}));var g=(0,v.useCallback)(e=>{if(e){var t=e.getElementsByClassName(`recharts-cartesian-axis-tick-value`);h.current=t;var n=t[0];if(n){var r=window.getComputedStyle(n),i=r.fontSize,a=r.letterSpacing;(i!==d||a!==p)&&(f(i),m(a))}}},[d,p]);return o||r!=null&&r<=0||i!=null&&i<=0?null:v.createElement(z$,{zIndex:e.zIndex},v.createElement(_k,{className:cn(`recharts-cartesian-axis`,a)},v.createElement(z3,{x:e.x,y:e.y,width:r,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:ak(e)}),v.createElement(G3,{ref:g,axisType:c,events:u,fontSize:d,getTicksConfig:e,height:e.height,letterSpacing:p,mirror:e.mirror,orientation:e.orientation,padding:e.padding,stroke:e.stroke,tick:e.tick,tickFormatter:e.tickFormatter,tickLine:e.tickLine,tickMargin:e.tickMargin,tickSize:e.tickSize,tickTextProps:e.tickTextProps,ticks:s,unit:e.unit,width:e.width,x:e.x,y:e.y,axisId:l}),v.createElement(Z0,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},v.createElement(d2,{label:e.label,labelRef:e.labelRef}),e.children)))}),q3=v.forwardRef((e,t)=>{var n=Vj(e,R3);return v.createElement(K3,M3({},n,{ref:t}))});q3.displayName=`CartesianAxis`;var J3=[`x1`,`y1`,`x2`,`y2`,`key`],Y3=[`offset`],X3=[`xAxisId`,`yAxisId`],Z3=[`xAxisId`,`yAxisId`];function Q3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function $3(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Q3(Object(n),!0).forEach(function(t){e6(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Q3(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function e6(e,t,n){return(t=t6(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function t6(e){var t=n6(e,`string`);return typeof t==`symbol`?t:t+``}function n6(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function r6(){return r6=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},r6.apply(null,arguments)}function i6(e,t){if(e==null)return{};var n,r,i=a6(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function a6(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var o6=e=>{var{fill:t}=e;if(!t||t===`none`)return null;var{fillOpacity:n,x:r,y:i,width:a,height:o,ry:s}=e;return v.createElement(`rect`,{x:r,y:i,ry:s,width:a,height:o,stroke:`none`,fill:t,fillOpacity:n,className:`recharts-cartesian-grid-bg`})};function s6(e){var{option:t,lineItemProps:n}=e,r;if(v.isValidElement(t))r=v.cloneElement(t,n);else if(typeof t==`function`)r=t(n);else{var{x1:i,y1:a,x2:o,y2:s,key:c}=n,l=ak(i6(n,J3))??{},{offset:u}=l,d=i6(l,Y3);r=v.createElement(`line`,r6({},d,{x1:i,y1:a,x2:o,y2:s,fill:`none`,key:c}))}return r}function c6(e){var{x:t,width:n,horizontal:r=!0,horizontalPoints:i}=e;if(!r||!i||!i.length)return null;var{xAxisId:a,yAxisId:o}=e,s=i6(e,X3),c=i.map((e,i)=>{var a=$3($3({},s),{},{x1:t,y1:e,x2:t+n,y2:e,key:`line-${i}`,index:i});return v.createElement(s6,{key:`line-${i}`,option:r,lineItemProps:a})});return v.createElement(`g`,{className:`recharts-cartesian-grid-horizontal`},c)}function l6(e){var{y:t,height:n,vertical:r=!0,verticalPoints:i}=e;if(!r||!i||!i.length)return null;var{xAxisId:a,yAxisId:o}=e,s=i6(e,Z3),c=i.map((e,i)=>{var a=$3($3({},s),{},{x1:e,y1:t,x2:e,y2:t+n,key:`line-${i}`,index:i});return v.createElement(s6,{option:r,lineItemProps:a,key:`line-${i}`})});return v.createElement(`g`,{className:`recharts-cartesian-grid-vertical`},c)}function u6(e){var{horizontalFill:t,fillOpacity:n,x:r,y:i,width:a,height:o,horizontalPoints:s,horizontal:c=!0}=e;if(!c||!t||!t.length||s==null)return null;var l=s.map(e=>Math.round(e+i-i)).sort((e,t)=>e-t);i!==l[0]&&l.unshift(0);var u=l.map((e,s)=>{var c=l[s+1],u=c==null?i+o-e:c-e;if(u<=0)return null;var d=s%t.length;return v.createElement(`rect`,{key:`react-${s}`,y:e,x:r,height:u,width:a,stroke:`none`,fill:t[d],fillOpacity:n,className:`recharts-cartesian-grid-bg`})});return v.createElement(`g`,{className:`recharts-cartesian-gridstripes-horizontal`},u)}function d6(e){var{vertical:t=!0,verticalFill:n,fillOpacity:r,x:i,y:a,width:o,height:s,verticalPoints:c}=e;if(!t||!n||!n.length)return null;var l=c.map(e=>Math.round(e+i-i)).sort((e,t)=>e-t);i!==l[0]&&l.unshift(0);var u=l.map((e,t)=>{var c=l[t+1],u=c==null?i+o-e:c-e;if(u<=0)return null;var d=t%n.length;return v.createElement(`rect`,{key:`react-${t}`,x:e,y:a,width:u,height:s,stroke:`none`,fill:n[d],fillOpacity:r,className:`recharts-cartesian-grid-bg`})});return v.createElement(`g`,{className:`recharts-cartesian-gridstripes-vertical`},u)}var f6=(e,t)=>{var{xAxis:n,width:r,height:i,offset:a}=e;return HI(C3($3($3($3({},R3),n),{},{ticks:UI(n,!0),viewBox:{x:0,y:0,width:r,height:i}})),a.left,a.left+a.width,t)},p6=(e,t)=>{var{yAxis:n,width:r,height:i,offset:a}=e;return HI(C3($3($3($3({},R3),n),{},{ticks:UI(n,!0),viewBox:{x:0,y:0,width:r,height:i}})),a.top,a.top+a.height,t)},m6={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:`#ccc`,fill:`none`,verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:VH.grid};function h6(e){var t=XL(),n=ZL(),r=YL(),i=$3($3({},Vj(e,m6)),{},{x:Z(e.x)?e.x:r.left,y:Z(e.y)?e.y:r.top,width:Z(e.width)?e.width:r.width,height:Z(e.height)?e.height:r.height}),{xAxisId:a,yAxisId:o,x:s,y:c,width:l,height:u,syncWithTicks:d,horizontalValues:f,verticalValues:p}=i,m=yL(),h=Q(e=>mZ(e,`xAxis`,a,m)),g=Q(e=>mZ(e,`yAxis`,o,m));if(!NI(l)||!NI(u)||!Z(s)||!Z(c))return null;var _=i.verticalCoordinatesGenerator||f6,y=i.horizontalCoordinatesGenerator||p6,{horizontalPoints:b,verticalPoints:x}=i;if((!b||!b.length)&&typeof y==`function`){var S=f&&f.length,C=y({yAxis:g?$3($3({},g),{},{ticks:S?f:g.ticks}):void 0,width:t??l,height:n??u,offset:r},S?!0:d);TL(Array.isArray(C),`horizontalCoordinatesGenerator should return Array but instead it returned [${typeof C}]`),Array.isArray(C)&&(b=C)}if((!x||!x.length)&&typeof _==`function`){var w=p&&p.length,T=_({xAxis:h?$3($3({},h),{},{ticks:w?p:h.ticks}):void 0,width:t??l,height:n??u,offset:r},w?!0:d);TL(Array.isArray(T),`verticalCoordinatesGenerator should return Array but instead it returned [${typeof T}]`),Array.isArray(T)&&(x=T)}return v.createElement(z$,{zIndex:i.zIndex},v.createElement(`g`,{className:`recharts-cartesian-grid`},v.createElement(o6,{fill:i.fill,fillOpacity:i.fillOpacity,x:i.x,y:i.y,width:i.width,height:i.height,ry:i.ry}),v.createElement(u6,r6({},i,{horizontalPoints:b})),v.createElement(d6,r6({},i,{verticalPoints:x})),v.createElement(c6,r6({},i,{offset:r,horizontalPoints:b,xAxis:h,yAxis:g})),v.createElement(l6,r6({},i,{offset:r,verticalPoints:x,xAxis:h,yAxis:g}))))}h6.displayName=`CartesianGrid`;var g6=LF({name:`errorBars`,initialState:{},reducers:{addErrorBar:(e,t)=>{var{itemId:n,errorBar:r}=t.payload;e[n]||(e[n]=[]),e[n].push(r)},replaceErrorBar:(e,t)=>{var{itemId:n,prev:r,next:i}=t.payload;e[n]&&(e[n]=e[n].map(e=>e.dataKey===r.dataKey&&e.direction===r.direction?i:e))},removeErrorBar:(e,t)=>{var{itemId:n,errorBar:r}=t.payload;e[n]&&(e[n]=e[n].filter(e=>e.dataKey!==r.dataKey||e.direction!==r.direction))}}}),{addErrorBar:Vee,replaceErrorBar:Hee,removeErrorBar:Uee}=g6.actions,_6=g6.reducer,v6=[`children`];function y6(e,t){if(e==null)return{};var n,r,i=b6(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function b6(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var x6=(0,v.createContext)({data:[],xAxisId:`xAxis-0`,yAxisId:`yAxis-0`,dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0});function S6(e){var{children:t}=e,n=y6(e,v6);return v.createElement(x6.Provider,{value:n},t)}function C6(e,t){var n=Q(t=>_Y(t,e)),r=Q(e=>bY(e,t)),i=n?.allowDataOverflow??hY.allowDataOverflow,a=r?.allowDataOverflow??vY.allowDataOverflow;return{needClip:i||a,needClipX:i,needClipY:a}}function w6(e){var{xAxisId:t,yAxisId:n,clipPathId:r}=e,i=B4(),{needClipX:a,needClipY:o,needClip:s}=C6(t,n);if(!s||!i)return null;var{x:c,y:l,width:u,height:d}=i;return v.createElement(`clipPath`,{id:`clipPath-${r}`},v.createElement(`rect`,{x:a?c:c-u/2,y:o?l:l-d/2,width:a?u:u*2,height:o?d:d*2}))}function T6(e,t){return e.graphicalItems.cartesianItems.find(e=>e.id===t)?.xAxisId??0}function E6(e,t){return e.graphicalItems.cartesianItems.find(e=>e.id===t)?.yAxisId??0}var D6=`Invariant failed`;function O6(e,t){if(!e)throw Error(D6)}function k6(){return k6=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},k6.apply(null,arguments)}function A6(e){return v.createElement(l4,k6({shapeType:`rectangle`,activeClassName:`recharts-active-bar`,inActiveClassName:`recharts-inactive-bar`},e))}var j6=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return(n,r)=>{if(Z(e))return e;var i=Z(n)||pj(n);return i?e(n,r):(!i&&O6(!1,`minPointSize callback function received a value with type of ${typeof n}. Currently only numbers or null/undefined are supported.`),t)}},M6=(e,t,n)=>n,N6=$([OY,(e,t)=>t],(e,t)=>e.filter(e=>e.type===`bar`).find(e=>e.id===t)),P6=$([N6],e=>e?.maxBarSize),F6=(e,t,n,r)=>r,I6=$([QL,OY,T6,E6,M6],(e,t,n,r,i)=>t.filter(t=>e===`horizontal`?t.xAxisId===n:t.yAxisId===r).filter(e=>e.isPanorama===i).filter(e=>e.hide===!1).filter(e=>e.type===`bar`)),L6=(e,t,n)=>{var r=QL(e),i=T6(e,t),a=E6(e,t);if(i!=null&&a!=null)return r===`horizontal`?QY(e,`yAxis`,a,n):QY(e,`xAxis`,i,n)},R6=$([I6,PH,(e,t)=>{var n=QL(e),r=T6(e,t),i=E6(e,t);if(r!=null&&i!=null)return n===`horizontal`?dZ(e,`xAxis`,r):dZ(e,`yAxis`,i)}],H4),z6=(e,t,n)=>{var r=N6(e,t);if(r==null)return 0;var i=T6(e,t),a=E6(e,t);if(i==null||a==null)return 0;var o=QL(e),s=jH(e),{maxBarSize:c}=r,l=pj(c)?s:c,u,d;return o===`horizontal`?(u=_Z(e,`xAxis`,i,n),d=gZ(e,`xAxis`,i,n)):(u=_Z(e,`yAxis`,a,n),d=gZ(e,`yAxis`,a,n)),tL(u,d,!0)??l??0},B6=(e,t,n)=>{var r=QL(e),i=T6(e,t),a=E6(e,t);if(i!=null&&a!=null){var o,s;return r===`horizontal`?(o=_Z(e,`xAxis`,i,n),s=gZ(e,`xAxis`,i,n)):(o=_Z(e,`yAxis`,a,n),s=gZ(e,`yAxis`,a,n)),tL(o,s)}},V6=$([hL,_L,(e,t,n)=>{var r=T6(e,t);if(r!=null)return _Z(e,`xAxis`,r,n)},(e,t,n)=>{var r=E6(e,t);if(r!=null)return _Z(e,`yAxis`,r,n)},(e,t,n)=>{var r=T6(e,t);if(r!=null)return gZ(e,`xAxis`,r,n)},(e,t,n)=>{var r=E6(e,t);if(r!=null)return gZ(e,`yAxis`,r,n)},$([$([R6,jH,MH,NH,z6,B6,P6],Y4),N6],Z4),QL,gH,B6,$([L6,N6],X4),N6,F6],(e,t,n,r,i,a,o,s,c,l,u,d,f)=>{var{chartData:p,dataStartIndex:m,dataEndIndex:h}=c;if(!(d==null||o==null||t==null||s!==`horizontal`&&s!==`vertical`||n==null||r==null||i==null||a==null||l==null)){var{data:g}=d,_=g!=null&&g.length>0?g:p?.slice(m,h+1);if(_!=null)return C8({layout:s,barSettings:d,pos:o,parentViewBox:t,bandSize:l,xAxis:n,yAxis:r,xAxisTicks:i,yAxisTicks:a,stackedData:u,displayedData:_,offset:e,cells:f,dataStartIndex:m})}}),H6=[`index`];function U6(){return U6=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},U6.apply(null,arguments)}function W6(e,t){if(e==null)return{};var n,r,i=G6(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function G6(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var K6=(0,v.createContext)(void 0),q6=e=>{var t=(0,v.useContext)(K6);if(t!=null)return t.stackId;if(e!=null)return qI(e)},J6=(e,t)=>`recharts-bar-stack-clip-path-${e}-${t}`,Y6=e=>{var t=(0,v.useContext)(K6);if(t!=null){var{stackId:n}=t;return`url(#${J6(n,e)})`}},X6=e=>{var{index:t}=e,n=W6(e,H6),r=Y6(t);return v.createElement(_k,U6({className:`recharts-bar-stack-layer`,clipPath:r},n))},Z6=[`onMouseEnter`,`onMouseLeave`,`onClick`],Q6=[`value`,`background`,`tooltipPosition`],$6=[`id`],e8=[`onMouseEnter`,`onClick`,`onMouseLeave`];function t8(){return t8=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},t8.apply(null,arguments)}function n8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function r8(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?n8(Object(n),!0).forEach(function(t){i8(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):n8(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function i8(e,t,n){return(t=a8(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a8(e){var t=o8(e,`string`);return typeof t==`symbol`?t:t+``}function o8(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function s8(e,t){if(e==null)return{};var n,r,i=c8(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function c8(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var l8=e=>{var{dataKey:t,name:n,fill:r,legendType:i,hide:a}=e;return[{inactive:a,dataKey:t,type:i,color:r,value:rL(n,t),payload:e}]},u8=v.memo(e=>{var{dataKey:t,stroke:n,strokeWidth:r,fill:i,name:a,hide:o,unit:s,tooltipType:c,id:l}=e,u={dataDefinedOnItem:void 0,getPosition:gj,settings:{stroke:n,strokeWidth:r,fill:i,dataKey:t,nameKey:void 0,name:rL(a,t),hide:o,type:c,color:i,unit:s,graphicalItemId:l}};return v.createElement(p4,{tooltipEntrySettings:u})});function d8(e){var t=Q(LQ),{data:n,dataKey:r,background:i,allOtherBarProps:a}=e,{onMouseEnter:o,onMouseLeave:s,onClick:c}=a,l=s8(a,Z6),u=u4(o,r,a.id),d=d4(s),f=f4(c,r,a.id);if(!i||n==null)return null;var p=ok(i);return v.createElement(z$,{zIndex:Q4(i,VH.barBackground)},n.map((e,n)=>{var{value:a,background:o,tooltipPosition:s}=e,c=s8(e,Q6);if(!o)return null;var m=u(e,n),h=d(e,n),g=f(e,n),_=r8(r8(r8(r8(r8({option:i,isActive:String(n)===t},c),{},{fill:`#eee`},o),p),Fj(l,e,n)),{},{onMouseEnter:m,onMouseLeave:h,onClick:g,dataKey:r,index:n,className:`recharts-bar-background-rectangle`});return v.createElement(A6,t8({key:`background-bar-${n}`},_))}))}function f8(e){var{showLabels:t,children:n,rects:r}=e,i=r?.map(e=>{var t={x:e.x,y:e.y,width:e.width,lowerWidth:e.width,upperWidth:e.width,height:e.height};return r8(r8({},t),{},{value:e.value,payload:e.payload,parentViewBox:e.parentViewBox,viewBox:t,fill:e.fill})});return v.createElement(y2,{value:t?i:void 0},n)}function p8(e){var{shape:t,activeBar:n,baseProps:r,entry:i,index:a,dataKey:o}=e,s=Q(LQ),c=Q(zQ),l=n&&String(i.originalDataIndex)===s&&(c==null||o===c),[u,d]=(0,v.useState)(!1),[f,p]=(0,v.useState)(!1);(0,v.useEffect)(()=>{var e;return l?(d(!0),e=requestAnimationFrame(()=>{p(!0)})):p(!1),()=>{cancelAnimationFrame(e)}},[l]);var m=(0,v.useCallback)(()=>{l||d(!1)},[l]),h=l&&f,g=l||u,_=l?n===!0?t:n:t,y=v.createElement(A6,t8({},r,{name:String(r.name)},i,{isActive:h,option:_,index:a,dataKey:o,onTransitionEnd:m}));return g?v.createElement(z$,{zIndex:VH.activeBar},v.createElement(X6,{index:i.originalDataIndex},y)):y}function m8(e){var{shape:t,baseProps:n,entry:r,index:i,dataKey:a}=e;return v.createElement(A6,t8({},n,{name:String(n.name)},r,{isActive:!1,option:t,index:i,dataKey:a}))}function h8(e){var{data:t,props:n}=e,r=ak(n)??{},{id:i}=r,a=s8(r,$6),{shape:o,dataKey:s,activeBar:c}=n,{onMouseEnter:l,onClick:u,onMouseLeave:d}=n,f=s8(n,e8),p=u4(l,s,i),m=d4(d),h=f4(u,s,i);return t?v.createElement(v.Fragment,null,t.map((e,t)=>v.createElement(X6,t8({index:e.originalDataIndex,key:`rectangle-${e?.x}-${e?.y}-${e?.value}-${t}`,className:`recharts-bar-rectangle`},Fj(f,e,t),{onMouseEnter:p(e,t),onMouseLeave:m(e,t),onClick:h(e,t)}),c?v.createElement(p8,{shape:o,activeBar:c,baseProps:a,entry:e,index:t,dataKey:s}):v.createElement(m8,{shape:o,baseProps:a,entry:e,index:t,dataKey:s})))):null}function g8(e){var{props:t,previousRectanglesRef:n}=e,{data:r,layout:i,isAnimationActive:a,animationBegin:o,animationDuration:s,animationEasing:c,onAnimationEnd:l,onAnimationStart:u}=t,d=n.current,f=cV(t,`recharts-bar-`),[p,m]=(0,v.useState)(!1),h=!p,g=(0,v.useCallback)(()=>{typeof l==`function`&&l(),m(!1)},[l]),_=(0,v.useCallback)(()=>{typeof u==`function`&&u(),m(!0)},[u]);return v.createElement(f8,{showLabels:h,rects:r},v.createElement(sV,{animationId:f,begin:o,duration:s,isActive:a,easing:c,onAnimationEnd:g,onAnimationStart:_,key:f},e=>{var a=e===1?r:r?.map((t,n)=>{var r=d&&d[n];if(r)return r8(r8({},t),{},{x:dj(r.x,t.x,e),y:dj(r.y,t.y,e),width:dj(r.width,t.width,e),height:dj(r.height,t.height,e)});if(i===`horizontal`){var a=dj(0,t.height,e),o=dj(t.stackedBarStart,t.y,e);return r8(r8({},t),{},{y:o,height:a})}var s=dj(0,t.width,e),c=dj(t.stackedBarStart,t.x,e);return r8(r8({},t),{},{width:s,x:c})});return e>0&&(n.current=a??null),a==null?null:v.createElement(_k,null,v.createElement(h8,{props:t,data:a}))}),v.createElement(w2,{label:t.label}),t.children)}function _8(e){var t=(0,v.useRef)(null);return v.createElement(g8,{previousRectanglesRef:t,props:e})}var v8=0,y8=(e,t)=>{var n=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:n,errorVal:zI(e,t)}},b8=class extends v.PureComponent{render(){var{hide:e,data:t,dataKey:n,className:r,xAxisId:i,yAxisId:a,needClip:o,background:s,id:c}=this.props;if(e||t==null)return null;var l=cn(`recharts-bar`,r),u=c;return v.createElement(_k,{className:l,id:c},o&&v.createElement(`defs`,null,v.createElement(w6,{clipPathId:u,xAxisId:i,yAxisId:a})),v.createElement(_k,{className:`recharts-bar-rectangles`,clipPath:o?`url(#clipPath-${u})`:void 0},v.createElement(d8,{data:t,dataKey:n,background:s,allOtherBarProps:this.props}),v.createElement(_8,this.props)))}},x8={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:`ease`,background:!1,hide:!1,isAnimationActive:`auto`,label:!1,legendType:`rect`,minPointSize:v8,xAxisId:0,yAxisId:0,zIndex:VH.bar};function S8(e){var{xAxisId:t,yAxisId:n,hide:r,legendType:i,minPointSize:a,activeBar:o,animationBegin:s,animationDuration:c,animationEasing:l,isAnimationActive:u}=e,{needClip:d}=C6(t,n),f=$L(),p=yL(),m=P2(e.children,M1),h=Q(t=>V6(t,e.id,p,m));if(f!==`vertical`&&f!==`horizontal`)return null;var g,_=h?.[0];return g=_==null||_.height==null||_.width==null?0:f===`vertical`?_.height/2:_.width/2,v.createElement(S6,{xAxisId:t,yAxisId:n,data:h,dataPointFormatter:y8,errorBarOffset:g},v.createElement(b8,t8({},e,{layout:f,needClip:d,data:h,xAxisId:t,yAxisId:n,hide:r,legendType:i,minPointSize:a,activeBar:o,animationBegin:s,animationDuration:c,animationEasing:l,isAnimationActive:u})))}function C8(e){var{layout:t,barSettings:{dataKey:n,minPointSize:r,hasCustomShape:i},pos:a,bandSize:o,xAxis:s,yAxis:c,xAxisTicks:l,yAxisTicks:u,stackedData:d,displayedData:f,offset:p,cells:m,parentViewBox:h,dataStartIndex:g}=e,_=t===`horizontal`?c:s,v=d?_.scale.domain():null,y=YI({numericAxis:_}),b=_.scale.map(y);return f.map((e,f)=>{var _,x,S,C,w,T;if(d){var E=d[f+g];if(E==null)return null;_=WI(E,v)}else _=zI(e,n),Array.isArray(_)||(_=[y,_]);var D=j6(r,v8)(_[1],f);if(t===`horizontal`){var O=c.scale.map(_[0]),k=c.scale.map(_[1]);if(O==null||k==null)return null;x=JI({axis:s,ticks:l,bandSize:o,offset:a.offset,entry:e,index:f}),S=k??O??void 0,C=a.size;var A=O-k;if(w=ij(A)?0:A,T={x,y:p.top,width:C,height:p.height},Math.abs(D)>0&&Math.abs(w)<Math.abs(D)){var j=rj(w||D)*(Math.abs(D)-Math.abs(w));S-=j,w+=j}}else{var M=s.scale.map(_[0]),N=s.scale.map(_[1]);if(M==null||N==null)return null;if(x=M,S=JI({axis:c,ticks:u,bandSize:o,offset:a.offset,entry:e,index:f}),C=N-M,w=a.size,T={x:p.left,y:S,width:p.width,height:w},Math.abs(D)>0&&Math.abs(C)<Math.abs(D)){var P=rj(C||D)*(Math.abs(D)-Math.abs(C));C+=P}}return x==null||S==null||C==null||w==null||!i&&(C===0||w===0)?null:r8(r8({},e),{},{stackedBarStart:b,x,y:S,width:C,height:w,value:d?_:_[1],payload:e,background:T,tooltipPosition:{x:x+C/2,y:S+w/2},parentViewBox:h,originalDataIndex:f},m&&m[f]&&m[f].props)}).filter(Boolean)}function w8(e){var t=Vj(e,x8),n=q6(t.stackId),r=yL();return v.createElement(v4,{id:t.id,type:`bar`},e=>v.createElement(v.Fragment,null,v.createElement(m4,{legendPayload:l8(t)}),v.createElement(u8,{dataKey:t.dataKey,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:e}),v.createElement(w4,{type:`bar`,id:e,data:void 0,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,stackId:n,hide:t.hide,barSize:t.barSize,minPointSize:t.minPointSize,maxBarSize:t.maxBarSize,isPanorama:r,hasCustomShape:t.shape!=null}),v.createElement(z$,{zIndex:t.zIndex},v.createElement(S8,t8({},t,{id:e})))))}var T8=v.memo(w8,Sz);T8.displayName=`Bar`;var E8=[`domain`,`range`],D8=[`domain`,`range`];function O8(e,t){if(e==null)return{};var n,r,i=k8(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function k8(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function A8(e,t){return e===t?!0:Array.isArray(e)&&e.length===2&&Array.isArray(t)&&t.length===2?e[0]===t[0]&&e[1]===t[1]:!1}function j8(e,t){if(e===t)return!0;var{domain:n,range:r}=e,i=O8(e,E8),{domain:a,range:o}=t,s=O8(t,D8);return!A8(n,a)||!A8(r,o)?!1:Sz(i,s)}var M8=[`type`],N8=[`dangerouslySetInnerHTML`,`ticks`,`scale`],P8=[`id`,`scale`];function F8(){return F8=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},F8.apply(null,arguments)}function I8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function L8(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?I8(Object(n),!0).forEach(function(t){R8(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):I8(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function R8(e,t,n){return(t=z8(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function z8(e){var t=B8(e,`string`);return typeof t==`symbol`?t:t+``}function B8(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function V8(e,t){if(e==null)return{};var n,r,i=H8(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function H8(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function U8(e){var t=tN(),n=(0,v.useRef)(null),r=eR(),{type:i}=e,a=V8(e,M8),o=GH(r,`xAxis`,i),s=(0,v.useMemo)(()=>{if(o!=null)return L8(L8({},a),{},{type:o})},[a,o]);return(0,v.useLayoutEffect)(()=>{s!=null&&(n.current===null?t(j4(s)):n.current!==s&&t(M4({prev:n.current,next:s})),n.current=s)},[s,t]),(0,v.useLayoutEffect)(()=>()=>{n.current&&=(t(N4(n.current)),null)},[t]),null}var W8=e=>{var{xAxisId:t,className:n}=e,r=Q(_L),i=yL(),a=`xAxis`,o=Q(e=>hZ(e,a,t,i)),s=Q(e=>rZ(e,t)),c=Q(e=>cZ(e,t)),l=Q(e=>gY(e,t));if(s==null||c==null||l==null)return null;var{dangerouslySetInnerHTML:u,ticks:d,scale:f}=e,p=V8(e,N8),{id:m,scale:h}=l,g=V8(l,P8);return v.createElement(q3,F8({},p,g,{x:c.x,y:c.y,width:s.width,height:s.height,className:cn(`recharts-${a} ${a}`,n),viewBox:r,ticks:o,axisType:a,axisId:t}))},G8={allowDataOverflow:hY.allowDataOverflow,allowDecimals:hY.allowDecimals,allowDuplicatedCategory:hY.allowDuplicatedCategory,angle:hY.angle,axisLine:R3.axisLine,height:hY.height,hide:!1,includeHidden:hY.includeHidden,interval:hY.interval,label:!1,minTickGap:hY.minTickGap,mirror:hY.mirror,orientation:hY.orientation,padding:hY.padding,reversed:hY.reversed,scale:hY.scale,tick:hY.tick,tickCount:hY.tickCount,tickLine:R3.tickLine,tickSize:R3.tickSize,type:hY.type,niceTicks:hY.niceTicks,xAxisId:0},K8=v.memo(e=>{var t=Vj(e,G8);return v.createElement(v.Fragment,null,v.createElement(U8,{allowDataOverflow:t.allowDataOverflow,allowDecimals:t.allowDecimals,allowDuplicatedCategory:t.allowDuplicatedCategory,angle:t.angle,dataKey:t.dataKey,domain:t.domain,height:t.height,hide:t.hide,id:t.xAxisId,includeHidden:t.includeHidden,interval:t.interval,minTickGap:t.minTickGap,mirror:t.mirror,name:t.name,orientation:t.orientation,padding:t.padding,reversed:t.reversed,scale:t.scale,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,niceTicks:t.niceTicks}),v.createElement(W8,t))},j8);K8.displayName=`XAxis`;var q8=[`type`],J8=[`dangerouslySetInnerHTML`,`ticks`,`scale`],Y8=[`id`,`scale`];function X8(){return X8=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},X8.apply(null,arguments)}function Z8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Q8(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Z8(Object(n),!0).forEach(function(t){$8(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Z8(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function $8(e,t,n){return(t=e5(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function e5(e){var t=t5(e,`string`);return typeof t==`symbol`?t:t+``}function t5(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function n5(e,t){if(e==null)return{};var n,r,i=r5(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function r5(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function i5(e){var t=tN(),n=(0,v.useRef)(null),r=eR(),{type:i}=e,a=n5(e,q8),o=GH(r,`yAxis`,i),s=(0,v.useMemo)(()=>{if(o!=null)return Q8(Q8({},a),{},{type:o})},[o,a]);return(0,v.useLayoutEffect)(()=>{s!=null&&(n.current===null?t(P4(s)):n.current!==s&&t(F4({prev:n.current,next:s})),n.current=s)},[s,t]),(0,v.useLayoutEffect)(()=>()=>{n.current&&=(t(I4(n.current)),null)},[t]),null}function a5(e){var{yAxisId:t,className:n,width:r,label:i}=e,a=(0,v.useRef)(null),o=(0,v.useRef)(null),s=Q(_L),c=yL(),l=tN(),u=`yAxis`,d=Q(e=>uZ(e,t)),f=Q(e=>lZ(e,t)),p=Q(e=>hZ(e,u,t,c)),m=Q(e=>yY(e,t));if((0,v.useLayoutEffect)(()=>{if(!(r!==`auto`||!d||n2(i)||(0,v.isValidElement)(i)||m==null)){var e=a.current;if(e){var n=e.getCalculatedWidth();Math.round(d.width)!==Math.round(n)&&l(L4({id:t,width:n}))}}},[p,d,l,i,t,r,m]),d==null||f==null||m==null)return null;var{dangerouslySetInnerHTML:h,ticks:g,scale:_}=e,y=n5(e,J8),{id:b,scale:x}=m,S=n5(m,Y8);return v.createElement(q3,X8({},y,S,{ref:a,labelRef:o,x:f.x,y:f.y,tickTextProps:r===`auto`?{width:void 0}:{width:r},width:d.width,height:d.height,className:cn(`recharts-${u} ${u}`,n),viewBox:s,ticks:p,axisType:u,axisId:t}))}var o5={allowDataOverflow:vY.allowDataOverflow,allowDecimals:vY.allowDecimals,allowDuplicatedCategory:vY.allowDuplicatedCategory,angle:vY.angle,axisLine:R3.axisLine,hide:!1,includeHidden:vY.includeHidden,interval:vY.interval,label:!1,minTickGap:vY.minTickGap,mirror:vY.mirror,orientation:vY.orientation,padding:vY.padding,reversed:vY.reversed,scale:vY.scale,tick:vY.tick,tickCount:vY.tickCount,tickLine:R3.tickLine,tickSize:R3.tickSize,type:vY.type,niceTicks:vY.niceTicks,width:vY.width,yAxisId:0},s5=v.memo(e=>{var t=Vj(e,o5);return v.createElement(v.Fragment,null,v.createElement(i5,{interval:t.interval,id:t.yAxisId,scale:t.scale,type:t.type,domain:t.domain,allowDataOverflow:t.allowDataOverflow,dataKey:t.dataKey,allowDuplicatedCategory:t.allowDuplicatedCategory,allowDecimals:t.allowDecimals,tickCount:t.tickCount,padding:t.padding,includeHidden:t.includeHidden,reversed:t.reversed,ticks:t.ticks,width:t.width,orientation:t.orientation,mirror:t.mirror,hide:t.hide,unit:t.unit,name:t.name,angle:t.angle,minTickGap:t.minTickGap,tick:t.tick,tickFormatter:t.tickFormatter,niceTicks:t.niceTicks}),v.createElement(a5,t))},j8);s5.displayName=`YAxis`;var c5=$([(e,t)=>t,QL,sU,gU,AQ,MQ,u$,hL],S$);function l5(e){return`getBBox`in e.currentTarget&&typeof e.currentTarget.getBBox==`function`}function u5(e){var t=e.currentTarget.getBoundingClientRect(),n,r;if(l5(e)){var i=e.currentTarget.getBBox();n=i.width>0?t.width/i.width:1,r=i.height>0?t.height/i.height:1}else{var a=e.currentTarget;n=a.offsetWidth>0?t.width/a.offsetWidth:1,r=a.offsetHeight>0?t.height/a.offsetHeight:1}var o=(e,i)=>({relativeX:Math.round((e-t.left)/n),relativeY:Math.round((i-t.top)/r)});return`touches`in e?Array.from(e.touches).map(e=>o(e.clientX,e.clientY)):o(e.clientX,e.clientY)}var d5=hF(`mouseClick`),f5=CI();f5.startListening({actionCreator:d5,effect:(e,t)=>{var n=e.payload,r=c5(t.getState(),u5(n));r?.activeIndex!=null&&t.dispatch(LZ({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var p5=hF(`mouseMove`),m5=CI(),h5=null,g5=null,_5=null;m5.startListening({actionCreator:p5,effect:(e,t)=>{var n=e.payload,{throttleDelay:r,throttledEvents:i}=t.getState().eventSettings,a=i===`all`||i?.includes(`mousemove`);h5!==null&&(cancelAnimationFrame(h5),h5=null),g5!==null&&(typeof r!=`number`||!a)&&(clearTimeout(g5),g5=null),_5=u5(n);var o=()=>{var e=t.getState(),n=SZ(e,e.tooltip.settings.shared);if(!_5){h5=null,g5=null;return}if(n===`axis`){var r=c5(e,_5);r?.activeIndex==null?t.dispatch(PZ()):t.dispatch(IZ({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}h5=null,g5=null};if(!a){o();return}r===`raf`?h5=requestAnimationFrame(o):typeof r==`number`&&g5===null&&(g5=setTimeout(o,r))}});function v5(e,t){return t instanceof HTMLElement?`HTMLElement <${t.tagName} class="${t.className}">`:t===window?`global.window`:e===`children`&&typeof t==`object`&&t?`<<CHILDREN>>`:t}var y5={accessibilityLayer:!0,barCategoryGap:`10%`,barGap:4,barSize:void 0,className:void 0,maxBarSize:void 0,stackOffset:`none`,syncId:void 0,syncMethod:`index`,baseValue:void 0,reverseStackOrder:!1},b5=LF({name:`rootProps`,initialState:y5,reducers:{updateOptions:(e,t)=>{e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=t.payload.barGap??y5.barGap,e.barSize=t.payload.barSize,e.maxBarSize=t.payload.maxBarSize,e.stackOffset=t.payload.stackOffset,e.syncId=t.payload.syncId,e.syncMethod=t.payload.syncMethod,e.className=t.payload.className,e.baseValue=t.payload.baseValue,e.reverseStackOrder=t.payload.reverseStackOrder}}}),x5=b5.reducer,{updateOptions:S5}=b5.actions,C5=LF({name:`polarOptions`,initialState:null,reducers:{updatePolarOptions:(e,t)=>e===null?t.payload:(e.startAngle=t.payload.startAngle,e.endAngle=t.payload.endAngle,e.cx=t.payload.cx,e.cy=t.payload.cy,e.innerRadius=t.payload.innerRadius,e.outerRadius=t.payload.outerRadius,e)}}),{updatePolarOptions:Wee}=C5.actions,w5=C5.reducer,T5=hF(`keyDown`),E5=hF(`focus`),D5=hF(`blur`),O5=CI(),k5=null,A5=null,j5=null;O5.startListening({actionCreator:T5,effect:(e,t)=>{j5=e.payload,k5!==null&&(cancelAnimationFrame(k5),k5=null);var{throttleDelay:n,throttledEvents:r}=t.getState().eventSettings,i=r===`all`||r.includes(`keydown`);A5!==null&&(typeof n!=`number`||!i)&&(clearTimeout(A5),A5=null);var a=()=>{try{var e=t.getState();if(e.rootProps.accessibilityLayer===!1)return;var{keyboardInteraction:n}=e.tooltip,r=j5;if(r!==`ArrowRight`&&r!==`ArrowLeft`&&r!==`Enter`)return;var i=QZ(n,vQ(e),YY(e),DQ(e)),a=i==null?-1:Number(i);if(!Number.isFinite(a)||a<0)return;var o=MQ(e);if(r===`Enter`){var s=h$(e,`axis`,`hover`,String(n.index));t.dispatch(zZ({active:!n.active,activeIndex:n.index,activeCoordinate:s}));return}var c=vZ(e)===`left-to-right`?1:-1,l=a+(r===`ArrowRight`?1:-1)*c;if(o==null||l>=o.length||l<0)return;var u=h$(e,`axis`,`hover`,String(l));t.dispatch(zZ({active:!0,activeIndex:l.toString(),activeCoordinate:u}))}finally{k5=null,A5=null}};if(!i){a();return}n===`raf`?k5=requestAnimationFrame(a):typeof n==`number`&&A5===null&&(a(),j5=null,A5=setTimeout(()=>{j5?a():(A5=null,k5=null)},n))}}),O5.startListening({actionCreator:E5,effect:(e,t)=>{var n=t.getState();if(n.rootProps.accessibilityLayer!==!1){var{keyboardInteraction:r}=n.tooltip;if(!r.active&&r.index==null){var i=`0`,a=h$(n,`axis`,`hover`,String(i));t.dispatch(zZ({active:!0,activeIndex:i,activeCoordinate:a}))}}}}),O5.startListening({actionCreator:D5,effect:(e,t)=>{var n=t.getState();if(n.rootProps.accessibilityLayer!==!1){var{keyboardInteraction:r}=n.tooltip;r.active&&t.dispatch(zZ({active:!1,activeIndex:r.index,activeCoordinate:r.coordinate}))}}});function M5(e){e.persist();var{currentTarget:t}=e;return new Proxy(e,{get:(e,n)=>{if(n===`currentTarget`)return t;var r=Reflect.get(e,n);return typeof r==`function`?r.bind(e):r}})}var N5=hF(`externalEvent`),P5=CI(),F5=new Map,I5=new Map,L5=new Map;P5.startListening({actionCreator:N5,effect:(e,t)=>{var{handler:n,reactEvent:r}=e.payload;if(n!=null){var i=r.type,a=M5(r);L5.set(i,{handler:n,reactEvent:a});var o=F5.get(i);o!==void 0&&(cancelAnimationFrame(o),F5.delete(i));var{throttleDelay:s,throttledEvents:c}=t.getState().eventSettings,l=c,u=l===`all`||l?.includes(i),d=I5.get(i);d!==void 0&&(typeof s!=`number`||!u)&&(clearTimeout(d),I5.delete(i));var f=()=>{var e=L5.get(i);try{if(!e)return;var{handler:n,reactEvent:r}=e,a=t.getState(),o={activeCoordinate:HQ(a),activeDataKey:zQ(a),activeIndex:LQ(a),activeLabel:RQ(a),activeTooltipIndex:LQ(a),isTooltipActive:UQ(a)};n&&n(o,r)}finally{F5.delete(i),I5.delete(i),L5.delete(i)}};if(!u){f();return}if(s===`raf`){var p=requestAnimationFrame(f);F5.set(i,p)}else if(typeof s==`number`){if(!I5.has(i)){f();var m=setTimeout(f,s);I5.set(i,m)}}else f()}}});var R5=$([$([nQ],e=>e.tooltipItemPayloads),(e,t)=>t,(e,t,n)=>n],(e,t,n)=>{if(t!=null){var r=e.find(e=>e.settings.graphicalItemId===n);if(r!=null){var{getPosition:i}=r;if(i!=null)return i(t)}}}),z5=hF(`touchMove`),B5=CI(),V5=null,H5=null,U5=null,W5=null;B5.startListening({actionCreator:z5,effect:(e,t)=>{var n=e.payload;if(n.touches!=null&&n.touches.length!==0){W5=M5(n);var{throttleDelay:r,throttledEvents:i}=t.getState().eventSettings,a=i===`all`||i.includes(`touchmove`);V5!==null&&(cancelAnimationFrame(V5),V5=null),H5!==null&&(typeof r!=`number`||!a)&&(clearTimeout(H5),H5=null),U5=Array.from(n.touches).map(e=>u5({clientX:e.clientX,clientY:e.clientY,currentTarget:n.currentTarget}));var o=()=>{if(W5!=null){var e=t.getState(),n=SZ(e,e.tooltip.settings.shared);if(n===`axis`){var r=U5?.[0];if(r==null){V5=null,H5=null;return}var i=c5(e,r);i?.activeIndex!=null&&t.dispatch(IZ({activeIndex:i.activeIndex,activeDataKey:void 0,activeCoordinate:i.activeCoordinate}))}else if(n===`item`){var a=W5.touches[0];if(document.elementFromPoint==null||a==null)return;var o=document.elementFromPoint(a.clientX,a.clientY);if(!o||!o.getAttribute)return;var s=o.getAttribute(gee),c=o.getAttribute(`data-recharts-item-id`)??void 0,l=gQ(e).find(e=>e.id===c);if(s==null||l==null||c==null)return;var{dataKey:u}=l,d=R5(e,s,c);t.dispatch(MZ({activeDataKey:u,activeIndex:s,activeCoordinate:d,activeGraphicalItemId:c}))}V5=null,H5=null}};if(!a){o();return}r===`raf`?V5=requestAnimationFrame(o):typeof r==`number`&&H5===null&&(o(),W5=null,H5=setTimeout(()=>{W5?o():(H5=null,V5=null)},r))}}});var G5={throttleDelay:`raf`,throttledEvents:[`mousemove`,`touchmove`,`pointermove`,`scroll`,`wheel`]},K5=LF({name:`eventSettings`,initialState:G5,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=$R(t.payload.throttledEvents))}}}),{setEventSettings:q5}=K5.actions,J5=K5.reducer,Y5=zN({brush:n3,cartesianAxis:R4,chartData:l1,errorBars:_6,eventSettings:J5,graphicalItems:C4,layout:AI,legend:iz,options:r1,polarAxis:E2,polarOptions:w5,referenceElements:o3,renderedTicks:O3,rootProps:x5,tooltip:BZ,zIndex:R$}),X5=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`Chart`;return DF({reducer:Y5,preloadedState:e,middleware:e=>e({serializableCheck:!1,immutableCheck:![`commonjs`,`es6`,`production`].includes(`es6`)}).concat([f5.middleware,m5.middleware,O5.middleware,P5.middleware,B5.middleware]),enhancers:e=>{var t=e;return typeof e==`function`&&(t=e()),t.concat(TF({type:`raf`}))},devTools:zz.devToolsEnabled&&{serialize:{replacer:v5},name:`recharts-${t}`}})};function Z5(e){var{preloadedState:t,children:n,reduxStoreName:r}=e,i=yL(),a=(0,v.useRef)(null);if(i)return n;a.current??=X5(t,r);var o=QM;return v.createElement(yz,{context:o,store:a.current},n)}function Q5(e){var{layout:t,margin:n}=e,r=tN(),i=yL();return(0,v.useEffect)(()=>{i||(r(DI(t)),r(EI(n)))},[r,i,t,n]),null}var $5=(0,v.memo)(Q5,Sz);function e7(e){var t=tN();return(0,v.useEffect)(()=>{t(S5(e))},[t,e]),null}var t7=(0,v.memo)(e=>{var t=tN();return(0,v.useEffect)(()=>{t(q5(e))},[t,e]),null},Sz);function n7(e){var{zIndex:t,isPanorama:n}=e,r=(0,v.useRef)(null),i=tN();return(0,v.useLayoutEffect)(()=>(r.current&&i(I$({zIndex:t,element:r.current,isPanorama:n})),()=>{i(L$({zIndex:t,isPanorama:n}))}),[i,t,n]),v.createElement(`g`,{tabIndex:-1,ref:r,className:`recharts-zIndex-layer_${t}`})}function r7(e){var{children:t,isPanorama:n}=e,r=Q(w$);if(!r||r.length===0)return t;var i=r.filter(e=>e<0),a=r.filter(e=>e>0);return v.createElement(v.Fragment,null,i.map(e=>v.createElement(n7,{key:e,zIndex:e,isPanorama:n})),t,a.map(e=>v.createElement(n7,{key:e,zIndex:e,isPanorama:n})))}var i7=[`children`];function a7(e,t){if(e==null)return{};var n,r,i=o7(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function o7(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function s7(){return s7=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s7.apply(null,arguments)}var c7={width:`100%`,height:`100%`,display:`block`},l7=(0,v.forwardRef)((e,t)=>{var n=XL(),r=ZL(),i=Yz();if(!NI(n)||!NI(r))return null;var{children:a,otherAttributes:o,title:s,desc:c}=e,l,u;return o!=null&&(l=typeof o.tabIndex==`number`?o.tabIndex:i?0:void 0,u=typeof o.role==`string`?o.role:i?`application`:void 0),v.createElement(fk,s7({},o,{title:s,desc:c,role:u,tabIndex:l,width:n,height:r,style:c7,ref:t}),a)}),u7=e=>{var{children:t}=e,n=Q(xL);if(!n)return null;var{width:r,height:i,y:a,x:o}=n;return v.createElement(fk,{width:r,height:i,x:o,y:a},t)},d7=(0,v.forwardRef)((e,t)=>{var{children:n}=e,r=a7(e,i7);return yL()?v.createElement(u7,null,v.createElement(r7,{isPanorama:!0},n)):v.createElement(l7,s7({ref:t},r),v.createElement(r7,{isPanorama:!1},n))});function f7(){var e=tN(),[t,n]=(0,v.useState)(null),r=Q(hee);return(0,v.useEffect)(()=>{if(t!=null){var n=t.getBoundingClientRect().width/t.offsetWidth;MI(n)&&n!==r&&e(kI(n))}},[t,e,r]),n}function p7(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function m7(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?p7(Object(n),!0).forEach(function(t){h7(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p7(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function h7(e,t,n){return(t=g7(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g7(e){var t=_7(e,`string`);return typeof t==`symbol`?t:t+``}function _7(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function v7(){return v7=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},v7.apply(null,arguments)}var y7=()=>(b1(),null);function b7(e){if(typeof e==`number`)return e;if(typeof e==`string`){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var x7=(0,v.forwardRef)((e,t)=>{var n=(0,v.useRef)(null),[r,i]=(0,v.useState)({containerWidth:b7(e.style?.width),containerHeight:b7(e.style?.height)}),a=(0,v.useCallback)((e,t)=>{i(n=>{var r=Math.round(e),i=Math.round(t);return n.containerWidth===r&&n.containerHeight===i?n:{containerWidth:r,containerHeight:i}})},[]),o=(0,v.useCallback)(e=>{if(typeof t==`function`&&t(e),e!=null&&typeof ResizeObserver<`u`){var{width:r,height:i}=e.getBoundingClientRect();a(r,i);var o=new ResizeObserver(e=>{var t=e[0];if(t!=null){var{width:n,height:r}=t.contentRect;a(n,r)}});o.observe(e),n.current=o}},[t,a]);return(0,v.useEffect)(()=>()=>{n.current?.disconnect()},[a]),v.createElement(v.Fragment,null,v.createElement(rR,{width:r.containerWidth,height:r.containerHeight}),v.createElement(`div`,v7({ref:o},e)))}),S7=(0,v.forwardRef)((e,t)=>{var{width:n,height:r}=e,[i,a]=(0,v.useState)({containerWidth:b7(n),containerHeight:b7(r)}),o=(0,v.useCallback)((e,t)=>{a(n=>{var r=Math.round(e),i=Math.round(t);return n.containerWidth===r&&n.containerHeight===i?n:{containerWidth:r,containerHeight:i}})},[]),s=(0,v.useCallback)(e=>{if(typeof t==`function`&&t(e),e!=null){var{width:n,height:r}=e.getBoundingClientRect();o(n,r)}},[t,o]);return v.createElement(v.Fragment,null,v.createElement(rR,{width:i.containerWidth,height:i.containerHeight}),v.createElement(`div`,v7({ref:s},e)))}),C7=(0,v.forwardRef)((e,t)=>{var{width:n,height:r}=e;return v.createElement(v.Fragment,null,v.createElement(rR,{width:n,height:r}),v.createElement(`div`,v7({ref:t},e)))}),w7=(0,v.forwardRef)((e,t)=>{var{width:n,height:r}=e;return typeof n==`string`||typeof r==`string`?v.createElement(S7,v7({},e,{ref:t})):typeof n==`number`&&typeof r==`number`?v.createElement(C7,v7({},e,{width:n,height:r,ref:t})):v.createElement(v.Fragment,null,v.createElement(rR,{width:n,height:r}),v.createElement(`div`,v7({ref:t},e)))});function T7(e){return e?x7:w7}var E7=(0,v.forwardRef)((e,t)=>{var{children:n,className:r,height:i,onClick:a,onContextMenu:o,onDoubleClick:s,onMouseDown:c,onMouseEnter:l,onMouseLeave:u,onMouseMove:d,onMouseUp:f,onTouchEnd:p,onTouchMove:m,onTouchStart:h,style:g,width:_,responsive:y,dispatchTouchEvents:b=!0}=e,x=(0,v.useRef)(null),S=tN(),[C,w]=(0,v.useState)(null),[T,E]=(0,v.useState)(null),D=f7(),O=UL(),k=O?.width>0?O.width:_,A=O?.height>0?O.height:i,j=(0,v.useCallback)(e=>{D(e),typeof t==`function`&&t(e),w(e),E(e),e!=null&&(x.current=e)},[D,t,w,E]),M=(0,v.useCallback)(e=>{S(d5(e)),S(N5({handler:a,reactEvent:e}))},[S,a]),N=(0,v.useCallback)(e=>{S(p5(e)),S(N5({handler:l,reactEvent:e}))},[S,l]),P=(0,v.useCallback)(e=>{S(PZ()),S(N5({handler:u,reactEvent:e}))},[S,u]),ee=(0,v.useCallback)(e=>{S(p5(e)),S(N5({handler:d,reactEvent:e}))},[S,d]),F=(0,v.useCallback)(()=>{S(E5())},[S]),I=(0,v.useCallback)(()=>{S(D5())},[S]),te=(0,v.useCallback)(e=>{S(T5(e.key))},[S]),L=(0,v.useCallback)(e=>{S(N5({handler:o,reactEvent:e}))},[S,o]),ne=(0,v.useCallback)(e=>{S(N5({handler:s,reactEvent:e}))},[S,s]),re=(0,v.useCallback)(e=>{S(N5({handler:c,reactEvent:e}))},[S,c]),R=(0,v.useCallback)(e=>{S(N5({handler:f,reactEvent:e}))},[S,f]),ie=(0,v.useCallback)(e=>{S(N5({handler:h,reactEvent:e}))},[S,h]),ae=(0,v.useCallback)(e=>{b&&S(z5(e)),S(N5({handler:m,reactEvent:e}))},[S,b,m]),oe=(0,v.useCallback)(e=>{S(N5({handler:p,reactEvent:e}))},[S,p]),se=T7(y);return v.createElement(Y$.Provider,{value:C},v.createElement(vk.Provider,{value:T},v.createElement(se,{width:k??g?.width,height:A??g?.height,className:cn(`recharts-wrapper`,r),style:m7({position:`relative`,cursor:`default`,width:k,height:A},g),onClick:M,onContextMenu:L,onDoubleClick:ne,onFocus:F,onBlur:I,onKeyDown:te,onMouseDown:re,onMouseEnter:N,onMouseLeave:P,onMouseMove:ee,onMouseUp:R,onTouchEnd:oe,onTouchMove:ae,onTouchStart:ie,ref:j},v.createElement(y7,null),n)))}),D7=[`width`,`height`,`responsive`,`children`,`className`,`style`,`compact`,`title`,`desc`];function O7(e,t){if(e==null)return{};var n,r,i=k7(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function k7(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var A7=(0,v.forwardRef)((e,t)=>{var{width:n,height:r,responsive:i,children:a,className:o,style:s,compact:c,title:l,desc:u}=e,d=ak(O7(e,D7));return c?v.createElement(v.Fragment,null,v.createElement(rR,{width:n,height:r}),v.createElement(d7,{otherAttributes:d,title:l,desc:u},a)):v.createElement(E7,{className:o,style:s,width:n,height:r,responsive:i??!1,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},v.createElement(d7,{otherAttributes:d,title:l,desc:u,ref:t},v.createElement(c3,null,a)))});function j7(){return j7=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},j7.apply(null,arguments)}function M7(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function N7(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?M7(Object(n),!0).forEach(function(t){P7(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):M7(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function P7(e,t,n){return(t=F7(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function F7(e){var t=I7(e,`string`);return typeof t==`symbol`?t:t+``}function I7(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var L7=N7({accessibilityLayer:!0,barCategoryGap:`10%`,barGap:4,layout:`horizontal`,margin:{top:5,right:5,bottom:5,left:5},responsive:!1,reverseStackOrder:!1,stackOffset:`none`,syncMethod:`index`},G5),R7=(0,v.forwardRef)(function(e,t){var n=Vj(e.categoricalChartProps,L7),{chartName:r,defaultTooltipEventType:i,validateTooltipEventTypes:a,tooltipPayloadSearcher:o,categoricalChartProps:s}=e,c={chartName:r,defaultTooltipEventType:i,validateTooltipEventTypes:a,tooltipPayloadSearcher:o,eventEmitter:void 0};return v.createElement(Z5,{preloadedState:{options:c},reduxStoreName:s.id??r},v.createElement($4,{chartData:s.data}),v.createElement($5,{layout:n.layout,margin:n.margin}),v.createElement(t7,{throttleDelay:n.throttleDelay,throttledEvents:n.throttledEvents}),v.createElement(e7,{baseValue:n.baseValue,accessibilityLayer:n.accessibilityLayer,barCategoryGap:n.barCategoryGap,maxBarSize:n.maxBarSize,stackOffset:n.stackOffset,barGap:n.barGap,barSize:n.barSize,syncId:n.syncId,syncMethod:n.syncMethod,className:n.className,reverseStackOrder:n.reverseStackOrder}),v.createElement(A7,j7({},n,{ref:t})))}),z7=[`axis`,`item`],B7=(0,v.forwardRef)((e,t)=>v.createElement(R7,{chartName:`BarChart`,defaultTooltipEventType:`axis`,validateTooltipEventTypes:z7,tooltipPayloadSearcher:t1,categoricalChartProps:e,ref:t})),V7={light:``,dark:`.dark`},H7={width:320,height:200},U7=v.createContext(null);function W7(){let e=v.useContext(U7);if(!e)throw Error(`useChart must be used within a <ChartContainer />`);return e}function G7({id:e,className:t,children:n,config:r,initialDimension:i=H7,...a}){let o=v.useId(),s=`chart-${e??o.replace(/:/g,``)}`;return(0,H.jsx)(U7.Provider,{value:{config:r},children:(0,H.jsxs)(`div`,{"data-slot":`chart`,"data-chart":s,className:V(`flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden`,t),...a,children:[(0,H.jsx)(K7,{id:s,config:r}),(0,H.jsx)(GL,{initialDimension:i,children:n})]})})}var K7=({id:e,config:t})=>{let n=Object.entries(t).filter(([,e])=>e.theme??e.color);return n.length?(0,H.jsx)(`style`,{dangerouslySetInnerHTML:{__html:Object.entries(V7).map(([t,r])=>`
|
|
165
|
-
${r} [data-chart=${e}] {
|
|
166
|
-
${n.map(([e,n])=>{let r=n.theme?.[t]??n.color;return r?` --color-${e}: ${r};`:null}).join(`
|
|
167
|
-
`)}
|
|
168
|
-
}
|
|
169
|
-
`).join(`
|
|
170
|
-
`)}}):null},q7=j1;function J7({active:e,payload:t,className:n,indicator:r=`dot`,hideLabel:i=!1,hideIndicator:a=!1,label:o,labelFormatter:s,labelClassName:c,formatter:l,color:u,nameKey:d,labelKey:f}){let{config:p}=W7(),m=v.useMemo(()=>{if(i||!t?.length)return null;let[e]=t,n=`${f??e?.dataKey??e?.name??`value`}`,r=Y7(p,e,n),a=!f&&typeof o==`string`?p[o]?.label??o:r?.label;return s?(0,H.jsx)(`div`,{className:V(`font-medium`,c),children:s(a,t)}):a?(0,H.jsx)(`div`,{className:V(`font-medium`,c),children:a}):null},[o,s,t,i,c,p,f]);if(!e||!t?.length)return null;let h=t.length===1&&r!==`dot`;return(0,H.jsxs)(`div`,{className:V(`grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl`,n),children:[h?null:m,(0,H.jsx)(`div`,{className:`grid gap-1.5`,children:t.filter(e=>e.type!==`none`).map((e,t)=>{let n=`${d??e.name??e.dataKey??`value`}`,i=Y7(p,e,n),o=u??e.payload?.fill??e.color;return(0,H.jsx)(`div`,{className:V(`flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground`,r===`dot`&&`items-center`),children:l&&e?.value!==void 0&&e.name?l(e.value,e.name,e,t,e.payload):(0,H.jsxs)(H.Fragment,{children:[i?.icon?(0,H.jsx)(i.icon,{}):!a&&(0,H.jsx)(`div`,{className:V(`shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)`,{"h-2.5 w-2.5":r===`dot`,"w-1":r===`line`,"w-0 border-[1.5px] border-dashed bg-transparent":r===`dashed`,"my-0.5":h&&r===`dashed`}),style:{"--color-bg":o,"--color-border":o}}),(0,H.jsxs)(`div`,{className:V(`flex flex-1 justify-between leading-none`,h?`items-end`:`items-center`),children:[(0,H.jsxs)(`div`,{className:`grid gap-1.5`,children:[h?m:null,(0,H.jsx)(`span`,{className:`text-muted-foreground`,children:i?.label??e.name})]}),e.value!=null&&(0,H.jsx)(`span`,{className:`font-mono font-medium text-foreground tabular-nums`,children:typeof e.value==`number`?e.value.toLocaleString():String(e.value)})]})]})},t)})})]})}function Y7(e,t,n){if(typeof t!=`object`||!t)return;let r=`payload`in t&&typeof t.payload==`object`&&t.payload!==null?t.payload:void 0,i=n;return n in t&&typeof t[n]==`string`?i=t[n]:r&&n in r&&typeof r[n]==`string`&&(i=r[n]),i in e?e[i]:e[n]}function X7({className:e,...t}){return(0,H.jsx)(`div`,{"data-slot":`card`,className:V(`flex min-w-0 flex-col gap-3 rounded-xl border border-border bg-card p-4 text-card-foreground`,e),...t})}function Z7({className:e,...t}){return(0,H.jsx)(`div`,{"data-slot":`card-header`,className:V(`grid gap-1`,e),...t})}function Q7({className:e,...t}){return(0,H.jsx)(`h3`,{"data-slot":`card-title`,className:V(`text-sm font-semibold leading-snug`,e),...t})}function $7({className:e,...t}){return(0,H.jsx)(`p`,{"data-slot":`card-description`,className:V(`text-xs text-muted-foreground`,e),...t})}function e9({className:e,...t}){return(0,H.jsx)(`div`,{"data-slot":`card-content`,className:V(`min-w-0`,e),...t})}function t9({title:e,summary:t,emptyText:n,table:r,children:i,className:a,interactive:o=!1}){return(0,H.jsxs)(X7,{className:a,children:[(0,H.jsxs)(Z7,{children:[(0,H.jsx)(Q7,{children:e}),t&&!n?(0,H.jsx)($7,{children:t}):null]}),(0,H.jsx)(e9,{children:n?(0,H.jsx)(`p`,{className:`flex min-h-40 items-center text-sm text-muted-foreground`,children:n}):(0,H.jsxs)(H.Fragment,{children:[o?i:(0,H.jsx)(`div`,{"aria-hidden":`true`,children:i}),(0,H.jsxs)(`table`,{className:`sr-only`,children:[(0,H.jsx)(`caption`,{children:e}),(0,H.jsx)(`thead`,{children:(0,H.jsx)(`tr`,{children:r.columns.map(e=>(0,H.jsx)(`th`,{scope:`col`,children:e},e))})}),(0,H.jsx)(`tbody`,{children:r.rows.map((e,t)=>(0,H.jsx)(`tr`,{children:e.map((e,t)=>(0,H.jsx)(`td`,{children:e},t))},t))})]})]})})]})}var n9={pending:`var(--status-info)`,applied:`var(--status-success)`,rejected:`var(--destructive)`,stale:`var(--status-warning)`,undone:`var(--muted-foreground)`};function r9({proposals:e}){let t=Y(),n=jO(e).map(e=>({...e,label:t(e.state)})),r={count:{label:t(`Proposals`),color:`var(--chart-1)`}},i=n[0]?.count??0;return(0,H.jsx)(t9,{title:t(`Proposal pipeline`),summary:Ff(t(`{total} proposals, {pending} waiting for a decision`),{total:e.length,pending:i}),emptyText:e.length===0?t(`No proposals yet.`):``,table:{columns:[t(`State`),t(`Proposals`)],rows:n.map(e=>[e.label,e.count])},children:(0,H.jsx)(G7,{config:r,className:`aspect-auto h-44 w-full`,children:(0,H.jsxs)(B7,{data:n,layout:`vertical`,accessibilityLayer:!1,margin:{top:0,right:28,left:0,bottom:0},children:[(0,H.jsx)(K8,{type:`number`,hide:!0,allowDecimals:!1}),(0,H.jsx)(s5,{type:`category`,dataKey:`label`,width:104,tickLine:!1,axisLine:!1}),(0,H.jsx)(q7,{cursor:{fill:`var(--interactive-hover)`},content:(0,H.jsx)(J7,{hideLabel:!0,nameKey:`count`})}),(0,H.jsxs)(T8,{dataKey:`count`,fill:`var(--color-count)`,radius:[0,2,2,0],children:[n.map(e=>(0,H.jsx)(M1,{fill:n9[e.state]??`var(--color-count)`},e.state)),(0,H.jsx)(C2,{dataKey:`count`,position:`right`,className:`fill-foreground`})]})]})})})}var i9=`var(--status-success)`,a9=`var(--destructive)`;function o9(){let e=Y();return{succeeded:{label:e(`Successful`),color:i9},failed:{label:e(`Failed`),color:a9}}}var s9={stroke:`var(--card)`,strokeWidth:1};function c9(){let e=Y(),t=[{label:e(`Successful`),background:i9},{label:e(`Failed`),background:a9}];return(0,H.jsx)(`ul`,{className:`flex flex-wrap items-center justify-center gap-4 pt-3 text-xs`,children:t.map(e=>(0,H.jsxs)(`li`,{className:`flex items-center gap-1.5`,children:[(0,H.jsx)(`span`,{className:`size-2.5 shrink-0 rounded-[2px]`,style:{background:e.background}}),e.label]},e.label))})}var l9=26;function u9({skills:e,total:t,shown:n,onShown:r,onOpen:i,className:a}){let o=Y(),s=o9(),c=e.slice(0,n).map(kO),l=c[0],u=e=>{let t=e?.payload;t&&i(t)};return(0,H.jsxs)(t9,{className:a,interactive:!0,title:o(`Most used skills`),summary:l?Ff(o(`{name} leads with {uses} uses. Click a bar to open the skill.`),{name:l.name,uses:l.uses}):void 0,emptyText:c.length===0?o(`No skill was used in the last 30 days.`):``,table:{columns:[o(`Skill`),o(`Uses`),o(`Failed`)],rows:c.map(e=>[e.name,e.uses,e.failed])},children:[(0,H.jsxs)(`div`,{className:V(`flex gap-2`,c.length>16&&`overflow-y-auto overscroll-contain pt-8`),style:c.length>16?{maxHeight:`448px`}:void 0,children:[(0,H.jsx)(`ol`,{className:`w-[6.5rem] shrink-0`,"aria-label":o(`Most used skills`),children:c.map(e=>(0,H.jsx)(`li`,{className:`flex h-[26px] items-center justify-end`,children:(0,H.jsx)(bf,{content:e.name,className:`min-w-0 max-w-full`,children:(0,H.jsx)(`button`,{type:`button`,className:`block max-w-full truncate rounded-sm text-end text-xs hover:underline focus-visible:outline-2 focus-visible:outline-ring`,onClick:()=>i(e),children:e.name})})},`${e.name}\n${e.path??``}`))}),(0,H.jsx)(`div`,{"aria-hidden":`true`,className:`min-w-0 flex-1`,children:(0,H.jsx)(G7,{config:s,className:`aspect-auto w-full`,style:{height:`${c.length*l9}px`},children:(0,H.jsxs)(B7,{data:c,layout:`vertical`,accessibilityLayer:!1,margin:{top:0,right:8,left:0,bottom:0},children:[(0,H.jsx)(K8,{type:`number`,hide:!0,allowDecimals:!1}),(0,H.jsx)(s5,{type:`category`,dataKey:`name`,hide:!0}),(0,H.jsx)(q7,{cursor:{fill:`var(--interactive-hover)`},content:(0,H.jsx)(J7,{})}),(0,H.jsx)(T8,{dataKey:`succeeded`,stackId:`uses`,fill:`var(--color-succeeded)`,cursor:`pointer`,onClick:u,...s9}),(0,H.jsx)(T8,{dataKey:`failed`,stackId:`uses`,fill:`var(--color-failed)`,radius:[0,2,2,0],cursor:`pointer`,onClick:u,...s9})]})})})]}),(0,H.jsx)(`div`,{"aria-hidden":`true`,children:(0,H.jsx)(c9,{})}),t>8?(0,H.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center justify-between gap-2`,children:[(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,"aria-live":`polite`,children:Ff(o(`Showing {shown} of {total}`),{shown:c.length,total:t})}),(0,H.jsxs)(`div`,{className:`flex gap-2`,children:[c.length<e.length?(0,H.jsx)(q,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>r(LO(n,e.length)),children:o(`Show more`)}):null,c.length>8?(0,H.jsx)(q,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>r(8),children:o(`Show less`)}):null]})]}):null]})}function d9(e){let[t,n]=(0,v.useState)(8);return(0,H.jsx)(u9,{...e,shown:t,onShown:n})}var f9=e=>{let t=Math.ceil(Math.max(0,...e.map(e=>e.uses))*1.25);return Math.max(28,String(t).length*7+10)};function p9({rows:e,bucket:t,period:n,title:r,className:i}){let a=Y(),o=o9(),s=Op(),c=t??`day`,l=e.map(kO),u=e.reduce((e,t)=>e+t.uses,0),d=e.reduce((e,t)=>e+t.failed,0),f=e=>qO(c,String(e),!1,s),p=t?e=>qO(c,String(e),!0,s):f,m={uses:Wf(u),failed:Wf(d)},h=a(t?`No uses in this period. Bars appear after OMMS records turns.`:`No uses in the last 30 days. Bars appear after OMMS records turns.`);return(0,H.jsxs)(t9,{className:i,title:r,summary:n?Ff(a(`{period}: {uses} uses, {failed} with a failed tool call`),{period:n,...m}):Ff(a(`{uses} uses, {failed} with a failed tool call`),m),emptyText:OO(e)?h:``,table:{columns:[a(zO[c]),a(`Uses`),a(`Failed`)],rows:e.map(e=>[p(e.key),e.uses,e.failed])},children:[(0,H.jsx)(G7,{config:o,className:`aspect-auto h-44 w-full`,children:(0,H.jsxs)(B7,{data:l,accessibilityLayer:!1,margin:{top:4,right:0,left:0},children:[(0,H.jsx)(h6,{vertical:!1}),(0,H.jsx)(K8,{dataKey:`key`,tickLine:!1,axisLine:!1,minTickGap:c===`day`?24:8,tickFormatter:f}),(0,H.jsx)(s5,{width:f9(e),tickLine:!1,axisLine:!1,allowDecimals:!1,tickCount:3}),(0,H.jsx)(q7,{cursor:{fill:`var(--interactive-hover)`},content:(0,H.jsx)(J7,{labelFormatter:p})}),(0,H.jsx)(T8,{dataKey:`succeeded`,stackId:`uses`,fill:`var(--color-succeeded)`,...s9}),(0,H.jsx)(T8,{dataKey:`failed`,stackId:`uses`,fill:`var(--color-failed)`,radius:[2,2,0,0],...s9})]})}),(0,H.jsx)(c9,{})]})}var m9={months:[],years:[]},h9=`The use charts appear after OMMS records agent turns that use a skill.`;function g9(e,t,n){return e.bucket===`year`?`${n(`No skill uses are recorded yet.`)} ${n(h9)}`:e.bucket===`day`&&!e.month?n(`No skill uses are recorded in the last 30 days. The use charts appear after OMMS records agent turns that use a skill.`):`${Ff(n(`No skill uses are recorded in {period}.`),{period:t})} ${n(h9)}`}function _9({activity:e,range:t,shownRange:n=t,loading:r,error:i,proposals:a,onOpen:o,onRange:s}){let c=Y(),l=Op(),u=e!==null&&OO(e.series),d=e?JO(n,e.series,l,c):``,f=n.bucket===`day`&&!n.month,p=r&&e!==null,m=V(`transition-opacity duration-150`,p&&`opacity-60`);return(0,H.jsxs)(`section`,{id:`skills-section-activity`,className:`scroll-mt-4 space-y-3`,"aria-labelledby":`skills-activity-title`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,H.jsx)(`h2`,{id:`skills-activity-title`,className:`text-section-title font-semibold`,children:c(`Activity`)}),(0,H.jsx)($O,{range:t,available:e?.available??m9,currentYear:new Date().getUTCFullYear(),loading:p,onChange:s})]}),i?(0,H.jsxs)(`p`,{role:`alert`,className:`text-sm text-destructive-label`,children:[c(`Activity could not load.`),` `,i]}):null,e===null&&!i?(0,H.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,H.jsx)(at,{className:`size-4 animate-spin`,"aria-hidden":`true`}),c(`Loading…`)]}):null,(0,H.jsxs)(`div`,{"aria-busy":p||void 0,className:`space-y-3`,children:[e?(0,H.jsx)(`dl`,{className:V(`flex flex-wrap gap-x-6 gap-y-1 text-sm`,m),children:[[f?c(`Uses in 30 days`):Ff(c(`Uses in {period}`),{period:d}),e.totals.uses],[c(`Failed turns`),e.totals.failed],[c(`Active skills`),e.totals.activeSkills]].map(([e,t])=>(0,H.jsxs)(`div`,{className:`flex items-baseline gap-1.5`,children:[(0,H.jsx)(`dt`,{className:`text-muted-foreground`,children:e}),(0,H.jsx)(`dd`,{className:`font-semibold tabular-nums`,children:Wf(Number(t))})]},e))}):null,e&&u?(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:g9(n,d,c)}):null,(0,H.jsxs)(`div`,{className:`grid grid-cols-1 items-start gap-3 lg:grid-cols-2`,children:[e&&!u?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(p9,{className:V(`lg:col-span-2`,m),rows:e.series,bucket:e.bucket,period:d,title:c(RO[e.bucket])}),(0,H.jsx)(d9,{className:m,skills:e.topSkills,total:e.topTotal,onOpen:o},VO(n))]}):null,(0,H.jsx)(r9,{proposals:a})]})]})]})}function v9({proposals:e,onOpen:t,reloadKey:n}){let[r,i]=(0,v.useState)(()=>HO(Si(PO,PO))),[a,o]=(0,v.useState)(null),[s,c]=(0,v.useState)(``),[l,u]=(0,v.useState)(!0);return(0,v.useEffect)(()=>{let e=!0;return u(!0),CC.activity({...BO(r),top:100}).then(t=>{if(!e)return;if(!t.ok){c(t.error),u(!1);return}let n=TO(t.data),a=UO(r,n.available);if(a!==r){wi(PO,VO(a)),i(a);return}o({range:r,activity:n}),c(``),u(!1)}),()=>{e=!1}},[r,n]),(0,H.jsx)(_9,{activity:a?.activity??null,range:r,shownRange:a?.range??r,loading:l,error:s,proposals:e,onOpen:t,onRange:e=>{wi(PO,VO(e)),i(e)}})}var y9={all:`All ({count})`,"not-modified":`Not modified ({count})`,modified:`Modified ({count})`,suggested:`Suggested ({count})`},b9={all:{idle:`border-input bg-card text-muted-foreground hover:bg-interactive-hover`,chosen:`border-primary/40 bg-selection text-foreground`},"not-modified":{idle:`border-status-info/35 bg-status-info/5 text-status-info hover:bg-status-info/15`,chosen:`border-status-info/70 bg-status-info/20 text-status-info`},modified:{idle:`border-status-success/35 bg-status-success/5 text-status-success hover:bg-status-success/15`,chosen:`border-status-success/70 bg-status-success/20 text-status-success`},suggested:{idle:`[color:oklch(0.42_0.13_var(--keyword-hue))] dark:[color:oklch(0.8_0.13_var(--keyword-hue))] hover:brightness-110`,chosen:`[color:oklch(0.42_0.13_var(--keyword-hue))] dark:[color:oklch(0.8_0.13_var(--keyword-hue))]`}};function x9(e){let t=Wd(`Suggested`);return{backgroundColor:`oklch(0.72 0.14 ${t} / ${e?.3:.1})`,borderColor:`oklch(0.72 0.14 ${t} / ${e?.8:.4})`,"--keyword-hue":String(t)}}var S9={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1};function C9({value:e,counts:t,onChange:n}){let r=Y(),i=(0,v.useRef)([]),a=e=>{i.current[e]?.focus(),n(dO[e])};return(0,H.jsx)(`div`,{role:`radiogroup`,"aria-label":r(`Show skills by modification`),className:`inline-flex flex-wrap gap-1.5`,onKeyDown:t=>{let n=S9[t.key];if(!n)return;t.preventDefault();let r=getComputedStyle(t.currentTarget).direction===`rtl`,i=t.key===`ArrowLeft`||t.key===`ArrowRight`,o=r&&i?-n:n,s=dO.indexOf(e);a((s+o+dO.length)%dO.length)},children:dO.map((n,o)=>(0,H.jsx)(`button`,{ref:e=>{i.current[o]=e},type:`button`,role:`radio`,"aria-checked":e===n,tabIndex:e===n?0:-1,className:V(`min-h-9 rounded-[10px] border px-3 text-ui transition-colors duration-150 focus-visible:outline-2 focus-visible:outline-ring`,e===n?b9[n].chosen:b9[n].idle),style:n===`suggested`?x9(e===n):void 0,onClick:()=>a(o),children:Ff(r(y9[n]),{count:Wf(t[n])})},n))})}var w9=(e,t)=>e.name.localeCompare(t.name,void 0,{sensitivity:`base`}),T9=[{value:`uses`,label:`Most used`,first:`desc`,compare:(e,t)=>e.uses-t.uses},{value:`attention`,label:`Needs attention`,first:`desc`,compare:(e,t)=>e.attention-t.attention},{value:`name`,label:`Name (A–Z)`,first:`asc`,compare:w9},{value:`lastUsed`,label:`Last used`,first:`desc`,compare:(e,t)=>(e.lastUsedAt??0)-(t.lastUsedAt??0),last:e=>e.lastUsedAt===null},{value:`failed`,label:`Failed turns`,first:`desc`,compare:(e,t)=>e.failedTurns-t.failedTurns},{value:`lastModified`,label:`Last modified`,first:`desc`,compare:(e,t)=>(e.lastAppliedAt??0)-(t.lastAppliedAt??0),last:e=>e.lastAppliedAt===null}],E9=(e,t)=>(e.errorLine??``).localeCompare(t.errorLine??``,void 0,{sensitivity:`base`}),D9=[{value:`calls`,label:`Most calls`,first:`desc`,compare:(e,t)=>e.calls-t.calls},{value:`lastSeen`,label:`Last seen`,first:`desc`,compare:(e,t)=>e.lastSeenAt-t.lastSeenAt},{value:`tool`,label:`Tool (A–Z)`,first:`asc`,compare:(e,t)=>w9(e,t)||E9(e,t)}],O9=[`pending`,`applied`,`rejected`,`stale`,`undone`],k9=(e,t)=>e.updatedAt-t.updatedAt,A9=[{value:`newest`,label:`Newest`,first:`desc`,flip:`oldest`,compare:k9},{value:`oldest`,label:`Oldest`,first:`asc`,flip:`newest`,compare:k9},{value:`state`,label:`State`,first:`asc`,compare:(e,t)=>O9.indexOf(e.state)-O9.indexOf(t.state)},{value:`skill`,label:`Skill`,first:`asc`,compare:(e,t)=>w9({name:e.skillName},{name:t.skillName})}],j9=[{value:`newest`,label:`Newest`,first:`desc`,flip:`oldest`},{value:`oldest`,label:`Oldest`,first:`asc`,flip:`newest`}],M9=e=>e.order===`asc`;function N9(e){return[`Tool: ${e.name}`,`Error: ${e.error??`(no error text recorded)`}`,`Input: ${e.input}`].join(`
|
|
171
|
-
`)}function P9({call:e}){let t=Y(),[n,r]=(0,v.useState)(!1),[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)(!1),c=e.input.length>400,l=c&&!n?e.input.slice(0,400)+`…`:e.input;async function u(){try{await navigator.clipboard.writeText(N9(e)),s(!1),a(!0),window.setTimeout(()=>a(!1),2e3)}catch{a(!1),s(!0),window.setTimeout(()=>s(!1),4e3)}}return(0,H.jsxs)(`div`,{className:`min-w-0 space-y-1.5 rounded-xl border border-border bg-card px-3 py-2.5`,children:[(0,H.jsxs)(`p`,{className:`flex flex-wrap gap-x-3 gap-y-0.5 text-xs text-muted-foreground`,children:[(0,H.jsx)(`span`,{className:`font-mono`,dir:`ltr`,children:e.name}),(0,H.jsx)(`span`,{dir:`ltr`,children:Ff(t(`Position {position}`),{position:e.position})}),`createdAt`in e?(0,H.jsx)(`span`,{children:wp(e.createdAt)}):null,`projectName`in e&&e.projectName?(0,H.jsx)(`bdi`,{children:e.projectName}):null]}),(0,H.jsx)(`p`,{className:`break-words text-sm`,dir:`auto`,children:e.error??(0,H.jsx)(`span`,{className:`text-muted-foreground`,children:t(`No error text recorded`)})}),(0,H.jsx)(`pre`,{dir:`ltr`,className:`max-h-64 overflow-y-auto rounded-lg bg-secondary px-2.5 py-2 font-mono text-xs whitespace-pre-wrap [overflow-wrap:anywhere]`,children:l}),e.inputCut?(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t(`The server sent the first 20000 characters of this input.`)}):null,(0,H.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[c?(0,H.jsx)(q,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>r(e=>!e),children:t(n?`Show less input`:`Show full input`)}):null,(0,H.jsxs)(q,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>void u(),children:[i?(0,H.jsx)(le,{"aria-hidden":`true`}):(0,H.jsx)(xe,{"aria-hidden":`true`}),(0,H.jsx)(`span`,{role:`status`,children:t(i?`Copied`:`Copy`)})]}),o?(0,H.jsx)(`span`,{role:`status`,className:`self-center text-xs text-destructive-label`,children:t(`Could not copy`)}):null]})]})}function F9({title:e,calls:t,totalCount:n,loading:r,loadError:i,onClose:a}){let o=Y();return(0,H.jsx)(Du,{open:!0,onOpenChange:e=>void(!e&&a()),children:(0,H.jsxs)(Au,{className:`sm:max-w-2xl`,children:[(0,H.jsxs)(ju,{children:[(0,H.jsx)(Nu,{children:e}),n!==void 0&&t.length>0?(0,H.jsx)(Pu,{children:Ff(o(n===1?`{count} call is in this group; showing the latest {shown}.`:`{count} calls are in this group; showing the latest {shown}.`),{count:n,shown:t.length})}):null]}),i?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive-label`,children:o(`The failed calls could not be loaded.`)}),(0,H.jsx)(Mu,{children:(0,H.jsx)(q,{type:`button`,variant:`outline`,onClick:a,children:o(`Close`)})})]}):r?(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:o(`Loading…`)}):(0,H.jsx)(`div`,{className:`space-y-3`,children:t.map(e=>(0,H.jsx)(P9,{call:e},`turnId`in e?`${e.turnId}-${e.position}`:e.position))})]})})}function Gee({turn:e}){let t=Ff(Y()(e.failedToolCalls===1?`{count} failed tool call`:`{count} failed tool calls`),{count:e.failedToolCalls}),[n,r]=(0,v.useState)(!1),[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)([]),[c,l]=(0,v.useState)(``);async function u(){r(!0),a(!0),l(``);let t=await CC.turnFailures(e.id);if(a(!1),!t.ok){l(t.error);return}s(t.data.failures)}return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(q,{type:`button`,variant:`link`,"aria-haspopup":`dialog`,className:`h-auto p-0 text-xs font-normal text-destructive-label underline decoration-dotted underline-offset-2`,onClick:()=>void u(),children:t}),n?(0,H.jsx)(F9,{title:t,calls:o,loading:i,loadError:c,onClose:()=>r(!1)}):null]})}function I9({turns:e,nested:t=!1}){let n=Y();return e.length===0?(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n(`No recorded turns.`)}):(0,H.jsx)(`ul`,{className:`space-y-3`,children:e.map(e=>(0,H.jsxs)(`li`,{className:V(`min-w-0 space-y-1 border border-border px-3 py-2.5`,t?`rounded-lg bg-muted`:`rounded-xl bg-card`),children:[(0,H.jsx)(`p`,{className:`line-clamp-3 break-words text-sm`,dir:`auto`,children:e.promptPreview||n(`(empty prompt)`)}),(0,H.jsxs)(`p`,{className:`flex flex-wrap gap-x-3 gap-y-0.5 text-xs text-muted-foreground`,children:[(0,H.jsx)(`span`,{children:wp(e.createdAt)}),(0,H.jsx)(`span`,{dir:`ltr`,children:e.host}),e.projectName?(0,H.jsx)(`bdi`,{children:e.projectName}):null,e.failedToolCalls>0?(0,H.jsx)(Gee,{turn:e}):null]})]},e.id))})}function Kee(e,t,n){let r=e.length>3;return!r||!t?{canExpand:r,moreCount:r?Math.min(e.length,6)-3:0,...ip(e,1,3)}:{canExpand:r,moreCount:0,...ip(e,n,6)}}function qee({turns:e,expanded:t,page:n,onToggle:r,onPage:i}){let a=Y(),o=(0,v.useId)(),s=Kee(e,t,n),c=t?pe:ue;return(0,H.jsxs)(`div`,{className:`space-y-3`,children:[(0,H.jsx)(`div`,{id:o,children:(0,H.jsx)(I9,{turns:s.items,nested:!0})}),s.canExpand?(0,H.jsxs)(q,{type:`button`,variant:`ghost`,size:`sm`,"aria-expanded":t,"aria-controls":o,onClick:r,children:[(0,H.jsx)(c,{"aria-hidden":`true`}),t?a(`Show less`):Ff(a(`Show {count} more`),{count:s.moreCount})]}):null,t?(0,H.jsx)(mp,{view:{...s,setPage:i}}):null]})}function Jee({turns:e}){let[t,n]=(0,v.useState)(!1),[r,i]=(0,v.useState)(1);return(0,H.jsx)(qee,{turns:e,expanded:t,page:r,onToggle:()=>{n(e=>!e),i(1)},onPage:i})}var Yee={add:`bg-status-success/15 text-status-success`,del:`bg-destructive/10 text-destructive-label`,hunk:`text-status-info`,ctx:`text-muted-foreground`};function Xee({diff:e,label:t}){return(0,H.jsx)(`pre`,{dir:`ltr`,tabIndex:0,"aria-label":t,className:`max-h-96 overflow-auto rounded-lg border border-border bg-background py-1 font-mono text-xs leading-5`,children:zf(e).map((e,t)=>(0,H.jsx)(`code`,{"data-line":e.kind,className:V(`block px-2 whitespace-pre-wrap break-words`,Yee[e.kind]),children:e.text||` `},t))})}function L9({detail:e,part:t}){let n=Y();if(t===`evidence`)return e?.status!==`ready`||e.proposal.evidenceTurnIds.length===0?null:(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(`h4`,{className:`text-sm font-medium`,children:n(`Evidence turns`)}),(0,H.jsx)(Jee,{turns:e.evidence})]});if(e===null)return(0,H.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,H.jsx)(at,{className:`size-3.5 animate-spin`,"aria-hidden":`true`}),n(`Loading the proposal…`)]});if(e.status===`failed`)return(0,H.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive-label`,children:n(`The proposal could not be loaded. Select Show less, then Show more to try again.`)});let{proposal:r}=e;return r.diff?(0,H.jsx)(Xee,{diff:r.diff,label:n(`Changes to SKILL.md`)}):(0,H.jsx)(`pre`,{dir:`ltr`,className:`max-h-96 overflow-auto rounded-lg border border-border bg-background p-2 font-mono text-xs`,children:r.content})}async function Zee(e,t=CC.proposal){let n=await t(e);return n.ok?{status:`ready`,proposal:n.data.proposal,evidence:n.data.evidence}:{status:`failed`}}function Qee(e,t,n=null){let[r,i]=(0,v.useState)(n),a=r?.status===`ready`;return(0,v.useEffect)(()=>{if(!t||a)return;let n=!0;return Zee(e).then(e=>{n&&i(e)}),()=>{n=!1,i(e=>e?.status===`ready`?e:null)}},[t,a,e]),r}function $ee(e,t){return e===`state-write-failed`?{message:`The state could not be saved, so SKILL.md is as it was. Try again.`,reload:!0}:{message:t,reload:!1}}function R9({savedContent:e}){let t=Y();return(0,H.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,H.jsx)(`p`,{className:`text-sm`,children:t(`Undo stopped because the file changed. This is the content OMMS saved:`)}),e===null?(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t(`No content was saved.`)}):(0,H.jsx)(`pre`,{dir:`ltr`,className:`max-h-72 overflow-auto rounded-lg border border-border bg-background p-2 font-mono text-xs`,children:e})]})}var ete=(e,t)=>({...e,state:`stale`,updatedAt:t}),tte={applied:`Applied {date}`,rejected:`Rejected {date}`,undone:`Undone {date}`,stale:`Stale since {date}`};function nte({proposal:e}){let t=Y(),n=e.state===`pending`?null:tte[e.state];return(0,H.jsxs)(`span`,{className:`flex flex-wrap gap-x-2 text-xs text-muted-foreground`,children:[(0,H.jsx)(`span`,{children:Ff(t(`Created {date}`),{date:wp(e.createdAt)})}),n?(0,H.jsx)(`span`,{children:Ff(t(n),{date:wp(e.updatedAt)})}):null]})}function rte({proposal:e}){let t=Y(),{added:n,removed:r}=e;return n===0&&r===0?null:(0,H.jsxs)(`span`,{dir:`ltr`,className:`inline-flex w-fit items-center gap-1 rounded-[7px] border border-border bg-background px-2 font-mono text-xs tabular-nums leading-5`,children:[(0,H.jsx)(`span`,{className:`sr-only`,children:Ff(t(`{added} lines added, {removed} lines removed`),{added:n,removed:r})}),(0,H.jsxs)(`span`,{"aria-hidden":`true`,className:`text-status-success`,children:[`+`,n]}),(0,H.jsxs)(`span`,{"aria-hidden":`true`,className:`text-destructive-label`,children:[`−`,r]}),(0,H.jsx)(`span`,{"aria-hidden":`true`,className:`text-muted-foreground`,children:t(`lines`)})]})}function z9({proposal:e,onChange:t,initiallyOpen:n=!1,initialDetail:r=null}){let i=Y(),a=Lf(e),o=e.state===`pending`,s=(0,v.useId)(),c=(0,v.useId)(),l=(0,v.useId)(),u=e.canUndo!==!1,[d,f]=(0,v.useState)(n),p=d?pe:ue,m=Qee(e.id,d,r),[h,g]=(0,v.useState)(!1),[_,y]=(0,v.useState)(``),[b,x]=(0,v.useState)(void 0);async function S(n){g(!0),y(``),x(void 0);let r=await n();if(g(!1),r.ok)t(Vf(r.data.proposal));else{let n=$ee(r.code,r.error);y(i(n.message)),n.reload&&CC.proposal(e.id).then(e=>{e.ok&&t(Vf(e.data.proposal))}),r.code===`changed`&&x(r.savedContent??null),r.code===`stale`&&t(ete(e,Date.now()))}}return(0,H.jsxs)(`article`,{className:`min-w-0 space-y-3 rounded-xl border border-border bg-card p-3`,children:[(0,H.jsxs)(`header`,{className:`flex flex-wrap items-center gap-2`,children:[(0,H.jsx)(`h3`,{className:`min-w-0 break-words text-sm font-semibold`,children:e.skillName}),(0,H.jsx)(AE,{label:i(a),colourKey:a}),(0,H.jsx)(AE,{label:i(e.kind===`new`?`New skill`:`Improvement`),colourKey:e.kind}),(0,H.jsx)(nte,{proposal:e})]}),e.summary||e.added||e.removed||d?(0,H.jsxs)(`div`,{className:`space-y-2 rounded-lg border border-border bg-muted p-3`,children:[e.summary?(0,H.jsx)(`p`,{className:V(`break-words text-sm`,d?``:`line-clamp-2`),dir:`auto`,children:e.summary}):null,(0,H.jsx)(rte,{proposal:e}),(0,H.jsx)(`div`,{id:c,hidden:!d,className:`space-y-3`,children:d?(0,H.jsx)(L9,{detail:m,part:`content`}):null})]}):null,e.state===`stale`?(0,H.jsx)(Xp,{tone:`warning`,children:(0,H.jsx)(`p`,{children:i(`Stale: the file changed since this draft`)})}):null,(0,H.jsx)(`div`,{id:l,hidden:!d,children:d?(0,H.jsx)(L9,{detail:m,part:`evidence`}):null}),o||e.state===`applied`?(0,H.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:o?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(q,{type:`button`,size:`sm`,disabled:h,onClick:()=>void S(()=>CC.apply(e.id)),children:[(0,H.jsx)(le,{"aria-hidden":`true`}),i(`Apply`)]}),(0,H.jsxs)(q,{type:`button`,variant:`destructive`,size:`sm`,disabled:h,onClick:()=>void S(()=>CC.reject(e.id)),children:[(0,H.jsx)(an,{"aria-hidden":`true`}),i(`Reject`)]})]}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(q,{type:`button`,variant:`outline`,size:`sm`,disabled:h||!u,"aria-describedby":u?void 0:s,onClick:()=>void S(()=>CC.undo(e.id)),children:[(0,H.jsx)(Zt,{"aria-hidden":`true`}),i(`Undo`)]}),u?null:(0,H.jsx)(`span`,{id:s,className:`self-center text-xs text-muted-foreground`,children:i(`Revert the newer change first.`)})]})}):null,_?(0,H.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive-label`,children:_}):null,b===void 0?null:(0,H.jsx)(R9,{savedContent:b}),Uf(e)?(0,H.jsxs)(q,{type:`button`,variant:`ghost`,size:`sm`,"aria-expanded":d,"aria-controls":`${c} ${l}`,onClick:()=>f(e=>!e),children:[(0,H.jsx)(p,{"aria-hidden":`true`}),i(d?`Show less`:`Show more`)]}):null]})}var B9=`omms-list-pending-v2`,V9=`omms-list-recent-v2`,H9=`omms-list-skill-proposals-v2`,ite={[B9]:`omms-list-pending`,[V9]:`omms-list-recent`,[H9]:`omms-list-skill-proposals`};function U9({storageKey:e,proposals:t,onChange:n}){let r=Y(),{view:i,pageItems:a}=xp({storageKey:e,legacyKey:ite[e],items:t,sorts:A9,defaultPerPage:3});return(0,H.jsx)(_p,{view:i,totalLabel:Ff(r(i.total===1?`{count} proposal`:`{count} proposals`),{count:i.total}),children:(0,H.jsx)(`div`,{className:`space-y-3`,children:a.map(e=>(0,H.jsx)(z9,{proposal:e,onChange:n},e.id))})})}function W9(){let[e,t]=(0,v.useState)({kind:`none`});return{value:e,clear:()=>t({kind:`none`}),show:e=>{e.ok?t(e.code===`no-change`?{kind:`no-change`}:{kind:`none`}):t(e.code===`not-configured`?{kind:`not-configured`}:{kind:`error`,text:e.error})}}}function G9({notice:e}){let t=Y();if(e.kind===`none`)return null;if(e.kind===`no-change`)return(0,H.jsx)(`p`,{role:`status`,className:`text-sm`,children:t(`No change proposed`)});if(e.kind===`error`)return(0,H.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive-label`,children:e.text});let n=`${J.settings}#settings-section-external-api`;return(0,H.jsxs)(Xp,{tone:`info`,children:[(0,H.jsx)(`p`,{children:t(`Drafting needs the external API. Set it up first.`)}),(0,H.jsx)(`a`,{className:`underline`,href:n,onClick:e=>{e.preventDefault(),Em(n)},children:t(`External API`)})]})}var ate=[`manual`,`automatic`];function ote({mode:e,disabled:t,confirming:n,onSelect:r,onConfirm:i,onCancel:a}){let o=Y();return(0,H.jsxs)(`div`,{className:`space-y-3`,children:[(0,H.jsx)(`div`,{role:`radiogroup`,"aria-label":o(`Mode`),className:`inline-flex gap-1.5`,children:ate.map(n=>(0,H.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":e===n,disabled:t,className:V(`min-h-9 rounded-[10px] border px-3 text-ui transition-colors duration-150 focus-visible:outline-2 focus-visible:outline-ring disabled:opacity-50`,e===n?`border-primary/40 bg-selection text-foreground`:`border-input bg-card text-muted-foreground hover:bg-interactive-hover`),onClick:()=>r(n),children:o(n===`manual`?`Manual`:`Automatic`)},n))}),n?(0,H.jsxs)(Xp,{tone:`warning`,children:[(0,H.jsx)(`p`,{className:`font-medium`,children:o(`Turn on Automatic mode for this skill?`)}),(0,H.jsx)(`p`,{children:o(`OMMS will change this SKILL.md file without asking. It drafts an improvement after 10 new uses and at least 24 hours, then applies it. Each change can be undone.`)}),(0,H.jsxs)(`div`,{className:`flex flex-wrap gap-2 pt-1`,children:[(0,H.jsx)(q,{type:`button`,size:`sm`,disabled:t,onClick:i,children:o(`Turn on Automatic`)}),(0,H.jsx)(q,{type:`button`,variant:`outline`,size:`sm`,onClick:a,children:o(`Cancel`)})]})]}):null]})}function ste({mode:e,disabled:t,onChoose:n}){let[r,i]=(0,v.useState)(!1);return(0,H.jsx)(ote,{mode:e,disabled:t,confirming:r,onSelect:t=>{t!==e&&(t===`automatic`?i(!0):(i(!1),n(t)))},onConfirm:()=>{i(!1),n(`automatic`)},onCancel:()=>i(!1)})}function K9({at:e,className:t}){let n=Ff(Y()(`Modified on {date}`),{date:wp(e)});return(0,H.jsx)(bf,{content:n,className:t,children:(0,H.jsxs)(`span`,{tabIndex:0,className:`inline-flex rounded-full text-status-success focus-visible:outline-2 focus-visible:outline-ring`,children:[(0,H.jsx)(ge,{className:`size-4`,"aria-hidden":`true`}),(0,H.jsx)(`span`,{className:`sr-only`,children:n})]})})}var q9=`omms-explain-failures-confirmed`;function cte(){try{return window.localStorage.getItem(q9)===`1`}catch{return!1}}function lte(){try{window.localStorage.setItem(q9,`1`)}catch{}}function J9(e,t){return[(0,H.jsx)(`p`,{children:e(`This sends the failure groups (tool names, error text and input excerpts of up to 500 characters) and this skill's SKILL.md to the external API model.`)},`what`),t?(0,H.jsx)(`p`,{children:e(`The text is sent as stored, after <private> removal and secret redaction.`)},`redact`):(0,H.jsx)(`p`,{children:e(`Warning: redaction is off. The text may hold secrets that were not removed.`)},`no-redact`)]}function ute(e,t){switch(t){case`skill`:return e(`Skill fix`);case`harness`:return e(`Host or harness bug`);case`environment`:return e(`Environment problem`);default:return e(`Unknown`)}}function dte({cause:e}){let t=Y();return(0,H.jsxs)(`li`,{className:`space-y-1.5 rounded-xl border border-border bg-card px-3 py-2.5`,children:[(0,H.jsx)(`p`,{className:`text-xs font-medium text-muted-foreground`,children:ute(t,e.kind)}),(0,H.jsx)(`p`,{className:`break-words text-sm`,dir:`auto`,children:e.explanation}),e.actions.length>0?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t(`Suggested actions`)}),(0,H.jsx)(`ul`,{className:`list-disc space-y-0.5 ps-5 text-sm`,children:e.actions.map((e,t)=>(0,H.jsx)(`li`,{dir:`auto`,children:e},t))})]}):null]})}function fte({skill:e,groups:t}){let n=Y(),[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(!1),[s,c]=(0,v.useState)(!1),[l,u]=(0,v.useState)(!1),[d,f]=(0,v.useState)(``),[p,m]=(0,v.useState)(!1),[h,g]=(0,v.useState)(null);(0,v.useEffect)(()=>{let e=!0;return CC.stats().then(t=>{e&&(t.ok?i({recording:t.data.recording,redact:t.data.redact}):o(!0))}),()=>{e=!1}},[]);async function _(){c(!0),f(``),m(!1);let t=await CC.explainFailures(e.path,e.name);if(c(!1),!t.ok){t.code===`not-configured`?m(!0):f(t.error);return}g(t.data.explanation)}let y=t!==null&&t.length===0,b=r!==null&&!r.recording,x=s||t===null||r===null&&!a||b||y,S=r?.redact===!0;function C(){if(!x){if(cte()){_();return}u(!0)}}return(0,H.jsxs)(`div`,{className:`space-y-3`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,H.jsxs)(q,{type:`button`,size:`sm`,disabled:x,onClick:C,children:[(0,H.jsx)(Bt,{"aria-hidden":`true`}),n(`Explain failures`)]}),s?(0,H.jsxs)(`span`,{role:`status`,className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,H.jsx)(at,{className:`size-4 animate-spin`,"aria-hidden":`true`}),n(`Explaining… This can take a few minutes.`)]}):b?(0,H.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:n(`Skill learning must be on to explain failures.`)}):y?(0,H.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:n(`No failure groups to explain.`)}):null,(0,H.jsx)(ox,{label:n(`About Explain failures`),children:(0,H.jsx)(`div`,{className:`space-y-1.5`,children:J9(n,S)})})]}),p?(0,H.jsxs)(Xp,{tone:`info`,children:[(0,H.jsx)(`p`,{children:n(`Explaining needs the external API. Set it up first.`)}),(0,H.jsx)(`a`,{className:`underline`,href:`${J.settings}#settings-section-external-api`,onClick:e=>{e.preventDefault(),Em(`${J.settings}#settings-section-external-api`)},children:n(`External API`)})]}):null,d?(0,H.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive-label`,children:d}):null,h?(0,H.jsxs)(`div`,{className:`space-y-3`,children:[(0,H.jsx)(`p`,{className:`break-words text-sm`,dir:`auto`,children:h.summary}),(0,H.jsx)(`ul`,{className:`space-y-2`,children:h.causes.map((e,t)=>(0,H.jsx)(dte,{cause:e},t))}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`The labels and suggestions are leads from the error text only; the model cannot see the host's code.`)})]}):null,(0,H.jsx)(Du,{open:l,onOpenChange:e=>{e||u(!1)},children:(0,H.jsxs)(Au,{children:[(0,H.jsxs)(ju,{children:[(0,H.jsx)(Nu,{children:n(`Send failures to the external API?`)}),(0,H.jsx)(Pu,{children:n(`Nothing is sent until you confirm. Nothing is saved.`)})]}),(0,H.jsx)(Xp,{tone:S?`warning`:`danger`,children:(0,H.jsx)(`div`,{className:`space-y-1.5`,children:J9(n,S)})}),(0,H.jsxs)(Mu,{children:[(0,H.jsx)(q,{type:`button`,variant:`outline`,onClick:()=>u(!1),children:n(`Cancel`)}),(0,H.jsx)(q,{type:`button`,onClick:()=>{lte(),u(!1),_()},children:n(`Explain failures`)})]})]})})]})}var pte=`omms-list-skill-failures`;function Y9(e,t){return`${t.name} — ${t.errorLine??e(`no error text`)}`}function mte({skill:e,reloadKey:t}){let n=Y(),[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(null),{view:l,pageItems:u}=xp({storageKey:pte,items:r??[],sorts:D9});return(0,v.useEffect)(()=>{let t=!0;return CC.skillFailures(e.path,e.name).then(e=>{if(t){if(!e.ok)return o(e.error);o(``),i(e.data.groups)}}),()=>{t=!1}},[e.path,e.name,t]),(0,H.jsxs)(`section`,{className:`space-y-3`,"aria-labelledby":`skill-failures-title`,children:[(0,H.jsx)(`h3`,{id:`skill-failures-title`,className:`text-section-title font-semibold`,children:n(`Failures`)}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`Failed calls that count against this skill, grouped by tool and first error line.`)}),(0,H.jsx)(fte,{skill:e,groups:r}),a?(0,H.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive-label`,children:a}):r===null?(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n(`Loading…`)}):r.length===0?(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n(`No failed tool calls are recorded for this skill.`)}):(0,H.jsx)(_p,{view:l,totalLabel:Ff(n(l.total===1?`{count} failure group`:`{count} failure groups`),{count:l.total}),children:(0,H.jsx)(`ul`,{className:`space-y-3`,children:u.map(e=>(0,H.jsx)(`li`,{children:(0,H.jsxs)(`button`,{type:`button`,"aria-haspopup":`dialog`,onClick:()=>c(e),className:`flex w-full cursor-pointer items-start gap-2 rounded-xl border border-border bg-card px-3 py-2.5 text-start hover:bg-interactive-hover`,children:[(0,H.jsx)(fe,{className:`rtl:-scale-x-100 mt-0.5 size-4 shrink-0`,"aria-hidden":`true`}),(0,H.jsxs)(`span`,{className:`min-w-0 flex-1 space-y-1`,children:[(0,H.jsx)(`span`,{className:`block break-words text-sm`,dir:`auto`,children:Y9(n,e)}),(0,H.jsxs)(`span`,{className:`block text-xs text-muted-foreground`,children:[Ff(n(e.calls===1?e.turns===1?`{calls} call over {turns} turn`:`{calls} call over {turns} turns`:e.turns===1?`{calls} calls over {turns} turn`:`{calls} calls over {turns} turns`),{calls:e.calls,turns:e.turns}),` · `,Ff(n(`Last seen {date}`),{date:wp(e.lastSeenAt)})]})]})]})},`${e.name}\u0000${e.errorLine??``}`))})}),s?(0,H.jsx)(F9,{title:Y9(n,s),calls:s.latest,totalCount:s.calls,loading:!1,loadError:``,onClose:()=>c(null)}):null]})}var hte=e=>e.kind===`applied`&&e.appliedBy===`automatic`?`applied automatically`:e.kind;function gte({entry:e,confirming:t,working:n,locked:r,onAsk:i,onConfirm:a,onCancel:o}){let s=Y(),c=(0,v.useId)(),l=hte(e),u=e.added>0||e.removed>0;return(0,H.jsxs)(`li`,{className:`relative min-w-0 space-y-1.5`,children:[(0,H.jsx)(`span`,{"aria-hidden":`true`,className:`absolute -start-[21.5px] top-1.5 size-2.5 rounded-full border-2 border-background`,style:{backgroundColor:`oklch(0.66 0.14 ${Wd(l)})`}}),(0,H.jsxs)(`p`,{className:`flex flex-wrap items-center gap-2`,children:[(0,H.jsx)(AE,{label:s(l),colourKey:l}),(0,H.jsx)(`time`,{dateTime:new Date(e.at).toISOString(),className:`text-xs text-muted-foreground`,children:wp(e.at)}),u?(0,H.jsxs)(`span`,{className:`font-mono text-xs tabular-nums`,dir:`ltr`,"aria-label":Ff(s(`{added} lines added, {removed} lines removed`),{added:e.added,removed:e.removed}),children:[(0,H.jsxs)(`span`,{className:`text-status-success`,children:[`+`,e.added]}),` `,(0,H.jsxs)(`span`,{className:`text-destructive-label`,children:[`−`,e.removed]})]}):null]}),e.summary?(0,H.jsx)(`p`,{className:`break-words text-sm`,dir:`auto`,children:e.summary}):null,e.kind===`applied`?(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 pt-0.5`,children:[(0,H.jsxs)(q,{type:`button`,variant:`outline`,size:`sm`,disabled:!e.canUndo||r||t,"aria-describedby":e.canUndo?void 0:c,onClick:i,children:[(0,H.jsx)(Zt,{"aria-hidden":`true`}),s(`Revert to before this change`)]}),e.canUndo?null:(0,H.jsx)(`span`,{id:c,className:`text-xs text-muted-foreground`,children:s(`Revert the newer change first.`)}),n?(0,H.jsxs)(`span`,{role:`status`,className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,H.jsx)(at,{className:`size-4 animate-spin`,"aria-hidden":`true`}),s(`Reverting…`)]}):null]}):null,t?(0,H.jsxs)(Xp,{tone:`warning`,children:[(0,H.jsx)(`p`,{className:`font-medium`,children:s(`Revert this change?`)}),(0,H.jsx)(`p`,{children:s(`OMMS restores SKILL.md as it was before this change.`)}),e.laterAppliedCount>0?(0,H.jsx)(`p`,{className:`font-medium`,children:Ff(s(e.laterAppliedCount===1?`Reverting this also removes {count} later change.`:`Reverting this also removes {count} later changes.`),{count:e.laterAppliedCount})}):null,(0,H.jsxs)(`div`,{className:`flex flex-wrap gap-2 pt-1`,children:[(0,H.jsx)(q,{type:`button`,size:`sm`,disabled:n||r,onClick:a,children:s(`Revert`)}),(0,H.jsx)(q,{type:`button`,variant:`outline`,size:`sm`,onClick:o,children:s(`Cancel`)})]})]}):null]})}function _te(e){let t=Y(),{view:n,entries:r,loaded:i,error:a,notice:o,refreshing:s=!1}=e;return(0,H.jsxs)(`section`,{className:`space-y-3`,"aria-labelledby":`skill-history-title`,children:[(0,H.jsx)(`h3`,{id:`skill-history-title`,className:`text-section-title font-semibold`,children:t(`History`)}),(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t(`Each proposal, apply, reject and undo of this skill. Revert an applied change to restore SKILL.md as it was before it.`)}),o?.tone===`done`?(0,H.jsx)(`p`,{role:`status`,className:`text-sm text-status-success`,children:t(`Reverted. SKILL.md is back to the version before that change.`)}):null,o?.tone===`error`?(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive-label`,children:o.text}),o.savedContent===void 0?null:(0,H.jsx)(R9,{savedContent:o.savedContent})]}):null,a?(0,H.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive-label`,children:a}):i?n.total===0?(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t(`No history yet.`)}):(0,H.jsx)(_p,{view:n,totalLabel:Ff(t(n.total===1?`{count} entry`:`{count} entries`),{count:n.total}),children:(0,H.jsx)(`ol`,{"aria-busy":s,className:`ms-1.5 space-y-4 border-s border-border ps-4 transition-opacity ${s?`opacity-60`:``}`,children:r.map(t=>(0,H.jsx)(gte,{entry:t,confirming:e.confirmId===t.id,working:e.workingId===t.id,locked:e.workingId!==null||s,onAsk:()=>e.onAsk(t),onConfirm:()=>e.onConfirm(t),onCancel:e.onCancel},t.id))})}):(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t(`Loading…`)})]})}function vte({skill:e,reloadKey:t,onChanged:n}){let[r,i]=(0,v.useState)(0),[a,o]=(0,v.useState)([]),[s,c]=(0,v.useState)(!1),[l,u]=(0,v.useState)(``),[d,f]=(0,v.useState)(``),[p,m]=(0,v.useState)(null),[h,g]=(0,v.useState)(null),[_,y]=(0,v.useState)(null),b=bp({storageKey:`omms-list-skill-history`,total:r,sorts:j9}),x=M9(b),{offset:S,limit:C}=ap(b.page,b.perPage,r,x),w=`${e.path}|${e.name}|${C}|${S}|${x}|${t}`;(0,v.useEffect)(()=>{let t=!0;return CC.history(e.path,e.name,{limit:C,offset:S}).then(e=>{if(!t)return;if(c(!0),!e.ok)return f(e.error);let n=DO(e.data);f(``),i(n.total);let r=n.entries.slice(0,C);o(x?r.reverse():r),u(w)}),()=>{t=!1}},[e.path,e.name,C,S,x,t,w]);async function T(e){m(null),g(e.id),y(null);let t=await CC.undo(e.proposalId);if(g(null),t.ok){y({tone:`done`}),n();return}y({tone:`error`,text:t.error,...t.code===`changed`?{savedContent:t.savedContent??null}:{}})}return(0,H.jsx)(_te,{view:b,entries:a,loaded:s,error:d,confirmId:p,workingId:h,notice:_,refreshing:s&&l!==w,onAsk:e=>{y(null),m(e.id)},onConfirm:e=>void T(e),onCancel:()=>m(null)})}var X9=[{id:`skill-section-uses`,title:`Uses in the last 30 days`},{id:`skill-section-mode`,title:`Mode`},{id:`skill-section-proposals`,title:`Proposals`},{id:`skill-section-history`,title:`History`},{id:`skill-section-turns`,title:`Recent turns`},{id:`skill-section-failures`,title:`Failures`}];function yte({onBack:e,hasMode:t=!0}){let n=Y(),r=t?X9:X9.filter(e=>e.id!==`skill-section-mode`);return(0,H.jsx)(gx,{storageKey:`omms-skill-toc-open`,sections:r,back:{label:n(`All skills`),onBack:e}})}function bte({skill:e,reloadKey:t}){let n=Y(),[r,i]=(0,v.useState)(0),[a,o]=(0,v.useState)(null),[s,c]=(0,v.useState)(``),l=bp({storageKey:`omms-list-skill-turns`,total:r,sorts:j9}),u=M9(l),{offset:d,limit:f}=ap(l.page,l.perPage,r,u);return(0,v.useEffect)(()=>{let t=!0;return CC.skill(e.path,e.name,{limit:f,offset:d}).then(e=>{if(!t)return;if(!e.ok)return c(e.error);let n=(e.data.recentTurns??[]).slice(0,f);c(``),i(e.data.turnTotal??n.length),o(u?n.reverse():n)}),()=>{t=!1}},[e.path,e.name,f,d,u,t]),(0,H.jsxs)(`section`,{className:`space-y-3`,"aria-labelledby":`skill-turns-title`,children:[(0,H.jsx)(`h3`,{id:`skill-turns-title`,className:`text-section-title font-semibold`,children:n(`Recent turns`)}),s?(0,H.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive-label`,children:s}):a===null?(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n(`Loading…`)}):r===0?(0,H.jsx)(I9,{turns:[]}):(0,H.jsx)(_p,{view:l,totalLabel:Ff(n(r===1?`{count} turn`:`{count} turns`),{count:r}),children:(0,H.jsx)(I9,{turns:a})})]})}var xte=e=>e.ok?``:e.error;function Ste(e,t){t.setDetail(t=>t&&{...t,proposals:t.proposals.map(t=>t.id===e.id?e:t)}),t.bumpHistory(),t.reload()}function Cte({skill:e,onBack:t,onChanged:n}){let r=Y(),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(e.mode),[f,p]=(0,v.useState)(``),m=W9(),[h,g]=(0,v.useState)(0),_=(0,v.useCallback)(async()=>{let t=await CC.skill(e.path,e.name,{limit:1,offset:0});t.ok&&a(t.data),s(xte(t))},[e.path,e.name]),y=()=>{g(e=>e+1),_(),n()};(0,v.useEffect)(()=>{_()},[_]);async function b(){l(!0),m.clear();let t=await CC.draftImprovement(e.path??e.name);l(!1),m.show(t),t.ok&&y()}async function x(t){if(!e.path)return;p(``);let r=await CC.setMode(e.path,t);r.ok?(d(t),n()):p(r.error)}let S=e=>Ste(e,{setDetail:a,bumpHistory:()=>g(e=>e+1),reload:()=>void _()}),C=i?.proposals??[],w=i?.skill??e;return(0,H.jsxs)(`div`,{className:`space-y-8`,children:[(0,H.jsx)(yte,{onBack:t,hasMode:!!e.path}),(0,H.jsxs)(`div`,{className:`space-y-3`,children:[(0,H.jsxs)(q,{type:`button`,variant:`ghost`,size:`sm`,onClick:t,children:[(0,H.jsx)(F,{className:`rtl:-scale-x-100`,"aria-hidden":`true`}),r(`All skills`)]}),(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,H.jsx)(`h2`,{className:`min-w-0 break-words text-section-title font-semibold`,children:e.name}),w.modified&&w.lastAppliedAt!==null?(0,H.jsx)(K9,{at:w.lastAppliedAt}):null,e.suggested?(0,H.jsx)(AE,{label:r(`Suggested`),colourKey:`Suggested`}):null,(0,H.jsx)(AE,{label:r(u===`manual`?`Manual`:`Automatic`),colourKey:u})]}),e.path?(0,H.jsx)(`p`,{dir:`ltr`,className:`break-all font-mono text-xs text-start text-muted-foreground`,children:e.path}):(0,H.jsx)(Xp,{tone:`info`,children:(0,H.jsx)(`p`,{children:r(`Not in a watched folder`)})}),(0,H.jsx)(`dl`,{className:`grid max-w-xl grid-cols-1 gap-3 text-sm sm:grid-cols-3`,children:[[r(`Uses in 30 days`),Wf(e.uses)],[r(`Failed turns`),Wf(e.failedTurns)],[r(`Last use`),e.lastUsedAt?wp(e.lastUsedAt):r(`Never`)]].map(([e,t])=>(0,H.jsxs)(`div`,{className:`rounded-xl border border-border bg-card px-3 py-2.5`,children:[(0,H.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:e}),(0,H.jsx)(`dd`,{className:`font-medium`,children:t})]},e))})]}),i?(0,H.jsx)(`div`,{id:`skill-section-uses`,className:`scroll-mt-4`,children:(0,H.jsx)(p9,{className:`max-w-3xl`,rows:xO(bO(i.daily)),title:r(`Uses in the last 30 days`)})}):null,e.path?(0,H.jsxs)(`section`,{id:`skill-section-mode`,className:`scroll-mt-4 space-y-3`,"aria-label":r(`Mode`),children:[(0,H.jsx)(`h3`,{className:`text-section-title font-semibold`,children:r(`Mode`)}),(0,H.jsx)(ste,{mode:u,disabled:c,onChoose:e=>void x(e)}),f?(0,H.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive-label`,children:f}):null,(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 pt-1`,children:[(0,H.jsxs)(q,{type:`button`,size:`sm`,disabled:c,onClick:()=>void b(),children:[(0,H.jsx)(Bt,{"aria-hidden":`true`}),r(`Draft improvement`)]}),c?(0,H.jsxs)(`span`,{role:`status`,className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,H.jsx)(at,{className:`size-4 animate-spin`,"aria-hidden":`true`}),r(`Drafting… This can take a few minutes.`)]}):null]}),(0,H.jsx)(G9,{notice:m.value})]}):null,(0,H.jsxs)(`section`,{id:`skill-section-proposals`,className:`scroll-mt-4 space-y-3`,"aria-labelledby":`skill-proposals-title`,children:[(0,H.jsx)(`h3`,{id:`skill-proposals-title`,className:`text-section-title font-semibold`,children:r(`Proposals`)}),o?(0,H.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive-label`,children:o}):C.length===0?(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:r(`No proposals yet.`)}):(0,H.jsx)(U9,{storageKey:H9,proposals:C,onChange:S})]}),(0,H.jsx)(`div`,{id:`skill-section-history`,className:`scroll-mt-4`,children:(0,H.jsx)(vte,{skill:e,reloadKey:h,onChanged:y})}),(0,H.jsx)(`div`,{id:`skill-section-turns`,className:`scroll-mt-4`,children:(0,H.jsx)(bte,{skill:e,reloadKey:h})}),(0,H.jsx)(`div`,{id:`skill-section-failures`,className:`scroll-mt-4`,children:(0,H.jsx)(mte,{skill:e,reloadKey:h})})]})}function wte({folders:e,onChanged:t}){let n=Y(),{snapshot:r,busy:i,save:a}=DC(),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(``),u=e.map(e=>e.path),d=r?.settings.skillFolders?.source===`global`;async function f(e){l(``);let n=await a({skillFolders:e});n?l(n):(s(``),t())}return(0,H.jsxs)(`section`,{id:`skills-section-folders`,className:`scroll-mt-4 space-y-3`,"aria-label":n(`Watched folders`),children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,H.jsx)(`h2`,{className:`text-section-title font-semibold`,children:n(`Watched folders`)}),d?(0,H.jsxs)(q,{type:`button`,variant:`ghost`,size:`sm`,disabled:i,onClick:()=>void f(null),children:[(0,H.jsx)(Pt,{"aria-hidden":`true`}),n(`Reset default`)]}):null]}),e.length===0?(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n(`No folders are watched.`)}):(0,H.jsx)(`ul`,{className:`space-y-3`,children:e.map(e=>(0,H.jsxs)(`li`,{className:`flex min-w-0 items-center gap-3 rounded-xl border border-border bg-card px-3 py-2.5`,children:[(0,H.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,H.jsx)(`p`,{dir:`ltr`,className:`break-all font-mono text-xs text-start`,children:e.path}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.exists?Ff(n(e.skills===1?`{count} skill`:`{count} skills`),{count:e.skills}):n(`Folder not found`)})]}),(0,H.jsx)(q,{type:`button`,variant:`ghost`,size:`icon-sm`,disabled:i,"aria-label":Ff(n(`Remove folder {path}`),{path:e.path}),title:n(`Remove folder`),onClick:()=>void f(qf(u,e.path)),children:(0,H.jsx)(an,{"aria-hidden":`true`})})]},e.path))}),(0,H.jsxs)(`form`,{className:`flex flex-wrap items-center gap-3`,onSubmit:e=>{e.preventDefault(),o.trim()&&f(Kf(u,o))},children:[(0,H.jsx)(Jd,{dir:`ltr`,className:`max-w-md flex-1 basis-60`,value:o,placeholder:`~/.agents/skills`,"aria-label":n(`Folder path`),onChange:e=>s(e.target.value)}),(0,H.jsxs)(q,{type:`submit`,variant:`outline`,size:`sm`,disabled:i||!o.trim(),children:[(0,H.jsx)(Ie,{"aria-hidden":`true`}),n(`Add folder`)]})]}),c?(0,H.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive-label`,children:c}):null]})}function Tte({idea:e,folders:t,onDrafted:n}){let r=Y(),[i,a]=(0,v.useState)(t[0]?.path??``),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(null),u=W9();async function d(){s(!0),u.clear();let t=await CC.draftNew(e,i);s(!1),u.show(t),t.ok&&t.data.proposal&&(l(Vf(t.data.proposal)),n())}return(0,H.jsxs)(`li`,{className:`min-w-0 space-y-3 rounded-xl border border-border bg-card p-3`,children:[(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsx)(`h3`,{className:`break-words text-sm font-semibold`,children:e.name}),(0,H.jsx)(`p`,{className:`text-sm`,dir:`auto`,children:e.description}),e.reason?(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,dir:`auto`,children:e.reason}):null,e.evidenceTurnIds.length>0?(0,H.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[r(`Evidence turns`),`:`,` `,(0,H.jsx)(`bdi`,{dir:`ltr`,children:e.evidenceTurnIds.map(e=>`T${e}`).join(`, `)})]}):null]}),c?(0,H.jsx)(z9,{proposal:c,onChange:l}):(0,H.jsxs)(`div`,{className:`flex flex-wrap items-end gap-3`,children:[(0,H.jsxs)(`label`,{className:`min-w-0 max-w-full space-y-1 text-sm`,children:[(0,H.jsx)(`span`,{className:`block text-xs text-muted-foreground`,children:r(`Folder for the new skill`)}),(0,H.jsx)(Rr,{value:i,disabled:o,"aria-label":r(`Folder for the new skill`),onChange:e=>a(e.target.value),children:t.map(e=>(0,H.jsx)(`option`,{value:e.path,children:e.path},e.path))})]}),(0,H.jsxs)(q,{type:`button`,size:`sm`,disabled:o||!i,onClick:()=>void d(),children:[(0,H.jsx)(Bt,{"aria-hidden":`true`}),r(`Draft skill`)]})]}),(0,H.jsx)(G9,{notice:u.value})]})}function Ete({folders:e,onDrafted:t}){let n=Y(),[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(!1),s=W9();async function c(){o(!0),s.clear();let e=await CC.ideas();o(!1),s.show(e),e.ok&&i(e.data.ideas)}return(0,H.jsxs)(`section`,{className:`space-y-3`,"aria-label":n(`New skill ideas`),children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,H.jsxs)(q,{type:`button`,variant:`outline`,size:`sm`,disabled:a,onClick:()=>void c(),children:[(0,H.jsx)($e,{"aria-hidden":`true`}),n(`Find new skill ideas`)]}),a?(0,H.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:n(`Looking…`)}):null]}),(0,H.jsx)(G9,{notice:s.value}),r&&r.length===0?(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n(`No new skill ideas in the recorded turns.`)}):null,r&&r.length>0?(0,H.jsx)(`ul`,{className:`space-y-3`,children:r.map(n=>(0,H.jsx)(Tte,{idea:n,folders:e,onDrafted:t},n.name))}):null]})}function Dte(e,t){return e.path?t.filter(t=>e.path.startsWith(t.path)).sort((e,t)=>t.path.length-e.path.length)[0]?.path??null:null}function Ote({skills:e,folders:t,onOpen:n}){let r=Y();return(0,H.jsx)(`ul`,{className:`space-y-3`,children:e.map(e=>{let i=Dte(e,t);return(0,H.jsxs)(`li`,{className:`relative`,children:[(0,H.jsxs)(`button`,{type:`button`,onClick:()=>n(e),className:`w-full min-w-0 space-y-1.5 rounded-xl border border-border bg-card px-3 py-2.5 text-start transition-colors duration-150 hover:bg-interactive-hover focus-visible:outline-2 focus-visible:outline-ring`,children:[(0,H.jsxs)(`span`,{className:V(`flex flex-wrap items-center gap-2`,e.modified&&`ps-6`),children:[(0,H.jsx)(`span`,{className:`min-w-0 break-words text-sm font-semibold`,children:e.name}),e.suggested?(0,H.jsx)(AE,{label:r(`Suggested`),colourKey:`Suggested`}):null,(0,H.jsx)(AE,{label:r(e.mode===`manual`?`Manual`:`Automatic`),colourKey:e.mode}),e.notInWatchedFolder?(0,H.jsx)(AE,{label:r(`Not in a watched folder`),colourKey:`not-watched`}):null]}),(0,H.jsxs)(`span`,{className:`block text-xs text-muted-foreground`,children:[i?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`bdi`,{dir:`ltr`,className:`break-all`,children:i}),` · `]}):null,r(`Uses`),` `,Wf(e.uses),` · `,r(`Failed turns`),` `,Wf(e.failedTurns),` · `,r(`Attention`),` `,e.attention.toFixed(2),` ·`,` `,r(`Last use`),` `,e.lastUsedAt?wp(e.lastUsedAt):r(`Never`)]})]}),e.modified&&e.lastAppliedAt!==null?(0,H.jsx)(K9,{at:e.lastAppliedAt,className:`absolute start-3 top-3`}):null]},e.path??`name:${e.name}`)})})}function kte({skills:e,folders:t,query:n,modifiedFilter:r=`all`,onOpen:i}){let a=Y(),{view:o,pageItems:s}=xp({storageKey:`omms-list-skills`,items:e,sorts:T9,resetKey:`${r}|${n.trim().toLowerCase()}`});return(0,H.jsx)(_p,{view:o,totalLabel:Ff(a(o.total===1?`{count} skill`:`{count} skills`),{count:o.total}),children:(0,H.jsx)(Ote,{skills:s,folders:t,onOpen:i})})}var Z9=`${J.settings}#settings-section-skill-learning`;function Ate(e,t,n,r){return e.trim()?t===0?`No skill matches this name.`:`No skill matches this name in this tab.`:n>0&&r===`modified`?`No skill has been modified yet.`:n>0&&r===`not-modified`?`Every skill has been modified.`:n>0&&r===`suggested`?`No skill is suggested for a change yet.`:`No skills found in the watched folders.`}function jte({overview:e,turns:t,pending:n,recent:r,error:i,query:a,modifiedFilter:o=`all`,reloadKey:s=0,onQuery:c,onModifiedFilter:l=()=>{},onOpen:u,onPendingChange:d,onRecentChange:f,onReload:p}){let m=Y(),h=e?.skills??[],g=If(h,a),_=mO(g,o),v=e?.folders??[],y=t=>{let n=(e?.skills??[]).find(e=>t.path?e.path===t.path:e.name===t.name);n&&u(n)};return(0,H.jsxs)(`div`,{className:`space-y-8`,children:[(0,H.jsx)(gx,{storageKey:`omms-skills-toc-open`,sections:lO}),(0,H.jsxs)(`div`,{className:`max-w-3xl space-y-2 text-sm text-muted-foreground`,children:[(0,H.jsx)(`p`,{children:m(`Skill learning watches how your agents use your skills on Pi, OpenCode and Claude Code. It ranks each skill by use and failed tool calls, and drafts better versions from real turns.`)}),(0,H.jsx)(`p`,{children:m(`Every draft is a proposal with a diff. Nothing changes a SKILL.md file until you apply it, unless you set that skill to Automatic. Undo restores the previous version.`)})]}),e&&!e.recording?(0,H.jsxs)(Xp,{tone:`info`,children:[(0,H.jsx)(`p`,{children:m(`Nothing is recorded yet. Agent turns are recorded only after you turn it on.`)}),(0,H.jsx)(`a`,{className:`underline`,href:Z9,onClick:e=>{e.preventDefault(),Em(Z9)},children:m(`Open the Skill learning card`)})]}):null,i?(0,H.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive-label`,children:i}):null,(0,H.jsx)(v9,{proposals:[...n,...r],onOpen:y,reloadKey:s}),(0,H.jsxs)(`section`,{id:`skills-section-ranked`,className:`scroll-mt-4 space-y-3`,"aria-label":m(`Skills`),children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,H.jsx)(`h2`,{className:`text-section-title font-semibold`,children:m(`Ranked skills`)}),(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[h.length>0?(0,H.jsx)(C9,{value:o,counts:pO(h),onChange:l}):null,(0,H.jsx)(Jd,{type:`search`,className:`w-72 max-w-full`,value:a,"aria-label":m(`Filter skills by name`),placeholder:m(`Filter skills by name`),onChange:e=>c(e.target.value)})]})]}),e&&e.recording&&t===0?(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:m(`No turns are recorded yet.`)}),(0,H.jsx)(TC,{onEnd:p})]}):null,e&&_.length===0?(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:m(Ate(a,g.length,h.length,o))}):null,_.length>0?(0,H.jsx)(kte,{skills:_,folders:v,query:a,modifiedFilter:o,onOpen:u}):null]}),(0,H.jsxs)(`section`,{id:`skills-section-pending`,className:`scroll-mt-4 space-y-3`,"aria-label":m(`Pending proposals`),children:[(0,H.jsx)(`h2`,{className:`text-section-title font-semibold`,children:m(`Pending proposals`)}),n.length>0?(0,H.jsx)(U9,{storageKey:B9,proposals:n,onChange:d}):(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:m(`No proposals are waiting.`)})]}),(0,H.jsxs)(`section`,{id:`skills-section-recent`,className:`scroll-mt-4 space-y-3`,"aria-label":m(`Recent proposals`),children:[(0,H.jsx)(`h2`,{className:`text-section-title font-semibold`,children:m(`Recent proposals`)}),r.length>0?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:m(`Each card shows when the proposal was created and when it was last applied, rejected or undone.`)}),(0,H.jsx)(U9,{storageKey:V9,proposals:r,onChange:f})]}):(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:m(`No proposals have been decided yet.`)})]}),e?.recording?(0,H.jsx)(Ete,{folders:v,onDrafted:p}):null,(0,H.jsx)(wte,{folders:v,onChanged:p})]})}function Q9(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)([]),[o,s]=(0,v.useState)([]),[c,l]=(0,v.useState)(``),[u,d]=(0,v.useState)(``),[f,p]=(0,v.useState)(hO),[m,h]=(0,v.useState)(null),[g,_]=(0,v.useState)(0),y=(0,v.useCallback)(async()=>{let[e,n,i]=await Promise.all([CC.overview(),CC.stats(),CC.proposals()]);if(e.ok?(t(e.data),l(``)):l(e.error),n.ok&&r(n.data.turns),i.ok){let e=i.data.proposals;a(e.filter(e=>e.state===`pending`)),s(Rf(e))}},[]);(0,v.useEffect)(()=>{y()},[y]);let b=()=>{_(e=>e+1),y()},x=Om();return(0,v.useEffect)(()=>{x.includes(`#skills-section-`)&&h(null)},[x]),m?(0,H.jsx)(Cte,{skill:m,onBack:()=>{h(null),b()},onChanged:()=>void y()}):(0,H.jsx)(jte,{overview:e,turns:n,pending:i,recent:o,error:c,query:u,modifiedFilter:f,reloadKey:g,onQuery:d,onModifiedFilter:e=>{p(e),gO(e)},onOpen:h,onPendingChange:e=>a(t=>t.map(t=>t.id===e.id?e:t)),onRecentChange:e=>s(t=>t.map(t=>t.id===e.id?e:t)),onReload:b})}function Mte({...e}){let t=rg();return(0,H.jsx)(gi,{theme:t,className:`toaster group`,style:{"--normal-bg":`var(--color-popover)`,"--normal-text":`var(--color-popover-foreground)`,"--normal-border":`var(--color-border)`},icons:{loading:(0,H.jsx)(it,{className:`size-4 animate-spin`}),success:(0,H.jsx)(ge,{className:`size-4`}),error:(0,H.jsx)(gt,{className:`size-4`}),info:(0,H.jsx)(qe,{className:`size-4`}),warning:(0,H.jsx)(Xt,{className:`size-4`})},...e})}function Nte(e,t,n){return e?t:n}function Pte(e,t,n){return sm.map(r=>{let i=Pf(r.title,e);return r.id===`shared`?{id:r.id,label:i,avatar:(0,H.jsx)(th,{className:`size-5 rounded-md`,iconClassName:`size-3`}),items:cm.map(t=>({id:t.id,label:Pf(t.title,e)}))}:{id:r.id,label:i,avatar:(0,H.jsx)(eh,{host:r.id,look:t[r.id],className:`size-5 rounded-md text-[9px]`}),warning:n}})}function Fte(e){let{looks:t}=sw(),n=CT();return{memoryViewId:tf(Om().split(`#`)[0]),memoryWarningLabel:Pf(`Memories not saved`,e),memorySections:Pte(e,t,n?.ok===!1)}}var Ite=[``,`feature`,`bug-fix`,`refactor`,`architecture`,`rule`,`documentation`,`discussion`,`analysis`,`configuration`];function Lte(){let{t:e,language:t}=G(),n=km(),r=Fte(t),[i,a]=(0,v.useState)(!1),o=Ca(),s=Za(),c=Xa(o,s);(0,v.useEffect)(()=>{let e=Dm();(async()=>{await o.loadTags(),await o.loadMemories(),await o.loadStats(),await o.checkMigrationStatus(),await o.checkAuthWarning()})();let t=setInterval(()=>{o.loadStats(),!o.isSearching&&n===`project`&&o.loadMemories()},3e4);return()=>{e(),clearInterval(t)}},[]);let l=s.loadUserProfile;(0,v.useEffect)(()=>{n===`profile`&&l()},[n,l]);function u(e){e!==t&&(_a(e),o.loadMemories(),o.loadStats(),n===`profile`&&s.loadUserProfile())}function d(e){e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),Em(J.home))}return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(Mte,{richColors:!0,position:`bottom-right`}),(0,H.jsxs)(`div`,{className:`flex min-h-svh bg-background text-foreground overflow-x-clip`,children:[(0,H.jsx)(hg,{open:i,onOpenChange:a,currentView:n,brand:e(`brand`),projectLabel:e(`tab-project`),profileLabel:e(`tab-profile`),chatLabel:e(`nav-chat`),memorisationLabel:e(`nav-memorisation`),skillsLabel:e(`nav-skills`),profileSections:[{id:`profile-preferences`,label:e(`profile-preferences`)},{id:`profile-patterns`,label:e(`profile-patterns`)},{id:`profile-workflows`,label:e(`profile-workflows`)}],skillsSections:uO(t),memoryLabel:Pf(`Memory`,t),...r,settingsSections:px.map(e=>({id:e.id,label:Pf(e.title,t)})),langLabel:t.toUpperCase(),languageLabel:e(`nav-language`),themeLabel:e(`nav-theme`),settingsLabel:e(`nav-settings`),closeLabel:e(`nav-close`),collapseLabel:e(`nav-collapse`),expandLabel:e(`nav-expand`),onLanguageSelect:u}),(0,H.jsxs)(`div`,{"data-tooltip-bounds":!0,className:`flex min-w-0 flex-1 flex-col`,children:[(0,H.jsxs)(`div`,{className:`sticky top-0 z-30 flex items-center gap-2 border-b border-border bg-background/95 px-3 py-2 backdrop-blur md:hidden`,children:[(0,H.jsx)(q,{variant:`ghost`,size:`icon-sm`,className:`min-h-11 min-w-11`,onClick:()=>a(!0),"aria-label":e(`nav-menu`),children:(0,H.jsx)(ot,{className:`size-4`})}),(0,H.jsx)(`a`,{href:J.home,className:`min-w-0`,onClick:d,children:(0,H.jsx)(pf,{brand:e(`brand`)})})]}),(0,H.jsxs)(`div`,{className:`mx-auto w-full max-w-6xl flex-1 space-y-4 p-4 md:p-6`,children:[o.showAuthWarning?(0,H.jsxs)(Xy,{variant:`destructive`,children:[(0,H.jsx)(Xt,{}),(0,H.jsx)(Zy,{children:e(`auth-warning-text`)})]}):null,(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,H.jsx)(`h1`,{className:`text-page-title font-semibold text-foreground`,children:n===`project`?e(`tab-project`):n===`profile`?e(`tab-profile`):n===`memory`?Pf(`Memory`,t):e(`nav-${n}`)}),n===`project`?(0,H.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,H.jsx)(`span`,{children:e(`text-total`,{count:Nte(o.isSearching,o.totalItems,o.statsTotal)})}),o.refreshing?(0,H.jsx)(at,{className:`size-3.5 animate-spin`}):null]}):null]}),n===`project`?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-end gap-3 rounded-xl border border-border bg-card p-3`,children:[(0,H.jsxs)(`div`,{className:`min-w-0 max-w-full space-y-1`,children:[(0,H.jsx)(nm,{htmlFor:`tag-filter`,children:e(`label-tag`)}),(0,H.jsxs)(Rr,{id:`tag-filter`,className:`w-64 max-w-full`,value:o.selectedTag,onChange:e=>o.onTagFilterChange(e.currentTarget.value),children:[(0,H.jsx)(`option`,{value:``,children:e(`opt-all-tags`)}),o.tags.map(e=>(0,H.jsx)(`option`,{value:e.tag,children:e.displayName||e.tag},e.tag))]})]}),(0,H.jsxs)(`div`,{className:`min-w-0 max-w-full space-y-1`,children:[(0,H.jsx)(nm,{htmlFor:`keyword-filter`,children:e(`label-label-filter`)}),(0,H.jsxs)(Rr,{id:`keyword-filter`,className:`w-56 max-w-full`,value:o.selectedKeyword.toLowerCase(),onChange:e=>o.onKeywordFilterChange(e.currentTarget.value),children:[(0,H.jsx)(`option`,{value:``,children:e(`opt-all-labels`)}),o.selectedKeyword&&!o.keywords.some(e=>e.keyword===o.selectedKeyword.toLowerCase())?(0,H.jsxs)(`option`,{value:o.selectedKeyword.toLowerCase(),children:[o.selectedKeyword,` (0)`]}):null,o.keywords.map(e=>(0,H.jsxs)(`option`,{value:e.keyword,children:[e.keyword,` (`,e.count,`)`]},e.keyword))]})]}),(0,H.jsxs)(`div`,{className:`flex flex-1 items-end gap-1.5 min-w-0 basis-56`,children:[(0,H.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[(0,H.jsx)(nm,{htmlFor:`search-input`,className:`sr-only`,children:e(`placeholder-search`)}),(0,H.jsx)(Jd,{id:`search-input`,placeholder:e(`placeholder-search`),value:o.searchInput,onChange:e=>o.setSearchInput(e.target.value),onKeyDown:e=>e.key===`Enter`&&o.performSearch()})]}),(0,H.jsx)(q,{variant:`outline`,size:`icon`,onClick:o.performSearch,children:(0,H.jsx)(It,{className:`size-4`})}),o.isSearching?(0,H.jsx)(q,{variant:`outline`,size:`icon`,onClick:o.clearSearch,children:(0,H.jsx)(an,{className:`size-4`})}):null]}),(0,H.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[(0,H.jsx)(bf,{content:e(`tooltip-cleanup`),children:(0,H.jsxs)(q,{variant:`outline`,size:`sm`,onClick:o.runCleanup,children:[(0,H.jsx)(Yt,{className:`size-3.5`}),e(`btn-cleanup`)]})}),(0,H.jsx)(bf,{content:e(`tooltip-deduplicate`),children:(0,H.jsxs)(q,{variant:`outline`,size:`sm`,onClick:o.runDeduplication,children:[(0,H.jsx)(jt,{className:`size-3.5`}),e(`btn-deduplicate`)]})})]}),o.selectedIds.size>0?(0,H.jsxs)(`div`,{className:`flex w-full flex-wrap items-center gap-2 border-t border-border pt-3`,children:[(0,H.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e(`text-selected`,{count:o.selectedIds.size})}),(0,H.jsx)(q,{variant:`secondary`,size:`xs`,onClick:o.selectAllCurrentPage,children:e(`btn-select-all`)}),(0,H.jsx)(q,{variant:`destructive`,size:`xs`,onClick:o.bulkDelete,children:e(`btn-delete-selected`)}),(0,H.jsx)(q,{variant:`ghost`,size:`xs`,onClick:o.deselectAll,children:e(`btn-deselect-all`)})]}):null]}),o.migrationNeeded?(0,H.jsxs)(Xy,{variant:`destructive`,className:`space-y-3`,children:[(0,H.jsx)(Xt,{}),(0,H.jsxs)(Zy,{className:`space-y-3`,children:[(0,H.jsx)(`p`,{children:o.migrationMessage||e(`migration-mismatch`)}),(0,H.jsxs)(`label`,{className:`flex items-start gap-2 text-sm`,children:[(0,H.jsx)(Bs,{checked:o.migrationConfirmed,onCheckedChange:e=>o.setMigrationConfirmed(e===!0),className:`mt-0.5`}),(0,H.jsx)(`span`,{children:e(`migration-understand`)})]}),(0,H.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,H.jsx)(q,{variant:`destructive`,size:`sm`,disabled:!o.migrationConfirmed,onClick:()=>o.runMigration(`fresh-start`),children:e(`btn-fresh-start`)}),(0,H.jsx)(q,{variant:`secondary`,size:`sm`,disabled:!o.migrationConfirmed,onClick:()=>o.runMigration(`re-embed`),children:e(`btn-reembed`)})]})]})]}):null,(0,H.jsx)(Vy,{memories:o.memories,selectedIds:o.selectedIds,currentPage:o.currentPage,totalPages:o.totalPages,totalItems:o.totalItems,isSearching:o.isSearching,loading:o.loadingMemories,error:o.memoriesError,onSelect:o.onSelect,onPageChange:e=>{let t=o.currentPage+e;o.setCurrentPage(t),o.loadMemories({page:t})},onPin:o.pinMemory,onUnpin:o.unpinMemory,onEdit:o.openEdit,onDeleteMemory:o.deleteMemory,onDeletePrompt:o.deletePrompt,activeKeyword:o.selectedKeyword,onKeywordClick:e=>o.onKeywordFilterChange(o.selectedKeyword.toLowerCase()===e.toLowerCase()?``:e)}),(0,H.jsxs)(`section`,{className:`rounded-xl border border-border bg-card p-4 space-y-3`,children:[(0,H.jsx)(`h2`,{className:`text-section-title font-semibold text-muted-foreground`,children:e(`section-add`)}),(0,H.jsxs)(`form`,{className:`space-y-3`,onSubmit:o.addMemory,children:[(0,H.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-3`,children:[(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsx)(nm,{htmlFor:`add-tag`,children:e(`label-tag`)}),(0,H.jsxs)(Rr,{id:`add-tag`,required:!0,className:`w-full`,value:o.addTag,onChange:e=>o.setAddTag(e.target.value),children:[(0,H.jsx)(`option`,{value:``,children:e(`opt-select-tag`)}),o.tags.map(e=>(0,H.jsx)(`option`,{value:e.tag,children:e.displayName||e.tag},e.tag))]})]}),(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsx)(nm,{htmlFor:`add-type`,children:e(`label-type`)}),(0,H.jsx)(Rr,{id:`add-type`,className:`w-full`,value:o.addType,onChange:e=>o.setAddType(e.target.value),children:Ite.map(t=>(0,H.jsx)(`option`,{value:t,children:e(t?`opt-${t}`:`opt-other`)},t||`other`))})]}),(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsx)(nm,{htmlFor:`add-tags`,children:e(`label-tags`)}),(0,H.jsx)(Jd,{id:`add-tags`,placeholder:e(`placeholder-tags`),value:o.addTags,onChange:e=>o.setAddTags(e.target.value)})]})]}),(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsx)(nm,{htmlFor:`add-content`,children:e(`label-content`)}),(0,H.jsx)(gg,{id:`add-content`,rows:4,required:!0,placeholder:e(`placeholder-content`),value:o.addContent,onChange:e=>o.setAddContent(e.target.value)})]}),(0,H.jsxs)(q,{type:`submit`,children:[(0,H.jsx)(Ot,{className:`size-3.5`}),e(`btn-add-memory`)]})]})]})]}):n===`memory`?(0,H.jsx)(EE,{},c):n===`memorisation`?(0,H.jsx)(mD,{},c):n===`chat`?(0,H.jsx)(cO,{},c):n===`skills`?(0,H.jsx)(Q9,{}):n===`spaces`?(0,H.jsx)(Qm,{}):n===`spaces-archive`?(0,H.jsx)(jm,{}):n===`settings`?(0,H.jsx)(MC,{}):(0,H.jsx)(ux,{profile:s.userProfile,loading:s.loadingProfile,onRefresh:s.refreshProfile,onCleanup:()=>s.setAiCleanupOpen(!0),onCategoryCleanup:()=>s.setCategoryCleanupOpen(!0),categoryCleanupOpen:s.categoryCleanupOpen})]})]})]}),(0,H.jsx)(_g,{open:o.editOpen,onOpenChange:o.setEditOpen,content:o.editContent,onSave:o.saveEdit}),(0,H.jsx)(fx,{open:o.tagMigrationOpen,onOpenChange:e=>{e||Di(o.tagMigrationCount),o.setTagMigrationOpen(e)},count:o.tagMigrationCount,onComplete:()=>{Oi(),o.loadMemories(),o.loadStats()}}),(0,H.jsx)(Rd,{open:s.aiCleanupOpen,onOpenChange:s.setAiCleanupOpen,onMinimise:s.minimiseAiCleanup,profile:s.userProfile,onApplied:s.loadUserProfile}),s.aiCleanupMinimised?(0,H.jsx)(zd,{onOpen:()=>s.setAiCleanupOpen(!0),onGone:s.dismissAiCleanupPill}):null,(0,H.jsx)(Zd,{open:s.categoryCleanupOpen,onOpenChange:s.setCategoryCleanupOpen,onApplied:s.loadUserProfile})]})}var Rte=new Set([`Shift`,`Control`,`Alt`,`Meta`]);function zte(e,t){return t.type===`pointerdown`?`typing`:t.type!==`keydown`||!t.key?e:t.key===`Tab`?`keyboard`:Rte.has(t.key)?e:t.inTextField?`typing`:e}function Bte(e){return e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement}function Vte(){if(typeof document>`u`)return()=>{};let e=document.documentElement,t=`keyboard`;e.dataset.focusMode=t;let n=n=>{let r=zte(t,{type:n.type,key:n instanceof KeyboardEvent?n.key:void 0,inTextField:Bte(n.target)});r!==t&&(t=r,e.dataset.focusMode=t)};return document.addEventListener(`keydown`,n,!0),document.addEventListener(`pointerdown`,n,!0),()=>{document.removeEventListener(`keydown`,n,!0),document.removeEventListener(`pointerdown`,n,!0)}}ng(),Vte();var $9=document.getElementById(`app`);if(!$9)throw Error(`Root element #app not found`);(0,y.createRoot)($9).render((0,H.jsx)(v.StrictMode,{children:(0,H.jsx)(Sa,{children:(0,H.jsx)(Lte,{})})}));
|