@lacneu/atrium 0.10.8 → 0.10.9
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/assets/highlighted-body-OFNGDK62-bt3ucuhQ.js +1 -0
- package/dist/assets/index-H8yz6a5P.js +268 -0
- package/dist/assets/index-yQOsGOrG.css +1 -0
- package/dist/assets/mermaid-GHXKKRXX-AdR6Q7xN.js +1 -0
- package/dist/index.html +2 -2
- package/package.json +3 -3
- package/dist/assets/index-CVp_aMoo.js +0 -164
- package/dist/assets/index-DoSFeJ-S.css +0 -1
|
@@ -0,0 +1,268 @@
|
|
|
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=(e,t,n)=>(c(e,t,`default`),n&&c(n,t,`default`)),u=(n,r,a)=>(a=n==null?{}:e(i(n)),c(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,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),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();for(var d=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 ee(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var te=/\/+/g;function k(e,t){return typeof e==`object`&&e&&e.key!=null?ee(``+e.key):t.toString(36)}function A(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 ne(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,ne(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+k(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(te,`$&/`)+`/`),ne(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(te,`$&/`)+`/`)+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+k(a,u),c+=ne(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+k(a,u++),c+=ne(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return ne(A(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 re(e,t,n){if(e==null)return e;var r=[],i=0;return ne(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ie(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 j=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)},ae={map:re,forEach:function(e,t,n){re(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return re(e,function(){t++}),t},toArray:function(e){return re(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=ae,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:ie}},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,j)}catch(e){j(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.7`})),f=o(((e,t)=>{t.exports=d()})),p=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&&k(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&&k(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var ee=new MessageChannel,te=ee.port2;ee.port1.onmessage=D,O=function(){te.postMessage(null)}}else O=function(){_(D,0)};function k(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,k(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}}}})),m=o(((e,t)=>{t.exports=p()})),h=o((e=>{var t=f();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.7`})),g=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=h()})),_=o((e=>{var t=m(),n=f(),r=g();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 d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}var p=Object.assign,h=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`),ee=Symbol.for(`react.activity`),te=Symbol.for(`react.memo_cache_sentinel`),k=Symbol.iterator;function A(e){return typeof e!=`object`||!e?null:(e=k&&e[k]||e[`@@iterator`],typeof e==`function`?e:null)}var ne=Symbol.for(`react.client.reference`);function re(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ne?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 ee: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?re(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return re(e(t))}catch{}}return null}var ie=Array.isArray,j=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe={pending:!1,data:null,method:null,action:null},se=[],ce=-1;function le(e){return{current:e}}function ue(e){0>ce||(e.current=se[ce],se[ce]=null,ce--)}function de(e,t){ce++,se[ce]=e.current,e.current=t}var fe=le(null),pe=le(null),me=le(null),he=le(null);function ge(e,t){switch(de(me,t),de(pe,e),de(fe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?af(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=af(t),e=of(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}ue(fe),de(fe,e)}function _e(){ue(fe),ue(pe),ue(me)}function ve(e){e.memoizedState!==null&&de(he,e);var t=fe.current,n=of(t,e.type);t!==n&&(de(pe,e),de(fe,n))}function ye(e){pe.current===e&&(ue(fe),ue(pe)),he.current===e&&(ue(he),hp._currentValue=oe)}var be,xe;function Se(e){if(be===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);be=t&&t[1]||``,xe=-1<e.stack.indexOf(`
|
|
2
|
+
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
3
|
+
`+be+e+xe}var Ce=!1;function we(e,t){if(!e||Ce)return``;Ce=!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{Ce=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Se(n):``}function Te(e,t){switch(e.tag){case 26:case 27:case 5:return Se(e.type);case 16:return Se(`Lazy`);case 13:return e.child!==t&&t!==null?Se(`Suspense Fallback`):Se(`Suspense`);case 19:return Se(`SuspenseList`);case 0:case 15:return we(e.type,!1);case 11:return we(e.type.render,!1);case 1:return we(e.type,!0);case 31:return Se(`Activity`);default:return``}}function Ee(e){try{var t=``,n=null;do t+=Te(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
7
|
+
Error generating stack: `+e.message+`
|
|
8
|
+
`+e.stack}}var De=Object.prototype.hasOwnProperty,Oe=t.unstable_scheduleCallback,ke=t.unstable_cancelCallback,Ae=t.unstable_shouldYield,je=t.unstable_requestPaint,Me=t.unstable_now,Ne=t.unstable_getCurrentPriorityLevel,Pe=t.unstable_ImmediatePriority,Fe=t.unstable_UserBlockingPriority,Ie=t.unstable_NormalPriority,Le=t.unstable_LowPriority,Re=t.unstable_IdlePriority,ze=t.log,Be=t.unstable_setDisableYieldValue,Ve=null,He=null;function Ue(e){if(typeof ze==`function`&&Be(e),He&&typeof He.setStrictMode==`function`)try{He.setStrictMode(Ve,e)}catch{}}var We=Math.clz32?Math.clz32:qe,Ge=Math.log,Ke=Math.LN2;function qe(e){return e>>>=0,e===0?32:31-(Ge(e)/Ke|0)|0}var Je=256,Ye=262144,Xe=4194304;function Ze(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 Qe(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=Ze(n))):i=Ze(o):i=Ze(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ze(n))):i=Ze(o)):i=Ze(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 $e(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function et(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 tt(){var e=Xe;return Xe<<=1,!(Xe&62914560)&&(Xe=4194304),e}function nt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function rt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function it(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-We(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&&at(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function at(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-We(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function ot(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-We(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function st(e,t){var n=t&-t;return n=n&42?1:ct(n),(n&(e.suspendedLanes|t))===0?n:0}function ct(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 lt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function ut(){var e=ae.p;return e===0?(e=window.event,e===void 0?32:jp(e.type)):e}function dt(e,t){var n=ae.p;try{return ae.p=e,t()}finally{ae.p=n}}var ft=Math.random().toString(36).slice(2),pt=`__reactFiber$`+ft,mt=`__reactProps$`+ft,ht=`__reactContainer$`+ft,gt=`__reactEvents$`+ft,_t=`__reactListeners$`+ft,vt=`__reactHandles$`+ft,yt=`__reactResources$`+ft,bt=`__reactMarker$`+ft;function xt(e){delete e[pt],delete e[mt],delete e[gt],delete e[_t],delete e[vt]}function St(e){var t=e[pt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ht]||n[pt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Of(e);e!==null;){if(n=e[pt])return n;e=Of(e)}return t}e=n,n=e.parentNode}return null}function Ct(e){if(e=e[pt]||e[ht]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function wt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Tt(e){var t=e[yt];return t||=e[yt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Et(e){e[bt]=!0}var Dt=new Set,Ot={};function kt(e,t){At(e,t),At(e+`Capture`,t)}function At(e,t){for(Ot[e]=t,e=0;e<t.length;e++)Dt.add(t[e])}var jt=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]*$`),Mt={},Nt={};function Pt(e){return De.call(Nt,e)?!0:De.call(Mt,e)?!1:jt.test(e)?Nt[e]=!0:(Mt[e]=!0,!1)}function Ft(e,t,n){if(Pt(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 It(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 Lt(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 Rt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function zt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Bt(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 Vt(e){if(!e._valueTracker){var t=zt(e)?`checked`:`value`;e._valueTracker=Bt(e,t,``+e[t])}}function Ht(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=zt(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function Ut(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 Wt=/[\n"\\]/g;function Gt(e){return e.replace(Wt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Kt(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=``+Rt(t)):e.value!==``+Rt(t)&&(e.value=``+Rt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Jt(e,o,Rt(n)):Jt(e,o,Rt(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=``+Rt(s):e.removeAttribute(`name`)}function qt(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)){Vt(e);return}n=n==null?``:``+Rt(n),t=t==null?n:``+Rt(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),Vt(e)}function Jt(e,t,n){t===`number`&&Ut(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Yt(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=``+Rt(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 Xt(e,t,n){if(t!=null&&(t=``+Rt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Rt(n)}function Zt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ie(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Rt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Vt(e)}function Qt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var $t=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 en(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||$t.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function tn(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&&en(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&en(e,o,t[o])}function nn(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 rn=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`]]),an=/^[\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 on(e){return an.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function sn(){}var cn=null;function ln(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var un=null,dn=null;function fn(e){var t=Ct(e);if(t&&(e=t.stateNode)){var n=e[mt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Kt(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="`+Gt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[mt]||null;if(!a)throw Error(i(90));Kt(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&&Ht(r)}break a;case`textarea`:Xt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Yt(e,!!n.multiple,t,!1)}}}var pn=!1;function mn(e,t,n){if(pn)return e(t,n);pn=!0;try{return e(t)}finally{if(pn=!1,(un!==null||dn!==null)&&(Pu(),un&&(t=un,e=dn,dn=un=null,fn(t),e)))for(t=0;t<e.length;t++)fn(e[t])}}function hn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[mt]||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 gn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),_n=!1;if(gn)try{var vn={};Object.defineProperty(vn,"passive",{get:function(){_n=!0}}),window.addEventListener(`test`,vn,vn),window.removeEventListener(`test`,vn,vn)}catch{_n=!1}var yn=null,bn=null,xn=null;function Sn(){if(xn)return xn;var e,t=bn,n=t.length,r,i=`value`in yn?yn.value:yn.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 xn=i.slice(e,1<r?1-r:void 0)}function Cn(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 wn(){return!0}function Tn(){return!1}function En(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)?wn:Tn,this.isPropagationStopped=Tn,this}return p(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=wn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=wn)},persist:function(){},isPersistent:wn}),t}var Dn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},On=En(Dn),kn=p({},Dn,{view:0,detail:0}),An=En(kn),jn,Mn,Nn,Pn=p({},kn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Wn,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!==Nn&&(Nn&&e.type===`mousemove`?(jn=e.screenX-Nn.screenX,Mn=e.screenY-Nn.screenY):Mn=jn=0,Nn=e),jn)},movementY:function(e){return`movementY`in e?e.movementY:Mn}}),Fn=En(Pn),In=En(p({},Pn,{dataTransfer:0})),Ln=En(p({},kn,{relatedTarget:0})),Rn=En(p({},Dn,{animationName:0,elapsedTime:0,pseudoElement:0})),zn=En(p({},Dn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Bn=En(p({},Dn,{data:0})),Vn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Hn={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`},M={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Un(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=M[e])?!!t[e]:!1}function Wn(){return Un}var Gn=En(p({},kn,{key:function(e){if(e.key){var t=Vn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Cn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Hn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Wn,charCode:function(e){return e.type===`keypress`?Cn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Cn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Kn=En(p({},Pn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),qn=En(p({},kn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Wn})),Jn=En(p({},Dn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Yn=En(p({},Pn,{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})),Xn=En(p({},Dn,{newState:0,oldState:0})),Zn=[9,13,27,32],Qn=gn&&`CompositionEvent`in window,$n=null;gn&&`documentMode`in document&&($n=document.documentMode);var N=gn&&`TextEvent`in window&&!$n,P=gn&&(!Qn||$n&&8<$n&&11>=$n),er=` `,tr=!1;function nr(e,t){switch(e){case`keyup`:return Zn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function rr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var ir=!1;function ar(e,t){switch(e){case`compositionend`:return rr(t);case`keypress`:return t.which===32?(tr=!0,er):null;case`textInput`:return e=t.data,e===er&&tr?null:e;default:return null}}function or(e,t){if(ir)return e===`compositionend`||!Qn&&nr(e,t)?(e=Sn(),xn=bn=yn=null,ir=!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 P&&t.locale!==`ko`?null:t.data;default:return null}}var sr={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 cr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!sr[e.type]:t===`textarea`}function lr(e,t,n,r){un?dn?dn.push(r):dn=[r]:un=r,t=Hd(t,`onChange`),0<t.length&&(n=new On(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var ur=null,dr=null;function fr(e){Pd(e,0)}function pr(e){if(Ht(wt(e)))return e}function mr(e,t){if(e===`change`)return t}var hr=!1;if(gn){var gr;if(gn){var _r=`oninput`in document;if(!_r){var vr=document.createElement(`div`);vr.setAttribute(`oninput`,`return;`),_r=typeof vr.oninput==`function`}gr=_r}else gr=!1;hr=gr&&(!document.documentMode||9<document.documentMode)}function F(){ur&&(ur.detachEvent(`onpropertychange`,yr),dr=ur=null)}function yr(e){if(e.propertyName===`value`&&pr(dr)){var t=[];lr(t,dr,e,ln(e)),mn(fr,t)}}function br(e,t,n){e===`focusin`?(F(),ur=t,dr=n,ur.attachEvent(`onpropertychange`,yr)):e===`focusout`&&F()}function xr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return pr(dr)}function Sr(e,t){if(e===`click`)return pr(t)}function Cr(e,t){if(e===`input`||e===`change`)return pr(t)}function wr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Tr=typeof Object.is==`function`?Object.is:wr;function Er(e,t){if(Tr(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(!De.call(t,i)||!Tr(e[i],t[i]))return!1}return!0}function Dr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Or(e,t){var n=Dr(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=Dr(n)}}function kr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?kr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ar(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ut(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=Ut(e.document)}return t}function jr(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 Mr=gn&&`documentMode`in document&&11>=document.documentMode,Nr=null,Pr=null,Fr=null,Ir=!1;function Lr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ir||Nr==null||Nr!==Ut(r)||(r=Nr,`selectionStart`in r&&jr(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}),Fr&&Er(Fr,r)||(Fr=r,r=Hd(Pr,`onSelect`),0<r.length&&(t=new On(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Nr)))}function Rr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var zr={animationend:Rr(`Animation`,`AnimationEnd`),animationiteration:Rr(`Animation`,`AnimationIteration`),animationstart:Rr(`Animation`,`AnimationStart`),transitionrun:Rr(`Transition`,`TransitionRun`),transitionstart:Rr(`Transition`,`TransitionStart`),transitioncancel:Rr(`Transition`,`TransitionCancel`),transitionend:Rr(`Transition`,`TransitionEnd`)},Br={},Vr={};gn&&(Vr=document.createElement(`div`).style,`AnimationEvent`in window||(delete zr.animationend.animation,delete zr.animationiteration.animation,delete zr.animationstart.animation),`TransitionEvent`in window||delete zr.transitionend.transition);function Hr(e){if(Br[e])return Br[e];if(!zr[e])return e;var t=zr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Vr)return Br[e]=t[n];return e}var Ur=Hr(`animationend`),Wr=Hr(`animationiteration`),Gr=Hr(`animationstart`),Kr=Hr(`transitionrun`),qr=Hr(`transitionstart`),Jr=Hr(`transitioncancel`),Yr=Hr(`transitionend`),Xr=new Map,Zr=`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(` `);Zr.push(`scrollEnd`);function Qr(e,t){Xr.set(e,t),kt(t,[e])}var $r=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)},ei=[],ti=0,ni=0;function ri(){for(var e=ti,t=ni=ti=0;t<e;){var n=ei[t];ei[t++]=null;var r=ei[t];ei[t++]=null;var i=ei[t];ei[t++]=null;var a=ei[t];if(ei[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&&si(n,i,a)}}function ii(e,t,n,r){ei[ti++]=e,ei[ti++]=t,ei[ti++]=n,ei[ti++]=r,ni|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function ai(e,t,n,r){return ii(e,t,n,r),ci(e)}function oi(e,t){return ii(e,null,null,t),ci(e)}function si(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-We(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ci(e){if(50<Tu)throw Tu=0,Eu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var li={};function ui(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 di(e,t,n,r){return new ui(e,t,n,r)}function fi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function pi(e,t){var n=e.alternate;return n===null?(n=di(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 mi(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 hi(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)fi(e)&&(s=1);else if(typeof e==`string`)s=op(e,n,fe.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case ee:return e=di(31,n,t,a),e.elementType=ee,e.lanes=o,e;case y:return gi(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=di(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=di(13,n,t,a),e.elementType=T,e.lanes=o,e;case E:return e=di(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=di(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function gi(e,t,n,r){return e=di(7,e,r,t),e.lanes=n,e}function _i(e,t,n){return e=di(6,e,null,t),e.lanes=n,e}function vi(e){var t=di(18,null,null,0);return t.stateNode=e,t}function yi(e,t,n){return t=di(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var bi=new WeakMap;function xi(e,t){if(typeof e==`object`&&e){var n=bi.get(e);return n===void 0?(t={value:e,source:t,stack:Ee(t)},bi.set(e,t),t):n}return{value:e,source:t,stack:Ee(t)}}var Si=[],Ci=0,wi=null,Ti=0,Ei=[],Di=0,Oi=null,ki=1,Ai=``;function ji(e,t){Si[Ci++]=Ti,Si[Ci++]=wi,wi=e,Ti=t}function Mi(e,t,n){Ei[Di++]=ki,Ei[Di++]=Ai,Ei[Di++]=Oi,Oi=e;var r=ki;e=Ai;var i=32-We(r)-1;r&=~(1<<i),n+=1;var a=32-We(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,ki=1<<32-We(t)+i|n<<i|r,Ai=a+e}else ki=1<<a|n<<i|r,Ai=e}function Ni(e){e.return!==null&&(ji(e,1),Mi(e,1,0))}function Pi(e){for(;e===wi;)wi=Si[--Ci],Si[Ci]=null,Ti=Si[--Ci],Si[Ci]=null;for(;e===Oi;)Oi=Ei[--Di],Ei[Di]=null,Ai=Ei[--Di],Ei[Di]=null,ki=Ei[--Di],Ei[Di]=null}function Fi(e,t){Ei[Di++]=ki,Ei[Di++]=Ai,Ei[Di++]=Oi,ki=t.id,Ai=t.overflow,Oi=e}var Ii=null,Li=null,Ri=!1,zi=null,Bi=!1,Vi=Error(i(519));function Hi(e){throw Ji(xi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Vi}function Ui(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[pt]=e,t[mt]=r,n){case`dialog`:Fd(`cancel`,t),Fd(`close`,t);break;case`iframe`:case`object`:case`embed`:Fd(`load`,t);break;case`video`:case`audio`:for(n=0;n<Md.length;n++)Fd(Md[n],t);break;case`source`:Fd(`error`,t);break;case`img`:case`image`:case`link`:Fd(`error`,t),Fd(`load`,t);break;case`details`:Fd(`toggle`,t);break;case`input`:Fd(`invalid`,t),qt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Fd(`invalid`,t);break;case`textarea`:Fd(`invalid`,t),Zt(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||Jd(t.textContent,n)?(r.popover!=null&&(Fd(`beforetoggle`,t),Fd(`toggle`,t)),r.onScroll!=null&&Fd(`scroll`,t),r.onScrollEnd!=null&&Fd(`scrollend`,t),r.onClick!=null&&(t.onclick=sn),t=!0):t=!1,t||Hi(e,!0)}function Wi(e){for(Ii=e.return;Ii;)switch(Ii.tag){case 5:case 31:case 13:Bi=!1;return;case 27:case 3:Bi=!0;return;default:Ii=Ii.return}}function Gi(e){if(e!==Ii)return!1;if(!Ri)return Wi(e),Ri=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||sf(e.type,e.memoizedProps)),n=!n),n&&Li&&Hi(e),Wi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Li=Df(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Li=Df(e)}else t===27?(t=Li,hf(e.type)?(e=Ef,Ef=null,Li=e):Li=t):Li=Ii?Tf(e.stateNode.nextSibling):null;return!0}function Ki(){Li=Ii=null,Ri=!1}function qi(){var e=zi;return e!==null&&(du===null?du=e:du.push.apply(du,e),zi=null),e}function Ji(e){zi===null?zi=[e]:zi.push(e)}var Yi=le(null),Xi=null,Zi=null;function Qi(e,t,n){de(Yi,t._currentValue),t._currentValue=n}function $i(e){e._currentValue=Yi.current,ue(Yi)}function ea(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 ta(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),ea(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),ea(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 na(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;Tr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===he.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[hp]:e.push(hp))}a=a.return}e!==null&&ta(t,e,n,r),t.flags|=262144}function ra(e){for(e=e.firstContext;e!==null;){if(!Tr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ia(e){Xi=e,Zi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function aa(e){return sa(Xi,e)}function oa(e,t){return Xi===null&&ia(e),sa(e,t)}function sa(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Zi===null){if(e===null)throw Error(i(308));Zi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Zi=Zi.next=t;return n}var ca=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()})}},la=t.unstable_scheduleCallback,ua=t.unstable_NormalPriority,da={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function fa(){return{controller:new ca,data:new Map,refCount:0}}function pa(e){e.refCount--,e.refCount===0&&la(ua,function(){e.controller.abort()})}var ma=null,ha=0,ga=0,_a=null;function va(e,t){if(ma===null){var n=ma=[];ha=0,ga=Ed(),_a={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return ha++,t.then(ya,ya),t}function ya(){if(--ha===0&&ma!==null){_a!==null&&(_a.status=`fulfilled`);var e=ma;ma=null,ga=0,_a=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ba(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 xa=j.S;j.S=function(e,t){mu=Me(),typeof t==`object`&&t&&typeof t.then==`function`&&va(e,t),xa!==null&&xa(e,t)};var Sa=le(null);function Ca(){var e=Sa.current;return e===null?Yl.pooledCache:e}function wa(e,t){t===null?de(Sa,Sa.current):de(Sa,t.pool)}function Ta(){var e=Ca();return e===null?null:{parent:da._currentValue,pool:e}}var Ea=Error(i(460)),Da=Error(i(474)),Oa=Error(i(542)),ka={then:function(){}};function Aa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function ja(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(sn,sn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Fa(e),e;default:if(typeof t.status==`string`)t.then(sn,sn);else{if(e=Yl,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,Fa(e),e}throw Na=t,Ea}}function Ma(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Na=e,Ea):e}}var Na=null;function Pa(){if(Na===null)throw Error(i(459));var e=Na;return Na=null,e}function Fa(e){if(e===Ea||e===Oa)throw Error(i(483))}var Ia=null,La=0;function Ra(e){var t=La;return La+=1,Ia===null&&(Ia=[]),ja(Ia,e,t)}function za(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Ba(e,t){throw t.$$typeof===h?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Va(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=pi(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=_i(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&&Ma(i)===t.type)?(t=a(t,n.props),za(t,n),t.return=e,t):(t=hi(n.type,n.key,n.props,null,e.mode,r),za(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=yi(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=gi(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=_i(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=hi(t.type,t.key,t.props,null,e.mode,n),za(n,t),n.return=e,n;case v:return t=yi(t,e.mode,n),t.return=e,t;case O:return t=Ma(t),f(e,t,n)}if(ie(t)||A(t))return t=gi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Ra(t),n);if(t.$$typeof===C)return f(e,oa(e,t),n);Ba(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=Ma(n),p(e,t,n,r)}if(ie(n)||A(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Ra(n),r);if(n.$$typeof===C)return p(e,t,oa(e,n),r);Ba(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=Ma(r),m(e,t,n,r,i)}if(ie(r)||A(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Ra(r),i);if(r.$$typeof===C)return m(e,t,n,oa(t,r),i);Ba(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),Ri&&ji(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 Ri&&ji(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)}),Ri&&ji(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),Ri&&ji(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 Ri&&ji(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)}),Ri&&ji(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&&Ma(l)===r.type){n(e,r.sibling),c=a(r,o.props),za(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=gi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=hi(o.type,o.key,o.props,null,e.mode,c),za(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}else{n(e,r);break}else t(e,r);r=r.sibling}c=yi(o,e.mode,c),c.return=e,e=c}return s(e);case O:return o=Ma(o),b(e,r,o,c)}if(ie(o))return h(e,r,o,c);if(A(o)){if(l=A(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,Ra(o),c);if(o.$$typeof===C)return b(e,r,oa(e,o),c);Ba(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=_i(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{La=0;var i=b(e,t,n,r);return Ia=null,i}catch(t){if(t===Ea||t===Oa)throw t;var a=di(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Ha=Va(!0),Ua=Va(!1),Wa=!1;function Ga(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ka(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 qa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ja(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Jl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ci(e),si(e,null,n),t}return ii(e,r,t,n),ci(e)}function Ya(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,ot(e,n)}}function Xa(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 Za=!1;function Qa(){if(Za){var e=_a;if(e!==null)throw e}}function $a(e,t,n,r){Za=!1;var i=e.updateQueue;Wa=!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,m=f!==s.lane;if(m?(Zl&f)===f:(r&f)===f){f!==0&&f===ga&&(Za=!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=p({},d,f);break a;case 2:Wa=!0}}f=s.callback,f!==null&&(e.flags|=64,m&&(e.flags|=8192),m=i.callbacks,m===null?i.callbacks=[f]:m.push(f))}else m={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=m,c=d):u=u.next=m,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;m=s,s=m.next,m.next=null,i.lastBaseUpdate=m,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),au|=o,e.lanes=o,e.memoizedState=d}}function eo(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function to(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)eo(n[e],t)}var no=le(null),ro=le(0);function io(e,t){e=ru,de(ro,e),de(no,t),ru=e|t.baseLanes}function ao(){de(ro,ru),de(no,no.current)}function oo(){ru=ro.current,ue(no),ue(ro)}var so=le(null),co=null;function lo(e){var t=e.alternate;de(ho,ho.current&1),de(so,e),co===null&&(t===null||no.current!==null||t.memoizedState!==null)&&(co=e)}function uo(e){de(ho,ho.current),de(so,e),co===null&&(co=e)}function fo(e){e.tag===22?(de(ho,ho.current),de(so,e),co===null&&(co=e)):po(e)}function po(){de(ho,ho.current),de(so,so.current)}function mo(e){ue(so),co===e&&(co=null),ue(ho)}var ho=le(0);function go(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Sf(n)||Cf(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 _o=0,vo=null,yo=null,bo=null,xo=!1,So=!1,Co=!1,wo=0,To=0,Eo=null,Do=0;function Oo(){throw Error(i(321))}function ko(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Tr(e[n],t[n]))return!1;return!0}function Ao(e,t,n,r,i,a){return _o=a,vo=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,j.H=e===null||e.memoizedState===null?qs:I,Co=!1,a=n(r,i),Co=!1,So&&(a=Mo(t,n,r,i)),jo(e),a}function jo(e){j.H=Ks;var t=yo!==null&&yo.next!==null;if(_o=0,bo=yo=vo=null,xo=!1,To=0,Eo=null,t)throw Error(i(300));e===null||uc||(e=e.dependencies,e!==null&&ra(e)&&(uc=!0))}function Mo(e,t,n,r){vo=e;var a=0;do{if(So&&(Eo=null),To=0,So=!1,25<=a)throw Error(i(301));if(a+=1,bo=yo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}j.H=Js,o=t(n,r)}while(So);return o}function No(){var e=j.H,t=e.useState()[0];return t=typeof t.then==`function`?Bo(t):t,e=e.useState()[0],(yo===null?null:yo.memoizedState)!==e&&(vo.flags|=1024),t}function Po(){var e=wo!==0;return wo=0,e}function Fo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Io(e){if(xo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}xo=!1}_o=0,bo=yo=vo=null,So=!1,To=wo=0,Eo=null}function Lo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return bo===null?vo.memoizedState=bo=e:bo=bo.next=e,bo}function Ro(){if(yo===null){var e=vo.alternate;e=e===null?null:e.memoizedState}else e=yo.next;var t=bo===null?vo.memoizedState:bo.next;if(t!==null)bo=t,yo=e;else{if(e===null)throw vo.alternate===null?Error(i(467)):Error(i(310));yo=e,e={memoizedState:yo.memoizedState,baseState:yo.baseState,baseQueue:yo.baseQueue,queue:yo.queue,next:null},bo===null?vo.memoizedState=bo=e:bo=bo.next=e}return bo}function zo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Bo(e){var t=To;return To+=1,Eo===null&&(Eo=[]),e=ja(Eo,e,t),t=vo,(bo===null?t.memoizedState:bo.next)===null&&(t=t.alternate,j.H=t===null||t.memoizedState===null?qs:I),e}function Vo(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Bo(e);if(e.$$typeof===C)return aa(e)}throw Error(i(438,String(e)))}function Ho(e){var t=null,n=vo.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=vo.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=zo(),vo.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]=te;return t.index++,n}function Uo(e,t){return typeof t==`function`?t(e):t}function Wo(e){return Go(Ro(),yo,e)}function Go(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?(_o&f)===f:(Zl&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===ga&&(d=!0);else if((_o&p)===p){u=u.next,p===ga&&(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,vo.lanes|=p,au|=p;f=u.action,Co&&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,vo.lanes|=f,au|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Tr(o,e.memoizedState)&&(uc=!0,d&&(n=_a,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 Ko(e){var t=Ro(),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);Tr(o,t.memoizedState)||(uc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function qo(e,t,n){var r=vo,a=Ro(),o=Ri;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Tr((yo||a).memoizedState,n);if(s&&(a.memoizedState=n,uc=!0),a=a.queue,vs(Xo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||bo!==null&&bo.memoizedState.tag&1){if(r.flags|=2048,ps(9,{destroy:void 0},Yo.bind(null,r,a,n,t),null),Yl===null)throw Error(i(349));o||_o&127||Jo(r,t,n)}return n}function Jo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=vo.updateQueue,t===null?(t=zo(),vo.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Yo(e,t,n,r){t.value=n,t.getSnapshot=r,Zo(t)&&Qo(e)}function Xo(e,t,n){return n(function(){Zo(t)&&Qo(e)})}function Zo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Tr(e,n)}catch{return!0}}function Qo(e){var t=oi(e,2);t!==null&&ku(t,e,2)}function $o(e){var t=Lo();if(typeof e==`function`){var n=e;if(e=n(),Co){Ue(!0);try{n()}finally{Ue(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Uo,lastRenderedState:e},t}function es(e,t,n,r){return e.baseState=n,Go(e,yo,typeof r==`function`?r:Uo)}function ts(e,t,n,r,a){if(Us(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)}};j.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,ns(t,o)):(o.next=n.next,t.pending=n.next=o)}}function ns(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=j.T,o={};j.T=o;try{var s=n(i,r),c=j.S;c!==null&&c(o,s),rs(e,t,s)}catch(n){as(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),j.T=a}}else try{a=n(i,r),rs(e,t,a)}catch(n){as(e,t,n)}}function rs(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){is(e,t,n)},function(n){return as(e,t,n)}):is(e,t,n)}function is(e,t,n){t.status=`fulfilled`,t.value=n,os(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,ns(e,n)))}function as(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,os(t),t=t.next;while(t!==r)}e.action=null}function os(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function ss(e,t){return t}function cs(e,t){if(Ri){var n=Yl.formState;if(n!==null){a:{var r=vo;if(Ri){if(Li){b:{for(var i=Li,a=Bi;i.nodeType!==8;){if(!a){i=null;break b}if(i=Tf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Li=Tf(i.nextSibling),r=i.data===`F!`;break a}}Hi(r)}r=!1}r&&(t=n[0])}}return n=Lo(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ss,lastRenderedState:t},n.queue=r,n=Bs.bind(null,vo,r),r.dispatch=n,r=$o(!1),a=Hs.bind(null,vo,!1,r.queue),r=Lo(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=ts.bind(null,vo,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function ls(e){return us(Ro(),yo,e)}function us(e,t,n){if(t=Go(e,t,ss)[0],e=Wo(Uo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Bo(t)}catch(e){throw e===Ea?Oa:e}else r=t;t=Ro();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(vo.flags|=2048,ps(9,{destroy:void 0},ds.bind(null,i,n),null)),[r,a,e]}function ds(e,t){e.action=t}function fs(e){var t=Ro(),n=yo;if(n!==null)return us(t,n,e);Ro(),t=t.memoizedState,n=Ro();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function ps(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=vo.updateQueue,t===null&&(t=zo(),vo.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 ms(){return Ro().memoizedState}function hs(e,t,n,r){var i=Lo();vo.flags|=e,i.memoizedState=ps(1|t,{destroy:void 0},n,r===void 0?null:r)}function gs(e,t,n,r){var i=Ro();r=r===void 0?null:r;var a=i.memoizedState.inst;yo!==null&&r!==null&&ko(r,yo.memoizedState.deps)?i.memoizedState=ps(t,a,n,r):(vo.flags|=e,i.memoizedState=ps(1|t,a,n,r))}function _s(e,t){hs(8390656,8,e,t)}function vs(e,t){gs(2048,8,e,t)}function ys(e){vo.flags|=4;var t=vo.updateQueue;if(t===null)t=zo(),vo.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function bs(e){var t=Ro().memoizedState;return ys({ref:t,nextImpl:e}),function(){if(Jl&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function xs(e,t){return gs(4,2,e,t)}function Ss(e,t){return gs(4,4,e,t)}function Cs(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 ws(e,t,n){n=n==null?null:n.concat([e]),gs(4,4,Cs.bind(null,t,e),n)}function Ts(){}function Es(e,t){var n=Ro();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&ko(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Ds(e,t){var n=Ro();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&ko(t,r[1]))return r[0];if(r=e(),Co){Ue(!0);try{e()}finally{Ue(!1)}}return n.memoizedState=[r,t],r}function Os(e,t,n){return n===void 0||_o&1073741824&&!(Zl&261930)?e.memoizedState=t:(e.memoizedState=n,e=Ou(),vo.lanes|=e,au|=e,n)}function ks(e,t,n,r){return Tr(n,t)?n:no.current===null?!(_o&42)||_o&1073741824&&!(Zl&261930)?(uc=!0,e.memoizedState=n):(e=Ou(),vo.lanes|=e,au|=e,t):(e=Os(e,n,r),Tr(e,t)||(uc=!0),e)}function As(e,t,n,r,i){var a=ae.p;ae.p=a!==0&&8>a?a:8;var o=j.T,s={};j.T=s,Hs(e,!1,t,n);try{var c=i(),l=j.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Vs(e,t,ba(c,r),Du(e)):Vs(e,t,r,Du(e))}catch(n){Vs(e,t,{then:function(){},status:`rejected`,reason:n},Du())}finally{ae.p=a,o!==null&&s.types!==null&&(o.types=s.types),j.T=o}}function js(){}function Ms(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Ns(e).queue;As(e,a,t,oe,n===null?js:function(){return Ps(e),n(r)})}function Ns(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:oe,baseState:oe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Uo,lastRenderedState:oe},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Uo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ps(e){var t=Ns(e);t.next===null&&(t=e.alternate.memoizedState),Vs(e,t.next.queue,{},Du())}function Fs(){return aa(hp)}function Is(){return Ro().memoizedState}function Ls(){return Ro().memoizedState}function Rs(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Du();e=qa(n);var r=Ja(t,e,n);r!==null&&(ku(r,t,n),Ya(r,t,n)),t={cache:fa()},e.payload=t;return}t=t.return}}function zs(e,t,n){var r=Du();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Us(e)?Ws(t,n):(n=ai(e,t,n,r),n!==null&&(ku(n,e,r),Gs(n,t,r)))}function Bs(e,t,n){Vs(e,t,n,Du())}function Vs(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Us(e))Ws(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,Tr(s,o))return ii(e,t,i,0),Yl===null&&ri(),!1}catch{}if(n=ai(e,t,i,r),n!==null)return ku(n,e,r),Gs(n,t,r),!0}return!1}function Hs(e,t,n,r){if(r={lane:2,revertLane:Ed(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Us(e)){if(t)throw Error(i(479))}else t=ai(e,n,r,2),t!==null&&ku(t,e,2)}function Us(e){var t=e.alternate;return e===vo||t!==null&&t===vo}function Ws(e,t){So=xo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Gs(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ot(e,n)}}var Ks={readContext:aa,use:Vo,useCallback:Oo,useContext:Oo,useEffect:Oo,useImperativeHandle:Oo,useLayoutEffect:Oo,useInsertionEffect:Oo,useMemo:Oo,useReducer:Oo,useRef:Oo,useState:Oo,useDebugValue:Oo,useDeferredValue:Oo,useTransition:Oo,useSyncExternalStore:Oo,useId:Oo,useHostTransitionStatus:Oo,useFormState:Oo,useActionState:Oo,useOptimistic:Oo,useMemoCache:Oo,useCacheRefresh:Oo};Ks.useEffectEvent=Oo;var qs={readContext:aa,use:Vo,useCallback:function(e,t){return Lo().memoizedState=[e,t===void 0?null:t],e},useContext:aa,useEffect:_s,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),hs(4194308,4,Cs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return hs(4194308,4,e,t)},useInsertionEffect:function(e,t){hs(4,2,e,t)},useMemo:function(e,t){var n=Lo();t=t===void 0?null:t;var r=e();if(Co){Ue(!0);try{e()}finally{Ue(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Lo();if(n!==void 0){var i=n(t);if(Co){Ue(!0);try{n(t)}finally{Ue(!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=zs.bind(null,vo,e),[r.memoizedState,e]},useRef:function(e){var t=Lo();return e={current:e},t.memoizedState=e},useState:function(e){e=$o(e);var t=e.queue,n=Bs.bind(null,vo,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Ts,useDeferredValue:function(e,t){return Os(Lo(),e,t)},useTransition:function(){var e=$o(!1);return e=As.bind(null,vo,e.queue,!0,!1),Lo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=vo,a=Lo();if(Ri){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Yl===null)throw Error(i(349));Zl&127||Jo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,_s(Xo.bind(null,r,o,e),[e]),r.flags|=2048,ps(9,{destroy:void 0},Yo.bind(null,r,o,n,t),null),n},useId:function(){var e=Lo(),t=Yl.identifierPrefix;if(Ri){var n=Ai,r=ki;n=(r&~(1<<32-We(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=wo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Do++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Fs,useFormState:cs,useActionState:cs,useOptimistic:function(e){var t=Lo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Hs.bind(null,vo,!0,n),n.dispatch=t,[e,t]},useMemoCache:Ho,useCacheRefresh:function(){return Lo().memoizedState=Rs.bind(null,vo)},useEffectEvent:function(e){var t=Lo(),n={impl:e};return t.memoizedState=n,function(){if(Jl&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},I={readContext:aa,use:Vo,useCallback:Es,useContext:aa,useEffect:vs,useImperativeHandle:ws,useInsertionEffect:xs,useLayoutEffect:Ss,useMemo:Ds,useReducer:Wo,useRef:ms,useState:function(){return Wo(Uo)},useDebugValue:Ts,useDeferredValue:function(e,t){return ks(Ro(),yo.memoizedState,e,t)},useTransition:function(){var e=Wo(Uo)[0],t=Ro().memoizedState;return[typeof e==`boolean`?e:Bo(e),t]},useSyncExternalStore:qo,useId:Is,useHostTransitionStatus:Fs,useFormState:ls,useActionState:ls,useOptimistic:function(e,t){return es(Ro(),yo,e,t)},useMemoCache:Ho,useCacheRefresh:Ls};I.useEffectEvent=bs;var Js={readContext:aa,use:Vo,useCallback:Es,useContext:aa,useEffect:vs,useImperativeHandle:ws,useInsertionEffect:xs,useLayoutEffect:Ss,useMemo:Ds,useReducer:Ko,useRef:ms,useState:function(){return Ko(Uo)},useDebugValue:Ts,useDeferredValue:function(e,t){var n=Ro();return yo===null?Os(n,e,t):ks(n,yo.memoizedState,e,t)},useTransition:function(){var e=Ko(Uo)[0],t=Ro().memoizedState;return[typeof e==`boolean`?e:Bo(e),t]},useSyncExternalStore:qo,useId:Is,useHostTransitionStatus:Fs,useFormState:fs,useActionState:fs,useOptimistic:function(e,t){var n=Ro();return yo===null?(n.baseState=e,[e,n.queue.dispatch]):es(n,yo,e,t)},useMemoCache:Ho,useCacheRefresh:Ls};Js.useEffectEvent=bs;function Ys(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:p({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Xs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Du(),i=qa(r);i.payload=t,n!=null&&(i.callback=n),t=Ja(e,i,r),t!==null&&(ku(t,e,r),Ya(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Du(),i=qa(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ja(e,i,r),t!==null&&(ku(t,e,r),Ya(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Du(),r=qa(n);r.tag=2,t!=null&&(r.callback=t),t=Ja(e,r,n),t!==null&&(ku(t,e,n),Ya(t,e,n))}};function Zs(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?!Er(n,r)||!Er(i,a):!0}function Qs(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&&Xs.enqueueReplaceState(t,t.state,null)}function $s(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=p({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function ec(e){$r(e)}function tc(e){console.error(e)}function nc(e){$r(e)}function rc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function ic(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 ac(e,t,n){return n=qa(n),n.tag=3,n.payload={element:null},n.callback=function(){rc(e,t)},n}function oc(e){return e=qa(e),e.tag=3,e}function sc(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(){ic(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){ic(t,n,r),typeof i!=`function`&&(_u===null?_u=new Set([this]):_u.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function cc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&na(t,n,a,!0),n=so.current,n!==null){switch(n.tag){case 31:case 13:return co===null?Vu():n.alternate===null&&iu===0&&(iu=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===ka?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),od(e,r,a)),!1;case 22:return n.flags|=65536,r===ka?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)),od(e,r,a)),!1}throw Error(i(435,n.tag))}return od(e,r,a),Vu(),!1}if(Ri)return t=so.current,t===null?(r!==Vi&&(t=Error(i(423),{cause:r}),Ji(xi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=xi(r,n),a=ac(e.stateNode,r,a),Xa(e,a),iu!==4&&(iu=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Vi&&(e=Error(i(422),{cause:r}),Ji(xi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=xi(o,n),uu===null?uu=[o]:uu.push(o),iu!==4&&(iu=2),t===null)return!0;r=xi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=ac(n.stateNode,r,e),Xa(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`&&(_u===null||!_u.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=oc(a),sc(a,e,n,r),Xa(n,a),!1}n=n.return}while(n!==null);return!1}var lc=Error(i(461)),uc=!1;function dc(e,t,n,r){t.child=e===null?Ua(t,null,n,r):Ha(t,e.child,n,r)}function fc(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 ia(t),r=Ao(e,t,n,o,a,i),s=Po(),e!==null&&!uc?(Fo(e,t,i),Ic(e,t,i)):(Ri&&s&&Ni(t),t.flags|=1,dc(e,t,r,i),t.child)}function pc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!fi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,mc(e,t,a,r,i)):(e=hi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Lc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Er:n,n(o,r)&&e.ref===t.ref)return Ic(e,t,i)}return t.flags|=1,e=pi(a,r),e.ref=t.ref,e.return=t,t.child=e}function mc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Er(a,r)&&e.ref===t.ref)if(uc=!1,t.pendingProps=r=a,Lc(e,i))e.flags&131072&&(uc=!0);else return t.lanes=e.lanes,Ic(e,t,i)}return Sc(e,t,n,r,i)}function hc(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 _c(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&wa(t,a===null?null:a.cachePool),a===null?ao():io(t,a),fo(t);else return r=t.lanes=536870912,_c(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&wa(t,null),ao(),po(t)):(wa(t,a.cachePool),io(t,a),po(t),t.memoizedState=null);return dc(e,t,i,n),t.child}function gc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function _c(e,t,n,r,i){var a=Ca();return a=a===null?null:{parent:da._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&wa(t,null),ao(),fo(t),e!==null&&na(e,t,r,!0),t.childLanes=i,null}function vc(e,t){return t=jc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function yc(e,t,n){return Ha(t,e.child,null,n),e=vc(t,t.pendingProps),e.flags|=2,mo(t),t.memoizedState=null,e}function bc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(Ri){if(r.mode===`hidden`)return e=vc(t,r),t.lanes=536870912,gc(null,e);if(uo(t),(e=Li)?(e=xf(e,Bi),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Oi===null?null:{id:ki,overflow:Ai},retryLane:536870912,hydrationErrors:null},n=vi(e),n.return=t,t.child=n,Ii=t,Li=null)):e=null,e===null)throw Hi(t);return t.lanes=536870912,null}return vc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(uo(t),a)if(t.flags&256)t.flags&=-257,t=yc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(uc||na(e,t,n,!1),a=(n&e.childLanes)!==0,uc||a){if(r=Yl,r!==null&&(s=st(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,oi(e,s),ku(r,e,s),lc;Vu(),t=yc(e,t,n)}else e=o.treeContext,Li=Tf(s.nextSibling),Ii=t,Ri=!0,zi=null,Bi=!1,e!==null&&Fi(t,e),t=vc(t,r),t.flags|=4096;return t}return e=pi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function xc(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 Sc(e,t,n,r,i){return ia(t),n=Ao(e,t,n,r,void 0,i),r=Po(),e!==null&&!uc?(Fo(e,t,i),Ic(e,t,i)):(Ri&&r&&Ni(t),t.flags|=1,dc(e,t,n,i),t.child)}function Cc(e,t,n,r,i,a){return ia(t),t.updateQueue=null,n=Mo(t,r,n,i),jo(e),r=Po(),e!==null&&!uc?(Fo(e,t,a),Ic(e,t,a)):(Ri&&r&&Ni(t),t.flags|=1,dc(e,t,n,a),t.child)}function wc(e,t,n,r,i){if(ia(t),t.stateNode===null){var a=li,o=n.contextType;typeof o==`object`&&o&&(a=aa(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Xs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Ga(t),o=n.contextType,a.context=typeof o==`object`&&o?aa(o):li,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Ys(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&&Xs.enqueueReplaceState(a,a.state,null),$a(t,r,a,i),Qa(),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=$s(n,s);a.props=c;var l=a.context,u=n.contextType;o=li,typeof u==`object`&&u&&(o=aa(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)&&Qs(t,a,r,o),Wa=!1;var f=t.memoizedState;a.state=f,$a(t,r,a,i),Qa(),l=t.memoizedState,s||f!==l||Wa?(typeof d==`function`&&(Ys(t,n,d,r),l=t.memoizedState),(c=Wa||Zs(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,Ka(e,t),o=t.memoizedProps,u=$s(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=li,typeof l==`object`&&l&&(c=aa(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)&&Qs(t,a,r,c),Wa=!1,f=t.memoizedState,a.state=f,$a(t,r,a,i),Qa();var p=t.memoizedState;o!==d||f!==p||Wa||e!==null&&e.dependencies!==null&&ra(e.dependencies)?(typeof s==`function`&&(Ys(t,n,s,r),p=t.memoizedState),(u=Wa||Zs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&ra(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,xc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Ha(t,e.child,null,i),t.child=Ha(t,null,n,i)):dc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Ic(e,t,i),e}function Tc(e,t,n,r){return Ki(),t.flags|=256,dc(e,t,n,r),t.child}var Ec={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Dc(e){return{baseLanes:e,cachePool:Ta()}}function Oc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=cu),e}function kc(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(ho.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(Ri){if(a?lo(t):po(t),(e=Li)?(e=xf(e,Bi),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Oi===null?null:{id:ki,overflow:Ai},retryLane:536870912,hydrationErrors:null},n=vi(e),n.return=t,t.child=n,Ii=t,Li=null)):e=null,e===null)throw Hi(t);return Cf(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(po(t),a=t.mode,c=jc({mode:`hidden`,children:c},a),r=gi(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=Dc(n),r.childLanes=Oc(e,s,n),t.memoizedState=Ec,gc(null,r)):(lo(t),Ac(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(lo(t),t.flags&=-257,t=Mc(e,t,n)):t.memoizedState===null?(po(t),c=r.fallback,a=t.mode,r=jc({mode:`visible`,children:r.children},a),c=gi(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Ha(t,e.child,null,n),r=t.child,r.memoizedState=Dc(n),r.childLanes=Oc(e,s,n),t.memoizedState=Ec,t=gc(null,r)):(po(t),t.child=e.child,t.flags|=128,t=null);else if(lo(t),Cf(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Ji({value:r,source:null,stack:null}),t=Mc(e,t,n)}else if(uc||na(e,t,n,!1),s=(n&e.childLanes)!==0,uc||s){if(s=Yl,s!==null&&(r=st(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,oi(e,r),ku(s,e,r),lc;Sf(c)||Vu(),t=Mc(e,t,n)}else Sf(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Li=Tf(c.nextSibling),Ii=t,Ri=!0,zi=null,Bi=!1,e!==null&&Fi(t,e),t=Ac(t,r.children),t.flags|=4096);return t}return a?(po(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=pi(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=gi(c,a,n,null),c.flags|=2):c=pi(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,gc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=Dc(n):(a=c.cachePool,a===null?a=Ta():(l=da._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=Oc(e,s,n),t.memoizedState=Ec,gc(e.child,r)):(lo(t),n=e.child,e=n.sibling,n=pi(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 Ac(e,t){return t=jc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function jc(e,t){return e=di(22,e,null,t),e.lanes=0,e}function Mc(e,t,n){return Ha(t,e.child,null,n),e=Ac(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Nc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ea(e.return,t,n)}function Pc(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 Fc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=ho.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,de(ho,o),dc(e,t,r,n),r=Ri?Ti:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Nc(e,n,t);else if(e.tag===19)Nc(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&&go(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Pc(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&&go(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Pc(t,!0,n,null,a,r);break;case`together`:Pc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Ic(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),au|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(na(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=pi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=pi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Lc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&ra(e))):!0}function Rc(e,t,n){switch(t.tag){case 3:ge(t,t.stateNode.containerInfo),Qi(t,da,e.memoizedState.cache),Ki();break;case 27:case 5:ve(t);break;case 4:ge(t,t.stateNode.containerInfo);break;case 10:Qi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,uo(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(lo(t),e=Ic(e,t,n),e===null?null:e.sibling):kc(e,t,n):(lo(t),t.flags|=128,null);lo(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(na(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Fc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),de(ho,ho.current),r)break;return null;case 22:return t.lanes=0,hc(e,t,n,t.pendingProps);case 24:Qi(t,da,e.memoizedState.cache)}return Ic(e,t,n)}function zc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)uc=!0;else{if(!Lc(e,n)&&!(t.flags&128))return uc=!1,Rc(e,t,n);uc=!!(e.flags&131072)}else uc=!1,Ri&&t.flags&1048576&&Mi(t,Ti,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Ma(t.elementType),t.type=e,typeof e==`function`)fi(e)?(r=$s(e,r),t.tag=1,t=wc(null,t,e,r,n)):(t.tag=0,t=Sc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=fc(null,t,e,r,n);break a}else if(a===D){t.tag=14,t=pc(null,t,e,r,n);break a}}throw t=re(e)||e,Error(i(306,t,``))}}return t;case 0:return Sc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=$s(r,t.pendingProps),wc(e,t,r,a,n);case 3:a:{if(ge(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Ka(e,t),$a(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Qi(t,da,r),r!==o.cache&&ta(t,[da],n,!0),Qa(),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=Tc(e,t,r,n);break a}else if(r!==a){a=xi(Error(i(424)),t),Ji(a),t=Tc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Li=Tf(e.firstChild),Ii=t,Ri=!0,zi=null,Bi=!0,n=Ua(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Ki(),r===a){t=Ic(e,t,n);break a}dc(e,t,r,n)}t=t.child}return t;case 26:return xc(e,t),e===null?(n=Kf(t.type,null,t.pendingProps,null))?t.memoizedState=n:Ri||(n=t.type,e=t.pendingProps,r=rf(me.current).createElement(n),r[pt]=t,r[mt]=e,Zd(r,n,e),Et(r),t.stateNode=r):t.memoizedState=Kf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ve(t),e===null&&Ri&&(r=t.stateNode=kf(t.type,t.pendingProps,me.current),Ii=t,Bi=!0,a=Li,hf(t.type)?(Ef=a,Li=Tf(r.firstChild)):Li=a),dc(e,t,t.pendingProps.children,n),xc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ri&&((a=r=Li)&&(r=yf(r,t.type,t.pendingProps,Bi),r===null?a=!1:(t.stateNode=r,Ii=t,Li=Tf(r.firstChild),Bi=!1,a=!0)),a||Hi(t)),ve(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,sf(a,o)?r=null:s!==null&&sf(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Ao(e,t,No,null,null,n),hp._currentValue=a),xc(e,t),dc(e,t,r,n),t.child;case 6:return e===null&&Ri&&((e=n=Li)&&(n=bf(n,t.pendingProps,Bi),n===null?e=!1:(t.stateNode=n,Ii=t,Li=null,e=!0)),e||Hi(t)),null;case 13:return kc(e,t,n);case 4:return ge(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ha(t,null,r,n):dc(e,t,r,n),t.child;case 11:return fc(e,t,t.type,t.pendingProps,n);case 7:return dc(e,t,t.pendingProps,n),t.child;case 8:return dc(e,t,t.pendingProps.children,n),t.child;case 12:return dc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Qi(t,t.type,r.value),dc(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,ia(t),a=aa(a),r=r(a),t.flags|=1,dc(e,t,r,n),t.child;case 14:return pc(e,t,t.type,t.pendingProps,n);case 15:return mc(e,t,t.type,t.pendingProps,n);case 19:return Fc(e,t,n);case 31:return bc(e,t,n);case 22:return hc(e,t,n,t.pendingProps);case 24:return ia(t),r=aa(da),e===null?(a=Ca(),a===null&&(a=Yl,o=fa(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Ga(t),Qi(t,da,a)):((e.lanes&n)!==0&&(Ka(e,t),$a(t,null,null,n),Qa()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Qi(t,da,r),r!==a.cache&&ta(t,[da],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Qi(t,da,r))),dc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Bc(e){e.flags|=4}function Vc(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Ru())e.flags|=8192;else throw Na=ka,Da}else e.flags&=-16777217}function Hc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!sp(t))if(Ru())e.flags|=8192;else throw Na=ka,Da}function Uc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:tt(),e.lanes|=t,lu|=t)}function Wc(e,t){if(!Ri)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 Gc(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 Kc(e,t,n){var r=t.pendingProps;switch(Pi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Gc(t),null;case 1:return Gc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),$i(da),_e(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Gi(t)?Bc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,qi())),Gc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Bc(t),o===null?(Gc(t),Vc(t,a,null,r,n)):(Gc(t),Hc(t,o))):o?o===e.memoizedState?(Gc(t),t.flags&=-16777217):(Bc(t),Gc(t),Hc(t,o)):(e=e.memoizedProps,e!==r&&Bc(t),Gc(t),Vc(t,a,e,r,n)),null;case 27:if(ye(t),n=me.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Bc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Gc(t),null}e=fe.current,Gi(t)?Ui(t,e):(e=kf(a,r,n),t.stateNode=e,Bc(t))}return Gc(t),null;case 5:if(ye(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Bc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Gc(t),null}if(o=fe.current,Gi(t))Ui(t,o);else{var s=rf(me.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[pt]=t,o[mt]=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(Zd(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&&Bc(t)}}return Gc(t),Vc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Bc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=me.current,Gi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Ii,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[pt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Jd(e.nodeValue,n)),e||Hi(t,!0)}else e=rf(e).createTextNode(r),e[pt]=t,t.stateNode=e}return Gc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Gi(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[pt]=t}else Ki(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Gc(t),e=!1}else n=qi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(mo(t),t):(mo(t),null);if(t.flags&128)throw Error(i(558))}return Gc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Gi(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[pt]=t}else Ki(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Gc(t),a=!1}else a=qi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(mo(t),t):(mo(t),null)}return mo(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),Uc(t,t.updateQueue),Gc(t),null);case 4:return _e(),e===null&&Rd(t.stateNode.containerInfo),Gc(t),null;case 10:return $i(t.type),Gc(t),null;case 19:if(ue(ho),r=t.memoizedState,r===null)return Gc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Wc(r,!1);else{if(iu!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=go(e),o!==null){for(t.flags|=128,Wc(r,!1),e=o.updateQueue,t.updateQueue=e,Uc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)mi(n,e),n=n.sibling;return de(ho,ho.current&1|2),Ri&&ji(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Me()>hu&&(t.flags|=128,a=!0,Wc(r,!1),t.lanes=4194304)}else{if(!a)if(e=go(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Uc(t,e),Wc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Ri)return Gc(t),null}else 2*Me()-r.renderingStartTime>hu&&n!==536870912&&(t.flags|=128,a=!0,Wc(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?(Gc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Me(),e.sibling=null,n=ho.current,de(ho,a?n&1|2:n&1),Ri&&ji(t,r.treeForkCount),e);case 22:case 23:return mo(t),oo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Gc(t),t.subtreeFlags&6&&(t.flags|=8192)):Gc(t),n=t.updateQueue,n!==null&&Uc(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&&ue(Sa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),$i(da),Gc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function qc(e,t){switch(Pi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return $i(da),_e(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ye(t),null;case 31:if(t.memoizedState!==null){if(mo(t),t.alternate===null)throw Error(i(340));Ki()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(mo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Ki()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ue(ho),null;case 4:return _e(),null;case 10:return $i(t.type),null;case 22:case 23:return mo(t),oo(),e!==null&&ue(Sa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return $i(da),null;case 25:return null;default:return null}}function Jc(e,t){switch(Pi(t),t.tag){case 3:$i(da),_e();break;case 26:case 27:case 5:ye(t);break;case 4:_e();break;case 31:t.memoizedState!==null&&mo(t);break;case 13:mo(t);break;case 19:ue(ho);break;case 10:$i(t.type);break;case 22:case 23:mo(t),oo(),e!==null&&ue(Sa);break;case 24:$i(da)}}function Yc(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){ad(t,t.return,e)}}function Xc(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){ad(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){ad(t,t.return,e)}}function Zc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{to(t,n)}catch(t){ad(e,e.return,t)}}}function Qc(e,t,n){n.props=$s(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){ad(e,t,n)}}function $c(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){ad(e,t,n)}}function el(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){ad(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){ad(e,t,n)}else n.current=null}function tl(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){ad(e,e.return,t)}}function nl(e,t,n){try{var r=e.stateNode;Qd(r,e.type,n,t),r[mt]=t}catch(t){ad(e,e.return,t)}}function rl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&hf(e.type)||e.tag===4}function il(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||rl(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&&hf(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 al(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=sn));else if(r!==4&&(r===27&&hf(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(al(e,t,n),e=e.sibling;e!==null;)al(e,t,n),e=e.sibling}function ol(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&&hf(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(ol(e,t,n),e=e.sibling;e!==null;)ol(e,t,n),e=e.sibling}function sl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Zd(t,r,n),t[pt]=e,t[mt]=n}catch(t){ad(e,e.return,t)}}var cl=!1,ll=!1,ul=!1,dl=typeof WeakSet==`function`?WeakSet:Set,fl=null;function pl(e,t){if(e=e.containerInfo,tf=wp,e=Ar(e),jr(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(nf={focusedElem:e,selectionRange:n},wp=!1,fl=t;fl!==null;)if(t=fl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,fl=e;else for(;fl!==null;){switch(t=fl,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=$s(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){ad(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)vf(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:vf(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,fl=e;break}fl=t.return}}function ml(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:kl(e,n),r&4&&Yc(5,n);break;case 1:if(kl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){ad(n,n.return,e)}else{var i=$s(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){ad(n,n.return,e)}}r&64&&Zc(n),r&512&&$c(n,n.return);break;case 3:if(kl(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{to(e,t)}catch(e){ad(n,n.return,e)}}break;case 27:t===null&&r&4&&sl(n);case 26:case 5:kl(e,n),t===null&&r&4&&tl(n),r&512&&$c(n,n.return);break;case 12:kl(e,n);break;case 31:kl(e,n),r&4&&bl(e,n);break;case 13:kl(e,n),r&4&&xl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=ld.bind(null,n),wf(e,n))));break;case 22:if(r=n.memoizedState!==null||cl,!r){t=t!==null&&t.memoizedState!==null||ll,i=cl;var a=ll;cl=r,(ll=t)&&!a?jl(e,n,(n.subtreeFlags&8772)!=0):kl(e,n),cl=i,ll=a}break;case 30:break;default:kl(e,n)}}function hl(e){var t=e.alternate;t!==null&&(e.alternate=null,hl(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&xt(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 gl=null,_l=!1;function vl(e,t,n){for(n=n.child;n!==null;)yl(e,t,n),n=n.sibling}function yl(e,t,n){if(He&&typeof He.onCommitFiberUnmount==`function`)try{He.onCommitFiberUnmount(Ve,n)}catch{}switch(n.tag){case 26:ll||el(n,t),vl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:ll||el(n,t);var r=gl,i=_l;hf(n.type)&&(gl=n.stateNode,_l=!1),vl(e,t,n),Af(n.stateNode),gl=r,_l=i;break;case 5:ll||el(n,t);case 6:if(r=gl,i=_l,gl=null,vl(e,t,n),gl=r,_l=i,gl!==null)if(_l)try{(gl.nodeType===9?gl.body:gl.nodeName===`HTML`?gl.ownerDocument.body:gl).removeChild(n.stateNode)}catch(e){ad(n,t,e)}else try{gl.removeChild(n.stateNode)}catch(e){ad(n,t,e)}break;case 18:gl!==null&&(_l?(e=gl,gf(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Xp(e)):gf(gl,n.stateNode));break;case 4:r=gl,i=_l,gl=n.stateNode.containerInfo,_l=!0,vl(e,t,n),gl=r,_l=i;break;case 0:case 11:case 14:case 15:Xc(2,n,t),ll||Xc(4,n,t),vl(e,t,n);break;case 1:ll||(el(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Qc(n,t,r)),vl(e,t,n);break;case 21:vl(e,t,n);break;case 22:ll=(r=ll)||n.memoizedState!==null,vl(e,t,n),ll=r;break;default:vl(e,t,n)}}function bl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Xp(e)}catch(e){ad(t,t.return,e)}}}function xl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Xp(e)}catch(e){ad(t,t.return,e)}}function Sl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new dl),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new dl),t;default:throw Error(i(435,e.tag))}}function Cl(e,t){var n=Sl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=ud.bind(null,e,t);t.then(r,r)}})}function wl(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(hf(c.type)){gl=c.stateNode,_l=!1;break a}break;case 5:gl=c.stateNode,_l=!1;break a;case 3:case 4:gl=c.stateNode.containerInfo,_l=!0;break a}c=c.return}if(gl===null)throw Error(i(160));yl(o,s,a),gl=null,_l=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)El(t,e),t=t.sibling}var Tl=null;function El(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:wl(t,e),Dl(e),r&4&&(Xc(3,e,e.return),Yc(3,e),Xc(5,e,e.return));break;case 1:wl(t,e),Dl(e),r&512&&(ll||n===null||el(n,n.return)),r&64&&cl&&(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=Tl;if(wl(t,e),Dl(e),r&512&&(ll||n===null||el(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[bt]||o[pt]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Zd(o,r,n),o[pt]=e,Et(o),r=o;break a;case`link`:var s=ip(`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),Zd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=ip(`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),Zd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[pt]=e,Et(o),r=o}e.stateNode=r}else ap(a,e.type,e.stateNode);else e.stateNode=$f(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&nl(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?ap(a,e.type,e.stateNode):$f(a,r,e.memoizedProps))}break;case 27:wl(t,e),Dl(e),r&512&&(ll||n===null||el(n,n.return)),n!==null&&r&4&&nl(e,e.memoizedProps,n.memoizedProps);break;case 5:if(wl(t,e),Dl(e),r&512&&(ll||n===null||el(n,n.return)),e.flags&32){a=e.stateNode;try{Qt(a,``)}catch(t){ad(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,nl(e,a,n===null?a:n.memoizedProps)),r&1024&&(ul=!0);break;case 6:if(wl(t,e),Dl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){ad(e,e.return,t)}}break;case 3:if(rp=null,a=Tl,Tl=Nf(t.containerInfo),wl(t,e),Tl=a,Dl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Xp(t.containerInfo)}catch(t){ad(e,e.return,t)}ul&&(ul=!1,Ol(e));break;case 4:r=Tl,Tl=Nf(e.stateNode.containerInfo),wl(t,e),Dl(e),Tl=r;break;case 12:wl(t,e),Dl(e);break;case 31:wl(t,e),Dl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Cl(e,r)));break;case 13:wl(t,e),Dl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(pu=Me()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Cl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=cl,d=ll;if(cl=u||a,ll=d||l,wl(t,e),ll=d,cl=u,Dl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||cl||ll||Al(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){ad(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){ad(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?_f(m,!0):_f(l.stateNode,!1)}catch(e){ad(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,Cl(e,n))));break;case 19:wl(t,e),Dl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Cl(e,r)));break;case 30:break;case 21:break;default:wl(t,e),Dl(e)}}function Dl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(rl(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;ol(e,il(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Qt(o,``),n.flags&=-33),ol(e,il(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;al(e,il(e),s);break;default:throw Error(i(161))}}catch(t){ad(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Ol(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Ol(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function kl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)ml(e,t.alternate,t),t=t.sibling}function Al(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Xc(4,t,t.return),Al(t);break;case 1:el(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Qc(t,t.return,n),Al(t);break;case 27:Af(t.stateNode);case 26:case 5:el(t,t.return),Al(t);break;case 22:t.memoizedState===null&&Al(t);break;case 30:Al(t);break;default:Al(t)}e=e.sibling}}function jl(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,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:jl(i,a,n),Yc(4,a);break;case 1:if(jl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){ad(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++)eo(c[i],s)}catch(e){ad(r,r.return,e)}}n&&o&64&&Zc(a),$c(a,a.return);break;case 27:sl(a);case 26:case 5:jl(i,a,n),n&&r===null&&o&4&&tl(a),$c(a,a.return);break;case 12:jl(i,a,n);break;case 31:jl(i,a,n),n&&o&4&&bl(i,a);break;case 13:jl(i,a,n),n&&o&4&&xl(i,a);break;case 22:a.memoizedState===null&&jl(i,a,n),$c(a,a.return);break;case 30:break;default:jl(i,a,n)}t=t.sibling}}function Ml(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&&pa(n))}function Nl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&pa(e))}function Pl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Fl(e,t,n,r),t=t.sibling}function Fl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Pl(e,t,n,r),i&2048&&Yc(9,t);break;case 1:Pl(e,t,n,r);break;case 3:Pl(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&&pa(e)));break;case 12:if(i&2048){Pl(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){ad(t,t.return,e)}}else Pl(e,t,n,r);break;case 31:Pl(e,t,n,r);break;case 13:Pl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Pl(e,t,n,r):(a._visibility|=2,Il(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?Pl(e,t,n,r):Ll(e,t),i&2048&&Ml(o,t);break;case 24:Pl(e,t,n,r),i&2048&&Nl(t.alternate,t);break;default:Pl(e,t,n,r)}}function Il(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!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:Il(a,o,s,c,i),Yc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Il(a,o,s,c,i)):u._visibility&2?Il(a,o,s,c,i):Ll(a,o),i&&l&2048&&Ml(o.alternate,o);break;case 24:Il(a,o,s,c,i),i&&l&2048&&Nl(o.alternate,o);break;default:Il(a,o,s,c,i)}t=t.sibling}}function Ll(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:Ll(n,r),i&2048&&Ml(r.alternate,r);break;case 24:Ll(n,r),i&2048&&Nl(r.alternate,r);break;default:Ll(n,r)}t=t.sibling}}var Rl=8192;function zl(e,t,n){if(e.subtreeFlags&Rl)for(e=e.child;e!==null;)Bl(e,t,n),e=e.sibling}function Bl(e,t,n){switch(e.tag){case 26:zl(e,t,n),e.flags&Rl&&e.memoizedState!==null&&cp(n,Tl,e.memoizedState,e.memoizedProps);break;case 5:zl(e,t,n);break;case 3:case 4:var r=Tl;Tl=Nf(e.stateNode.containerInfo),zl(e,t,n),Tl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Rl,Rl=16777216,zl(e,t,n),Rl=r):zl(e,t,n));break;default:zl(e,t,n)}}function Vl(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 Hl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];fl=r,Gl(r,e)}Vl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ul(e),e=e.sibling}function Ul(e){switch(e.tag){case 0:case 11:case 15:Hl(e),e.flags&2048&&Xc(9,e,e.return);break;case 3:Hl(e);break;case 12:Hl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Wl(e)):Hl(e);break;default:Hl(e)}}function Wl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];fl=r,Gl(r,e)}Vl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Xc(8,t,t.return),Wl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Wl(t));break;default:Wl(t)}e=e.sibling}}function Gl(e,t){for(;fl!==null;){var n=fl;switch(n.tag){case 0:case 11:case 15:Xc(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:pa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,fl=r;else a:for(n=e;fl!==null;){r=fl;var i=r.sibling,a=r.return;if(hl(r),r===n){fl=null;break a}if(i!==null){i.return=a,fl=i;break a}fl=a}}}var Kl={getCacheForType:function(e){var t=aa(da),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return aa(da).controller.signal}},ql=typeof WeakMap==`function`?WeakMap:Map,Jl=0,Yl=null,Xl=null,Zl=0,Ql=0,$l=null,eu=!1,tu=!1,nu=!1,ru=0,iu=0,au=0,ou=0,su=0,cu=0,lu=0,uu=null,du=null,fu=!1,pu=0,mu=0,hu=1/0,gu=null,_u=null,vu=0,yu=null,bu=null,xu=0,Su=0,Cu=null,wu=null,Tu=0,Eu=null;function Du(){return Jl&2&&Zl!==0?Zl&-Zl:j.T===null?ut():Ed()}function Ou(){if(cu===0)if(!(Zl&536870912)||Ri){var e=Ye;Ye<<=1,!(Ye&3932160)&&(Ye=262144),cu=e}else cu=536870912;return e=so.current,e!==null&&(e.flags|=32),cu}function ku(e,t,n){(e===Yl&&(Ql===2||Ql===9)||e.cancelPendingCommit!==null)&&(Iu(e,0),Nu(e,Zl,cu,!1)),rt(e,n),(!(Jl&2)||e!==Yl)&&(e===Yl&&(!(Jl&2)&&(ou|=n),iu===4&&Nu(e,Zl,cu,!1)),vd(e))}function Au(e,t,n){if(Jl&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||$e(e,t),a=r?Wu(e,t):Hu(e,t,!0),o=r;do{if(a===0){tu&&!r&&Nu(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!Mu(n)){a=Hu(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=uu;var l=c.current.memoizedState.isDehydrated;if(l&&(Iu(c,s).flags|=256),s=Hu(c,s,!1),s!==2){if(nu&&!l){c.errorRecoveryDisabledLanes|=o,ou|=o,a=4;break a}o=du,du=a,o!==null&&(du===null?du=o:du.push.apply(du,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Iu(e,0),Nu(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:Nu(r,t,cu,!eu);break a;case 2:du=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=pu+300-Me(),10<a)){if(Nu(r,t,cu,!eu),Qe(r,0,!0)!==0)break a;xu=t,r.timeoutHandle=uf(ju.bind(null,r,n,du,gu,fu,t,cu,ou,lu,eu,o,`Throttled`,-0,0),a);break a}ju(r,n,du,gu,fu,t,cu,ou,lu,eu,o,null,-0,0)}}break}while(1);vd(e)}function ju(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:sn},Bl(t,a,d);var m=(a&62914560)===a?pu-Me():(a&4194048)===a?mu-Me():0;if(m=up(d,m),m!==null){xu=a,e.cancelPendingCommit=m(Zu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),Nu(e,a,o,!l);return}}Zu(e,t,a,n,r,i,o,s,c)}function Mu(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(!Tr(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 Nu(e,t,n,r){t&=~su,t&=~ou,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-We(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&at(e,n,t)}function Pu(){return Jl&6?!0:(yd(0,!1),!1)}function Fu(){if(Xl!==null){if(Ql===0)var e=Xl.return;else e=Xl,Zi=Xi=null,Io(e),Ia=null,La=0,e=Xl;for(;e!==null;)Jc(e.alternate,e),e=e.return;Xl=null}}function Iu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,df(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),xu=0,Fu(),Yl=e,Xl=n=pi(e.current,null),Zl=t,Ql=0,$l=null,eu=!1,tu=$e(e,t),nu=!1,lu=cu=su=ou=au=iu=0,du=uu=null,fu=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-We(r),a=1<<i;t|=e[i],r&=~a}return ru=t,ri(),n}function Lu(e,t){vo=null,j.H=Ks,t===Ea||t===Oa?(t=Pa(),Ql=3):t===Da?(t=Pa(),Ql=4):Ql=t===lc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,$l=t,Xl===null&&(iu=1,rc(e,xi(t,e.current)))}function Ru(){var e=so.current;return e===null?!0:(Zl&4194048)===Zl?co===null:(Zl&62914560)===Zl||Zl&536870912?e===co:!1}function zu(){var e=j.H;return j.H=Ks,e===null?Ks:e}function Bu(){var e=j.A;return j.A=Kl,e}function Vu(){iu=4,eu||(Zl&4194048)!==Zl&&so.current!==null||(tu=!0),!(au&134217727)&&!(ou&134217727)||Yl===null||Nu(Yl,Zl,cu,!1)}function Hu(e,t,n){var r=Jl;Jl|=2;var i=zu(),a=Bu();(Yl!==e||Zl!==t)&&(gu=null,Iu(e,t)),t=!1;var o=iu;a:do try{if(Ql!==0&&Xl!==null){var s=Xl,c=$l;switch(Ql){case 8:Fu(),o=6;break a;case 3:case 2:case 9:case 6:so.current===null&&(t=!0);var l=Ql;if(Ql=0,$l=null,Ju(e,s,c,l),n&&tu){o=0;break a}break;default:l=Ql,Ql=0,$l=null,Ju(e,s,c,l)}}Uu(),o=iu;break}catch(t){Lu(e,t)}while(1);return t&&e.shellSuspendCounter++,Zi=Xi=null,Jl=r,j.H=i,j.A=a,Xl===null&&(Yl=null,Zl=0,ri()),o}function Uu(){for(;Xl!==null;)Ku(Xl)}function Wu(e,t){var n=Jl;Jl|=2;var r=zu(),a=Bu();Yl!==e||Zl!==t?(gu=null,hu=Me()+500,Iu(e,t)):tu=$e(e,t);a:do try{if(Ql!==0&&Xl!==null){t=Xl;var o=$l;b:switch(Ql){case 1:Ql=0,$l=null,Ju(e,t,o,1);break;case 2:case 9:if(Aa(o)){Ql=0,$l=null,qu(t);break}t=function(){Ql!==2&&Ql!==9||Yl!==e||(Ql=7),vd(e)},o.then(t,t);break a;case 3:Ql=7;break a;case 4:Ql=5;break a;case 7:Aa(o)?(Ql=0,$l=null,qu(t)):(Ql=0,$l=null,Ju(e,t,o,7));break;case 5:var s=null;switch(Xl.tag){case 26:s=Xl.memoizedState;case 5:case 27:var c=Xl;if(s?sp(s):c.stateNode.complete){Ql=0,$l=null;var l=c.sibling;if(l!==null)Xl=l;else{var u=c.return;u===null?Xl=null:(Xl=u,Yu(u))}break b}}Ql=0,$l=null,Ju(e,t,o,5);break;case 6:Ql=0,$l=null,Ju(e,t,o,6);break;case 8:Fu(),iu=6;break a;default:throw Error(i(462))}}Gu();break}catch(t){Lu(e,t)}while(1);return Zi=Xi=null,j.H=r,j.A=a,Jl=n,Xl===null?(Yl=null,Zl=0,ri(),iu):0}function Gu(){for(;Xl!==null&&!Ae();)Ku(Xl)}function Ku(e){var t=zc(e.alternate,e,ru);e.memoizedProps=e.pendingProps,t===null?Yu(e):Xl=t}function qu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Cc(n,t,t.pendingProps,t.type,void 0,Zl);break;case 11:t=Cc(n,t,t.pendingProps,t.type.render,t.ref,Zl);break;case 5:Io(t);default:Jc(n,t),t=Xl=mi(t,ru),t=zc(n,t,ru)}e.memoizedProps=e.pendingProps,t===null?Yu(e):Xl=t}function Ju(e,t,n,r){Zi=Xi=null,Io(t),Ia=null,La=0;var i=t.return;try{if(cc(e,i,t,n,Zl)){iu=1,rc(e,xi(n,e.current)),Xl=null;return}}catch(t){if(i!==null)throw Xl=i,t;iu=1,rc(e,xi(n,e.current)),Xl=null;return}t.flags&32768?(Ri||r===1?e=!0:tu||Zl&536870912?e=!1:(eu=e=!0,(r===2||r===9||r===3||r===6)&&(r=so.current,r!==null&&r.tag===13&&(r.flags|=16384))),Xu(t,e)):Yu(t)}function Yu(e){var t=e;do{if(t.flags&32768){Xu(t,eu);return}e=t.return;var n=Kc(t.alternate,t,ru);if(n!==null){Xl=n;return}if(t=t.sibling,t!==null){Xl=t;return}Xl=t=e}while(t!==null);iu===0&&(iu=5)}function Xu(e,t){do{var n=qc(e.alternate,e);if(n!==null){n.flags&=32767,Xl=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Xl=e;return}Xl=e=n}while(e!==null);iu=6,Xl=null}function Zu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do nd();while(vu!==0);if(Jl&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=ni,it(e,n,o,s,c,l),e===Yl&&(Xl=Yl=null,Zl=0),bu=t,yu=e,xu=n,Su=o,Cu=a,wu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,dd(Ie,function(){return rd(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=j.T,j.T=null,a=ae.p,ae.p=2,s=Jl,Jl|=4;try{pl(e,t,n)}finally{Jl=s,ae.p=a,j.T=r}}vu=1,Qu(),$u(),ed()}}function Qu(){if(vu===1){vu=0;var e=yu,t=bu,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=j.T,j.T=null;var r=ae.p;ae.p=2;var i=Jl;Jl|=4;try{El(t,e);var a=nf,o=Ar(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&kr(s.ownerDocument.documentElement,s)){if(c!==null&&jr(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 _=Or(s,h),v=Or(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}}wp=!!tf,nf=tf=null}finally{Jl=i,ae.p=r,j.T=n}}e.current=t,vu=2}}function $u(){if(vu===2){vu=0;var e=yu,t=bu,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=j.T,j.T=null;var r=ae.p;ae.p=2;var i=Jl;Jl|=4;try{ml(e,t.alternate,t)}finally{Jl=i,ae.p=r,j.T=n}}vu=3}}function ed(){if(vu===4||vu===3){vu=0,je();var e=yu,t=bu,n=xu,r=wu;t.subtreeFlags&10256||t.flags&10256?vu=5:(vu=0,bu=yu=null,td(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(_u=null),lt(n),t=t.stateNode,He&&typeof He.onCommitFiberRoot==`function`)try{He.onCommitFiberRoot(Ve,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=j.T,i=ae.p,ae.p=2,j.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{j.T=t,ae.p=i}}xu&3&&nd(),vd(e),i=e.pendingLanes,n&261930&&i&42?e===Eu?Tu++:(Tu=0,Eu=e):Tu=0,yd(0,!1)}}function td(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,pa(t)))}function nd(){return Qu(),$u(),ed(),rd()}function rd(){if(vu!==5)return!1;var e=yu,t=Su;Su=0;var n=lt(xu),r=j.T,a=ae.p;try{ae.p=32>n?32:n,j.T=null,n=Cu,Cu=null;var o=yu,s=xu;if(vu=0,bu=yu=null,xu=0,Jl&6)throw Error(i(331));var c=Jl;if(Jl|=4,Ul(o.current),Fl(o,o.current,s,n),Jl=c,yd(0,!1),He&&typeof He.onPostCommitFiberRoot==`function`)try{He.onPostCommitFiberRoot(Ve,o)}catch{}return!0}finally{ae.p=a,j.T=r,td(e,t)}}function id(e,t,n){t=xi(n,t),t=ac(e.stateNode,t,2),e=Ja(e,t,2),e!==null&&(rt(e,2),vd(e))}function ad(e,t,n){if(e.tag===3)id(e,e,n);else for(;t!==null;){if(t.tag===3){id(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(_u===null||!_u.has(r))){e=xi(n,e),n=oc(2),r=Ja(t,n,2),r!==null&&(sc(n,r,t,e),rt(r,2),vd(r));break}}t=t.return}}function od(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new ql;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)||(nu=!0,i.add(n),e=sd.bind(null,e,t,n),t.then(e,e))}function sd(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Yl===e&&(Zl&n)===n&&(iu===4||iu===3&&(Zl&62914560)===Zl&&300>Me()-pu?!(Jl&2)&&Iu(e,0):su|=n,lu===Zl&&(lu=0)),vd(e)}function cd(e,t){t===0&&(t=tt()),e=oi(e,t),e!==null&&(rt(e,t),vd(e))}function ld(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),cd(e,n)}function ud(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),cd(e,n)}function dd(e,t){return Oe(e,t)}var fd=null,pd=null,md=!1,hd=!1,gd=!1,_d=0;function vd(e){e!==pd&&e.next===null&&(pd===null?fd=pd=e:pd=pd.next=e),hd=!0,md||(md=!0,Td())}function yd(e,t){if(!gd&&hd){gd=!0;do for(var n=!1,r=fd;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-We(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,wd(r,a))}else a=Zl,a=Qe(r,r===Yl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||$e(r,a)||(n=!0,wd(r,a));r=r.next}while(n);gd=!1}}function bd(){xd()}function xd(){hd=md=!1;var e=0;_d!==0&&lf()&&(e=_d);for(var t=Me(),n=null,r=fd;r!==null;){var i=r.next,a=Sd(r,t);a===0?(r.next=null,n===null?fd=i:n.next=i,i===null&&(pd=n)):(n=r,(e!==0||a&3)&&(hd=!0)),r=i}vu!==0&&vu!==5||yd(e,!1),_d!==0&&(_d=0)}function Sd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-We(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=et(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Yl,n=Zl,n=Qe(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Ql===2||Ql===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&ke(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||$e(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&ke(r),lt(n)){case 2:case 8:n=Fe;break;case 32:n=Ie;break;case 268435456:n=Re;break;default:n=Ie}return r=Cd.bind(null,e),n=Oe(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&ke(r),e.callbackPriority=2,e.callbackNode=null,2}function Cd(e,t){if(vu!==0&&vu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(nd()&&e.callbackNode!==n)return null;var r=Zl;return r=Qe(e,e===Yl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Au(e,r,t),Sd(e,Me()),e.callbackNode!=null&&e.callbackNode===n?Cd.bind(null,e):null)}function wd(e,t){if(nd())return null;Au(e,t,!0)}function Td(){pf(function(){Jl&6?Oe(Pe,bd):xd()})}function Ed(){if(_d===0){var e=ga;e===0&&(e=Je,Je<<=1,!(Je&261888)&&(Je=256)),_d=e}return _d}function Dd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:on(``+e)}function Od(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 kd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Dd((i[mt]||null).action),o=r.submitter;o&&(t=(t=o[mt]||null)?Dd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new On(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(_d!==0){var e=o?Od(i,o):new FormData(i);Ms(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?Od(i,o):new FormData(i),Ms(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Ad=0;Ad<Zr.length;Ad++){var jd=Zr[Ad];Qr(jd.toLowerCase(),`on`+(jd[0].toUpperCase()+jd.slice(1)))}Qr(Ur,`onAnimationEnd`),Qr(Wr,`onAnimationIteration`),Qr(Gr,`onAnimationStart`),Qr(`dblclick`,`onDoubleClick`),Qr(`focusin`,`onFocus`),Qr(`focusout`,`onBlur`),Qr(Kr,`onTransitionRun`),Qr(qr,`onTransitionStart`),Qr(Jr,`onTransitionCancel`),Qr(Yr,`onTransitionEnd`),At(`onMouseEnter`,[`mouseout`,`mouseover`]),At(`onMouseLeave`,[`mouseout`,`mouseover`]),At(`onPointerEnter`,[`pointerout`,`pointerover`]),At(`onPointerLeave`,[`pointerout`,`pointerover`]),kt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),kt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),kt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),kt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),kt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),kt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Md=`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(` `),Nd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Md));function Pd(e,t){t=(t&4)!=0;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){$r(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){$r(e)}i.currentTarget=null,a=c}}}}function Fd(e,t){var n=t[gt];n===void 0&&(n=t[gt]=new Set);var r=e+`__bubble`;n.has(r)||(zd(t,e,2,!1),n.add(r))}function Id(e,t,n){var r=0;t&&(r|=4),zd(n,e,r,t)}var Ld=`_reactListening`+Math.random().toString(36).slice(2);function Rd(e){if(!e[Ld]){e[Ld]=!0,Dt.forEach(function(t){t!==`selectionchange`&&(Nd.has(t)||Id(t,!1,e),Id(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ld]||(t[Ld]=!0,Id(`selectionchange`,!1,t))}}function zd(e,t,n,r){switch(jp(t)){case 2:var i=Tp;break;case 8:i=Ep;break;default:i=Dp}n=i.bind(null,t,n,e),i=void 0,!_n||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 Bd(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=St(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}mn(function(){var r=a,i=ln(n),s=[];a:{var c=Xr.get(e);if(c!==void 0){var l=On,u=e;switch(e){case`keypress`:if(Cn(n)===0)break a;case`keydown`:case`keyup`:l=Gn;break;case`focusin`:u=`focus`,l=Ln;break;case`focusout`:u=`blur`,l=Ln;break;case`beforeblur`:case`afterblur`:l=Ln;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=Fn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=In;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=qn;break;case Ur:case Wr:case Gr:l=Rn;break;case Yr:l=Jn;break;case`scroll`:case`scrollend`:l=An;break;case`wheel`:l=Yn;break;case`copy`:case`cut`:case`paste`:l=zn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Kn;break;case`toggle`:case`beforetoggle`:l=Xn}var d=(t&4)!=0,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=hn(m,p),g!=null&&d.push(Vd(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!==cn&&(u=n.relatedTarget||n.fromElement)&&(St(u)||u[ht]))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?St(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=Fn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Kn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:wt(l),h=u==null?c:wt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,St(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=Ud,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&&Wd(s,c,l,d,!1),u!==null&&f!==null&&Wd(s,f,u,d,!0)}}a:{if(c=r?wt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=mr;else if(cr(c))if(hr)v=Cr;else{v=xr;var y=br}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&nn(r.elementType)&&(v=mr):v=Sr;if(v&&=v(e,r)){lr(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Jt(c,`number`,c.value)}switch(y=r?wt(r):window,e){case`focusin`:(cr(y)||y.contentEditable===`true`)&&(Nr=y,Pr=r,Fr=null);break;case`focusout`:Fr=Pr=Nr=null;break;case`mousedown`:Ir=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Ir=!1,Lr(s,n,i);break;case`selectionchange`:if(Mr)break;case`keydown`:case`keyup`:Lr(s,n,i)}var b;if(Qn)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 ir?nr(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(P&&n.locale!==`ko`&&(ir||x!==`onCompositionStart`?x===`onCompositionEnd`&&ir&&(b=Sn()):(yn=i,bn=`value`in yn?yn.value:yn.textContent,ir=!0)),y=Hd(r,x),0<y.length&&(x=new Bn(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=rr(n),b!==null&&(x.data=b)))),(b=N?ar(e,n):or(e,n))&&(x=Hd(r,`onBeforeInput`),0<x.length&&(y=new Bn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),kd(s,e,r,n,i)}Pd(s,t)})}function Vd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Hd(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=hn(e,n),i!=null&&r.unshift(Vd(e,i,a)),i=hn(e,t),i!=null&&r.push(Vd(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Ud(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Wd(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=hn(n,a),l!=null&&o.unshift(Vd(n,l,c))):i||(l=hn(n,a),l!=null&&o.push(Vd(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Gd=/\r\n?/g,Kd=/\u0000|\uFFFD/g;function qd(e){return(typeof e==`string`?e:``+e).replace(Gd,`
|
|
9
|
+
`).replace(Kd,``)}function Jd(e,t){return t=qd(t),qd(e)===t}function Yd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Qt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Qt(e,``+r);break;case`className`:It(e,`class`,r);break;case`tabIndex`:It(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:It(e,n,r);break;case`style`:tn(e,r,o);break;case`data`:if(t!==`object`){It(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=on(``+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}else typeof o==`function`&&(n===`formAction`?(t!==`input`&&Yd(e,t,`name`,a.name,a,null),Yd(e,t,`formEncType`,a.formEncType,a,null),Yd(e,t,`formMethod`,a.formMethod,a,null),Yd(e,t,`formTarget`,a.formTarget,a,null)):(Yd(e,t,`encType`,a.encType,a,null),Yd(e,t,`method`,a.method,a,null),Yd(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=on(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=sn);break;case`onScroll`:r!=null&&Fd(`scroll`,e);break;case`onScrollEnd`:r!=null&&Fd(`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=on(``+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`:Fd(`beforetoggle`,e),Fd(`toggle`,e),Ft(e,`popover`,r);break;case`xlinkActuate`:Lt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Lt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Lt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Lt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Lt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Lt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Lt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Lt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Lt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Ft(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=rn.get(n)||n,Ft(e,n,r))}}function Xd(e,t,n,r,a,o){switch(n){case`style`:tn(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`?Qt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Qt(e,``+r);break;case`onScroll`:r!=null&&Fd(`scroll`,e);break;case`onScrollEnd`:r!=null&&Fd(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=sn);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!Ot.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[mt]||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,``):Ft(e,n,r)}}}function Zd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Fd(`error`,e),Fd(`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:Yd(e,t,o,s,n,null)}}a&&Yd(e,t,`srcSet`,n.srcSet,n,null),r&&Yd(e,t,`src`,n.src,n,null);return;case`input`:Fd(`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:Yd(e,t,r,d,n,null)}}qt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Fd(`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:Yd(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Yt(e,!!r,n,!0):Yt(e,!!r,t,!1);return;case`textarea`:for(s in Fd(`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:Yd(e,t,s,c,n,null)}Zt(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:Yd(e,t,l,r,n,null)}return;case`dialog`:Fd(`beforetoggle`,e),Fd(`toggle`,e),Fd(`cancel`,e),Fd(`close`,e);break;case`iframe`:case`object`:Fd(`load`,e);break;case`video`:case`audio`:for(r=0;r<Md.length;r++)Fd(Md[r],e);break;case`image`:Fd(`error`,e),Fd(`load`,e);break;case`details`:Fd(`toggle`,e);break;case`embed`:case`source`:case`link`:Fd(`error`,e),Fd(`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:Yd(e,t,u,r,n,null)}return;default:if(nn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Xd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Yd(e,t,c,r,n,null))}function Qd(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)||Yd(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&&Yd(e,t,p,m,r,f)}}Kt(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)||Yd(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&&Yd(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Yt(e,!!n,n?[]:``,!1):Yt(e,!!n,t,!0)):Yt(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:Yd(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&&Yd(e,t,s,a,r,o)}Xt(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:Yd(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:Yd(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)&&Yd(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:Yd(e,t,u,p,r,m)}return;default:if(nn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Xd(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||Xd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Yd(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||Yd(e,t,f,p,r,m)}function $d(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function ef(){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&&$d(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&&$d(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 tf=null,nf=null;function rf(e){return e.nodeType===9?e:e.ownerDocument}function af(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 of(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 sf(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 cf=null;function lf(){var e=window.event;return e&&e.type===`popstate`?e===cf?!1:(cf=e,!0):(cf=null,!1)}var uf=typeof setTimeout==`function`?setTimeout:void 0,df=typeof clearTimeout==`function`?clearTimeout:void 0,ff=typeof Promise==`function`?Promise:void 0,pf=typeof queueMicrotask==`function`?queueMicrotask:ff===void 0?uf:function(e){return ff.resolve(null).then(e).catch(mf)};function mf(e){setTimeout(function(){throw e})}function hf(e){return e===`head`}function gf(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),Xp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Af(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Af(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[bt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Af(e.ownerDocument.body);n=i}while(n);Xp(t)}function _f(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 vf(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`:vf(n),xt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function yf(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[bt])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=Tf(e.nextSibling),e===null)break}return null}function bf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=Tf(e.nextSibling),e===null))return null;return e}function xf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=Tf(e.nextSibling),e===null))return null;return e}function Sf(e){return e.data===`$?`||e.data===`$~`}function Cf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function wf(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 Tf(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 Ef=null;function Df(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return Tf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function Of(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 kf(e,t,n){switch(t=rf(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 Af(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);xt(e)}var jf=new Map,Mf=new Set;function Nf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Pf=ae.d;ae.d={f:Ff,r:If,D:zf,C:Bf,L:Vf,m:Hf,X:Wf,S:Uf,M:Gf};function Ff(){var e=Pf.f(),t=Pu();return e||t}function If(e){var t=Ct(e);t!==null&&t.tag===5&&t.type===`form`?Ps(t):Pf.r(e)}var Lf=typeof document>`u`?null:document;function Rf(e,t,n){var r=Lf;if(r&&typeof t==`string`&&t){var i=Gt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Mf.has(i)||(Mf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Zd(t,`link`,e),Et(t),r.head.appendChild(t)))}}function zf(e){Pf.D(e),Rf(`dns-prefetch`,e,null)}function Bf(e,t){Pf.C(e,t),Rf(`preconnect`,e,t)}function Vf(e,t,n){Pf.L(e,t,n);var r=Lf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Gt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Gt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Gt(n.imageSizes)+`"]`)):i+=`[href="`+Gt(e)+`"]`;var a=i;switch(t){case`style`:a=qf(e);break;case`script`:a=Zf(e)}jf.has(a)||(e=p({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),jf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Jf(a))||t===`script`&&r.querySelector(Qf(a))||(t=r.createElement(`link`),Zd(t,`link`,e),Et(t),r.head.appendChild(t)))}}function Hf(e,t){Pf.m(e,t);var n=Lf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Gt(r)+`"][href="`+Gt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Zf(e)}if(!jf.has(a)&&(e=p({rel:`modulepreload`,href:e},t),jf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Qf(a)))return}r=n.createElement(`link`),Zd(r,`link`,e),Et(r),n.head.appendChild(r)}}}function Uf(e,t,n){Pf.S(e,t,n);var r=Lf;if(r&&e){var i=Tt(r).hoistableStyles,a=qf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Jf(a)))s.loading=5;else{e=p({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=jf.get(a))&&tp(e,n);var c=o=r.createElement(`link`);Et(c),Zd(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,ep(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Wf(e,t){Pf.X(e,t);var n=Lf;if(n&&e){var r=Tt(n).hoistableScripts,i=Zf(e),a=r.get(i);a||(a=n.querySelector(Qf(i)),a||(e=p({src:e,async:!0},t),(t=jf.get(i))&&np(e,t),a=n.createElement(`script`),Et(a),Zd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Gf(e,t){Pf.M(e,t);var n=Lf;if(n&&e){var r=Tt(n).hoistableScripts,i=Zf(e),a=r.get(i);a||(a=n.querySelector(Qf(i)),a||(e=p({src:e,async:!0,type:`module`},t),(t=jf.get(i))&&np(e,t),a=n.createElement(`script`),Et(a),Zd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Kf(e,t,n,r){var a=(a=me.current)?Nf(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=qf(n.href),n=Tt(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=qf(n.href);var o=Tt(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(Jf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),jf.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},jf.set(e,n),o||Xf(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=Zf(n),n=Tt(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 qf(e){return`href="`+Gt(e)+`"`}function Jf(e){return`link[rel="stylesheet"][`+e+`]`}function Yf(e){return p({},e,{"data-precedence":e.precedence,precedence:null})}function Xf(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}),Zd(t,`link`,n),Et(t),e.head.appendChild(t))}function Zf(e){return`[src="`+Gt(e)+`"]`}function Qf(e){return`script[async]`+e}function $f(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Gt(n.href)+`"]`);if(r)return t.instance=r,Et(r),r;var a=p({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Et(r),Zd(r,`style`,a),ep(r,n.precedence,e),t.instance=r;case`stylesheet`:a=qf(n.href);var o=e.querySelector(Jf(a));if(o)return t.state.loading|=4,t.instance=o,Et(o),o;r=Yf(n),(a=jf.get(a))&&tp(r,a),o=(e.ownerDocument||e).createElement(`link`),Et(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Zd(o,`link`,r),t.state.loading|=4,ep(o,n.precedence,e),t.instance=o;case`script`:return o=Zf(n.src),(a=e.querySelector(Qf(o)))?(t.instance=a,Et(a),a):(r=n,(a=jf.get(o))&&(r=p({},n),np(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Et(a),Zd(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,ep(r,n.precedence,e));return t.instance}function ep(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 tp(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function np(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var rp=null;function ip(e,t,n){if(rp===null){var r=new Map,i=rp=new Map;i.set(n,r)}else i=rp,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[bt]||a[pt]||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 ap(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function op(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 sp(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function cp(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=qf(r.href),a=t.querySelector(Jf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=dp.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Et(a);return}a=t.ownerDocument||t,r=Yf(r),(i=jf.get(i))&&tp(r,i),a=a.createElement(`link`),Et(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Zd(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=dp.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var lp=0;function up(e,t){return e.stylesheets&&e.count===0&&pp(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&pp(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&lp===0&&(lp=62500*ef());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&pp(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>lp?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function dp(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)pp(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var fp=null;function pp(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,fp=new Map,t.forEach(mp,e),fp=null,dp.call(e))}function mp(e,t){if(!(t.state.loading&4)){var n=fp.get(e);if(n)var r=n.get(null);else{n=new Map,fp.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=dp.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 hp={$$typeof:C,Provider:null,Consumer:null,_currentValue:oe,_currentValue2:oe,_threadCount:0};function gp(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=nt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=nt(0),this.hiddenUpdates=nt(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 _p(e,t,n,r,i,a,o,s,c,l,u,d){return e=new gp(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=di(3,null,null,t),e.current=a,a.stateNode=e,t=fa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Ga(a),e}function vp(e){return e?(e=li,e):li}function yp(e,t,n,r,i,a){i=vp(i),r.context===null?r.context=i:r.pendingContext=i,r=qa(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ja(e,r,t),n!==null&&(ku(n,e,t),Ya(n,e,t))}function bp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function xp(e,t){bp(e,t),(e=e.alternate)&&bp(e,t)}function Sp(e){if(e.tag===13||e.tag===31){var t=oi(e,67108864);t!==null&&ku(t,e,67108864),xp(e,67108864)}}function Cp(e){if(e.tag===13||e.tag===31){var t=Du();t=ct(t);var n=oi(e,t);n!==null&&ku(n,e,t),xp(e,t)}}var wp=!0;function Tp(e,t,n,r){var i=j.T;j.T=null;var a=ae.p;try{ae.p=2,Dp(e,t,n,r)}finally{ae.p=a,j.T=i}}function Ep(e,t,n,r){var i=j.T;j.T=null;var a=ae.p;try{ae.p=8,Dp(e,t,n,r)}finally{ae.p=a,j.T=i}}function Dp(e,t,n,r){if(wp){var i=Op(r);if(i===null)Bd(e,t,r,kp,n),Bp(e,r);else if(Hp(i,e,t,n,r))r.stopPropagation();else if(Bp(e,r),t&4&&-1<zp.indexOf(e)){for(;i!==null;){var a=Ct(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Ze(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-We(o);s.entanglements[1]|=c,o&=~c}vd(a),!(Jl&6)&&(hu=Me()+500,yd(0,!1))}}break;case 31:case 13:s=oi(a,2),s!==null&&ku(s,a,2),Pu(),xp(a,2)}if(a=Op(r),a===null&&Bd(e,t,r,kp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Bd(e,t,r,null,n)}}function Op(e){return e=ln(e),Ap(e)}var kp=null;function Ap(e){if(kp=null,e=St(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 kp=e,null}function jp(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(Ne()){case Pe:return 2;case Fe:return 8;case Ie:case Le:return 32;case Re:return 268435456;default:return 32}default:return 32}}var Mp=!1,Np=null,Pp=null,Fp=null,Ip=new Map,Lp=new Map,Rp=[],zp=`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 Bp(e,t){switch(e){case`focusin`:case`focusout`:Np=null;break;case`dragenter`:case`dragleave`:Pp=null;break;case`mouseover`:case`mouseout`:Fp=null;break;case`pointerover`:case`pointerout`:Ip.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Lp.delete(t.pointerId)}}function Vp(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=Ct(t),t!==null&&Sp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Hp(e,t,n,r,i){switch(t){case`focusin`:return Np=Vp(Np,e,t,n,r,i),!0;case`dragenter`:return Pp=Vp(Pp,e,t,n,r,i),!0;case`mouseover`:return Fp=Vp(Fp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Ip.set(a,Vp(Ip.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Lp.set(a,Vp(Lp.get(a)||null,e,t,n,r,i)),!0}return!1}function Up(e){var t=St(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,dt(e.priority,function(){Cp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,dt(e.priority,function(){Cp(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 Wp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Op(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);cn=r,n.target.dispatchEvent(r),cn=null}else return t=Ct(n),t!==null&&Sp(t),e.blockedOn=n,!1;t.shift()}return!0}function Gp(e,t,n){Wp(e)&&n.delete(t)}function Kp(){Mp=!1,Np!==null&&Wp(Np)&&(Np=null),Pp!==null&&Wp(Pp)&&(Pp=null),Fp!==null&&Wp(Fp)&&(Fp=null),Ip.forEach(Gp),Lp.forEach(Gp)}function qp(e,n){e.blockedOn===n&&(e.blockedOn=null,Mp||(Mp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Kp)))}var Jp=null;function Yp(e){Jp!==e&&(Jp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Jp===e&&(Jp=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(Ap(r||n)===null)continue;break}var a=Ct(n);a!==null&&(e.splice(t,3),t-=3,Ms(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Xp(e){function t(t){return qp(t,e)}Np!==null&&qp(Np,e),Pp!==null&&qp(Pp,e),Fp!==null&&qp(Fp,e),Ip.forEach(t),Lp.forEach(t);for(var n=0;n<Rp.length;n++){var r=Rp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Rp.length&&(n=Rp[0],n.blockedOn===null);)Up(n),n.blockedOn===null&&Rp.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[mt]||null;if(typeof a==`function`)o||Yp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[mt]||null)s=o.formAction;else if(Ap(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Yp(n)}}}function Zp(){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 Qp(e){this._internalRoot=e}$p.prototype.render=Qp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;yp(n,Du(),e,t,null,null)},$p.prototype.unmount=Qp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;yp(e.current,2,null,e,null,null),Pu(),t[ht]=null}};function $p(e){this._internalRoot=e}$p.prototype.unstable_scheduleHydration=function(e){if(e){var t=ut();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Rp.length&&t!==0&&t<Rp[n].priority;n++);Rp.splice(n,0,e),n===0&&Up(e)}};var em=n.version;if(em!==`19.2.7`)throw Error(i(527,em,`19.2.7`));ae.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:d(e),e=e===null?null:e.stateNode,e};var tm={bundleType:0,version:`19.2.7`,rendererPackageName:`react-dom`,currentDispatcherRef:j,reconcilerVersion:`19.2.7`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var nm=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!nm.isDisabled&&nm.supportsFiber)try{Ve=nm.inject(tm),He=nm}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=ec,s=tc,c=nc;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=_p(e,1,!1,null,null,n,r,null,o,s,c,Zp),e[ht]=t.current,Rd(e),new Qp(t)}})),v=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=_()})),y=[],b=[],x=Uint8Array,S=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,C=0,w=S.length;C<w;++C)y[C]=S[C],b[S.charCodeAt(C)]=C;b[45]=62,b[95]=63;function T(e){var t=e.length;if(t%4>0)throw Error(`Invalid string. Length must be a multiple of 4`);var n=e.indexOf(`=`);n===-1&&(n=t);var r=n===t?0:4-n%4;return[n,r]}function E(e,t,n){return(t+n)*3/4-n}function D(e){var t,n=T(e),r=n[0],i=n[1],a=new x(E(e,r,i)),o=0,s=i>0?r-4:r,c;for(c=0;c<s;c+=4)t=b[e.charCodeAt(c)]<<18|b[e.charCodeAt(c+1)]<<12|b[e.charCodeAt(c+2)]<<6|b[e.charCodeAt(c+3)],a[o++]=t>>16&255,a[o++]=t>>8&255,a[o++]=t&255;return i===2&&(t=b[e.charCodeAt(c)]<<2|b[e.charCodeAt(c+1)]>>4,a[o++]=t&255),i===1&&(t=b[e.charCodeAt(c)]<<10|b[e.charCodeAt(c+1)]<<4|b[e.charCodeAt(c+2)]>>2,a[o++]=t>>8&255,a[o++]=t&255),a}function O(e){return y[e>>18&63]+y[e>>12&63]+y[e>>6&63]+y[e&63]}function ee(e,t,n){for(var r,i=[],a=t;a<n;a+=3)r=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(e[a+2]&255),i.push(O(r));return i.join(``)}function te(e){for(var t,n=e.length,r=n%3,i=[],a=16383,o=0,s=n-r;o<s;o+=a)i.push(ee(e,o,o+a>s?s:o+a));return r===1?(t=e[n-1],i.push(y[t>>2]+y[t<<4&63]+`==`)):r===2&&(t=(e[n-2]<<8)+e[n-1],i.push(y[t>>10]+y[t>>4&63]+y[t<<2&63]+`=`)),i.join(``)}function k(e){if(e===void 0)return{};if(!ne(e))throw Error(`The arguments to a Convex function must be an object. Received: ${e}`);return e}function A(e){if(e===void 0)throw Error(`Client created with undefined deployment address. If you used an environment variable, check that it's set.`);if(typeof e!=`string`)throw Error(`Invalid deployment address: found ${e}".`);if(!(e.startsWith(`http:`)||e.startsWith(`https:`)))throw Error(`Invalid deployment address: Must start with "https://" or "http://". Found "${e}".`);try{new URL(e)}catch{throw Error(`Invalid deployment address: "${e}" is not a valid URL. If you believe this URL is correct, use the \`skipConvexDeploymentUrlCheck\` option to bypass this.`)}if(e.endsWith(`.convex.site`))throw Error(`Invalid deployment address: "${e}" ends with .convex.site, which is used for HTTP Actions. Convex deployment URLs typically end with .convex.cloud? If you believe this URL is correct, use the \`skipConvexDeploymentUrlCheck\` option to bypass this.`)}function ne(e){let t=typeof e==`object`,n=Object.getPrototypeOf(e),r=n===null||n===Object.prototype||n?.constructor?.name===`Object`;return t&&r}var re=!0,ie=BigInt(`-9223372036854775808`),j=BigInt(`9223372036854775807`),ae=BigInt(`0`),oe=BigInt(`8`),se=BigInt(`256`);function ce(e){return Number.isNaN(e)||!Number.isFinite(e)||Object.is(e,-0)}function le(e){e<ae&&(e-=ie+ie);let t=e.toString(16);t.length%2==1&&(t=`0`+t);let n=new Uint8Array(new ArrayBuffer(8)),r=0;for(let i of t.match(/.{2}/g).reverse())n.set([parseInt(i,16)],r++),e>>=oe;return te(n)}function ue(e){let t=D(e);if(t.byteLength!==8)throw Error(`Received ${t.byteLength} bytes, expected 8 for $integer`);let n=ae,r=ae;for(let e of t)n+=BigInt(e)*se**r,r++;return n>j&&(n+=ie+ie),n}function de(e){if(e<ie||j<e)throw Error(`BigInt ${e} does not fit into a 64-bit signed integer.`);let t=new ArrayBuffer(8);return new DataView(t).setBigInt64(0,e,!0),te(new Uint8Array(t))}function fe(e){let t=D(e);if(t.byteLength!==8)throw Error(`Received ${t.byteLength} bytes, expected 8 for $integer`);return new DataView(t.buffer).getBigInt64(0,!0)}var pe=DataView.prototype.setBigInt64?de:le,me=DataView.prototype.getBigInt64?fe:ue,he=1024;function ge(e){if(e.length>he)throw Error(`Field name ${e} exceeds maximum field name length ${he}.`);if(e.startsWith(`$`))throw Error(`Field name ${e} starts with a '$', which is reserved.`);for(let t=0;t<e.length;t+=1){let n=e.charCodeAt(t);if(n<32||n>=127)throw Error(`Field name ${e} has invalid character '${e[t]}': Field names can only contain non-control ASCII characters`)}}function _e(e){if(e===null||typeof e==`boolean`||typeof e==`number`||typeof e==`string`)return e;if(Array.isArray(e))return e.map(e=>_e(e));if(typeof e!=`object`)throw Error(`Unexpected type of ${e}`);let t=Object.entries(e);if(t.length===1){let n=t[0][0];if(n===`$bytes`){if(typeof e.$bytes!=`string`)throw Error(`Malformed $bytes field on ${e}`);return D(e.$bytes).buffer}if(n===`$integer`){if(typeof e.$integer!=`string`)throw Error(`Malformed $integer field on ${e}`);return me(e.$integer)}if(n===`$float`){if(typeof e.$float!=`string`)throw Error(`Malformed $float field on ${e}`);let t=D(e.$float);if(t.byteLength!==8)throw Error(`Received ${t.byteLength} bytes, expected 8 for $float`);let n=new DataView(t.buffer).getFloat64(0,re);if(!ce(n))throw Error(`Float ${n} should be encoded as a number`);return n}if(n===`$set`)throw Error(`Received a Set which is no longer supported as a Convex type.`);if(n===`$map`)throw Error(`Received a Map which is no longer supported as a Convex type.`)}let n={};for(let[t,r]of Object.entries(e))ge(t),n[t]=_e(r);return n}var ve=16384;function ye(e){let t=JSON.stringify(e,(e,t)=>t===void 0?`undefined`:typeof t==`bigint`?`${t.toString()}n`:t);if(t.length>ve){let e=ve-14,n=t.codePointAt(e-1);return n!==void 0&&n>65535&&--e,t.substring(0,e)+`[...truncated]`}return t}function be(e,t,n,r){if(e===void 0){let e=n&&` (present at path ${n} in original object ${ye(t)})`;throw Error(`undefined is not a valid Convex value${e}. To learn about Convex's supported types, see https://docs.convex.dev/using/types.`)}if(e===null)return e;if(typeof e==`bigint`){if(e<ie||j<e)throw Error(`BigInt ${e} does not fit into a 64-bit signed integer.`);return{$integer:pe(e)}}if(typeof e==`number`)if(ce(e)){let t=new ArrayBuffer(8);return new DataView(t).setFloat64(0,e,re),{$float:te(new Uint8Array(t))}}else return e;if(typeof e==`boolean`||typeof e==`string`)return e;if(e instanceof ArrayBuffer)return{$bytes:te(new Uint8Array(e))};if(Array.isArray(e))return e.map((e,r)=>be(e,t,n+`[${r}]`,!1));if(e instanceof Set)throw Error(xe(n,`Set`,[...e],t));if(e instanceof Map)throw Error(xe(n,`Map`,[...e],t));if(!ne(e)){let r=e?.constructor?.name,i=r?`${r} `:``;throw Error(xe(n,i,e,t))}let i={},a=Object.entries(e);a.sort(([e,t],[n,r])=>e===n?0:e<n?-1:1);for(let[e,o]of a)o===void 0?r&&(ge(e),i[e]=Se(o,t,n+`.${e}`)):(ge(e),i[e]=be(o,t,n+`.${e}`,!1));return i}function xe(e,t,n,r){return e?`${t}${ye(n)} is not a supported Convex type (present at path ${e} in original object ${ye(r)}). To learn about Convex's supported types, see https://docs.convex.dev/using/types.`:`${t}${ye(n)} is not a supported Convex type.`}function Se(e,t,n){if(e===void 0)return{$undefined:null};if(t===void 0)throw Error(`Programming error. Current value is ${ye(e)} but original value is undefined`);return be(e,t,n,!1)}function Ce(e){return be(e,e,``,!1)}var we=Object.defineProperty,Te=(e,t,n)=>t in e?we(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ee=(e,t,n)=>Te(e,typeof t==`symbol`?t:t+``,n),De=`https://docs.convex.dev/error#undefined-validator`;function Oe(e,t){let n=t===void 0?``:` for field "${t}"`;throw Error(`A validator is undefined${n} in ${e}. This is often caused by circular imports. See ${De} for details.`)}var ke=class{constructor({isOptional:e}){Ee(this,`type`),Ee(this,`fieldPaths`),Ee(this,`isOptional`),Ee(this,`isConvexValidator`),this.isOptional=e,this.isConvexValidator=!0}},Ae=class e extends ke{constructor({isOptional:e,tableName:t}){if(super({isOptional:e}),Ee(this,`tableName`),Ee(this,`kind`,`id`),typeof t!=`string`)throw Error(`v.id(tableName) requires a string`);this.tableName=t}get json(){return{type:`id`,tableName:this.tableName}}asOptional(){return new e({isOptional:`optional`,tableName:this.tableName})}},je=class e extends ke{constructor(){super(...arguments),Ee(this,`kind`,`float64`)}get json(){return{type:`number`}}asOptional(){return new e({isOptional:`optional`})}},Me=class e extends ke{constructor(){super(...arguments),Ee(this,`kind`,`int64`)}get json(){return{type:`bigint`}}asOptional(){return new e({isOptional:`optional`})}},Ne=class e extends ke{constructor(){super(...arguments),Ee(this,`kind`,`boolean`)}get json(){return{type:this.kind}}asOptional(){return new e({isOptional:`optional`})}},Pe=class e extends ke{constructor(){super(...arguments),Ee(this,`kind`,`bytes`)}get json(){return{type:this.kind}}asOptional(){return new e({isOptional:`optional`})}},Fe=class e extends ke{constructor(){super(...arguments),Ee(this,`kind`,`string`)}get json(){return{type:this.kind}}asOptional(){return new e({isOptional:`optional`})}},Ie=class e extends ke{constructor(){super(...arguments),Ee(this,`kind`,`null`)}get json(){return{type:this.kind}}asOptional(){return new e({isOptional:`optional`})}},Le=class e extends ke{constructor(){super(...arguments),Ee(this,`kind`,`any`)}get json(){return{type:this.kind}}asOptional(){return new e({isOptional:`optional`})}},Re=class e extends ke{constructor({isOptional:e,fields:t}){super({isOptional:e}),Ee(this,`fields`),Ee(this,`kind`,`object`),globalThis.Object.entries(t).forEach(([e,t])=>{if(t===void 0&&Oe(`v.object()`,e),!t.isConvexValidator)throw Error(`v.object() entries must be validators`)}),this.fields=t}get json(){return{type:this.kind,value:globalThis.Object.fromEntries(globalThis.Object.entries(this.fields).map(([e,t])=>[e,{fieldType:t.json,optional:t.isOptional===`optional`}]))}}asOptional(){return new e({isOptional:`optional`,fields:this.fields})}omit(...t){let n={...this.fields};for(let e of t)delete n[e];return new e({isOptional:this.isOptional,fields:n})}pick(...t){let n={};for(let e of t)n[e]=this.fields[e];return new e({isOptional:this.isOptional,fields:n})}partial(){let t={};for(let[e,n]of globalThis.Object.entries(this.fields))t[e]=n.asOptional();return new e({isOptional:this.isOptional,fields:t})}extend(t){return new e({isOptional:this.isOptional,fields:{...this.fields,...t}})}},ze=class e extends ke{constructor({isOptional:e,value:t}){if(super({isOptional:e}),Ee(this,`value`),Ee(this,`kind`,`literal`),typeof t!=`string`&&typeof t!=`boolean`&&typeof t!=`number`&&typeof t!=`bigint`)throw Error(`v.literal(value) must be a string, number, or boolean`);this.value=t}get json(){return{type:this.kind,value:Ce(this.value)}}asOptional(){return new e({isOptional:`optional`,value:this.value})}},Be=class e extends ke{constructor({isOptional:e,element:t}){super({isOptional:e}),Ee(this,`element`),Ee(this,`kind`,`array`),t===void 0&&Oe(`v.array()`),this.element=t}get json(){return{type:this.kind,value:this.element.json}}asOptional(){return new e({isOptional:`optional`,element:this.element})}},Ve=class e extends ke{constructor({isOptional:e,key:t,value:n}){if(super({isOptional:e}),Ee(this,`key`),Ee(this,`value`),Ee(this,`kind`,`record`),t===void 0&&Oe(`v.record()`,`key`),n===void 0&&Oe(`v.record()`,`value`),t.isOptional===`optional`)throw Error(`Record validator cannot have optional keys`);if(n.isOptional===`optional`)throw Error(`Record validator cannot have optional values`);if(!t.isConvexValidator||!n.isConvexValidator)throw Error(`Key and value of v.record() but be validators`);this.key=t,this.value=n}get json(){return{type:this.kind,keys:this.key.json,values:{fieldType:this.value.json,optional:!1}}}asOptional(){return new e({isOptional:`optional`,key:this.key,value:this.value})}},He=class e extends ke{constructor({isOptional:e,members:t}){super({isOptional:e}),Ee(this,`members`),Ee(this,`kind`,`union`),t.forEach((e,t)=>{if(e===void 0&&Oe(`v.union()`,`member at index ${t}`),!e.isConvexValidator)throw Error(`All members of v.union() must be validators`)}),this.members=t}get json(){return{type:this.kind,value:this.members.map(e=>e.json)}}asOptional(){return new e({isOptional:`optional`,members:this.members})}},Ue={id:e=>new Ae({isOptional:`required`,tableName:e}),null:()=>new Ie({isOptional:`required`}),number:()=>new je({isOptional:`required`}),float64:()=>new je({isOptional:`required`}),bigint:()=>new Me({isOptional:`required`}),int64:()=>new Me({isOptional:`required`}),boolean:()=>new Ne({isOptional:`required`}),string:()=>new Fe({isOptional:`required`}),bytes:()=>new Pe({isOptional:`required`}),literal:e=>new ze({isOptional:`required`,value:e}),array:e=>new Be({isOptional:`required`,element:e}),object:e=>new Re({isOptional:`required`,fields:e}),record:(e,t)=>new Ve({isOptional:`required`,key:e,value:t}),union:(...e)=>new He({isOptional:`required`,members:e}),any:()=>new Le({isOptional:`required`}),optional:e=>e.asOptional(),nullable:e=>Ue.union(e,Ue.null())},We=Object.defineProperty,Ge=(e,t,n)=>t in e?We(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ke=(e,t,n)=>Ge(e,typeof t==`symbol`?t:t+``,n),qe,Je,Ye=Symbol.for(`ConvexError`),Xe=class extends (Je=Error,qe=Ye,Je){constructor(e){super(typeof e==`string`?e:ye(e)),Ke(this,`name`,`ConvexError`),Ke(this,`data`),Ke(this,qe,!0),this.data=e}},Ze=`1.40.0`,Qe=Object.defineProperty,$e=(e,t,n)=>t in e?Qe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,et=(e,t,n)=>$e(e,typeof t==`symbol`?t:t+``,n),tt=`color:rgb(0, 145, 255)`;function nt(e){switch(e){case`query`:return`Q`;case`mutation`:return`M`;case`action`:return`A`;case`any`:return`?`}}var rt=class{constructor(e){et(this,`_onLogLineFuncs`),et(this,`_verbose`),this._onLogLineFuncs={},this._verbose=e.verbose}addLogLineListener(e){let t=Math.random().toString(36).substring(2,15);for(let e=0;e<10&&this._onLogLineFuncs[t]!==void 0;e++)t=Math.random().toString(36).substring(2,15);return this._onLogLineFuncs[t]=e,()=>{delete this._onLogLineFuncs[t]}}logVerbose(...e){if(this._verbose)for(let t of Object.values(this._onLogLineFuncs))t(`debug`,`${new Date().toISOString()}`,...e)}log(...e){for(let t of Object.values(this._onLogLineFuncs))t(`info`,...e)}warn(...e){for(let t of Object.values(this._onLogLineFuncs))t(`warn`,...e)}error(...e){for(let t of Object.values(this._onLogLineFuncs))t(`error`,...e)}};function it(e){let t=new rt(e);return t.addLogLineListener((e,...t)=>{switch(e){case`debug`:console.debug(...t);break;case`info`:console.log(...t);break;case`warn`:console.warn(...t);break;case`error`:console.error(...t);break;default:console.log(...t)}}),t}function at(e){return new rt(e)}function ot(e,t,n,r,i){let a=nt(n);if(typeof i==`object`&&(i=`ConvexError ${JSON.stringify(i.errorData,null,2)}`),t===`info`){let t=i.match(/^\[.*?\] /);if(t===null){e.error(`[CONVEX ${a}(${r})] Could not parse console.log`);return}let n=i.slice(1,t[0].length-2),o=i.slice(t[0].length);e.log(`%c[CONVEX ${a}(${r})] [${n}]`,tt,o)}else e.error(`[CONVEX ${a}(${r})] ${i}`)}function st(e,t){let n=`[CONVEX FATAL ERROR] ${t}`;return e.error(n),Error(n)}function ct(e,t,n){return`[CONVEX ${nt(e)}(${t})] ${n.errorMessage}
|
|
10
|
+
Called by client`}function lt(e,t){return t.data=e.errorData,t}function ut(e){let t=e.split(`:`),n,r;return t.length===1?(n=t[0],r=`default`):(n=t.slice(0,t.length-1).join(`:`),r=t[t.length-1]),n.endsWith(`.js`)&&(n=n.slice(0,-3)),`${n}:${r}`}function dt(e,t){return JSON.stringify({udfPath:ut(e),args:Ce(t)})}function ft(e,t,n){let{initialNumItems:r,id:i}=n;return JSON.stringify({type:`paginated`,udfPath:ut(e),args:Ce(t),options:Ce({initialNumItems:r,id:i})})}var pt=Object.defineProperty,mt=(e,t,n)=>t in e?pt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ht=(e,t,n)=>mt(e,typeof t==`symbol`?t:t+``,n),gt=class{constructor(){ht(this,`nextQueryId`),ht(this,`querySetVersion`),ht(this,`querySet`),ht(this,`queryIdToToken`),ht(this,`identityVersion`),ht(this,`auth`),ht(this,`outstandingQueriesOlderThanRestart`),ht(this,`outstandingAuthOlderThanRestart`),ht(this,`paused`),ht(this,`pendingQuerySetModifications`),this.nextQueryId=0,this.querySetVersion=0,this.identityVersion=0,this.querySet=new Map,this.queryIdToToken=new Map,this.outstandingQueriesOlderThanRestart=new Set,this.outstandingAuthOlderThanRestart=!1,this.paused=!1,this.pendingQuerySetModifications=new Map}hasSyncedPastLastReconnect(){return this.outstandingQueriesOlderThanRestart.size===0&&!this.outstandingAuthOlderThanRestart}markAuthCompletion(){this.outstandingAuthOlderThanRestart=!1}subscribe(e,t,n,r){let i=ut(e),a=dt(i,t),o=this.querySet.get(a);if(o!==void 0)return o.numSubscribers+=1,{queryToken:a,modification:null,unsubscribe:()=>this.removeSubscriber(a)};{let e=this.nextQueryId++,o={id:e,canonicalizedUdfPath:i,args:t,numSubscribers:1,journal:n,componentPath:r};this.querySet.set(a,o),this.queryIdToToken.set(e,a);let s=this.querySetVersion,c=this.querySetVersion+1,l={type:`Add`,queryId:e,udfPath:i,args:[Ce(t)],journal:n,componentPath:r};return this.paused?this.pendingQuerySetModifications.set(e,l):this.querySetVersion=c,{queryToken:a,modification:{type:`ModifyQuerySet`,baseVersion:s,newVersion:c,modifications:[l]},unsubscribe:()=>this.removeSubscriber(a)}}}transition(e){for(let t of e.modifications)switch(t.type){case`QueryUpdated`:case`QueryFailed`:{this.outstandingQueriesOlderThanRestart.delete(t.queryId);let e=t.journal;if(e!==void 0){let n=this.queryIdToToken.get(t.queryId);n!==void 0&&(this.querySet.get(n).journal=e)}break}case`QueryRemoved`:this.outstandingQueriesOlderThanRestart.delete(t.queryId);break;default:throw Error(`Invalid modification ${t.type}`)}}queryId(e,t){let n=dt(ut(e),t),r=this.querySet.get(n);return r===void 0?null:r.id}isCurrentOrNewerAuthVersion(e){return e>=this.identityVersion}getAuth(){return this.auth}setAuth(e){this.auth={tokenType:`User`,value:e};let t=this.identityVersion;return this.paused||(this.identityVersion=t+1),{type:`Authenticate`,baseVersion:t,...this.auth}}setAdminAuth(e,t){let n={tokenType:`Admin`,value:e,impersonating:t};this.auth=n;let r=this.identityVersion;return this.paused||(this.identityVersion=r+1),{type:`Authenticate`,baseVersion:r,...n}}clearAuth(){this.auth=void 0,this.markAuthCompletion();let e=this.identityVersion;return this.paused||(this.identityVersion=e+1),{type:`Authenticate`,tokenType:`None`,baseVersion:e}}hasAuth(){return!!this.auth}isNewAuth(e){return this.auth?.value!==e}queryPath(e){let t=this.queryIdToToken.get(e);return t?this.querySet.get(t).canonicalizedUdfPath:null}queryArgs(e){let t=this.queryIdToToken.get(e);return t?this.querySet.get(t).args:null}queryToken(e){return this.queryIdToToken.get(e)??null}queryJournal(e){return this.querySet.get(e)?.journal}restart(){this.unpause(),this.outstandingQueriesOlderThanRestart.clear();let e=[];for(let t of this.querySet.values()){let n={type:`Add`,queryId:t.id,udfPath:t.canonicalizedUdfPath,args:[Ce(t.args)],journal:t.journal,componentPath:t.componentPath};e.push(n),this.outstandingQueriesOlderThanRestart.add(t.id)}this.querySetVersion=1;let t={type:`ModifyQuerySet`,baseVersion:0,newVersion:1,modifications:e};if(!this.auth)return this.identityVersion=0,[t,void 0];this.outstandingAuthOlderThanRestart=!0;let n={type:`Authenticate`,baseVersion:0,...this.auth};return this.identityVersion=1,[t,n]}pause(){this.paused=!0}resume(){let e=this.pendingQuerySetModifications.size>0?{type:`ModifyQuerySet`,baseVersion:this.querySetVersion,newVersion:++this.querySetVersion,modifications:Array.from(this.pendingQuerySetModifications.values())}:void 0,t=this.auth===void 0?void 0:{type:`Authenticate`,baseVersion:this.identityVersion++,...this.auth};return this.unpause(),[e,t]}unpause(){this.paused=!1,this.pendingQuerySetModifications.clear()}removeSubscriber(e){let t=this.querySet.get(e);if(t.numSubscribers>1)return--t.numSubscribers,null;{this.querySet.delete(e),this.queryIdToToken.delete(t.id),this.outstandingQueriesOlderThanRestart.delete(t.id);let n=this.querySetVersion,r=this.querySetVersion+1,i={type:`Remove`,queryId:t.id};return this.paused?this.pendingQuerySetModifications.has(t.id)?this.pendingQuerySetModifications.delete(t.id):this.pendingQuerySetModifications.set(t.id,i):this.querySetVersion=r,{type:`ModifyQuerySet`,baseVersion:n,newVersion:r,modifications:[i]}}}},_t=Object.defineProperty,vt=(e,t,n)=>t in e?_t(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,yt=(e,t,n)=>vt(e,typeof t==`symbol`?t:t+``,n),bt=class{constructor(e,t){this.logger=e,this.markConnectionStateDirty=t,yt(this,`inflightRequests`),yt(this,`requestsOlderThanRestart`),yt(this,`inflightMutationsCount`,0),yt(this,`inflightActionsCount`,0),this.inflightRequests=new Map,this.requestsOlderThanRestart=new Set}request(e,t){let n=new Promise(n=>{let r=t?`Requested`:`NotSent`;this.inflightRequests.set(e.requestId,{message:e,status:{status:r,requestedAt:new Date,onResult:n}}),e.type===`Mutation`?this.inflightMutationsCount++:e.type===`Action`&&this.inflightActionsCount++});return this.markConnectionStateDirty(),n}onResponse(e){let t=this.inflightRequests.get(e.requestId);if(t===void 0||t.status.status===`Completed`)return null;let n=t.message.type===`Mutation`?`mutation`:`action`,r=t.message.udfPath;for(let t of e.logLines)ot(this.logger,`info`,n,r,t);let i=t.status,a,o;if(e.success)a={success:!0,logLines:e.logLines,value:_e(e.result)},o=()=>i.onResult(a);else{let t=e.result,{errorData:s}=e;ot(this.logger,`error`,n,r,t),a={success:!1,errorMessage:t,errorData:s===void 0?void 0:_e(s),logLines:e.logLines},o=()=>i.onResult(a)}return e.type===`ActionResponse`||!e.success?(o(),this.inflightRequests.delete(e.requestId),this.requestsOlderThanRestart.delete(e.requestId),t.message.type===`Action`?this.inflightActionsCount--:t.message.type===`Mutation`&&this.inflightMutationsCount--,this.markConnectionStateDirty(),{requestId:e.requestId,result:a}):(t.status={status:`Completed`,result:a,ts:e.ts,onResolve:o},null)}removeCompleted(e){let t=new Map;for(let[n,r]of this.inflightRequests.entries()){let i=r.status;i.status===`Completed`&&i.ts.lessThanOrEqual(e)&&(i.onResolve(),t.set(n,i.result),r.message.type===`Mutation`?this.inflightMutationsCount--:r.message.type===`Action`&&this.inflightActionsCount--,this.inflightRequests.delete(n),this.requestsOlderThanRestart.delete(n))}return t.size>0&&this.markConnectionStateDirty(),t}restart(){this.requestsOlderThanRestart=new Set(this.inflightRequests.keys());let e=[];for(let[t,n]of this.inflightRequests){if(n.status.status===`NotSent`){n.status.status=`Requested`,e.push(n.message);continue}if(n.message.type===`Mutation`)e.push(n.message);else if(n.message.type===`Action`){if(this.inflightRequests.delete(t),this.requestsOlderThanRestart.delete(t),this.inflightActionsCount--,n.status.status===`Completed`)throw Error(`Action should never be in 'Completed' state`);n.status.onResult({success:!1,errorMessage:`Connection lost while action was in flight`,logLines:[]})}}return this.markConnectionStateDirty(),e}resume(){let e=[];for(let[,t]of this.inflightRequests)if(t.status.status===`NotSent`){t.status.status=`Requested`,e.push(t.message);continue}return e}hasIncompleteRequests(){for(let e of this.inflightRequests.values())if(e.status.status===`Requested`)return!0;return!1}hasInflightRequests(){return this.inflightRequests.size>0}hasSyncedPastLastReconnect(){return this.requestsOlderThanRestart.size===0}timeOfOldestInflightRequest(){if(this.inflightRequests.size===0)return null;let e=Date.now();for(let t of this.inflightRequests.values())t.status.status!==`Completed`&&t.status.requestedAt.getTime()<e&&(e=t.status.requestedAt.getTime());return new Date(e)}inflightMutations(){return this.inflightMutationsCount}inflightActions(){return this.inflightActionsCount}},xt=Symbol.for(`functionName`),St=Symbol.for(`toReferencePath`);function Ct(e){return e[St]??null}function wt(e){return e.startsWith(`function://`)}function Tt(e){let t;if(typeof e==`string`)t=wt(e)?{functionHandle:e}:{name:e};else if(e[xt])t={name:e[xt]};else{let n=Ct(e);if(!n)throw Error(`${e} is not a functionReference`);t={reference:n}}return t}function Et(e){let t=Tt(e);if(t.name===void 0)throw t.functionHandle===void 0?t.reference===void 0?Error(`Expected function reference like "api.file.func" or "internal.file.func", but received ${JSON.stringify(t)}`):Error(`Expected function reference in the current component like "api.file.func" or "internal.file.func", but received reference ${t.reference}`):Error(`Expected function reference like "api.file.func" or "internal.file.func", but received function handle ${t.functionHandle}`);if(typeof e==`string`)return e;let n=e[xt];if(!n)throw Error(`${e} is not a functionReference`);return n}function Dt(e){return{[xt]:e}}function Ot(e=[]){return new Proxy({},{get(t,n){if(typeof n==`string`)return Ot([...e,n]);if(n===xt){if(e.length<2){let t=[`api`,...e].join(`.`);throw Error(`API path is expected to be of the form \`api.moduleName.functionName\`. Found: \`${t}\``)}let t=e.slice(0,-1).join(`/`),n=e[e.length-1];return n==="default"?t:t+`:`+n}else if(n===Symbol.toStringTag)return`FunctionReference`;else return}})}var kt=Ot(),At=Object.defineProperty,jt=(e,t,n)=>t in e?At(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Mt=(e,t,n)=>jt(e,typeof t==`symbol`?t:t+``,n),Nt=class e{constructor(e){Mt(this,`queryResults`),Mt(this,`modifiedQueries`),this.queryResults=e,this.modifiedQueries=[]}getQuery(t,...n){let r=k(n[0]),i=Et(t),a=this.queryResults.get(dt(i,r));if(a!==void 0)return e.queryValue(a.result)}getAllQueries(t){let n=[],r=Et(t);for(let t of this.queryResults.values())t.udfPath===ut(r)&&n.push({args:t.args,value:e.queryValue(t.result)});return n}setQuery(e,t,n){let r=k(t),i=Et(e),a=dt(i,r),o;o=n===void 0?void 0:{success:!0,value:n,logLines:[]};let s={udfPath:i,args:r,result:o};this.queryResults.set(a,s),this.modifiedQueries.push(a)}static queryValue(e){if(e!==void 0&&e.success)return e.value}},Pt=class{constructor(){Mt(this,`queryResults`),Mt(this,`optimisticUpdates`),this.queryResults=new Map,this.optimisticUpdates=[]}ingestQueryResultsFromServer(e,t){this.optimisticUpdates=this.optimisticUpdates.filter(e=>!t.has(e.mutationId));let n=this.queryResults;this.queryResults=new Map(e);let r=new Nt(this.queryResults);for(let e of this.optimisticUpdates)e.update(r);let i=[];for(let[e,t]of this.queryResults){let r=n.get(e);(r===void 0||r.result!==t.result)&&i.push(e)}return i}applyOptimisticUpdate(e,t){this.optimisticUpdates.push({update:e,mutationId:t});let n=new Nt(this.queryResults);return e(n),n.modifiedQueries}rawQueryResult(e){let t=this.queryResults.get(e);if(t!==void 0)return t.result}queryResult(e){let t=this.queryResults.get(e);if(t===void 0)return;let n=t.result;if(n!==void 0){if(n.success)return n.value;throw n.errorData===void 0?Error(ct(`query`,t.udfPath,n)):lt(n,new Xe(ct(`query`,t.udfPath,n)))}}hasQueryResult(e){return this.queryResults.get(e)!==void 0}queryLogs(e){return this.queryResults.get(e)?.result?.logLines}},Ft=Object.defineProperty,It=(e,t,n)=>t in e?Ft(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Lt=(e,t,n)=>It(e,typeof t==`symbol`?t:t+``,n),Rt=class e{constructor(e,t){Lt(this,`low`),Lt(this,`high`),Lt(this,`__isUnsignedLong__`),this.low=e|0,this.high=t|0,this.__isUnsignedLong__=!0}static isLong(e){return(e&&e.__isUnsignedLong__)===!0}static fromBytesLE(t){return new e(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24)}toBytesLE(){let e=this.high,t=this.low;return[t&255,t>>>8&255,t>>>16&255,t>>>24,e&255,e>>>8&255,e>>>16&255,e>>>24]}static fromNumber(t){return isNaN(t)||t<0?zt:t>=Ht?Ut:new e(t%Vt|0,t/Vt|0)}toString(){return(BigInt(this.high)*BigInt(Vt)+BigInt(this.low)).toString()}equals(t){return e.isLong(t)||(t=e.fromValue(t)),this.high>>>31==1&&t.high>>>31==1?!1:this.high===t.high&&this.low===t.low}notEquals(e){return!this.equals(e)}comp(t){return e.isLong(t)||(t=e.fromValue(t)),this.equals(t)?0:t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1}lessThanOrEqual(e){return this.comp(e)<=0}static fromValue(t){return typeof t==`number`?e.fromNumber(t):new e(t.low,t.high)}},zt=new Rt(0,0),Bt=65536,Vt=Bt*Bt,Ht=Vt*Vt,Ut=new Rt(-1,-1),Wt=Object.defineProperty,Gt=(e,t,n)=>t in e?Wt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Kt=(e,t,n)=>Gt(e,typeof t==`symbol`?t:t+``,n),qt=class{constructor(e,t){Kt(this,`version`),Kt(this,`remoteQuerySet`),Kt(this,`queryPath`),Kt(this,`logger`),this.version={querySet:0,ts:Rt.fromNumber(0),identity:0},this.remoteQuerySet=new Map,this.queryPath=e,this.logger=t}transition(e){let t=e.startVersion;if(this.version.querySet!==t.querySet||this.version.ts.notEquals(t.ts)||this.version.identity!==t.identity)throw Error(`Invalid start version: ${t.ts.toString()}:${t.querySet}:${t.identity}, transitioning from ${this.version.ts.toString()}:${this.version.querySet}:${this.version.identity}`);for(let t of e.modifications)switch(t.type){case`QueryUpdated`:{let e=this.queryPath(t.queryId);if(e)for(let n of t.logLines)ot(this.logger,`info`,`query`,e,n);let n=_e(t.value??null);this.remoteQuerySet.set(t.queryId,{success:!0,value:n,logLines:t.logLines});break}case`QueryFailed`:{let e=this.queryPath(t.queryId);if(e)for(let n of t.logLines)ot(this.logger,`info`,`query`,e,n);let{errorData:n}=t;this.remoteQuerySet.set(t.queryId,{success:!1,errorMessage:t.errorMessage,errorData:n===void 0?void 0:_e(n),logLines:t.logLines});break}case`QueryRemoved`:this.remoteQuerySet.delete(t.queryId);break;default:throw Error(`Invalid modification ${t.type}`)}this.version=e.endVersion}remoteQueryResults(){return this.remoteQuerySet}timestamp(){return this.version.ts}};function Jt(e){let t=D(e);return Rt.fromBytesLE(Array.from(t))}function Yt(e){return te(new Uint8Array(e.toBytesLE()))}function Xt(e){switch(e.type){case`FatalError`:case`AuthError`:case`ActionResponse`:case`TransitionChunk`:case`Ping`:return{...e};case`MutationResponse`:return e.success?{...e,ts:Jt(e.ts)}:{...e};case`Transition`:return{...e,startVersion:{...e.startVersion,ts:Jt(e.startVersion.ts)},endVersion:{...e.endVersion,ts:Jt(e.endVersion.ts)}};default:}}function Zt(e){switch(e.type){case`Authenticate`:case`ModifyQuerySet`:case`Mutation`:case`Action`:case`Event`:return{...e};case`Connect`:return e.maxObservedTimestamp===void 0?{...e,maxObservedTimestamp:void 0}:{...e,maxObservedTimestamp:Yt(e.maxObservedTimestamp)};default:}}var Qt=Object.defineProperty,$t=(e,t,n)=>t in e?Qt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,en=(e,t,n)=>$t(e,typeof t==`symbol`?t:t+``,n),tn=1e3,nn=1001,rn=1005,an=4040,on;function sn(){return on===void 0&&(on=Date.now()),typeof performance>`u`||!performance.now?Date.now():Math.round(on+performance.now())}function cn(){return`t=${Math.round((sn()-on)/100)/10}s`}var ln={InternalServerError:{timeout:1e3},SubscriptionsWorkerFullError:{timeout:3e3},TooManyConcurrentRequests:{timeout:3e3},CommitterFullError:{timeout:3e3},AwsTooManyRequestsException:{timeout:3e3},ExecuteFullError:{timeout:3e3},SystemTimeoutError:{timeout:3e3},ExpiredInQueue:{timeout:3e3},VectorIndexesUnavailable:{timeout:1e3},SearchIndexesUnavailable:{timeout:1e3},TableSummariesUnavailable:{timeout:1e3},VectorIndexTooLarge:{timeout:3e3},SearchIndexTooLarge:{timeout:3e3},TooManyWritesInTimePeriod:{timeout:3e3}};function un(e){if(e===void 0)return`Unknown`;for(let t of Object.keys(ln))if(e.startsWith(t))return t;return`Unknown`}var dn=class{constructor(e,t,n,r,i,a){this.markConnectionStateDirty=i,this.debug=a,en(this,`socket`),en(this,`connectionCount`),en(this,`_hasEverConnected`,!1),en(this,`lastCloseReason`),en(this,`transitionChunkBuffer`,null),en(this,`defaultInitialBackoff`),en(this,`maxBackoff`),en(this,`retries`),en(this,`serverInactivityThreshold`),en(this,`reconnectDueToServerInactivityTimeout`),en(this,`scheduledReconnect`,null),en(this,`networkOnlineHandler`,null),en(this,`pendingNetworkRecoveryInfo`,null),en(this,`uri`),en(this,`onOpen`),en(this,`onResume`),en(this,`onMessage`),en(this,`webSocketConstructor`),en(this,`logger`),en(this,`onServerDisconnectError`),this.webSocketConstructor=n,this.socket={state:`disconnected`},this.connectionCount=0,this.lastCloseReason=`InitialConnect`,this.defaultInitialBackoff=1e3,this.maxBackoff=16e3,this.retries=0,this.serverInactivityThreshold=6e4,this.reconnectDueToServerInactivityTimeout=null,this.uri=e,this.onOpen=t.onOpen,this.onResume=t.onResume,this.onMessage=t.onMessage,this.onServerDisconnectError=t.onServerDisconnectError,this.logger=r,this.setupNetworkListener(),this.connect()}setSocketState(e){this.socket=e,this._logVerbose(`socket state changed: ${this.socket.state}, paused: ${`paused`in this.socket?this.socket.paused:void 0}`),this.markConnectionStateDirty()}setupNetworkListener(){typeof window>`u`||typeof window.addEventListener!=`function`||this.networkOnlineHandler===null&&(this.networkOnlineHandler=()=>{this._logVerbose(`network online event detected`),this.tryReconnectImmediately()},window.addEventListener(`online`,this.networkOnlineHandler),this._logVerbose(`network online event listener registered`))}cleanupNetworkListener(){this.networkOnlineHandler&&typeof window<`u`&&typeof window.removeEventListener==`function`&&(window.removeEventListener(`online`,this.networkOnlineHandler),this.networkOnlineHandler=null,this._logVerbose(`network online event listener removed`))}assembleTransition(e){if(e.partNumber<0||e.partNumber>=e.totalParts||e.totalParts===0||this.transitionChunkBuffer&&(this.transitionChunkBuffer.totalParts!==e.totalParts||this.transitionChunkBuffer.transitionId!==e.transitionId))throw this.transitionChunkBuffer=null,Error(`Invalid TransitionChunk`);if(this.transitionChunkBuffer===null&&(this.transitionChunkBuffer={chunks:[],totalParts:e.totalParts,transitionId:e.transitionId}),e.partNumber!==this.transitionChunkBuffer.chunks.length){let t=this.transitionChunkBuffer.chunks.length;throw this.transitionChunkBuffer=null,Error(`TransitionChunk received out of order: expected part ${t}, got ${e.partNumber}`)}if(this.transitionChunkBuffer.chunks.push(e.chunk),this.transitionChunkBuffer.chunks.length===e.totalParts){let e=this.transitionChunkBuffer.chunks.join(``);this.transitionChunkBuffer=null;let t=Xt(JSON.parse(e));if(t.type!==`Transition`)throw Error(`Expected Transition, got ${t.type} after assembling chunks`);return t}return null}connect(){if(this.socket.state===`terminated`)return;if(this.socket.state!==`disconnected`&&this.socket.state!==`stopped`)throw Error(`Didn't start connection from disconnected state: `+this.socket.state);let e=new this.webSocketConstructor(this.uri);this._logVerbose(`constructed WebSocket`),this.setSocketState({state:`connecting`,ws:e,paused:`no`}),this.resetServerInactivityTimeout(),e.onopen=()=>{if(this.logger.logVerbose(`begin ws.onopen`),this.socket.state!==`connecting`)throw Error(`onopen called with socket not in connecting state`);if(this.setSocketState({state:`ready`,ws:e,paused:this.socket.paused===`yes`?`uninitialized`:`no`}),this.resetServerInactivityTimeout(),this.socket.paused===`no`&&(this._hasEverConnected=!0,this.onOpen({connectionCount:this.connectionCount,lastCloseReason:this.lastCloseReason,clientTs:sn()})),this.lastCloseReason!==`InitialConnect`&&(this.lastCloseReason?this.logger.log(`WebSocket reconnected at`,cn(),`after disconnect due to`,this.lastCloseReason):this.logger.log(`WebSocket reconnected at`,cn())),this.connectionCount+=1,this.lastCloseReason=null,this.pendingNetworkRecoveryInfo!==null){let{timeSavedMs:e}=this.pendingNetworkRecoveryInfo;this.pendingNetworkRecoveryInfo=null,this.sendMessage({type:`Event`,eventType:`NetworkRecoveryReconnect`,event:{timeSavedMs:e}}),this.logger.log(`Network recovery reconnect saved ~${Math.round(e/1e3)}s of waiting`)}},e.onerror=e=>{this.transitionChunkBuffer=null;let t=e.message;t&&this.logger.log(`WebSocket error message: ${t}`)},e.onmessage=e=>{this.resetServerInactivityTimeout();let t=e.data.length,n=Xt(JSON.parse(e.data));if(this._logVerbose(`received ws message with type ${n.type}`),n.type!==`Ping`){if(n.type===`TransitionChunk`){let e=this.assembleTransition(n);if(!e)return;n=e,this._logVerbose(`assembled full ws message of type ${n.type}`)}this.transitionChunkBuffer!==null&&(this.transitionChunkBuffer=null,this.logger.log(`Received unexpected ${n.type} while buffering TransitionChunks`)),n.type===`Transition`&&this.reportLargeTransition({messageLength:t,transition:n}),this.onMessage(n).hasSyncedPastLastReconnect&&(this.retries=0,this.markConnectionStateDirty())}},e.onclose=e=>{if(this._logVerbose(`begin ws.onclose`),this.transitionChunkBuffer=null,this.lastCloseReason===null&&(this.lastCloseReason=e.reason||`closed with code ${e.code}`),e.code!==tn&&e.code!==nn&&e.code!==rn&&e.code!==an){let t=`WebSocket closed with code ${e.code}`;e.reason&&(t+=`: ${e.reason}`),this.logger.log(t),this.onServerDisconnectError&&e.reason&&this.onServerDisconnectError(t)}let t=un(e.reason);this.scheduleReconnect(t)}}socketState(){return this.socket.state}sendMessage(e){let t={type:e.type,...e.type===`Authenticate`&&e.tokenType===`User`?{value:`...${e.value.slice(-7)}`}:{}};if(this.socket.state===`ready`&&this.socket.paused===`no`){let n=Zt(e),r=JSON.stringify(n),i=!1;try{this.socket.ws.send(r),i=!0}catch(e){this.logger.log(`Failed to send message on WebSocket, reconnecting: ${e}`),this.closeAndReconnect(`FailedToSendMessage`)}return this._logVerbose(`${i?`sent`:`failed to send`} message with type ${e.type}: ${JSON.stringify(t)}`),!0}return this._logVerbose(`message not sent (socket state: ${this.socket.state}, paused: ${`paused`in this.socket?this.socket.paused:void 0}): ${JSON.stringify(t)}`),!1}resetServerInactivityTimeout(){this.socket.state!==`terminated`&&(this.reconnectDueToServerInactivityTimeout!==null&&(clearTimeout(this.reconnectDueToServerInactivityTimeout),this.reconnectDueToServerInactivityTimeout=null),this.reconnectDueToServerInactivityTimeout=setTimeout(()=>{this.closeAndReconnect(`InactiveServer`)},this.serverInactivityThreshold))}scheduleReconnect(e){this.scheduledReconnect&&=(clearTimeout(this.scheduledReconnect.timeout),null),this.socket={state:`disconnected`};let t=this.nextBackoff(e);this.markConnectionStateDirty(),this.logger.log(`Attempting reconnect in ${Math.round(t)}ms`);let n=sn(),r=setTimeout(()=>{this.scheduledReconnect?.timeout===r&&(this.scheduledReconnect=null,this.connect())},t);this.scheduledReconnect={timeout:r,scheduledAt:n,backoffMs:t}}closeAndReconnect(e){switch(this._logVerbose(`begin closeAndReconnect with reason ${e}`),this.socket.state){case`disconnected`:case`terminated`:case`stopped`:return;case`connecting`:case`ready`:this.lastCloseReason=e,this.close(),this.scheduleReconnect(`client`);return;default:this.socket}}close(){switch(this.transitionChunkBuffer=null,this.socket.state){case`disconnected`:case`terminated`:case`stopped`:return Promise.resolve();case`connecting`:{let e=this.socket.ws;return e.onmessage=e=>{this._logVerbose(`Ignoring message received after close`)},new Promise(t=>{e.onclose=()=>{this._logVerbose(`Closed after connecting`),t()},e.onopen=()=>{this._logVerbose(`Opened after connecting`),e.close()}})}case`ready`:{this._logVerbose(`ws.close called`);let e=this.socket.ws;e.onmessage=e=>{this._logVerbose(`Ignoring message received after close`)};let t=new Promise(t=>{e.onclose=()=>{t()}});return e.close(),t}default:return this.socket,Promise.resolve()}}terminate(){switch(this.reconnectDueToServerInactivityTimeout&&clearTimeout(this.reconnectDueToServerInactivityTimeout),this.scheduledReconnect&&=(clearTimeout(this.scheduledReconnect.timeout),null),this.cleanupNetworkListener(),this.socket.state){case`terminated`:case`stopped`:case`disconnected`:case`connecting`:case`ready`:{let e=this.close();return this.setSocketState({state:`terminated`}),e}default:throw this.socket,Error(`Invalid websocket state: ${this.socket.state}`)}}stop(){switch(this.socket.state){case`terminated`:return Promise.resolve();case`connecting`:case`stopped`:case`disconnected`:case`ready`:{this.cleanupNetworkListener();let e=this.close();return this.socket={state:`stopped`},e}default:return this.socket,Promise.resolve()}}tryRestart(){switch(this.socket.state){case`stopped`:break;case`terminated`:case`connecting`:case`ready`:case`disconnected`:this.logger.logVerbose(`Restart called without stopping first`);return;default:this.socket}this.setupNetworkListener(),this.connect()}pause(){switch(this.socket.state){case`disconnected`:case`stopped`:case`terminated`:return;case`connecting`:case`ready`:this.socket={...this.socket,paused:`yes`};return;default:this.socket;return}}tryReconnectImmediately(){if(this._logVerbose(`tryReconnectImmediately called`),this.socket.state!==`disconnected`){this._logVerbose(`tryReconnectImmediately called but socket state is ${this.socket.state}, no action taken`);return}let e=null;if(this.scheduledReconnect){let t=sn()-this.scheduledReconnect.scheduledAt;e=Math.max(0,this.scheduledReconnect.backoffMs-t),this._logVerbose(`would have waited ${Math.round(e)}ms more (backoff was ${Math.round(this.scheduledReconnect.backoffMs)}ms, elapsed ${Math.round(t)}ms)`),clearTimeout(this.scheduledReconnect.timeout),this.scheduledReconnect=null,this._logVerbose(`canceled scheduled reconnect`)}this.logger.log(`Network recovery detected, reconnecting immediately`),this.pendingNetworkRecoveryInfo=e===null?null:{timeSavedMs:e},this.connect()}resume(){switch(this.socket.state){case`connecting`:this.socket={...this.socket,paused:`no`};return;case`ready`:this.socket.paused===`uninitialized`?(this.socket={...this.socket,paused:`no`},this._hasEverConnected=!0,this.onOpen({connectionCount:this.connectionCount,lastCloseReason:this.lastCloseReason,clientTs:sn()})):this.socket.paused===`yes`&&(this.socket={...this.socket,paused:`no`},this.onResume());return;case`terminated`:case`stopped`:case`disconnected`:return;default:this.socket}this.connect()}connectionState(){return{isConnected:this.socket.state===`ready`,hasEverConnected:this._hasEverConnected,connectionCount:this.connectionCount,connectionRetries:this.retries}}_logVerbose(e){this.logger.logVerbose(e)}nextBackoff(e){let t=(e===`client`?100:e===`Unknown`?this.defaultInitialBackoff:ln[e].timeout)*2**this.retries;this.retries+=1;let n=Math.min(t,this.maxBackoff);return n+n*(Math.random()-.5)}reportLargeTransition({transition:e,messageLength:t}){if(e.clientClockSkew===void 0||e.serverTs===void 0)return;let n=sn()-e.clientClockSkew-e.serverTs/1e6,r=`${Math.round(n)}ms`,i=`${Math.round(t/1e4)/100}MB`,a=t/(n/1e3),o=`${Math.round(a/1e4)/100}MB per second`;this._logVerbose(`received ${i} transition in ${r} at ${o}`),t>2e7?this.logger.log(`received query results totaling more that 20MB (${i}) which will take a long time to download on slower connections`):n>2e4&&this.logger.log(`received query results totaling ${i} which took more than 20s to arrive (${r})`),this.debug&&this.sendMessage({type:`Event`,eventType:`ClientReceivedTransition`,event:{transitionTransitTime:n,messageLength:t}})}};function fn(){return pn()}function pn(){return`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e===`x`?t:t&3|8).toString(16)})}var mn=class extends Error{};mn.prototype.name=`InvalidTokenError`;function hn(e){return decodeURIComponent(atob(e).replace(/(.)/g,(e,t)=>{let n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n=`0`+n),`%`+n}))}function gn(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`);switch(t.length%4){case 0:break;case 2:t+=`==`;break;case 3:t+=`=`;break;default:throw Error(`base64 string is not of the correct length`)}try{return hn(t)}catch{return atob(t)}}function _n(e,t){if(typeof e!=`string`)throw new mn(`Invalid token specified: must be a string`);t||={};let n=t.header===!0?0:1,r=e.split(`.`)[n];if(typeof r!=`string`)throw new mn(`Invalid token specified: missing part #${n+1}`);let i;try{i=gn(r)}catch(e){throw new mn(`Invalid token specified: invalid base64 for part #${n+1} (${e.message})`)}try{return JSON.parse(i)}catch(e){throw new mn(`Invalid token specified: invalid json for part #${n+1} (${e.message})`)}}var vn=Object.defineProperty,yn=(e,t,n)=>t in e?vn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,bn=(e,t,n)=>yn(e,typeof t==`symbol`?t:t+``,n),xn=480*60*60*1e3,Sn=2,Cn=class{constructor(e,t,n){bn(this,`authState`,{state:`noAuth`}),bn(this,`configVersion`,0),bn(this,`syncState`),bn(this,`authenticate`),bn(this,`stopSocket`),bn(this,`tryRestartSocket`),bn(this,`pauseSocket`),bn(this,`resumeSocket`),bn(this,`clearAuth`),bn(this,`logger`),bn(this,`refreshTokenLeewaySeconds`),bn(this,`lastRefreshChange`),bn(this,`tokenConfirmationAttempts`,0),this.syncState=e,this.authenticate=t.authenticate,this.stopSocket=t.stopSocket,this.tryRestartSocket=t.tryRestartSocket,this.pauseSocket=t.pauseSocket,this.resumeSocket=t.resumeSocket,this.clearAuth=t.clearAuth,this.logger=n.logger,this.refreshTokenLeewaySeconds=n.refreshTokenLeewaySeconds,this.lastRefreshChange=!1}notifyRefreshChange(e){this.authState.state!==`noAuth`&&this.authState.state!==`initialRefetch`&&this.authState.config.onRefreshChange&&this.lastRefreshChange!==e&&(this.lastRefreshChange=e,this.authState.config.onRefreshChange(e))}async setConfig(e,t,n){this.resetAuthState(),this._logVerbose(`pausing WS for auth token fetch`),this.pauseSocket();let r=await this.fetchTokenAndGuardAgainstRace(e,{forceRefreshToken:!1});if(r.isFromOutdatedConfig)return;let i={fetchToken:e,onAuthChange:t,onRefreshChange:n};r.value?(this.setAuthState({state:`waitingForServerConfirmationOfCachedToken`,config:i,hasRetried:!1}),this.authenticate(r.value)):(this.setAuthState({state:`initialRefetch`,config:i}),await this.refetchToken()),this._logVerbose(`resuming WS after auth token fetch`),this.resumeSocket()}onTransition(e){if(this.syncState.isCurrentOrNewerAuthVersion(e.endVersion.identity)&&!(e.endVersion.identity<=e.startVersion.identity)){if(this._logVerbose(`auth state is ${this.authState.state} when handling transition`),this.syncState.markAuthCompletion(),this.authState.state===`waitingForServerConfirmationOfCachedToken`){this._logVerbose(`server confirmed auth token is valid`),this.refetchToken(),this.authState.config.onAuthChange(!0);return}this.authState.state===`waitingForServerConfirmationOfFreshToken`&&(this._logVerbose(`server confirmed new auth token is valid`),this.notifyRefreshChange(!1),this.scheduleTokenRefetch(this.authState.token),this.tokenConfirmationAttempts=0,this.authState.hadAuth||this.authState.config.onAuthChange(!0))}}onAuthError(e){if(e.authUpdateAttempted===!1&&(this.authState.state===`waitingForServerConfirmationOfFreshToken`||this.authState.state===`waitingForServerConfirmationOfCachedToken`)){this._logVerbose(`ignoring non-auth token expired error`);return}let{baseVersion:t}=e;if(!this.syncState.isCurrentOrNewerAuthVersion(t+1)){this._logVerbose(`ignoring auth error for previous auth attempt`);return}this.tryToReauthenticate(e)}async tryToReauthenticate(e){if(this._logVerbose(`attempting to reauthenticate: ${e.error}`),this.authState.state===`noAuth`||this.authState.state===`waitingForServerConfirmationOfFreshToken`&&this.tokenConfirmationAttempts>=Sn){this.logger.error(`Failed to authenticate: "${e.error}", check your server auth config`),this.syncState.hasAuth()&&this.syncState.clearAuth(),this.authState.state!==`noAuth`&&this.setAndReportAuthFailed(this.authState.config.onAuthChange);return}if(this.authState.state===`waitingForServerConfirmationOfFreshToken`&&(this.tokenConfirmationAttempts++,this._logVerbose(`retrying reauthentication, ${Sn-this.tokenConfirmationAttempts} attempts remaining`)),this.notifyRefreshChange(!0),await this.stopSocket(),this.authState.state===`noAuth`)return;let t=await this.fetchTokenAndGuardAgainstRace(this.authState.config.fetchToken,{forceRefreshToken:!0});t.isFromOutdatedConfig||(t.value&&this.syncState.isNewAuth(t.value)?(this.authenticate(t.value),this.setAuthState({state:`waitingForServerConfirmationOfFreshToken`,config:this.authState.config,token:t.value,hadAuth:this.authState.state===`notRefetching`||this.authState.state===`waitingForScheduledRefetch`})):(this._logVerbose(`reauthentication failed, could not fetch a new token`),this.syncState.hasAuth()&&this.syncState.clearAuth(),this.setAndReportAuthFailed(this.authState.config.onAuthChange)),this.tryRestartSocket())}async refetchToken(){if(this.authState.state===`noAuth`)return;this._logVerbose(`refetching auth token`);let e=await this.fetchTokenAndGuardAgainstRace(this.authState.config.fetchToken,{forceRefreshToken:!0});e.isFromOutdatedConfig||(e.value?this.syncState.isNewAuth(e.value)?(this.setAuthState({state:`waitingForServerConfirmationOfFreshToken`,hadAuth:this.syncState.hasAuth(),token:e.value,config:this.authState.config}),this.authenticate(e.value)):this.setAuthState({state:`notRefetching`,config:this.authState.config}):(this._logVerbose(`refetching token failed`),this.syncState.hasAuth()&&this.clearAuth(),this.setAndReportAuthFailed(this.authState.config.onAuthChange)),this._logVerbose(`restarting WS after auth token fetch (if currently stopped)`),this.tryRestartSocket())}scheduleTokenRefetch(e){if(this.authState.state===`noAuth`)return;let t=this.decodeToken(e);if(!t){this.logger.error(`Auth token is not a valid JWT, cannot refetch the token`);return}let{iat:n,exp:r}=t;if(!n||!r){this.logger.error(`Auth token does not have required fields, cannot refetch the token`);return}let i=r-n;if(i<=2){this.logger.error(`Auth token does not live long enough, cannot refetch the token`);return}let a=Math.min(xn,(i-this.refreshTokenLeewaySeconds)*1e3);a<=0&&(this.logger.warn(`Refetching auth token immediately, configured leeway ${this.refreshTokenLeewaySeconds}s is larger than the token's lifetime ${i}s`),a=0);let o=setTimeout(()=>{this._logVerbose(`running scheduled token refetch`),this.refetchToken()},a);this.setAuthState({state:`waitingForScheduledRefetch`,refetchTokenTimeoutId:o,config:this.authState.config}),this._logVerbose(`scheduled preemptive auth token refetching in ${a}ms`)}async fetchTokenAndGuardAgainstRace(e,t){let n=++this.configVersion;this._logVerbose(`fetching token with config version ${n}`);let r=await e(t);return this.configVersion===n?{isFromOutdatedConfig:!1,value:r}:(this._logVerbose(`stale config version, expected ${n}, got ${this.configVersion}`),{isFromOutdatedConfig:!0})}stop(){this.resetAuthState(),this.configVersion++,this._logVerbose(`config version bumped to ${this.configVersion}`)}setAndReportAuthFailed(e){e(!1),this.resetAuthState()}resetAuthState(){this.notifyRefreshChange(!1),this.setAuthState({state:`noAuth`})}setAuthState(e){let t=e.state===`waitingForServerConfirmationOfFreshToken`?{hadAuth:e.hadAuth,state:e.state,token:`...${e.token.slice(-7)}`}:{state:e.state};switch(this._logVerbose(`setting auth state to ${JSON.stringify(t)}`),e.state){case`waitingForScheduledRefetch`:case`notRefetching`:case`noAuth`:this.tokenConfirmationAttempts=0;break;case`waitingForServerConfirmationOfFreshToken`:case`waitingForServerConfirmationOfCachedToken`:case`initialRefetch`:break;default:}this.authState.state===`waitingForScheduledRefetch`&&clearTimeout(this.authState.refetchTokenTimeoutId),this.authState=e}decodeToken(e){try{return _n(e)}catch(e){return this._logVerbose(`Error decoding token: ${e instanceof Error?e.message:`Unknown error`}`),null}}_logVerbose(e){this.logger.logVerbose(`${e} [v${this.configVersion}]`)}},wn=[`convexClientConstructed`,`convexWebSocketOpen`,`convexFirstMessageReceived`];function Tn(e,t){let n={sessionId:t};typeof performance>`u`||!performance.mark||performance.mark(e,{detail:n})}function En(e){let t=e.name.slice(6);return t=t.charAt(0).toLowerCase()+t.slice(1),{name:t,startTime:e.startTime}}function Dn(e){if(typeof performance>`u`||!performance.getEntriesByName)return[];let t=[];for(let n of wn){let r=performance.getEntriesByName(n).filter(e=>e.entryType===`mark`).filter(t=>t.detail.sessionId===e);t.push(...r)}return t.map(En)}var On=Object.defineProperty,kn=(e,t,n)=>t in e?On(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,An=(e,t,n)=>kn(e,typeof t==`symbol`?t:t+``,n),jn=class{constructor(e,t,n){if(An(this,`address`),An(this,`state`),An(this,`requestManager`),An(this,`webSocketManager`),An(this,`authenticationManager`),An(this,`remoteQuerySet`),An(this,`optimisticQueryResults`),An(this,`_transitionHandlerCounter`,0),An(this,`_nextRequestId`),An(this,`_onTransitionFns`,new Map),An(this,`_sessionId`),An(this,`firstMessageReceived`,!1),An(this,`debug`),An(this,`logger`),An(this,`maxObservedTimestamp`),An(this,`connectionStateSubscribers`,new Map),An(this,`nextConnectionStateSubscriberId`,0),An(this,`_lastPublishedConnectionState`),An(this,`markConnectionStateDirty`,()=>{Promise.resolve().then(()=>{let e=this.connectionState();if(JSON.stringify(e)!==JSON.stringify(this._lastPublishedConnectionState)){this._lastPublishedConnectionState=e;for(let t of this.connectionStateSubscribers.values())t(e)}})}),An(this,`mark`,e=>{this.debug&&Tn(e,this.sessionId)}),typeof e==`object`)throw Error(`Passing a ClientConfig object is no longer supported. Pass the URL of the Convex deployment as a string directly.`);n?.skipConvexDeploymentUrlCheck!==!0&&A(e),n={...n};let r=n.authRefreshTokenLeewaySeconds??10,i=n.webSocketConstructor;if(!i&&typeof WebSocket>`u`)throw Error(`No WebSocket global variable defined! To use Convex in an environment without WebSocket try the HTTP client: https://docs.convex.dev/api/classes/browser.ConvexHttpClient`);i||=WebSocket,this.debug=n.reportDebugInfoToConvex??!1,this.address=e,this.logger=n.logger===!1?at({verbose:n.verbose??!1}):n.logger!==!0&&n.logger?n.logger:it({verbose:n.verbose??!1});let a=e.search(`://`);if(a===-1)throw Error(`Provided address was not an absolute URL.`);let o=e.substring(a+3),s=e.substring(0,a),c;if(s===`http`)c=`ws`;else if(s===`https`)c=`wss`;else throw Error(`Unknown parent protocol ${s}`);let l=`${c}://${o}/api/${Ze}/sync`;this.state=new gt,this.remoteQuerySet=new qt(e=>this.state.queryPath(e),this.logger),this.requestManager=new bt(this.logger,this.markConnectionStateDirty);let u=()=>{this.webSocketManager.pause(),this.state.pause()};this.authenticationManager=new Cn(this.state,{authenticate:e=>{let t=this.state.setAuth(e);return this.webSocketManager.sendMessage(t),t.baseVersion},stopSocket:()=>this.webSocketManager.stop(),tryRestartSocket:()=>this.webSocketManager.tryRestart(),pauseSocket:u,resumeSocket:()=>this.webSocketManager.resume(),clearAuth:()=>{this.clearAuth()}},{logger:this.logger,refreshTokenLeewaySeconds:r}),this.optimisticQueryResults=new Pt,this.addOnTransitionHandler(e=>{t(e.queries.map(e=>e.token))}),this._nextRequestId=0,this._sessionId=fn();let{unsavedChangesWarning:d}=n;if(typeof window>`u`||window.addEventListener===void 0){if(d===!0)throw Error(`unsavedChangesWarning requested, but window.addEventListener not found! Remove {unsavedChangesWarning: true} from Convex client options.`)}else d!==!1&&window.addEventListener(`beforeunload`,e=>{if(this.requestManager.hasIncompleteRequests()){e.preventDefault();let t=`Are you sure you want to leave? Your changes may not be saved.`;return(e||window.event).returnValue=t,t}});this.webSocketManager=new dn(l,{onOpen:e=>{this.mark(`convexWebSocketOpen`),this.webSocketManager.sendMessage({...e,type:`Connect`,sessionId:this._sessionId,maxObservedTimestamp:this.maxObservedTimestamp}),this.remoteQuerySet=new qt(e=>this.state.queryPath(e),this.logger);let[t,n]=this.state.restart();n&&this.webSocketManager.sendMessage(n),this.webSocketManager.sendMessage(t);for(let e of this.requestManager.restart())this.webSocketManager.sendMessage(e)},onResume:()=>{let[e,t]=this.state.resume();t&&this.webSocketManager.sendMessage(t),e&&this.webSocketManager.sendMessage(e);for(let e of this.requestManager.resume())this.webSocketManager.sendMessage(e)},onMessage:e=>{switch(this.firstMessageReceived||(this.firstMessageReceived=!0,this.mark(`convexFirstMessageReceived`),this.reportMarks()),e.type){case`Transition`:{this.observedTimestamp(e.endVersion.ts),this.authenticationManager.onTransition(e),this.remoteQuerySet.transition(e),this.state.transition(e);let t=this.requestManager.removeCompleted(this.remoteQuerySet.timestamp());this.notifyOnQueryResultChanges(t);break}case`MutationResponse`:{e.success&&this.observedTimestamp(e.ts);let t=this.requestManager.onResponse(e);t!==null&&this.notifyOnQueryResultChanges(new Map([[t.requestId,t.result]]));break}case`ActionResponse`:this.requestManager.onResponse(e);break;case`AuthError`:this.authenticationManager.onAuthError(e);break;case`FatalError`:{let t=st(this.logger,e.error);throw this.webSocketManager.terminate(),t}default:}return{hasSyncedPastLastReconnect:this.hasSyncedPastLastReconnect()}},onServerDisconnectError:n.onServerDisconnectError},i,this.logger,this.markConnectionStateDirty,this.debug),this.mark(`convexClientConstructed`),n.expectAuth&&u()}hasSyncedPastLastReconnect(){return this.requestManager.hasSyncedPastLastReconnect()&&this.state.hasSyncedPastLastReconnect()}observedTimestamp(e){(this.maxObservedTimestamp===void 0||this.maxObservedTimestamp.lessThanOrEqual(e))&&(this.maxObservedTimestamp=e)}getMaxObservedTimestamp(){return this.maxObservedTimestamp}notifyOnQueryResultChanges(e){let t=this.remoteQuerySet.remoteQueryResults(),n=new Map;for(let[e,r]of t){let t=this.state.queryToken(e);if(t!==null){let i={result:r,udfPath:this.state.queryPath(e),args:this.state.queryArgs(e)};n.set(t,i)}}let r=this.optimisticQueryResults.ingestQueryResultsFromServer(n,new Set(e.keys()));this.handleTransition({queries:r.map(e=>({token:e,modification:{kind:`Updated`,result:this.optimisticQueryResults.rawQueryResult(e)}})),reflectedMutations:Array.from(e).map(([e,t])=>({requestId:e,result:t})),timestamp:this.remoteQuerySet.timestamp()})}handleTransition(e){for(let t of this._onTransitionFns.values())t(e)}addOnTransitionHandler(e){let t=this._transitionHandlerCounter++;return this._onTransitionFns.set(t,e),()=>this._onTransitionFns.delete(t)}getCurrentAuthClaims(){let e=this.state.getAuth(),t={};if(e&&e.tokenType===`User`)try{t=e?_n(e.value):{}}catch{t={}}else return;return{token:e.value,decoded:t}}setAuth(e,t,n){this.authenticationManager.setConfig(e,t,n)}hasAuth(){return this.state.hasAuth()}setAdminAuth(e,t){let n=this.state.setAdminAuth(e,t);this.webSocketManager.sendMessage(n)}clearAuth(){let e=this.state.clearAuth();this.webSocketManager.sendMessage(e)}subscribe(e,t,n){let r=k(t),{modification:i,queryToken:a,unsubscribe:o}=this.state.subscribe(e,r,n?.journal,n?.componentPath);return i!==null&&this.webSocketManager.sendMessage(i),{queryToken:a,unsubscribe:()=>{let e=o();e&&this.webSocketManager.sendMessage(e)}}}localQueryResult(e,t){let n=dt(e,k(t));return this.optimisticQueryResults.queryResult(n)}localQueryResultByToken(e){return this.optimisticQueryResults.queryResult(e)}hasLocalQueryResultByToken(e){return this.optimisticQueryResults.hasQueryResult(e)}localQueryLogs(e,t){let n=dt(e,k(t));return this.optimisticQueryResults.queryLogs(n)}queryJournal(e,t){let n=dt(e,k(t));return this.state.queryJournal(n)}connectionState(){let e=this.webSocketManager.connectionState();return{hasInflightRequests:this.requestManager.hasInflightRequests(),isWebSocketConnected:e.isConnected,hasEverConnected:e.hasEverConnected,connectionCount:e.connectionCount,connectionRetries:e.connectionRetries,timeOfOldestInflightRequest:this.requestManager.timeOfOldestInflightRequest(),inflightMutations:this.requestManager.inflightMutations(),inflightActions:this.requestManager.inflightActions()}}subscribeToConnectionState(e){let t=this.nextConnectionStateSubscriberId++;return this.connectionStateSubscribers.set(t,e),()=>{this.connectionStateSubscribers.delete(t)}}async mutation(e,t,n){let r=await this.mutationInternal(e,t,n);if(!r.success)throw r.errorData===void 0?Error(ct(`mutation`,e,r)):lt(r,new Xe(ct(`mutation`,e,r)));return r.value}async mutationInternal(e,t,n,r){let{mutationPromise:i}=this.enqueueMutation(e,t,n,r);return i}enqueueMutation(e,t,n,r){let i=k(t);this.tryReportLongDisconnect();let a=this.nextRequestId;if(this._nextRequestId++,n!==void 0){let e=n.optimisticUpdate;if(e!==void 0){let t=this.optimisticQueryResults.applyOptimisticUpdate(t=>{e(t,i)instanceof Promise&&this.logger.warn(`Optimistic update handler returned a Promise. Optimistic updates should be synchronous.`)},a).map(e=>{let t=this.localQueryResultByToken(e);return{token:e,modification:{kind:`Updated`,result:t===void 0?void 0:{success:!0,value:t,logLines:[]}}}});this.handleTransition({queries:t,reflectedMutations:[],timestamp:this.remoteQuerySet.timestamp()})}}let o={type:`Mutation`,requestId:a,udfPath:e,componentPath:r,args:[Ce(i)]},s=this.webSocketManager.sendMessage(o);return{requestId:a,mutationPromise:this.requestManager.request(o,s)}}async action(e,t){let n=await this.actionInternal(e,t);if(!n.success)throw n.errorData===void 0?Error(ct(`action`,e,n)):lt(n,new Xe(ct(`action`,e,n)));return n.value}async actionInternal(e,t,n){let r=k(t),i=this.nextRequestId;this._nextRequestId++,this.tryReportLongDisconnect();let a={type:`Action`,requestId:i,udfPath:e,componentPath:n,args:[Ce(r)]},o=this.webSocketManager.sendMessage(a);return this.requestManager.request(a,o)}async close(){return this.authenticationManager.stop(),this.webSocketManager.terminate()}get url(){return this.address}get nextRequestId(){return this._nextRequestId}get sessionId(){return this._sessionId}reportMarks(){if(this.debug){let e=Dn(this.sessionId);this.webSocketManager.sendMessage({type:`Event`,eventType:`ClientConnect`,event:e})}}tryReportLongDisconnect(){if(!this.debug)return;let e=this.connectionState().timeOfOldestInflightRequest;if(e===null||Date.now()-e.getTime()<=60*1e3)return;let t=`${this.address}/api/debug_event`;fetch(t,{method:`POST`,headers:{"Content-Type":`application/json`,"Convex-Client":`npm-${Ze}`},body:JSON.stringify({event:`LongWebsocketDisconnect`})}).then(e=>{e.ok||this.logger.warn(`Analytics request failed with response:`,e.body)}).catch(e=>{this.logger.warn(`Analytics response failed with error:`,e)})}};function Mn(e){if(typeof e!=`object`||!e||!Array.isArray(e.page)||typeof e.isDone!=`boolean`||typeof e.continueCursor!=`string`)throw Error(`Not a valid paginated query result: ${e?.toString()}`);return e}var Nn=Object.defineProperty,Pn=(e,t,n)=>t in e?Nn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Fn=(e,t,n)=>Pn(e,typeof t==`symbol`?t:t+``,n),In=class{constructor(e,t){this.client=e,this.onTransition=t,Fn(this,`paginatedQuerySet`,new Map),Fn(this,`lastTransitionTs`),this.lastTransitionTs=Rt.fromNumber(0),this.client.addOnTransitionHandler(e=>this.onBaseTransition(e))}subscribe(e,t,n){let r=ut(e),i=ft(r,t,n),a=()=>this.removePaginatedQuerySubscriber(i),o=this.paginatedQuerySet.get(i);return o?(o.numSubscribers+=1,{paginatedQueryToken:i,unsubscribe:a}):(this.paginatedQuerySet.set(i,{token:i,canonicalizedUdfPath:r,args:t,numSubscribers:1,options:{initialNumItems:n.initialNumItems},nextPageKey:0,pageKeys:[],pageKeyToQuery:new Map,ongoingSplits:new Map,skip:!1,id:n.id}),this.addPageToPaginatedQuery(i,null,n.initialNumItems),{paginatedQueryToken:i,unsubscribe:a})}localQueryResult(e,t,n){let r=ft(ut(e),t,n);return this.localQueryResultByToken(r)}localQueryResultByToken(e){let t=this.paginatedQuerySet.get(e);if(!t)return;let n=this.activePageQueryTokens(t);if(n.length===0)return{results:[],status:`LoadingFirstPage`,loadMore:t=>this.loadMoreOfPaginatedQuery(e,t)};let r=[],i=!1,a=!1;for(let e of n){let t=this.client.localQueryResultByToken(e);if(t===void 0){i=!0,a=!1;continue}let n=Mn(t);r=r.concat(n.page),a=!!n.isDone}let o;return o=i?r.length===0?`LoadingFirstPage`:`LoadingMore`:a?`Exhausted`:`CanLoadMore`,{results:r,status:o,loadMore:t=>this.loadMoreOfPaginatedQuery(e,t)}}onBaseTransition(e){let t=e.queries.map(e=>e.token),n=this.queriesContainingTokens(t),r=[];n.length>0&&(this.processPaginatedQuerySplits(n,e=>this.client.localQueryResultByToken(e)),r=n.map(e=>({token:e,modification:{kind:`Updated`,result:this.localQueryResultByToken(e)}})));let i={...e,paginatedQueries:r};this.onTransition(i)}loadMoreOfPaginatedQuery(e,t){this.mustGetPaginatedQuery(e);let n=this.queryTokenForLastPageOfPaginatedQuery(e),r=this.client.localQueryResultByToken(n);if(!r)return!1;let i=Mn(r);if(i.isDone)return!1;this.addPageToPaginatedQuery(e,i.continueCursor,t);let a={timestamp:this.lastTransitionTs,reflectedMutations:[],queries:[],paginatedQueries:[{token:e,modification:{kind:`Updated`,result:this.localQueryResultByToken(e)}}]};return this.onTransition(a),!0}queriesContainingTokens(e){if(e.length===0)return[];let t=[],n=new Set(e);for(let[e,r]of this.paginatedQuerySet)for(let i of this.allQueryTokens(r))if(n.has(i)){t.push(e);break}return t}processPaginatedQuerySplits(e,t){for(let n of e){let e=this.mustGetPaginatedQuery(n),{ongoingSplits:r,pageKeyToQuery:i,pageKeys:a}=e;for(let[n,[a,o]]of r)t(i.get(a).queryToken)!==void 0&&t(i.get(o).queryToken)!==void 0&&this.completePaginatedQuerySplit(e,n,a,o);for(let n of a){if(r.has(n))continue;let a=i.get(n).queryToken,o=t(a);if(!o)continue;let s=Mn(o);s.splitCursor&&(s.pageStatus===`SplitRecommended`||s.pageStatus===`SplitRequired`||s.page.length>e.options.initialNumItems*2)&&this.splitPaginatedQueryPage(e,n,s.splitCursor,s.continueCursor)}}}splitPaginatedQueryPage(e,t,n,r){let i=e.nextPageKey++,a=e.nextPageKey++,o={cursor:r,numItems:e.options.initialNumItems,id:e.id},s=this.client.subscribe(e.canonicalizedUdfPath,{...e.args,paginationOpts:{...o,cursor:null,endCursor:n}});e.pageKeyToQuery.set(i,s);let c=this.client.subscribe(e.canonicalizedUdfPath,{...e.args,paginationOpts:{...o,cursor:n,endCursor:r}});e.pageKeyToQuery.set(a,c),e.ongoingSplits.set(t,[i,a])}addPageToPaginatedQuery(e,t,n){let r=this.mustGetPaginatedQuery(e),i=r.nextPageKey++,a={cursor:t,numItems:n,id:r.id},o={...r.args,paginationOpts:a},s=this.client.subscribe(r.canonicalizedUdfPath,o);return r.pageKeys.push(i),r.pageKeyToQuery.set(i,s),s}removePaginatedQuerySubscriber(e){let t=this.paginatedQuerySet.get(e);if(t&&(--t.numSubscribers,!(t.numSubscribers>0))){for(let e of t.pageKeyToQuery.values())e.unsubscribe();this.paginatedQuerySet.delete(e)}}completePaginatedQuerySplit(e,t,n,r){let i=e.pageKeyToQuery.get(t);e.pageKeyToQuery.delete(t);let a=e.pageKeys.indexOf(t);e.pageKeys.splice(a,1,n,r),e.ongoingSplits.delete(t),i.unsubscribe()}activePageQueryTokens(e){return e.pageKeys.map(t=>e.pageKeyToQuery.get(t).queryToken)}allQueryTokens(e){return Array.from(e.pageKeyToQuery.values()).map(e=>e.queryToken)}queryTokenForLastPageOfPaginatedQuery(e){let t=this.mustGetPaginatedQuery(e),n=t.pageKeys[t.pageKeys.length-1];if(n===void 0)throw Error(`No pages for paginated query ${e}`);return t.pageKeyToQuery.get(n).queryToken}mustGetPaginatedQuery(e){let t=this.paginatedQuerySet.get(e);if(!t)throw Error(`paginated query no longer exists for token `+e);return t}},Ln=Object.defineProperty,Rn=(e,t,n)=>t in e?Ln(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,zn=(e,t,n)=>Rn(e,typeof t==`symbol`?t:t+``,n),Bn=void 0,Vn=class{constructor(e,t){if(zn(this,`address`),zn(this,`auth`),zn(this,`adminAuth`),zn(this,`encodedTsPromise`),zn(this,`debug`),zn(this,`fetchOptions`),zn(this,`fetch`),zn(this,`logger`),zn(this,`mutationQueue`,[]),zn(this,`isProcessingQueue`,!1),typeof t==`boolean`)throw Error("skipConvexDeploymentUrlCheck as the second argument is no longer supported. Please pass an options object, `{ skipConvexDeploymentUrlCheck: true }`.");(t??{}).skipConvexDeploymentUrlCheck!==!0&&A(e),this.logger=t?.logger===!1?at({verbose:!1}):t?.logger!==!0&&t?.logger?t.logger:it({verbose:!1}),this.address=e,this.debug=!0,this.auth=void 0,this.adminAuth=void 0,this.fetch=t?.fetch,t?.auth&&this.setAuth(t.auth)}backendUrl(){return`${this.address}/api`}get url(){return this.address}setAuth(e){this.clearAuth(),this.auth=e}setAdminAuth(e,t){if(this.clearAuth(),t!==void 0){let n=new TextEncoder().encode(JSON.stringify(t)),r=btoa(String.fromCodePoint(...n));this.adminAuth=`${e}:${r}`}else this.adminAuth=e}clearAuth(){this.auth=void 0,this.adminAuth=void 0}setDebug(e){this.debug=e}setFetchOptions(e){this.fetchOptions=e}async consistentQuery(e,...t){let n=k(t[0]),r=this.getTimestamp();return await this.queryInner(e,n,{timestampPromise:r})}async getTimestamp(){return this.encodedTsPromise?this.encodedTsPromise:this.encodedTsPromise=this.getTimestampInner()}async getTimestampInner(){let e=this.fetch||Bn||fetch,t={"Content-Type":`application/json`,"Convex-Client":`npm-${Ze}`},n=await e(`${this.address}/api/query_ts`,{...this.fetchOptions,method:`POST`,headers:t});if(!n.ok)throw Error(await n.text());let{ts:r}=await n.json();return r}async query(e,...t){let n=k(t[0]);return await this.queryInner(e,n,{})}async queryInner(e,t,n){let r=Et(e),i=[Ce(t)],a={"Content-Type":`application/json`,"Convex-Client":`npm-${Ze}`};this.adminAuth?a.Authorization=`Convex ${this.adminAuth}`:this.auth&&(a.Authorization=`Bearer ${this.auth}`);let o=this.fetch||Bn||fetch,s=n.timestampPromise?await n.timestampPromise:void 0,c=JSON.stringify({path:r,format:`convex_encoded_json`,args:i,...s?{ts:s}:{}}),l=await o(s?`${this.address}/api/query_at_ts`:`${this.address}/api/query`,{...this.fetchOptions,body:c,method:`POST`,headers:a});if(!l.ok&&l.status!==560)throw Error(await l.text());let u=await l.json();if(this.debug)for(let e of u.logLines??[])ot(this.logger,`info`,`query`,r,e);switch(u.status){case`success`:return _e(u.value);case`error`:throw u.errorData===void 0?Error(u.errorMessage):Hn(u.errorData,new Xe(u.errorMessage));default:throw Error(`Invalid response: ${JSON.stringify(u)}`)}}async mutationInner(e,t){let n=Et(e),r=JSON.stringify({path:n,format:`convex_encoded_json`,args:[Ce(t)]}),i={"Content-Type":`application/json`,"Convex-Client":`npm-${Ze}`};this.adminAuth?i.Authorization=`Convex ${this.adminAuth}`:this.auth&&(i.Authorization=`Bearer ${this.auth}`);let a=await(this.fetch||Bn||fetch)(`${this.address}/api/mutation`,{...this.fetchOptions,body:r,method:`POST`,headers:i});if(!a.ok&&a.status!==560)throw Error(await a.text());let o=await a.json();if(this.debug)for(let e of o.logLines??[])ot(this.logger,`info`,`mutation`,n,e);switch(o.status){case`success`:return _e(o.value);case`error`:throw o.errorData===void 0?Error(o.errorMessage):Hn(o.errorData,new Xe(o.errorMessage));default:throw Error(`Invalid response: ${JSON.stringify(o)}`)}}async processMutationQueue(){if(!this.isProcessingQueue){for(this.isProcessingQueue=!0;this.mutationQueue.length>0;){let{mutation:e,args:t,resolve:n,reject:r}=this.mutationQueue.shift();try{n(await this.mutationInner(e,t))}catch(e){r(e)}}this.isProcessingQueue=!1}}enqueueMutation(e,t){return new Promise((n,r)=>{this.mutationQueue.push({mutation:e,args:t,resolve:n,reject:r}),this.processMutationQueue()})}async mutation(e,...t){let[n,r]=t,i=k(n);return r?.skipQueue?await this.mutationInner(e,i):await this.enqueueMutation(e,i)}async action(e,...t){let n=k(t[0]),r=Et(e),i=JSON.stringify({path:r,format:`convex_encoded_json`,args:[Ce(n)]}),a={"Content-Type":`application/json`,"Convex-Client":`npm-${Ze}`};this.adminAuth?a.Authorization=`Convex ${this.adminAuth}`:this.auth&&(a.Authorization=`Bearer ${this.auth}`);let o=await(this.fetch||Bn||fetch)(`${this.address}/api/action`,{...this.fetchOptions,body:i,method:`POST`,headers:a});if(!o.ok&&o.status!==560)throw Error(await o.text());let s=await o.json();if(this.debug)for(let e of s.logLines??[])ot(this.logger,`info`,`action`,r,e);switch(s.status){case`success`:return _e(s.value);case`error`:throw s.errorData===void 0?Error(s.errorMessage):Hn(s.errorData,new Xe(s.errorMessage));default:throw Error(`Invalid response: ${JSON.stringify(s)}`)}}async function(e,t,...n){let r=k(n[0]),i=typeof e==`string`?e:Et(e),a=JSON.stringify({componentPath:t,path:i,format:`convex_encoded_json`,args:Ce(r)}),o={"Content-Type":`application/json`,"Convex-Client":`npm-${Ze}`};this.adminAuth?o.Authorization=`Convex ${this.adminAuth}`:this.auth&&(o.Authorization=`Bearer ${this.auth}`);let s=await(this.fetch||Bn||fetch)(`${this.address}/api/function`,{...this.fetchOptions,body:a,method:`POST`,headers:o});if(!s.ok&&s.status!==560)throw Error(await s.text());let c=await s.json();if(this.debug)for(let e of c.logLines??[])ot(this.logger,`info`,`any`,i,e);switch(c.status){case`success`:return _e(c.value);case`error`:throw c.errorData===void 0?Error(c.errorMessage):Hn(c.errorData,new Xe(c.errorMessage));default:throw Error(`Invalid response: ${JSON.stringify(c)}`)}}};function Hn(e,t){return t.data=_e(e),t}var M=u(f(),1);function Un({getCurrentValue:e,subscribe:t}){let[n,r]=(0,M.useState)(()=>({getCurrentValue:e,subscribe:t,value:e()})),i=n.value;return(n.getCurrentValue!==e||n.subscribe!==t)&&(i=e(),r({getCurrentValue:e,subscribe:t,value:i})),(0,M.useEffect)(()=>{let n=!1,i=()=>{n||r(n=>{if(n.getCurrentValue!==e||n.subscribe!==t)return n;let r=e();return n.value===r?n:{...n,value:r}})},a=t(i);return i(),()=>{n=!0,a()}},[e,t]),i}var Wn=Object.defineProperty,Gn=(e,t,n)=>t in e?Wn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Kn=(e,t,n)=>Gn(e,typeof t==`symbol`?t:t+``,n),qn=5e3;if(M.default===void 0)throw Error(`Required dependency 'react' not found`);function Jn(e,t,n){function r(r){return tr(r),t.mutation(e,r,{optimisticUpdate:n})}return r.withOptimisticUpdate=function(r){if(n!==void 0)throw Error(`Already specified optimistic update for mutation ${Et(e)}`);return Jn(e,t,r)},r}function Yn(e,t){return function(n){return t.action(e,n)}}var Xn=class{constructor(e,t){if(Kn(this,`address`),Kn(this,`cachedSync`),Kn(this,`cachedPaginatedQueryClient`),Kn(this,`listeners`),Kn(this,`options`),Kn(this,`closed`,!1),Kn(this,`_logger`),Kn(this,`adminAuth`),Kn(this,`fakeUserIdentity`),e===void 0)throw Error(`No address provided to ConvexReactClient.
|
|
11
|
+
If trying to deploy to production, make sure to follow all the instructions found at https://docs.convex.dev/production/hosting/
|
|
12
|
+
If running locally, make sure to run \`convex dev\` and ensure the .env.local file is populated.`);if(typeof e!=`string`)throw Error(`ConvexReactClient requires a URL like 'https://happy-otter-123.convex.cloud', received something of type ${typeof e} instead.`);if(!e.includes(`://`))throw Error(`Provided address was not an absolute URL.`);this.address=e,this.listeners=new Map,this._logger=t?.logger===!1?at({verbose:t?.verbose??!1}):t?.logger!==!0&&t?.logger?t.logger:it({verbose:t?.verbose??!1}),this.options={...t,logger:this._logger}}get url(){return this.address}get sync(){if(this.closed)throw Error(`ConvexReactClient has already been closed.`);return this.cachedSync?this.cachedSync:(this.cachedSync=new jn(this.address,()=>{},this.options),this.adminAuth&&this.cachedSync.setAdminAuth(this.adminAuth,this.fakeUserIdentity),this.cachedPaginatedQueryClient=new In(this.cachedSync,e=>this.handleTransition(e)),this.cachedSync)}get paginatedQueryClient(){if(this.sync,this.cachedPaginatedQueryClient)return this.cachedPaginatedQueryClient;throw Error(`Should already be instantiated`)}setAuth(e,t,n){if(typeof e==`string`)throw Error(`Passing a string to ConvexReactClient.setAuth is no longer supported, please upgrade to passing in an async function to handle reauthentication.`);this.sync.setAuth(e,t??(()=>{}),n)}clearAuth(){this.sync.clearAuth()}setAdminAuth(e,t){if(this.adminAuth=e,this.fakeUserIdentity=t,this.closed)throw Error(`ConvexReactClient has already been closed.`);this.cachedSync&&this.sync.setAdminAuth(e,t)}watchQuery(e,...t){let[n,r]=t,i=Et(e);return{onUpdate:e=>{let{queryToken:t,unsubscribe:a}=this.sync.subscribe(i,n,r),o=this.listeners.get(t);return o===void 0?this.listeners.set(t,new Set([e])):o.add(e),()=>{if(this.closed)return;let n=this.listeners.get(t);n.delete(e),n.size===0&&this.listeners.delete(t),a()}},localQueryResult:()=>{if(this.cachedSync)return this.cachedSync.localQueryResult(i,n)},localQueryLogs:()=>{if(this.cachedSync)return this.cachedSync.localQueryLogs(i,n)},journal:()=>{if(this.cachedSync)return this.cachedSync.queryJournal(i,n)}}}prewarmQuery(e){let t=e.extendSubscriptionFor??qn,n=this.watchQuery(e.query,e.args||{}).onUpdate(()=>{});setTimeout(n,t)}watchPaginatedQuery(e,t,n){let r=Et(e);return{onUpdate:e=>{let{paginatedQueryToken:i,unsubscribe:a}=this.paginatedQueryClient.subscribe(r,t||{},n),o=this.listeners.get(i);return o===void 0?this.listeners.set(i,new Set([e])):o.add(e),()=>{if(this.closed)return;let t=this.listeners.get(i);t.delete(e),t.size===0&&this.listeners.delete(i),a()}},localQueryResult:()=>this.paginatedQueryClient.localQueryResult(r,t,n)}}mutation(e,...t){let[n,r]=t,i=Et(e);return this.sync.mutation(i,n,r)}action(e,...t){let n=Et(e);return this.sync.action(n,...t)}query(e,...t){let n=this.watchQuery(e,...t),r=n.localQueryResult();return r===void 0?new Promise((e,t)=>{let r=n.onUpdate(()=>{r();try{e(n.localQueryResult())}catch(e){t(e)}})}):Promise.resolve(r)}connectionState(){return this.sync.connectionState()}subscribeToConnectionState(e){return this.sync.subscribeToConnectionState(e)}get logger(){return this._logger}async close(){if(this.closed=!0,this.listeners=new Map,this.cachedPaginatedQueryClient&&=void 0,this.cachedSync){let e=this.cachedSync;this.cachedSync=void 0,await e.close()}}handleTransition(e){let t=e.queries.map(e=>e.token),n=e.paginatedQueries.map(e=>e.token);this.transition([...t,...n])}transition(e){for(let t of e){let e=this.listeners.get(t);if(e)for(let t of e)t()}}},Zn=M.createContext(void 0);function Qn(){return(0,M.useContext)(Zn)}var $n=({client:e,children:t})=>M.createElement(Zn.Provider,{value:e},t);function N(e,...t){let n=t[0]===`skip`,r=t[0]===`skip`?{}:k(t[0]),i=typeof e==`string`?Dt(e):e,a=Et(i),o=or((0,M.useMemo)(()=>n?{}:{query:{query:i,args:r}},[JSON.stringify(Ce(r)),a,n])).query;if(o instanceof Error)throw o;return o}function P(e){let t=typeof e==`string`?Dt(e):e,n=(0,M.useContext)(Zn);if(n===void 0)throw Error("Could not find Convex client! `useMutation` must be used in the React component tree under `ConvexProvider`. Did you forget it? See https://docs.convex.dev/quick-start#set-up-convex-in-your-react-app");return(0,M.useMemo)(()=>Jn(t,n),[n,Et(t)])}function er(e){let t=(0,M.useContext)(Zn),n=typeof e==`string`?Dt(e):e;if(t===void 0)throw Error("Could not find Convex client! `useAction` must be used in the React component tree under `ConvexProvider`. Did you forget it? See https://docs.convex.dev/quick-start#set-up-convex-in-your-react-app");return(0,M.useMemo)(()=>Yn(n,t),[t,Et(n)])}function tr(e){if(typeof e==`object`&&e&&`bubbles`in e&&`persist`in e&&`isDefaultPrevented`in e)throw Error("Convex function called with SyntheticEvent object. Did you use a Convex function as an event handler directly? Event handlers like onClick receive an event object as their first argument. These SyntheticEvent objects are not valid Convex values. Try wrapping the function like `const handler = () => myMutation();` and using `handler` in the event handler.")}var nr=Object.defineProperty,rr=(e,t,n)=>t in e?nr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ir=(e,t,n)=>rr(e,typeof t==`symbol`?t:t+``,n),ar=class{constructor(e){ir(this,`createWatch`),ir(this,`queries`),ir(this,`listeners`),this.createWatch=e,this.queries={},this.listeners=new Set}setQueries(e){for(let t of Object.keys(e)){let{query:n,args:r,paginationOptions:i}=e[t];if(Et(n),this.queries[t]===void 0)this.addQuery(t,n,r,i?{paginationOptions:i}:{});else{let e=this.queries[t];(Et(n)!==Et(e.query)||JSON.stringify(Ce(r))!==JSON.stringify(Ce(e.args))||JSON.stringify(i)!==JSON.stringify(e.paginationOptions))&&(this.removeQuery(t),this.addQuery(t,n,r,i?{paginationOptions:i}:{}))}}for(let t of Object.keys(this.queries))e[t]===void 0&&this.removeQuery(t)}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}getLocalResults(e){let t={};for(let n of Object.keys(e)){let{query:r,args:i}=e[n],a=e[n].paginationOptions;Et(r);let o=this.createWatch(r,i,a?{paginationOptions:a}:{}),s;try{s=o.localQueryResult()}catch(e){if(e instanceof Error)s=e;else throw e}t[n]=s}return t}setCreateWatch(e){this.createWatch=e;for(let e of Object.keys(this.queries)){let{query:t,args:n,watch:r,paginationOptions:i}=this.queries[e],a=`journal`in r?r.journal():void 0;this.removeQuery(e),this.addQuery(e,t,n,{...a?{journal:a}:[],...i?{paginationOptions:i}:{}})}}destroy(){for(let e of Object.keys(this.queries))this.removeQuery(e);this.listeners=new Set}addQuery(e,t,n,{paginationOptions:r,journal:i}){if(this.queries[e]!==void 0)throw Error(`Tried to add a new query with identifier ${e} when it already exists.`);let a=this.createWatch(t,n,{...i?{journal:i}:[],...r?{paginationOptions:r}:{}}),o=a.onUpdate(()=>this.notifyListeners());this.queries[e]={query:t,args:n,watch:a,unsubscribe:o,...r?{paginationOptions:r}:{}}}removeQuery(e){let t=this.queries[e];if(t===void 0)throw Error(`No query found with identifier ${e}.`);t.unsubscribe(),delete this.queries[e]}notifyListeners(){for(let e of this.listeners)e()}};function or(e){let t=Qn();if(t===void 0)throw Error("Could not find Convex client! `useQuery` must be used in the React component tree under `ConvexProvider`. Did you forget it? See https://docs.convex.dev/quick-start#set-up-convex-in-your-react-app");return sr(e,(0,M.useMemo)(()=>(e,n,{journal:r,paginationOptions:i})=>i?t.watchPaginatedQuery(e,n,i):t.watchQuery(e,n,r?{journal:r}:{}),[t]))}function sr(e,t){let[n]=(0,M.useState)(()=>new ar(t));return n.createWatch!==t&&n.setCreateWatch(t),(0,M.useEffect)(()=>()=>n.destroy(),[n]),Un((0,M.useMemo)(()=>({getCurrentValue:()=>n.getLocalResults(e),subscribe:t=>(n.setQueries(e),n.subscribe(t))}),[n,e]))}var cr=(0,M.createContext)(void 0);function lr(){let e=(0,M.useContext)(cr);if(e===void 0)throw Error("Could not find `ConvexProviderWithAuth` (or `ConvexProviderWithClerk` or `ConvexProviderWithAuth0`) as an ancestor component. This component may be missing, or you might have two instances of the `convex/react` module loaded in your project.");return e}function ur({children:e,client:t,useAuth:n}){let{isLoading:r,isAuthenticated:i,fetchAccessToken:a}=n(),[o,s]=(0,M.useState)(null),[c,l]=(0,M.useState)(!1);r&&o!==null&&(s(null),l(!1)),!r&&!i&&o!==!1&&(s(!1),l(!1));let u=i&&(o??!1);return M.createElement(cr.Provider,{value:{isLoading:o===null,isAuthenticated:u,isRefreshing:c&&u}},M.createElement(dr,{authProviderAuthenticated:i,fetchAccessToken:a,authProviderLoading:r,client:t,setIsConvexAuthenticated:s,setIsRefreshing:l}),M.createElement($n,{client:t},e),M.createElement(fr,{authProviderAuthenticated:i,fetchAccessToken:a,authProviderLoading:r,client:t,setIsConvexAuthenticated:s,setIsRefreshing:l}))}function dr({authProviderAuthenticated:e,fetchAccessToken:t,authProviderLoading:n,client:r,setIsConvexAuthenticated:i,setIsRefreshing:a}){return(0,M.useEffect)(()=>{let n=!0;if(e)return r.setAuth(t,e=>{n&&i(()=>e)},e=>{n&&a(e)}),()=>{n=!1,i(e=>e?!1:null),a(!1)}},[e,t,n,r,i,a]),null}function fr({authProviderAuthenticated:e,fetchAccessToken:t,authProviderLoading:n,client:r,setIsConvexAuthenticated:i,setIsRefreshing:a}){return(0,M.useEffect)(()=>{if(e)return()=>{r.clearAuth(),i(()=>null),a(!1)}},[e,t,n,r,i,a]),null}function pr({children:e}){let{isLoading:t,isAuthenticated:n}=lr();return t||!n?null:M.createElement(M.Fragment,null,e)}function mr({children:e}){let{isLoading:t,isAuthenticated:n}=lr();return t||n?null:M.createElement(M.Fragment,null,e)}function hr({children:e}){let{isLoading:t}=lr();return t?M.createElement(M.Fragment,null,e):null}var gr=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})),_r=o(((e,t)=>{t.exports=gr()})),vr=u(v(),1),F=_r(),yr=(0,M.createContext)(void 0),br=(0,M.createContext)(void 0);function xr(){return(0,M.useContext)(br)}var Sr=(0,M.createContext)(null),Cr=`__convexAuthOAuthVerifier`,wr=`__convexAuthJWT`,Tr=`__convexAuthRefreshToken`,Er=`__convexAuthServerStateFetchTime`;function Dr({client:e,serverState:t,onChange:n,storage:r,storageNamespace:i,replaceURL:a,children:o}){let s=(0,M.useRef)(t?._state.token??null),[c,l]=(0,M.useState)(s.current===null),[u,d]=(0,M.useState)(s.current),f=e.verbose??!1,p=(0,M.useCallback)(e=>{f&&console.debug(`${new Date().toISOString()} ${e}`)},[f]),{storageSet:m,storageGet:h,storageRemove:g,storageKey:_}=Or(r,i),[v,y]=(0,M.useState)(!1),b=(0,M.useCallback)(async e=>{let t=s.current!==null,r;if(e.tokens===null)s.current=null,e.shouldStore&&(await g(wr),await g(Tr)),r=null;else{let{token:t}=e.tokens;if(s.current=t,e.shouldStore){let{refreshToken:n}=e.tokens;await m(wr,t),await m(Tr,n)}r=t}t!==(r!==null)&&await n?.(),d(r),l(!1)},[m,g]);(0,M.useEffect)(()=>{let e=async e=>{if(v)return e.preventDefault(),e.returnValue=!0,`Are you sure you want to leave? Your changes may not be saved.`};return Fr(`beforeunload`,e),()=>{Ir(`beforeunload`,e)}}),(0,M.useEffect)(()=>{let e=e=>{(async()=>{if(e.storageArea===r&&e.key===_(wr)){let t=e.newValue;p(`synced access token, is null: ${t===null}`),await b({shouldStore:!1,tokens:t===null?null:{token:t}})}})()};return Fr(`storage`,e),()=>Ir(`storage`,e)},[b]);let x=(0,M.useCallback)(async t=>{let{tokens:n}=await e.unauthenticatedCall(`auth:signIn`,`code`in t?{params:{code:t.code},verifier:t.verifier}:t);return p(`retrieved tokens, is null: ${n===null}`),await b({shouldStore:!0,tokens:n??null}),n!==null},[e,b]),S=(0,M.useCallback)(async(t,n)=>{let r=n instanceof FormData?Array.from(n.entries()).reduce((e,[t,n])=>(e[t]=n,e),{}):n??{},i=await h(Cr)??void 0;await g(Cr);let a=await e.authenticatedCall(`auth:signIn`,{provider:t,params:r,verifier:i});if(a.redirect!==void 0){let e=new URL(a.redirect);return await m(Cr,a.verifier),window.location!==void 0&&(window.location.href=e.toString()),{signingIn:!1,redirect:e}}else if(a.tokens!==void 0){let{tokens:e}=a;return p(`signed in and got tokens, is null: ${e===null}`),await b({shouldStore:!0,tokens:e}),{signingIn:a.tokens!==null}}return{signingIn:!1}},[e,b,h]),C=(0,M.useCallback)(async()=>{try{await e.authenticatedCall(`auth:signOut`)}catch{}p(`signed out, erasing tokens`),await b({shouldStore:!0,tokens:null})},[b,e]),w=(0,M.useCallback)(async({forceRefreshToken:e})=>{if(e){let e=s.current;return await Ar(Tr,async()=>{let t=s.current;if(t!==e)return p(`returning synced token, is null: ${t===null}`),t;let n=await h(Tr)??null;return n===null?(y(!1),p(`returning null, there is no refresh token`),null):(y(!0),await x({refreshToken:n}).finally(()=>{y(!1)}),p(`returning retrieved token, is null: ${t===null}`),s.current)})}return s.current},[x,C,h]),T=(0,M.useRef)(!1);(0,M.useEffect)(()=>{if(r===void 0)throw Error("`localStorage` is not available in this environment, set the `storage` prop on `ConvexAuthProvider`!");let e=async()=>{let e=await h(wr)??null;p(`retrieved token from storage, is null: ${e===null}`),await b({shouldStore:!1,tokens:e===null?null:{token:e}})};if(t!==void 0){let n=h(Er),r=n=>{if(!n||t._timeFetched>+n){let{token:e,refreshToken:n}=t._state,r=e===null||n===null?null:{token:e,refreshToken:n};m(Er,t._timeFetched.toString()),b({tokens:r,shouldStore:!0})}else e()};n instanceof Promise?n.then(r):r(n);return}let n=window?.location===void 0?null:new URLSearchParams(window.location.search).get(`code`);if(T.current||n){if(n&&!T.current){T.current=!0;let e=new URL(window.location.href);e.searchParams.delete(`code`),(async()=>{await a(e.pathname+e.search+e.hash),await S(void 0,{code:n}),T.current=!1})()}}else e()},[e,h]);let E=(0,M.useMemo)(()=>({signIn:S,signOut:C}),[S,C]),D=u!==null,O=(0,M.useMemo)(()=>({isLoading:c,isAuthenticated:D,fetchAccessToken:w}),[w,c,D]);return(0,F.jsx)(br.Provider,{value:O,children:(0,F.jsx)(yr.Provider,{value:E,children:(0,F.jsx)(Sr.Provider,{value:u,children:o})})})}function Or(e,t){let n=kr(),r=(0,M.useMemo)(()=>e??n(),[e]),i=t.replace(/[^a-zA-Z0-9]/g,``),a=(0,M.useCallback)(e=>`${e}_${i}`,[t]);return{storageSet:(0,M.useCallback)((e,t)=>r.setItem(a(e),t),[r,a]),storageGet:(0,M.useCallback)(e=>r.getItem(a(e)),[r,a]),storageRemove:(0,M.useCallback)(e=>r.removeItem(a(e)),[r,a]),storageKey:a}}function kr(){let[e,t]=(0,M.useState)({});return()=>({getItem:t=>e[t],setItem:(e,n)=>{t(t=>({...t,[e]:n}))},removeItem:e=>{t(t=>{let{[e]:n,...r}=t;return r})}})}async function Ar(e,t){let n=window?.navigator?.locks;return n===void 0?await Pr(e,t):await n.request(e,t)}function jr(e){globalThis.__convexAuthMutexes===void 0&&(globalThis.__convexAuthMutexes={});let t=globalThis.__convexAuthMutexes[e];return t===void 0&&(globalThis.__convexAuthMutexes[e]={currentlyRunning:null,waiting:[]}),t=globalThis.__convexAuthMutexes[e],t}function Mr(e,t){globalThis.__convexAuthMutexes[e]=t}async function Nr(e,t){let n=jr(e);n.currentlyRunning===null?Mr(e,{currentlyRunning:t().finally(()=>{let t=jr(e).waiting.shift();jr(e).currentlyRunning=null,Mr(e,{...jr(e),currentlyRunning:t===void 0?null:Nr(e,t)})}),waiting:[]}):Mr(e,{...n,waiting:[...n.waiting,t]})}async function Pr(e,t){return new Promise((n,r)=>{Nr(e,()=>t().then(e=>n(e)).catch(e=>r(e)))})}function Fr(e,t,n){window.addEventListener?.(e,t,n)}function Ir(e,t,n){window.removeEventListener?.(e,t,n)}function Lr(){return(0,M.useContext)(yr)}function Rr(e){let{client:t,storage:n,storageNamespace:r,replaceURL:i,children:a}=e;return(0,F.jsx)(Dr,{client:(0,M.useMemo)(()=>({authenticatedCall(e,n){return t.action(e,n)},unauthenticatedCall(e,n){return new Vn(t.address).action(e,n)},verbose:t.options?.verbose}),[t]),storage:n??(typeof window>`u`?void 0:window?.localStorage),storageNamespace:r??t.address,replaceURL:i??(e=>{window.history.replaceState({},``,e)}),children:(0,F.jsx)(ur,{client:t,useAuth:xr,children:a})})}var zr=typeof window<`u`?M.useLayoutEffect:M.useEffect;function Br(e){let t=M.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function Vr(e,t,n={},r={}){M.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!=`function`)return;let i=new IntersectionObserver(([e])=>{t(e)},n);return i.observe(e.current),()=>{i.disconnect()}},[t,n,r.disabled,e])}function Hr(e){let t=M.useRef(null);return M.useImperativeHandle(e,()=>t.current,[]),t}function Ur(e){return e[e.length-1]}function Wr(e){return typeof e==`function`}function Gr(e,t){return Wr(e)?e(t):e}var Kr=Object.prototype.hasOwnProperty,qr=Object.prototype.propertyIsEnumerable;function Jr(e){for(let t in e)if(Kr.call(e,t))return!0;return!1}var Yr=()=>Object.create(null),Xr=(e,t)=>Zr(e,t,Yr);function Zr(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;let i=t,a=ti(e)&&ti(i);if(!a&&!($r(e)&&$r(i)))return i;let o=a?e:Qr(e);if(!o)return i;let s=a?i:Qr(i);if(!s)return i;let c=o.length,l=s.length,u=a?Array(l):n(),d=0;for(let t=0;t<l;t++){let o=a?t:s[t],l=e[o],f=i[o];if(l===f){u[o]=l,(a?t<c:Kr.call(e,o))&&d++;continue}if(l===null||f===null||typeof l!=`object`||typeof f!=`object`){u[o]=f;continue}let p=Zr(l,f,n,r+1);u[o]=p,p===l&&d++}return c===l&&d===c?e:u}function Qr(e){let t=Object.getOwnPropertyNames(e);for(let n of t)if(!qr.call(e,n))return!1;let n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;let r=t;for(let t of n){if(!qr.call(e,t))return!1;r.push(t)}return r}function $r(e){if(!ei(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!ei(n)||!n.hasOwnProperty(`isPrototypeOf`))}function ei(e){return Object.prototype.toString.call(e)===`[object Object]`}function ti(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ni(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r++)if(!ni(e[r],t[r],n))return!1;return!0}if($r(e)&&$r(t)){let r=n?.ignoreUndefined??!0;if(n?.partial){for(let i in t)if((!r||t[i]!==void 0)&&!ni(e[i],t[i],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(let t in e)e[t]!==void 0&&i++;let a=0;for(let o in t)if((!r||t[o]!==void 0)&&(a++,a>i||!ni(e[o],t[o],n)))return!1;return i===a}return!1}function ri(e){let t,n,r=new Promise((e,r)=>{t=e,n=r});return r.status=`pending`,r.resolve=n=>{r.status=`resolved`,r.value=n,t(n),e?.(n)},r.reject=e=>{r.status=`rejected`,n(e)},r}function ii(e){return!!(e&&typeof e==`object`&&typeof e.then==`function`)}function ai(e){return e.replace(/[\x00-\x1f\x7f]/g,``)}function oi(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return ai(t)}var si=[`http:`,`https:`,`mailto:`,`tel:`];function ci(e,t){if(!e)return!1;try{let n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function li(e){if(!e||!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith(`//`))return{path:e,handledProtocolRelativeURL:!1};let t=/%25|%5C/gi,n=0,r=``,i;for(;(i=t.exec(e))!==null;)r+=oi(e.slice(n,i.index))+i[0],n=t.lastIndex;r+=oi(n?e.slice(n):e);let a=!1;return r.startsWith(`//`)&&(a=!0,r=`/`+r.replace(/^\/+/,``)),{path:r,handledProtocolRelativeURL:a}}function ui(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function di(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function fi(){throw Error(`Invariant failed`)}function pi(e){let t=new Map,n,r,i=e=>{e.next&&(e.prev?(e.prev.next=e.next,e.next.prev=e.prev,e.next=void 0,r&&(r.next=e,e.prev=r)):(e.next.prev=void 0,n=e.next,e.next=void 0,r&&(e.prev=r,r.next=e)),r=e)};return{get(e){let n=t.get(e);if(n)return i(n),n.value},set(a,o){if(t.size>=e&&n){let e=n;t.delete(e.key),e.next&&(n=e.next,e.next.prev=void 0),e===r&&(r=void 0)}let s=t.get(a);if(s)s.value=o,i(s);else{let e={key:a,value:o,prev:r};r&&(r.next=e),r=e,n||=e,t.set(a,e)}},clear(){t.clear(),n=void 0,r=void 0}}}var mi=4,hi=5;function gi(e){let t=e.indexOf(`{`);if(t===-1)return null;let n=e.indexOf(`}`,t);return n===-1||t+1>=e.length?null:[t,n]}function _i(e,t,n=new Uint16Array(6)){let r=e.indexOf(`/`,t),i=r===-1?e.length:r,a=e.substring(t,i);if(!a||!a.includes(`$`))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(a===`$`){let r=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=r,n[4]=r,n[5]=r,n}if(a.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;let o=gi(a);if(o){let[r,s]=o,c=a.charCodeAt(r+1);if(c===45){if(r+2<a.length&&a.charCodeAt(r+2)===36){let e=r+3,a=s;if(e<a)return n[0]=3,n[1]=t+r,n[2]=t+e,n[3]=t+a,n[4]=t+s+1,n[5]=i,n}}else if(c===36){let a=r+1,o=r+2;return o===s?(n[0]=2,n[1]=t+r,n[2]=t+a,n[3]=t+o,n[4]=t+s+1,n[5]=e.length,n):(n[0]=1,n[1]=t+r,n[2]=t+o,n[3]=t+s,n[4]=t+s+1,n[5]=i,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function vi(e,t,n,r,i,a,o){o?.(n);let s=r;{let r=n.fullPath??n.from,o=r.length,c=n.options?.caseSensitive??e,l=n.options?.params?.parse??n.options?.parseParams;for(;s<o;){let e=_i(r,s,t),o,u=s,d=e[5];switch(s=d+1,a++,e[0]){case 0:{let t=r.substring(e[2],e[3]);if(c){let e=i.static?.get(t);if(e)o=e;else{i.static??=new Map;let e=xi(n.fullPath??n.from);e.parent=i,e.depth=a,o=e,i.static.set(t,e)}}else{let e=t.toLowerCase(),r=i.staticInsensitive?.get(e);if(r)o=r;else{i.staticInsensitive??=new Map;let t=xi(n.fullPath??n.from);t.parent=i,t.depth=a,o=t,i.staticInsensitive.set(e,t)}}break}case 1:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),f=c&&!!(t||s),p=t?f?t:t.toLowerCase():void 0,m=s?f?s:s.toLowerCase():void 0,h=!l&&i.dynamic?.find(e=>!e.parse&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=Si(1,n.fullPath??n.from,f,p,m);o=e,e.depth=a,e.parent=i,i.dynamic??=[],i.dynamic.push(e)}break}case 3:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),f=c&&!!(t||s),p=t?f?t:t.toLowerCase():void 0,m=s?f?s:s.toLowerCase():void 0,h=!l&&i.optional?.find(e=>!e.parse&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=Si(3,n.fullPath??n.from,f,p,m);o=e,e.parent=i,e.depth=a,i.optional??=[],i.optional.push(e)}break}case 2:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),l=c&&!!(t||s),f=t?l?t:t.toLowerCase():void 0,p=s?l?s:s.toLowerCase():void 0,m=Si(2,n.fullPath??n.from,l,f,p);o=m,m.parent=i,m.depth=a,i.wildcard??=[],i.wildcard.push(m)}}i=o}if(l&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf(`/`)+1)===95){let e=xi(n.fullPath??n.from);e.kind=hi,e.parent=i,a++,e.depth=a,i.pathless??=[],i.pathless.push(e),i=e}let u=(n.path||!n.children)&&!n.isRoot;if(u&&r.endsWith(`/`)){let e=xi(n.fullPath??n.from);e.kind=mi,e.parent=i,a++,e.depth=a,i.index=e,i=e}i.parse=l??null,i.priority=n.options?.params?.priority??0,u&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(let r of n.children)vi(e,t,r,s,i,a,o)}function yi(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.parse&&t.parse&&(e.priority||t.priority))return t.priority-e.priority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function bi(e){if(e.pathless)for(let t of e.pathless)bi(t);if(e.static)for(let t of e.static.values())bi(t);if(e.staticInsensitive)for(let t of e.staticInsensitive.values())bi(t);if(e.dynamic?.length){e.dynamic.sort(yi);for(let t of e.dynamic)bi(t)}if(e.optional?.length){e.optional.sort(yi);for(let t of e.optional)bi(t)}if(e.wildcard?.length){e.wildcard.sort(yi);for(let t of e.wildcard)bi(t)}}function xi(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0}}function Si(e,t,n,r,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,priority:0,caseSensitive:n,prefix:r,suffix:i}}function Ci(e,t){let n=xi(`/`),r=new Uint16Array(6);for(let t of e)vi(!1,r,t,1,n,0);bi(n),t.masksTree=n,t.flatCache=pi(1e3)}function wi(e,t){e||=`/`;let n=t.flatCache.get(e);if(n)return n;let r=ki(e,t.masksTree);return t.flatCache.set(e,r),r}function Ti(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=xi(`/`),vi(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),ki(r,o,n)}function Ei(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||=`/`;let a;try{a=ki(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=ji(a.route)),t.matchCache.set(r,a),a}function Di(e){return e===`/`?e:e.replace(/\/{1,}$/,``)}function Oi(e,t=!1,n){let r=xi(e.fullPath),i=new Uint16Array(6),a={},o={},s=0;return vi(t,i,e,1,r,0,e=>{if(n?.(e,s),e.id in a&&fi(),a[e.id]=e,s!==0&&e.path){let t=Di(e.fullPath);(!o[t]||e.fullPath.endsWith(`/`))&&(o[t]=e)}s++}),bi(r),{processedTree:{segmentTree:r,singleCache:pi(1e3),matchCache:pi(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:o}}function ki(e,t,n=!1){let r=e.split(`/`),i=Ni(e,r,t,n);if(!i)return null;let[a]=Ai(e,r,i);return{route:i.node.route,rawParams:a}}function Ai(e,t,n){let r=Mi(n.node),i=null,a=Object.create(null),o=n.extract?.part??0,s=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.segment??0;for(;s<r.length;o++,s++,c++,l++){let u=r[s];if(u.kind===mi)break;if(u.kind===hi){l--,o--,c--;continue}let d=t[o],f=c;if(d&&(c+=d.length),u.kind===1){i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0;if(e.charCodeAt(t)===123){let n=u.suffix?.length??0,r=e.substring(t+2,e.length-n-1),i=d.substring(t,d.length-n);a[r]=decodeURIComponent(i)}else{let t=e.substring(1);a[t]=decodeURIComponent(d)}}else if(u.kind===3){if(n.skipped&1<<s){o--,c=f-1;continue}i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0,r=u.suffix?.length??0,p=e.substring(t+3,e.length-r-1),m=u.suffix||u.prefix?d.substring(t,d.length-r):d;m&&(a[p]=decodeURIComponent(m))}else if(u.kind===2){let t=u,n=e.substring(f+(t.prefix?.length??0),e.length-(t.suffix?.length??0)),r=decodeURIComponent(n);a[`*`]=r,a._splat=r;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:s,path:c,segment:l}]}function ji(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function Mi(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function Ni(e,t,n,r){if(e===`/`&&n.index)return{node:n.index,skipped:0};let i=!Ur(t),a=i&&e!==`/`,o=t.length-+!!i,s=[{node:n,index:1,skipped:0,depth:1,statics:0,dynamics:0,optionals:0}],c=null,l=null;for(;s.length;){let n=s.pop(),{node:i,index:u,skipped:d,depth:f,statics:p,dynamics:m,optionals:h}=n,{extract:g,rawParams:_}=n;if(i.kind===2&&i.route&&!Li(l,n))continue;if(i.parse){if(!Ii(e,t,n))continue;_=n.rawParams,g=n.extract}r&&i.route&&i.kind!==mi&&Li(c,n)&&(c=n);let v=u===o;if(v&&(i.route&&(!a||i.kind===mi||i.kind===2)&&Li(l,n)&&(l=n),!i.optional&&!i.wildcard&&!i.index&&!i.pathless))continue;let y=v?void 0:t[u],b;if(v&&i.index){let n={node:i.index,index:u,skipped:d,depth:f+1,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_},r=!0;if(i.index.parse&&(Ii(e,t,n)||(r=!1)),r){if(!m&&!h&&!d&&Fi(p,o))return n;Li(l,n)&&(l=n)}}if(i.wildcard)for(let e=i.wildcard.length-1;e>=0;e--){let n=i.wildcard[e],{prefix:r,suffix:a}=n;if(!(r&&(v||!(n.caseSensitive?y:b??=y.toLowerCase()).startsWith(r)))){if(a){if(v)continue;let e=t.slice(u).join(`/`).slice(-a.length);if((n.caseSensitive?e:e.toLowerCase())!==a)continue}s.push({node:n,index:o,skipped:d,depth:f+1,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_})}}if(i.optional){let e=d|1<<f,t=f+1;for(let n=i.optional.length-1;n>=0;n--){let r=i.optional[n];s.push({node:r,index:u,skipped:e,depth:t,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_})}if(!v)for(let e=i.optional.length-1;e>=0;e--){let n=i.optional[e],{prefix:r,suffix:a}=n;if(r||a){let e=n.caseSensitive?y:b??=y.toLowerCase();if(r&&!e.startsWith(r)||a&&!e.endsWith(a))continue}s.push({node:n,index:u+1,skipped:d,depth:t,statics:p,dynamics:m,optionals:h+Pi(o,u),extract:g,rawParams:_})}}if(!v&&i.dynamic&&y)for(let e=i.dynamic.length-1;e>=0;e--){let t=i.dynamic[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?y:b??=y.toLowerCase();if(n&&!e.startsWith(n)||r&&!e.endsWith(r))continue}s.push({node:t,index:u+1,skipped:d,depth:f+1,statics:p,dynamics:m+Pi(o,u),optionals:h,extract:g,rawParams:_})}if(!v&&i.staticInsensitive){let e=i.staticInsensitive.get(b??=y.toLowerCase());e&&s.push({node:e,index:u+1,skipped:d,depth:f+1,statics:p+Pi(o,u),dynamics:m,optionals:h,extract:g,rawParams:_})}if(!v&&i.static){let e=i.static.get(y);e&&s.push({node:e,index:u+1,skipped:d,depth:f+1,statics:p+Pi(o,u),dynamics:m,optionals:h,extract:g,rawParams:_})}if(i.pathless){let e=f+1;for(let t=i.pathless.length-1;t>=0;t--){let n=i.pathless[t];s.push({node:n,index:u,skipped:d,depth:e,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_})}}}if(l)return l;if(r&&c){let n=c.index;for(let e=0;e<c.index;e++)n+=t[e].length;let r=n===e.length?`/`:e.slice(n);return c.rawParams??=Object.create(null),c.rawParams[`**`]=decodeURIComponent(r),c}return null}function Pi(e,t){return 2**(e-t-1)}function Fi(e,t){return e===2**(t-1)-1}function Ii(e,t,n){let r,i;try{[r,i]=Ai(e,t,n)}catch{return null}if(n.rawParams=r,n.extract=i,!n.node.parse)return!0;try{if(n.node.parse(r)===!1)return null}catch{}return!0}function Li(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===mi)>(e.node.kind===mi)||t.node.kind===mi==(e.node.kind===mi)&&t.depth>e.depth))):!0}function Ri(e){return zi(e.filter(e=>e!==void 0).join(`/`))}function zi(e){return e.replace(/\/{2,}/g,`/`)}function Bi(e){return e===`/`?e:e.replace(/^\/{1,}/,``)}function Vi(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/{1,}$/,``):e}function Hi(e){return Vi(Bi(e))}function Ui(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function Wi(e,t,n){return Ui(e,n)===Ui(t,n)}function Gi({base:e,to:t,trailingSlash:n=`never`,cache:r}){let i=t.startsWith(`/`),a=!i&&t===`.`,o;if(r){o=i?t:a?e:e+`\0`+t;let n=r.get(o);if(n)return n}let s;if(a)s=e.split(`/`);else if(i)s=t.split(`/`);else{for(s=e.split(`/`);s.length>1&&Ur(s)===``;)s.pop();let n=t.split(`/`);for(let e=0,t=n.length;e<t;e++){let r=n[e];r===``?e?e===t-1&&s.push(r):s=[r]:r===`..`?s.pop():r===`.`||s.push(r)}}s.length>1&&(Ur(s)===``?n===`never`&&s.pop():n===`always`&&s.push(``));let c=zi(s.join(`/`))||`/`;return o&&r&&r.set(o,c),c}function Ki(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=Array.from(t.keys()).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`),r=new RegExp(n,`g`);return e=>e.replace(r,e=>t.get(e)??e)}function qi(e,t,n){let r=t[e];return typeof r==`string`?e===`_splat`?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split(`/`).map(e=>Yi(e,n)).join(`/`):Yi(r,n):r}function Ji({path:e,params:t,decoder:n,...r}){let i=!1,a=Object.create(null);if(!e||e===`/`)return{interpolatedPath:`/`,usedParams:a,isMissingParams:i};if(!e.includes(`$`))return{interpolatedPath:e,usedParams:a,isMissingParams:i};let o=e.length,s=0,c,l=``;for(;s<o;){let r=s;c=_i(e,r,c);let o=c[5];if(s=o+1,r===o)continue;let u=c[0];if(u===0){l+=`/`+e.substring(r,o);continue}if(u===2){let s=t._splat;a._splat=s,a[`*`]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o);if(!s){i=!0,(u||d)&&(l+=`/`+u+d);continue}let f=qi(`_splat`,t,n);l+=`/`+u+f+d;continue}if(u===1){let s=e.substring(c[2],c[3]);!i&&!(s in t)&&(i=!0),a[s]=t[s];let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=qi(s,t,n)??`undefined`;l+=`/`+u+f+d;continue}if(u===3){let i=e.substring(c[2],c[3]),s=t[i];if(s==null)continue;a[i]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=qi(i,t,n)??``;l+=`/`+u+f+d;continue}}return e.endsWith(`/`)&&(l+=`/`),{usedParams:a,interpolatedPath:l||`/`,isMissingParams:i}}function Yi(e,t){let n=encodeURIComponent(e);return t?.(n)??n}function Xi(e){return e?.isNotFound===!0}function Zi(e,t=String){let n=new URLSearchParams;for(let r in e){let i=e[r];i!==void 0&&n.set(r,t(i))}return n.toString()}function Qi(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function $i(e){let t=new URLSearchParams(e),n=Object.create(null);for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=Qi(r):Array.isArray(t)?t.push(Qi(r)):n[e]=[t,Qi(r)]}return n}var ea=na(JSON.parse),ta=ra(JSON.stringify,JSON.parse);function na(e){return t=>{t[0]===`?`&&(t=t.substring(1));let n=$i(t);for(let t in n){let r=n[t];if(typeof r==`string`)try{n[t]=e(r)}catch{}}return n}}function ra(e,t){let n=typeof t==`function`;function r(r){if(typeof r==`object`&&r)try{return e(r)}catch{}else if(n&&typeof r==`string`)try{return t(r),e(r)}catch{}return r}return e=>{let t=Zi(e,r);return t?`?${t}`:``}}var ia=`__root__`;function aa(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href==`string`)try{new URL(e.href),e.reloadDocument=!0}catch{}let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function oa(e){return e instanceof Response&&!!e.options}var sa=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},ca=e=>e.stores.matchesId.get().some(t=>e.stores.matchStores.get(t)?.get()._forcePending),la=(e,t)=>!!(e.preload&&!e.router.stores.matchStores.has(t)),ua=(e,t,n=!0)=>{let r={...e.router.options.context??{}},i=n?t:t-1;for(let t=0;t<=i;t++){let n=e.matches[t];if(!n)continue;let i=e.router.getMatch(n.id);i&&Object.assign(r,i.__routeContext,i.__beforeLoadContext)}return r},da=(e,t)=>{if(!e.matches.length)return;let n=t.routeId,r=e.matches.findIndex(t=>t.routeId===e.router.routeTree.id),i=r>=0?r:0,a=n?e.matches.findIndex(e=>e.routeId===n):e.firstBadMatchIndex??e.matches.length-1;a<0&&(a=i);for(let t=a;t>=0;t--){let n=e.matches[t];if(e.router.looseRoutesById[n.routeId].options.notFoundComponent)return t}return n?a:i},fa=(e,t,n)=>{if(!(!oa(n)&&!Xi(n)))throw oa(n)&&n.redirectHandled&&!n.options.reloadDocument?n:(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,r=>({...r,status:oa(n)?`redirected`:Xi(n)?`notFound`:r.status===`pending`?`success`:r.status,context:ua(e,t.index),isFetching:!1,error:n})),Xi(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),oa(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n)),n)},pa=(e,t)=>{let n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},ma=(e,t,n)=>{let r=ua(e,n);e.updateMatch(t,e=>({...e,context:r}))},ha=(e,t,n)=>{let{id:r,routeId:i}=e.matches[t],a=e.router.looseRoutesById[i];if(n instanceof Promise)throw n;e.firstBadMatchIndex??=t,fa(e,e.router.getMatch(r),n);try{a.options.onError?.(n)}catch(t){n=t,fa(e,e.router.getMatch(r),n)}e.updateMatch(r,e=>(e._nonReactive.beforeLoadPromise?.resolve(),e._nonReactive.beforeLoadPromise=void 0,e._nonReactive.loadPromise?.resolve(),{...e,error:n,status:`error`,isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!oa(n)&&!Xi(n)&&(e.serialError??=n)},ga=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;let i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!la(e,t)&&(n.options.loader||n.options.beforeLoad||Da(n))&&typeof i==`number`&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){let t=setTimeout(()=>{sa(e)},i);r._nonReactive.pendingTimeout=t}},_a=(e,t,n)=>{let r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;ga(e,t,n,r);let i=()=>{let n=e.router.getMatch(t);n.preload&&(n.status===`redirected`||n.status===`notFound`)&&fa(e,n,n.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},va=(e,t,n,r)=>{let i=e.router.getMatch(t),a=i._nonReactive.loadPromise;i._nonReactive.loadPromise=ri(()=>{a?.resolve(),a=void 0});let{paramsError:o,searchError:s}=i;o&&ha(e,n,o),s&&ha(e,n,s),ga(e,t,r,i);let c=new AbortController,l=!1,u=()=>{l||(l=!0,e.updateMatch(t,e=>({...e,isFetching:`beforeLoad`,fetchCount:e.fetchCount+1,abortController:c})))},d=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,e=>({...e,isFetching:!1}))};if(!r.options.beforeLoad){e.router.batch(()=>{u(),d()});return}i._nonReactive.beforeLoadPromise=ri();let f={...ua(e,n,!1),...i.__routeContext},{search:p,params:m,cause:h}=i,g=la(e,t),_={search:p,abortController:c,params:m,preload:g,context:f,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:g?`preload`:h,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},v=r=>{if(r===void 0){e.router.batch(()=>{u(),d()});return}(oa(r)||Xi(r))&&(u(),ha(e,n,r)),e.router.batch(()=>{u(),e.updateMatch(t,e=>({...e,__beforeLoadContext:r})),d()})},y;try{if(y=r.options.beforeLoad(_),ii(y))return u(),y.catch(t=>{ha(e,n,t)}).then(v)}catch(t){u(),ha(e,n,t)}v(y)},ya=(e,t)=>{let{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],a=()=>s(),o=()=>va(e,n,t,i),s=()=>{if(pa(e,n))return;let t=_a(e,n,i);return ii(t)?t.then(o):o()};return a()},ba=(e,t,n)=>{let r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;let i={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(i),n.options.scripts?.(i),n.options.headers?.(i)]).then(([e,t,n])=>({meta:e?.meta,links:e?.links,headScripts:e?.scripts,headers:n,scripts:t,styles:e?.styles}))},xa=(e,t,n,r,i)=>{let a=t[r-1],{params:o,loaderDeps:s,abortController:c,cause:l}=e.router.getMatch(n),u=ua(e,r),d=la(e,n);return{params:o,deps:s,preload:!!d,parentMatchPromise:a,abortController:c,context:u,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),cause:d?`preload`:l,route:i,...e.router.options.additionalContext}},Sa=async(e,t,n,r,i)=>{try{let a=e.router.getMatch(n);try{Ea(i);let o=i.options.loader,s=typeof o==`function`?o:o?.handler,c=s?.(xa(e,t,n,r,i)),l=!!s&&ii(c);if((l||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||a._nonReactive.minPendingPromise)&&e.updateMatch(n,e=>({...e,isFetching:`loader`})),s){let t=l?await c:c;fa(e,e.router.getMatch(n),t),t!==void 0&&e.updateMatch(n,e=>({...e,loaderData:t}))}i._lazyPromise&&await i._lazyPromise;let u=a._nonReactive.minPendingPromise;u&&await u,i._componentsPromise&&await i._componentsPromise,e.updateMatch(n,t=>({...t,error:void 0,context:ua(e,r),status:`success`,isFetching:!1,updatedAt:Date.now()}))}catch(t){let o=t;if(o?.name===`AbortError`){if(a.abortController.signal.aborted){a._nonReactive.loaderPromise?.resolve(),a._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,t=>({...t,status:t.status===`pending`?`success`:t.status,isFetching:!1,context:ua(e,r)}));return}let s=a._nonReactive.minPendingPromise;s&&await s,Xi(t)&&await i.options.notFoundComponent?.preload?.(),fa(e,e.router.getMatch(n),t);try{i.options.onError?.(t)}catch(t){o=t,fa(e,e.router.getMatch(n),t)}!oa(o)&&!Xi(o)&&await Ea(i,[`errorComponent`]),e.updateMatch(n,t=>({...t,error:o,context:ua(e,r),status:`error`,isFetching:!1}))}}catch(t){let r=e.router.getMatch(n);r&&(r._nonReactive.loaderPromise=void 0),fa(e,r,t)}},Ca=async(e,t,n)=>{async function r(r,a,c,l,d){let f=Date.now()-a.updatedAt,p=r?d.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:d.options.staleTime??e.router.options.defaultStaleTime??0,m=d.options.shouldReload,h=typeof m==`function`?m(xa(e,t,i,n,d)):m,{status:g,invalid:_}=l,v=f>=p&&(!!e.forceStaleReload||l.cause===`enter`||c!==void 0&&c!==l.id);o=g===`success`&&(_||(h??v)),r&&d.options.preload===!1||(o&&!e.sync&&u?(s=!0,(async()=>{try{await Sa(e,t,i,n,d);let r=e.router.getMatch(i);r._nonReactive.loaderPromise?.resolve(),r._nonReactive.loadPromise?.resolve(),r._nonReactive.loaderPromise=void 0,r._nonReactive.loadPromise=void 0}catch(t){oa(t)&&await e.router.navigate(t.options)}})()):g!==`success`||o?await Sa(e,t,i,n,d):ma(e,i,n))}let{id:i,routeId:a}=e.matches[n],o=!1,s=!1,c=e.router.looseRoutesById[a],l=c.options.loader,u=((typeof l==`function`?void 0:l?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!==`blocking`;if(pa(e,i)){if(!e.router.getMatch(i))return e.matches[n];ma(e,i,n)}else{let t=e.router.getMatch(i),o=e.router.stores.matchesId.get()[n],s=(o&&e.router.stores.matchStores.get(o)||null)?.routeId===a?o:e.router.stores.matches.get().find(e=>e.routeId===a)?.id,l=la(e,i);if(t._nonReactive.loaderPromise){if(t.status===`success`&&!e.sync&&!t.preload&&u)return t;await t._nonReactive.loaderPromise;let n=e.router.getMatch(i),a=n._nonReactive.error||n.error;a&&fa(e,n,a),n.status===`pending`&&await r(l,t,s,n,c)}else{let n=l&&!e.router.stores.matchStores.has(i),a=e.router.getMatch(i);a._nonReactive.loaderPromise=ri(),n!==a.preload&&e.updateMatch(i,e=>({...e,preload:n})),await r(l,t,s,a,c)}}let d=e.router.getMatch(i);s||(d._nonReactive.loaderPromise?.resolve(),d._nonReactive.loadPromise?.resolve(),d._nonReactive.loadPromise=void 0),clearTimeout(d._nonReactive.pendingTimeout),d._nonReactive.pendingTimeout=void 0,s||(d._nonReactive.loaderPromise=void 0),d._nonReactive.dehydrated=void 0;let f=s?d.isFetching:!1;return f!==d.isFetching||d.invalid!==!1?(e.updateMatch(i,e=>({...e,isFetching:f,invalid:!1})),e.router.getMatch(i)):d};async function wa(e){let t=e,n=[];ca(t.router)&&sa(t);let r;for(let e=0;e<t.matches.length;e++){try{let n=ya(t,e);ii(n)&&await n}catch(e){if(oa(e))throw e;if(Xi(e))r=e;else if(!t.preload)throw e;break}if(t.serialError||t.firstBadMatchIndex!=null)break}let i=t.firstBadMatchIndex??t.matches.length,a=r&&!t.preload?da(t,r):void 0,o=r&&t.preload?0:a===void 0?i:Math.min(a+1,i),s,c;for(let e=0;e<o;e++)n.push(Ca(t,n,e));try{await Promise.all(n)}catch{let e=await Promise.allSettled(n);for(let t of e){if(t.status!==`rejected`)continue;let e=t.reason;if(oa(e))throw e;Xi(e)?s??=e:c??=e}if(c!==void 0)throw c}let l=s??(r&&!t.preload?r:void 0),u=t.firstBadMatchIndex===void 0?t.matches.length-1:t.firstBadMatchIndex;if(!l&&r&&t.preload)return t.matches;if(l){let e=da(t,l);e===void 0&&fi();let n=t.matches[e],r=t.router.looseRoutesById[n.routeId],i=t.router.options?.defaultNotFoundComponent;!r.options.notFoundComponent&&i&&(r.options.notFoundComponent=i),l.routeId=n.routeId;let a=n.routeId===t.router.routeTree.id;t.updateMatch(n.id,e=>({...e,...a?{status:`success`,globalNotFound:!0,error:void 0}:{status:`notFound`,error:l},isFetching:!1})),u=e,await Ea(r,[`notFoundComponent`])}else if(!t.preload){let e=t.matches[0];e.globalNotFound||t.router.getMatch(e.id)?.globalNotFound&&t.updateMatch(e.id,e=>({...e,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){let e=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await Ea(e,[`errorComponent`])}for(let e=0;e<=u;e++){let{id:n,routeId:r}=t.matches[e],i=t.router.looseRoutesById[r];try{let e=ba(t,n,i);if(e){let r=await e;t.updateMatch(n,e=>({...e,...r}))}}catch(e){console.error(`Error executing head for route ${r}:`,e)}}let d=sa(t);if(ii(d)&&await d,l)throw l;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function Ta(e,t){let n=t.map(t=>e.options[t]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function Ea(e,t=Oa){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);let n=()=>e._componentsLoaded?void 0:t===Oa?(()=>{if(e._componentsPromise===void 0){let t=Ta(e,Oa);t?e._componentsPromise=t.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():Ta(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function Da(e){for(let t of Oa)if(e.options[t]?.preload)return!0;return!1}var Oa=[`component`,`errorComponent`,`pendingComponent`,`notFoundComponent`];function ka(e){return{input:({url:t})=>{for(let n of e)t=ja(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=Ma(e[n],t);return t}}}function Aa(e){let t=Hi(e.basepath),n=`/${t}`,r=e.caseSensitive?n:n.toLowerCase(),i=`${r}/`;return{input:({url:t})=>{let a=e.caseSensitive?t.pathname:t.pathname.toLowerCase();return a===r?t.pathname=`/`:a.startsWith(i)&&(t.pathname=t.pathname.slice(n.length)),t},output:({url:e})=>(e.pathname=Ri([`/`,t,e.pathname]),e)}}function ja(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function Ma(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function Na(e,t){let{createMutableStore:n,createReadonlyStore:r,batch:i,init:a}=t,o=new Map,s=new Map,c=new Map,l=n(e.status),u=n(e.loadedAt),d=n(e.isLoading),f=n(e.isTransitioning),p=n(e.location),m=n(e.resolvedLocation),h=n(e.statusCode),g=n(e.redirect),_=n([]),v=n([]),y=n([]),b=r(()=>Pa(o,_.get())),x=r(()=>Pa(s,v.get())),S=r(()=>Pa(c,y.get())),C=r(()=>_.get()[0]),w=r(()=>_.get().some(e=>o.get(e)?.get().status===`pending`)),T=r(()=>({locationHref:p.get().href,resolvedLocationHref:m.get()?.href,status:l.get()})),E=r(()=>({status:l.get(),loadedAt:u.get(),isLoading:d.get(),isTransitioning:f.get(),matches:b.get(),location:p.get(),resolvedLocation:m.get(),statusCode:h.get(),redirect:g.get()})),D=pi(64);function O(e){let t=D.get(e);return t||(t=r(()=>{let t=_.get();for(let n of t){let t=o.get(n);if(t&&t.routeId===e)return t.get()}}),D.set(e,t)),t}let ee={status:l,loadedAt:u,isLoading:d,isTransitioning:f,location:p,resolvedLocation:m,statusCode:h,redirect:g,matchesId:_,pendingIds:v,cachedIds:y,matches:b,pendingMatches:x,cachedMatches:S,firstId:C,hasPending:w,matchRouteDeps:T,matchStores:o,pendingMatchStores:s,cachedMatchStores:c,__store:E,getRouteMatchStore:O,setMatches:te,setPending:k,setCached:A};te(e.matches),a?.(ee);function te(e){Fa(e,o,_,n,i)}function k(e){Fa(e,s,v,n,i)}function A(e){Fa(e,c,y,n,i)}return ee}function Pa(e,t){let n=[];for(let r of t){let t=e.get(r);t&&n.push(t.get())}return n}function Fa(e,t,n,r,i){let a=e.map(e=>e.id),o=new Set(a);i(()=>{for(let e of t.keys())o.has(e)||t.delete(e);for(let n of e){let e=t.get(n.id);if(!e){let e=r(n);e.routeId=n.routeId,t.set(n.id,e);continue}e.routeId=n.routeId,e.get()!==n&&e.set(n)}di(n.get(),a)||n.set(a)})}var Ia=`__TSR_index`,La=`popstate`,Ra=`beforeunload`;function za(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async({task:n,navigateOpts:r,...i})=>{if(r?.ignoreBlocker??!1){n();return}let a=e.getBlockers?.()??[],o=i.type===`PUSH`||i.type===`REPLACE`;if(typeof document<`u`&&a.length&&o)for(let n of a){let r=Ua(i.path,i.state);if(await n.blockerFn({currentLocation:t,nextLocation:r,action:i.type})){e.onBlocked?.();return}}n()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[Ia];i=Ba(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[Ia];i=Ba(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[Ia]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function Ba(e,t){t||={};let n=Wa();return{...t,key:n,__TSR_key:n,[Ia]:e}}function Va(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=e?.createHref??(e=>e),c=e?.parseLocation??(()=>Ua(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=Wa();t.history.replaceState({[Ia]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_,v=()=>{g&&(C._ignoreSubscribers=!0,(g.isPush?t.history.pushState:t.history.replaceState)(g.state,``,g.href),C._ignoreSubscribers=!1,g=void 0,_=void 0,u=void 0)},y=(e,t,n)=>{let r=s(t);_||(u=l),l=Ua(t,n),g={href:r,state:n,isPush:g?.isPush||e===`push`},_||=Promise.resolve().then(()=>v())},b=e=>{l=c(),C.notify({type:e})},x=async()=>{if(f){f=!1;return}let e=c(),n=e.state[Ia]-l.state[Ia],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let n=a();if(typeof document<`u`&&n.length){for(let r of n)if(await r.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(1),C.notify(u);return}}}l=c(),C.notify(u)},S=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0){t=!0;break}if(typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},C=za({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>y(`push`,e,t),replaceState:(e,t)=>y(`replace`,e,t),back:e=>(e&&(p=!0),m=!0,t.history.back()),forward:e=>{e&&(p=!0),m=!0,t.history.forward()},go:e=>{d=!0,t.history.go(e)},createHref:e=>s(e),flush:v,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(Ra,S,{capture:!0}),t.removeEventListener(La,x)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(Ra,S,{capture:!0}),t.addEventListener(La,x),t.history.pushState=function(...e){let r=n.apply(t.history,e);return C._ignoreSubscribers||b(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return C._ignoreSubscribers||b(`REPLACE`),n},C}function Ha(e){let t=e.replace(/[\x00-\x1f\x7f]/g,``);return t.startsWith(`//`)&&(t=`/`+t.replace(/^\/+/,``)),t}function Ua(e,t){let n=Ha(e),r=n.indexOf(`#`),i=n.indexOf(`?`),a=Wa();return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t||{[Ia]:0,key:a,__TSR_key:a}}}function Wa(){return(Math.random()+1).toString(36).substring(7)}function Ga(e,t){let n=t,r=e;return{fromLocation:n,toLocation:r,pathChanged:n?.pathname!==r.pathname,hrefChanged:n?.href!==r.href,hashChanged:n?.hash!==r.hash}}var Ka=new WeakMap,qa=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.routeBranchCache=new WeakMap,this.startTransition=e=>e(),this.update=e=>{let t=this.options,n=this.basepath??t?.basepath??`/`,r=this.basepath===void 0,i=t?.rewrite;if(this.options={...t,...e},this.isServer=this.options.isServer??typeof document>`u`,this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=Ki(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=Va()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!==`null`?this.origin=window.origin:this.origin=`http://localhost`),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;this.resolvePathCache=pi(1e3),e=this.buildRouteTree(),this.setRoutes(e)}if(!this.stores&&this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=Na(Xa(this.latestLocation),e),_o(this)}let a=!1,o=this.options.basepath??`/`,s=this.options.rewrite;if(r||n!==o||i!==s){this.basepath=o;let e=[],t=Hi(o);t&&t!==`/`&&e.push(Aa({basepath:o})),s&&e.push(s),this.rewrite=e.length===0?void 0:e.length===1?e[0]:ka(e),this.history&&this.updateLatestLocation(),a=!0}a&&this.stores&&this.stores.location.set(this.latestLocation),typeof window<`u`&&`CSS`in window&&typeof window.CSS?.supports==`function`&&(this.isViewTransitionTypesSupported=window.CSS.supports(`selector(:active-view-transition-type(a))`))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=Oi(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});return this.options.routeMasks&&Ci(this.options.routeMasks,e.processedTree),e},this.subscribe=(e,t)=>{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{this.subscribers.forEach(t=>{t.eventType===e.type&&t.fn(e)})},this.parseLocation=(e,t)=>{let n=({pathname:e,search:n,hash:r,href:i,state:a})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let i=this.options.parseSearch(n),o=this.options.stringifySearch(i);return{href:e+o+r,publicHref:e+o+r,pathname:li(e).path,external:!1,searchStr:o,search:Xr(t?.search,i),hash:li(r.slice(1)).path,state:Zr(t?.state,a)}}let o=new URL(i,this.origin),s=ja(this.rewrite,o),c=this.options.parseSearch(s.search),l=this.options.stringifySearch(c);return s.search=l,{href:s.href.replace(s.origin,``),publicHref:i,pathname:li(s.pathname).path,external:!!this.rewrite&&s.origin!==this.origin,searchStr:l,search:Xr(t?.search,c),hash:li(s.hash.slice(1)).path,state:Zr(t?.state,a)}},r=n(e),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i);return e.state.key=r.state.key,e.state.__TSR_key=r.state.__TSR_key,delete e.state.__tempLocation,{...e,maskedLocation:r}}return r},this.resolvePathWithBase=(e,t)=>Gi({base:e,to:t.includes(`//`)?zi(t):t,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>Qa({pathname:e,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=e=>{let t=this.getMatch(e);t&&(t.abortController.abort(),clearTimeout(t._nonReactive.pendingTimeout),t._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingIds.get().forEach(e=>{this.cancelMatch(e)}),this.stores.matchesId.get().forEach(e=>{if(this.stores.pendingMatchStores.has(e))return;let t=this.stores.matchStores.get(e)?.get();t&&(t.status===`pending`||t.isFetching===`loader`)&&this.cancelMatch(e)})},this.buildLocation=e=>{let t=(t={})=>{let n=t._fromLocation||this.pendingBuiltLocation||this.latestLocation,r=this.matchRoutesLightweight(n);t.from;let i=t.unsafeRelative===`path`?n.pathname:t.from??r.fullPath,a=t.to?`${t.to}`:void 0,o=r.search,s=Object.assign(Object.create(null),r.params),c=a?.charCodeAt(0)===47?`/`:this.resolvePathWithBase(i,`.`),l=a?this.resolvePathWithBase(c,a):c,u=t.params===!1||t.params===null?Object.create(null):(t.params??!0)===!0?s:Object.assign(s,Gr(t.params,s)),d=this.routesByPath[Vi(l)],f;if(d)f=this.getRouteBranch(d);else if(l.includes(`$`))f=[];else{let e=this.getMatchedRoutes(l);f=e.matchedRoutes,this.options.notFoundRoute&&(!e.foundRoute||e.foundRoute.path!==`/`&&e.routeParams[`**`])&&(f=[...f,this.options.notFoundRoute])}if(f.length&&Jr(u))for(let e of f){let t=e.options.params?.stringify??e.options.stringifyParams;if(t)try{Object.assign(u,t(u))}catch{}}let p=e.leaveParams?l:li(Ji({path:l,params:u,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path,m=o;if(e._includeValidateSearch&&this.options.search?.strict){let e={};f.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,Za(t.options.validateSearch,{...e,...m}))}catch{}}),m=e}m=$a({search:m,dest:t,destRoutes:f,_includeValidateSearch:e._includeValidateSearch}),m=Xr(o,m);let h=this.options.stringifySearch(m),g=t.hash===!0?n.hash:t.hash?Gr(t.hash,n.hash):void 0,_=g?`#${g}`:``,v=t.state===!0?n.state:t.state?Gr(t.state,n.state):{};v=Zr(n.state,v);let y=`${p}${h}${_}`,b,x,S=!1;if(this.rewrite){let e=new URL(y,this.origin),t=Ma(this.rewrite,e);b=e.href.replace(e.origin,``),t.origin===this.origin?x=t.pathname+t.search+t.hash:(x=t.href,S=!0)}else b=ui(y),x=b;return{publicHref:x,href:b,pathname:p,search:m,searchStr:h,state:v,hash:g??``,external:S,unmaskOnReload:t.unmaskOnReload}},n=(n={},r)=>{let i=t(n),a=r?t(r):void 0;if(!a){let n=Object.create(null);if(this.options.routeMasks){let o=wi(i.pathname,this.processedTree);if(o){Object.assign(n,o.rawParams);let{from:i,params:s,...c}=o.route,l=s===!1||s===null?Object.create(null):(s??!0)===!0?n:Object.assign(n,Gr(s,n));r={from:e.from,...c,params:l},a=t(r)}}}return a&&(i.maskedLocation=a),i};return e.mask?n(e,{from:e.from,...e.mask}):n(e)},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r,i=()=>{let e=[`key`,`__TSR_key`,`__TSR_index`,`__hashScrollIntoViewOptions`];e.forEach(e=>{n.state[e]=this.latestLocation.state[e]});let t=ni(n.state,this.latestLocation.state);return e.forEach(e=>{delete n.state[e]}),t},a=Vi(this.latestLocation.href)===Vi(n.href),o=this.commitLocationPromise;if(this.commitLocationPromise=ri(()=>{o?.resolve(),o=void 0}),a&&i())this.load();else{let{maskedLocation:i,hashScrollIntoView:a,...o}=n;i&&(o={...i,state:{...i.state,__tempKey:void 0,__tempLocation:{...o,search:o.searchStr,state:{...o.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(o.unmaskOnReload??this.options.unmaskOnReload??!1)&&(o.state.__tempKey=this.tempLocationKey)),o.state.__hashScrollIntoViewOptions=a??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,r=n.replace?`REPLACE`:`PUSH`,this.history[r===`REPLACE`?`replace`:`push`](o.publicHref,o.state,{ignoreBlocker:t})}return this._scroll.next=n.resetScroll??!0,this.history.subscribers.size||this.load(r?{action:{type:r}}:void 0),this.commitLocationPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,href:a,...o}={})=>{if(a){let t=this.history.location.state.__TSR_index,n=Ua(a,{__TSR_index:e?t:t+1}),r=new URL(n.pathname,this.origin);o.to=ja(this.rewrite,r).pathname,o.search=this.options.parseSearch(n.search),o.hash=n.hash.slice(1)}let s=this.buildLocation({...o,_includeValidateSearch:!0});this.pendingBuiltLocation=s;let c=this.commitLocation({...s,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return Promise.resolve().then(()=>{this.pendingBuiltLocation===s&&(this.pendingBuiltLocation=void 0)}),c},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=!1;if(n)try{new URL(`${n}`),a=!0}catch{}if(a&&!t&&(t=!0),t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i});n??=t.publicHref,r??=t.publicHref}let t=!a&&r?r:n;if(ci(t,this.protocolAllowlist))return Promise.resolve();if(!i.ignoreBlocker){let e=this.history.getBlockers?.()??[];for(let t of e)if(t?.blockerFn&&await t.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:`PUSH`}))return Promise.resolve()}return i.replace?window.location.replace(t):window.location.href=t,Promise.resolve()}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();let e=this.matchRoutes(this.latestLocation),t=this.stores.cachedMatches.get().filter(t=>!e.some(e=>e.id===t.id));this.batch(()=>{this.stores.status.set(`pending`),this.stores.statusCode.set(200),this.stores.isLoading.set(!0),this.stores.location.set(this.latestLocation),this.stores.setPending(e),this.stores.setCached(t)})},this.load=async e=>{let t=e?.action?.type,n,r,i,a=this.stores.resolvedLocation.get()??this.stores.location.get();for(i=new Promise(o=>{this.startTransition(async()=>{try{this.beforeLoad(),t?Ka.set(this.latestLocation,t):Ka.delete(this.latestLocation);let n=this.latestLocation,r=Ga(n,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:`onBeforeNavigate`,...r}),this.emit({type:`onBeforeLoad`,...r}),await wa({router:this,sync:e?.sync,forceStaleReload:a.href===n.href,matches:this.stores.pendingMatches.get(),location:n,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let e=null,t=null,n=null,r=null;this.batch(()=>{let i=this.stores.pendingMatches.get(),a=i.length,o=this.stores.matches.get();e=a?o.filter(e=>!this.stores.pendingMatchStores.has(e.id)):null;let s=new Set;for(let e of this.stores.pendingMatchStores.values())e.routeId&&s.add(e.routeId);let c=new Set;for(let e of this.stores.matchStores.values())e.routeId&&c.add(e.routeId);t=a?o.filter(e=>!s.has(e.routeId)):null,n=a?i.filter(e=>!c.has(e.routeId)):null,r=a?i.filter(e=>c.has(e.routeId)):o,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),a&&(this.stores.setMatches(i),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...e.filter(e=>e.status!==`error`&&e.status!==`notFound`&&e.status!==`redirected`)]),this.clearExpiredCache())});for(let[e,i]of[[t,`onLeave`],[n,`onEnter`],[r,`onStay`]])if(e)for(let t of e)this.looseRoutesById[t.routeId].options[i]?.(t)})})}})}catch(e){oa(e)?(n=e,this.navigate({...n.options,replace:!0,ignoreBlocker:!0})):Xi(e)&&(r=e);let t=n?n.status:r?404:this.stores.matches.get().some(e=>e.status===`error`)?500:200;this.batch(()=>{this.stores.statusCode.set(t),this.stores.redirect.set(n)})}this.latestLoadPromise===i&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),o()})}),this.latestLoadPromise=i,await i;this.latestLoadPromise&&i!==this.latestLoadPromise;)await this.latestLoadPromise;let o;this.hasNotFoundMatch()?o=404:this.stores.matches.get().some(e=>e.status===`error`)&&(o=500),o!==void 0&&this.stores.statusCode.set(o)},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document<`u`&&`startViewTransition`in document&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&this.isViewTransitionTypesSupported){let r=this.latestLocation,i=this.stores.resolvedLocation.get(),a=typeof t.types==`function`?t.types(Ga(r,i)):t.types;if(a===!1){e();return}n={update:e,types:a}}else n=e;document.startViewTransition(n)}else e()},this.updateMatch=(e,t)=>{this.startTransition(()=>{let n=this.stores.pendingMatchStores.get(e);if(n){n.set(t);return}let r=this.stores.matchStores.get(e);if(r){r.set(t);return}let i=this.stores.cachedMatchStores.get(e);if(i){let n=t(i.get());n.status===`redirected`?this.stores.cachedMatchStores.delete(e)&&this.stores.cachedIds.set(t=>t.filter(t=>t!==e)):i.set(n)}})},this.getMatch=e=>this.stores.cachedMatchStores.get(e)?.get()??this.stores.pendingMatchStores.get(e)?.get()??this.stores.matchStores.get(e)?.get(),this.invalidate=e=>{let t=t=>e?.filter?.(t)??!0?{...t,invalid:!0,...e?.forcePending||t.status===`error`||t.status===`notFound`?{status:`pending`,error:void 0}:void 0}:t;return this.batch(()=>{this.stores.setMatches(this.stores.matches.get().map(t)),this.stores.setCached(this.stores.cachedMatches.get().map(t)),this.stores.setPending(this.stores.pendingMatches.get().map(t))}),this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.getParsedLocationHref=e=>e.publicHref||`/`,this.resolveRedirect=e=>{let t=e.headers.get(`Location`);if(!e.options.href||e.options._builtLocation){let t=e.options._builtLocation??this.buildLocation(e.options),n=this.getParsedLocationHref(t);e.options.href=n,e.headers.set(`Location`,n)}else if(t)try{let n=new URL(t);if(this.origin&&n.origin===this.origin){let t=n.pathname+n.search+n.hash;e.options.href=t,e.headers.set(`Location`,t)}}catch{}if(e.options.href&&!e.options._builtLocation&&ci(e.options.href,this.protocolAllowlist))throw Error(`Redirect blocked: unsafe protocol`);return e.headers.get(`Location`)||e.headers.set(`Location`,e.options.href),e},this.clearCache=e=>{let t=e?.filter;t===void 0?this.stores.setCached([]):this.stores.setCached(this.stores.cachedMatches.get().filter(e=>!t(e)))},this.clearExpiredCache=()=>{let e=Date.now();this.clearCache({filter:t=>{let n=this.looseRoutesById[t.routeId];if(!n.options.loader)return!0;let r=(t.preload?n.options.preloadGcTime??this.options.defaultPreloadGcTime:n.options.gcTime??this.options.defaultGcTime)??300*1e3;return t.status===`error`?!0:e-t.updatedAt>=r}})},this.loadRouteChunk=Ea,this.preloadRoute=async e=>{let t=e._builtLocation??this.buildLocation(e),n=this.matchRoutes(t,{throwOnError:!0,preload:!0,dest:e}),r=new Set([...this.stores.matchesId.get(),...this.stores.pendingIds.get()]),i=new Set([...r,...this.stores.cachedIds.get()]),a=n.filter(e=>!i.has(e.id));if(a.length){let e=this.stores.cachedMatches.get();this.stores.setCached([...e,...a])}try{return n=await wa({router:this,matches:n,location:t,preload:!0,updateMatch:(e,t)=>{r.has(e)?n=n.map(n=>n.id===e?t(n):n):this.updateMatch(e,t)}}),n}catch(e){if(oa(e))return e.options.reloadDocument?void 0:await this.preloadRoute({...e.options,_fromLocation:t});Xi(e)||console.error(e);return}},this.matchRoute=(e,t)=>{let n={...e,to:e.to?this.resolvePathWithBase(e.from||``,e.to):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n);if(t?.pending&&this.stores.status.get()!==`pending`)return!1;let i=(t?.pending===void 0?!this.stores.isLoading.get():t.pending)?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),a=Ti(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,i.pathname,this.processedTree);return!a||e.params&&!ni(a.rawParams,e.params,{partial:!0})?!1:t?.includeSearch??!0?ni(i.search,r.search,{partial:!0})?a.rawParams:!1:a.rawParams},this.hasNotFoundMatch=()=>this.stores.matches.get().some(e=>e.status===`notFound`||e.globalNotFound),this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??ta,parseSearch:e.parseSearch??ea,protocolAllowlist:e.protocolAllowlist??si}),typeof document<`u`&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;let r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(e){let t=this.routeBranchCache.get(e);return t||(t=ji(e),this.routeBranchCache.set(e,t)),t}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){let n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:i}=n,{matchedRoutes:a}=n,o=!1;(r?r.path!==`/`&&i[`**`]:Vi(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:o=!0);let s=o?to(this.options.notFoundMode,a):void 0,c=Array(a.length),l=new Map;for(let e of this.stores.matchStores.values())e.routeId&&l.set(e.routeId,e.get());for(let n=0;n<a.length;n++){let r=a[n],o=c[n-1],u,d,f;{let n=o?.search??e.search,i=o?._strictSearch??void 0;try{let e=Za(r.options.validateSearch,{...n})??void 0;u={...n,...e},d={...i,...e},f=void 0}catch(e){let r=e;if(e instanceof Ja||(r=new Ja(e.message,{cause:e})),t?.throwOnError)throw r;u=n,d={},f=r}}let p=r.options.loaderDeps?.({search:u})??``,m=p?JSON.stringify(p):``,{interpolatedPath:h,usedParams:g}=Ji({path:r.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),_=r.id+h+m,v=this.getMatch(_),y=l.get(r.id),b=v?._strictParams??g,x;if(!v)try{no(r,b)}catch(e){if(x=Xi(e)||oa(e)?e:new Ya(e.message,{cause:e}),t?.throwOnError)throw x}Object.assign(i,b);let S=y?`stay`:`enter`,C;if(v)C={...v,cause:S,params:y?.params??i,_strictParams:b,search:Xr(y?y.search:v.search,u),_strictSearch:d};else{let e=r.options.loader||r.options.beforeLoad||r.lazyFn||Da(r)?`pending`:`success`;C={id:_,ssr:r.options.ssr,index:n,routeId:r.id,params:y?.params??i,_strictParams:b,pathname:h,updatedAt:Date.now(),search:y?Xr(y.search,u):u,_strictSearch:d,searchError:void 0,status:e,isFetching:!1,error:void 0,paramsError:x,__routeContext:void 0,_nonReactive:{loadPromise:ri()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:S,loaderDeps:y?Zr(y.loaderDeps,p):p,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:r.options.staticData||{},fullPath:r.fullPath}}t?.preload||(C.globalNotFound=s===r.id),C.searchError=f;let w=this.getParentContext(o);C.context={...w,...C.__routeContext,...C.__beforeLoadContext},c[n]=C}for(let t=0;t<c.length;t++){let n=c[t],r=this.looseRoutesById[n.routeId],a=this.getMatch(n.id),o=l.get(n.routeId);if(n.params=o?Xr(o.params,i):i,!a){let i=c[t-1],a=this.getParentContext(i);if(r.options.context){let t={deps:n.loaderDeps,params:n.params,context:a??{},location:e,navigate:t=>this.navigate({...t,_fromLocation:e}),buildLocation:this.buildLocation,cause:n.cause,abortController:n.abortController,preload:!!n.preload,matches:c,routeId:r.id};n.__routeContext=r.options.context(t)??void 0}n.context={...a,...n.__routeContext,...n.__beforeLoadContext}}}return c}matchRoutesLightweight(e){let{matchedRoutes:t,routeParams:n}=this.getMatchedRoutes(e.pathname),r=Ur(t),i={...e.search};for(let e of t)try{Object.assign(i,Za(e.options.validateSearch,i))}catch{}let a=Ur(this.stores.matchesId.get()),o=a&&this.stores.matchStores.get(a)?.get(),s=o&&o.routeId===r.id&&o.pathname===e.pathname,c;if(s)c=o.params;else{let e=Object.assign(Object.create(null),n);for(let n of t)try{no(n,e)}catch{}c=e}return{matchedRoutes:t,fullPath:r.fullPath,search:i,params:c}}},Ja=class extends Error{},Ya=class extends Error{};function Xa(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:`idle`,resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function Za(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new Ja(`Async validation not supported`);if(n.issues)throw new Ja(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return`parse`in e?e.parse(t):typeof e==`function`?e(t):{}}function Qa({pathname:e,routesById:t,processedTree:n}){let r=Object.create(null),i=Vi(e),a,o=Ei(i,n,!0);return o&&(a=o.route,Object.assign(r,o.rawParams)),{matchedRoutes:o?.branch||[t.__root__],routeParams:r,foundRoute:a}}function $a({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return eo(n)(e,t,r??!1)}function eo(e){let t,n,r=[];for(let t of e){let e=t.options;`search`in e?e.search?.middlewares&&r.push(...e.search.middlewares):(e.preSearchFilters||e.postSearchFilters)&&r.push(({search:t,next:n})=>{let r=n(e.preSearchFilters?e.preSearchFilters.reduce((e,t)=>t(e),t):t);return e.postSearchFilters?e.postSearchFilters.reduce((e,t)=>t(e),r):r});let i=e.validateSearch;i&&r.push(({search:e,next:t,meta:r})=>{let a=t(e);if(n)try{let e=Za(i,a);if(r&&e)for(let t in e)t in a||(r.defaulted||=new Map).set(t,e[t]);return{...a,...e}}catch{}return a})}let i=(e,n,a)=>{if(e>=r.length){if(!t.search)return{};if(t.search===!0)return n;let e=Gr(t.search,n);return a&&(a.explicit=e),e}return r[e]({search:n,next:(t,n)=>{if(n){let n=a||{};return{search:i(e+1,t,n),meta:n}}return i(e+1,t,a)},meta:a})};return function(e,r,a){return t=r,n=a,i(0,e)}}function to(e,t){if(e!==`root`)for(let e=t.length-1;e>=0;e--){let n=t[e];if(n.children)return n.id}return ia}function no(e,t){let n=e.options.params?.parse??e.options.parseParams;if(n){let e=n(t);if(e===!1)throw Error(`Route params.parse returned false for a matched route`);Object.assign(t,e)}}function ro(){try{return sessionStorage}catch{return}}var io=`tsr-scroll-restoration-v1_3`,ao=ro();function oo(){try{return JSON.parse(ao?.getItem(`tsr-scroll-restoration-v1_3`)||`{}`)}catch{return{}}}function so(){try{ao?.setItem(io,JSON.stringify(co))}catch{}}var co=oo(),lo=`data-scroll-restoration-id`,uo=e=>e.state.__TSR_key||e.href;function fo(e){let t=e.getAttribute(lo);if(t)return`[${lo}="${t}"]`;let n=``,r=e,i;for(;i=r.parentNode;){let e=1,t=r;for(;t=t.previousElementSibling;)e++;let a=`${r.localName}:nth-child(${e})`;n=n?`${a} > ${n}`:a,r=i}return n}var po=!1,mo=`window`;function ho(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function go(e){let t=[];for(let n of e){if(n===mo)continue;let e=ho(n);e&&t.push(e)}return t}function _o(e,t){let n=t??e.options.scrollRestoration,r=e._scroll;n&&(r.restoring=!0);let i=e.options.getScrollRestorationKey||uo,a=new Map,o=(e,t,n)=>{let r=a.get(e)||{};r.scrollX=t,r.scrollY=n,a.set(e,r)},s=e=>{if(!(po||!r.restoring))if(e.target===document)o(mo,scrollX,scrollY);else{let t=e.target;o(t,t.scrollLeft,t.scrollTop)}},c=e=>{if(!r.restoring)return;let t=co[e]||={};for(let[e,n]of a)e===mo?t[mo]=n:e.isConnected&&(t[fo(e)]=n)};n&&!r.restoration&&(r.restoration=!0,po=!1,history.scrollRestoration=`manual`,document.addEventListener(`scroll`,s,!0),e.subscribe(`onBeforeLoad`,e=>{e.fromLocation&&c(i(e.fromLocation)),a.clear()}),addEventListener(`pagehide`,()=>{c(i(e.stores.resolvedLocation.get()??e.stores.location.get())),so()})),!r.reset&&(r.reset=!0,e.subscribe(`onRendered`,t=>{let n=e.options.scrollRestorationBehavior,o=e.options.scrollToTopSelectors,s=r.next,c;if(a.clear(),s||(r.next=!0),typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))return;let l=i(t.toLocation),u=t.fromLocation&&i(t.fromLocation);if(r.restoring&&u&&u!==l){let e=co[u];if(e){let t=co[l];for(let n in e){if(n===mo){if(s)continue}else{let e=ho(n);if(!e||s&&o&&(c??=go(o),c.includes(e)))continue}t||=co[l]={},t[n]??=e[n]}}}po=!0;try{let e=t.toLocation.hash,i=t.toLocation.state.__hashScrollIntoViewOptions??!0,a=!1;if(s){let s=Ka.get(t.toLocation),u=e&&i&&(s===`PUSH`||s===`REPLACE`),d=r.restoring?co[l]:void 0;if(d)for(let e in d){let{scrollX:t,scrollY:r}=d[e];if(e===mo){if(u)continue;scrollTo({top:r,left:t,behavior:n}),a=!0}else{let n=ho(e);n&&(n.scrollLeft=t,n.scrollTop=r)}}if(!a&&!e){let e={top:0,left:0,behavior:n};if(scrollTo(e),o){c??=go(o);for(let t of c)t.scrollTo(e)}}}!a&&e&&i&&document.getElementById(e)?.scrollIntoView(i)}finally{po=!1}}))}var vo=`Error preloading route! ☝️`,yo=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=e=>{this.originalIndex=e.originalIndex;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=ia:this.parentRoute||fi();let r=n?ia:t?.path;r&&r!==`/`&&(r=Bi(r));let i=t?.id||r,a=n?ia:Ri([this.parentRoute.id===`__root__`?``:this.parentRoute.id,i]);r===`__root__`&&(r=`/`),a!==`__root__`&&(a=Ri([`/`,a]));let o=a===`__root__`?`/`:Ri([this.parentRoute.fullPath,r]);this._path=r,this._id=a,this._fullPath=o,this._to=Vi(o)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>aa({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}},bo=class extends yo{constructor(e){super(e)}};function xo(e){let t=e.errorComponent??Co;return(0,F.jsx)(So,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?M.createElement(t,{error:n,reset:r}):e.children})}var So=class extends M.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:null}:{resetKey:n}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.error,reset:()=>{this.reset()}})}};function Co({error:e}){let[t,n]=M.useState(!1);return(0,F.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,F.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,F.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,F.jsx)(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),(0,F.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,F.jsx)(`div`,{children:(0,F.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e.message?(0,F.jsx)(`code`,{children:e.message}):null})}):null]})}function wo({children:e,fallback:t=null}){return To()?(0,F.jsx)(M.Fragment,{children:e}):(0,F.jsx)(M.Fragment,{children:t})}function To(){return M.useSyncExternalStore(Eo,()=>!0,()=>!1)}function Eo(){return()=>{}}var Do=M.createContext(null);function Oo(e){return M.useContext(Do)}var ko=M.createContext(void 0),Ao=M.createContext(void 0),jo=(e=>(e[e.None=0]=`None`,e[e.Mutable=1]=`Mutable`,e[e.Watching=2]=`Watching`,e[e.RecursedCheck=4]=`RecursedCheck`,e[e.Recursed=8]=`Recursed`,e[e.Dirty=16]=`Dirty`,e[e.Pending=32]=`Pending`,e))(jo||{});function Mo({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0){n=e.nextSub;continue}for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}while(!0)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(!0)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}function No(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var Po=[],Fo=0,{link:Io,unlink:Lo,propagate:Ro,checkDirty:zo,shallowPropagate:Bo}=Mo({update(e){return e._update()},notify(e){Po[Ho++]=e,e.flags&=~jo.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=jo.Mutable|jo.Dirty,Ko(e))}}),Vo=0,Ho=0,Uo,Wo=0;function Go(e){try{++Wo,e()}finally{--Wo||qo()}}function Ko(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=Lo(n,e)}function qo(){if(!(Wo>0)){for(;Vo<Ho;){let e=Po[Vo];Po[Vo++]=void 0,e.notify()}Vo=0,Ho=0}}function Jo(e,t){let n=typeof e==`function`,r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?jo.None:jo.Mutable,get(){return Uo!==void 0&&Io(i,Uo,Fo),i._snapshot},subscribe(e){let t=No(e),n={current:!1},r=Yo(()=>{i.get(),n.current?t.next?.(i._snapshot):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=Uo,o=t?.compare??Object.is;if(n)Uo=i,++Fo,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=jo.Mutable|jo.RecursedCheck);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{Uo=a,n&&(i.flags&=~jo.RecursedCheck),Ko(i)}}};return n?(i.flags=jo.Mutable|jo.Dirty,i.get=function(){let e=i.flags;if(e&jo.Dirty||e&jo.Pending&&zo(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&Bo(e)}}else e&jo.Pending&&(i.flags=e&~jo.Pending);return Uo!==void 0&&Io(i,Uo,Fo),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(Ro(e),Bo(e),qo())}},i}function Yo(e){let t=()=>{let t=Uo;Uo=n,++Fo,n.depsTail=void 0,n.flags=jo.Watching|jo.RecursedCheck;try{return e()}finally{Uo=t,n.flags&=~jo.RecursedCheck,Ko(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:jo.Watching|jo.RecursedCheck,notify(){let e=this.flags;e&jo.Dirty||e&jo.Pending&&zo(this.deps,this)?t():this.flags=jo.Watching},stop(){this.flags=jo.None,this.depsTail=void 0,Ko(this)}};return t(),n}var Xo=o((e=>{var t=f();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 d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),Zo=o(((e,t)=>{t.exports=Xo()})),Qo=o((e=>{var t=f(),n=Zo();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}})),$o=o(((e,t)=>{t.exports=Qo()}))();function es(e,t){return e===t}function ts(e,t,n=es){let r=(0,M.useCallback)(t=>{if(!e)return()=>{};let{unsubscribe:n}=e.subscribe(t);return n},[e]),i=(0,M.useCallback)(()=>e?.get(),[e]);return(0,$o.useSyncExternalStoreWithSelector)(r,i,i,t,n)}var ns={get:()=>void 0,subscribe:()=>({unsubscribe:()=>{}})};function rs(e){let t=Oo(),n=M.useContext(e.from?Ao:ko),r=e.from??n,i=r?e.from?t.stores.getRouteMatchStore(r):t.stores.matchStores.get(r):void 0,a=M.useRef(void 0);return ts(i??ns,n=>{if((e.shouldThrow??!0)&&!n&&fi(),n===void 0)return;let r=e.select?e.select(n):n;if(e.structuralSharing??t.options.defaultStructuralSharing){let e=Zr(a.current,r);return a.current=e,e}return r})}function is(e){return rs({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function as(e){let{select:t,...n}=e;return rs({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function os(e){return rs({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function ss(e){return rs({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function cs(e){let t=Oo();return M.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function ls(e){return rs({...e,select:t=>e.select?e.select(t.context):t.context})}var us=u(g(),1);function ds(e,t){let n=Oo(),r=Hr(t),{activeProps:i,inactiveProps:a,activeOptions:o,to:s,preload:c,preloadDelay:l,preloadIntentProximity:u,hashScrollIntoView:d,replace:f,startTransition:p,resetScroll:m,viewTransition:h,children:g,target:_,disabled:v,style:y,className:b,onClick:x,onBlur:S,onFocus:C,onMouseEnter:w,onMouseLeave:T,onTouchStart:E,ignoreBlocker:D,params:O,search:ee,hash:te,state:k,mask:A,reloadDocument:ne,unsafeRelative:re,from:ie,_fromLocation:j,...ae}=e,oe=To(),se=M.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),ce=ts(n.stores.location,e=>e,(e,t)=>e.href===t.href),le=M.useMemo(()=>{let e={_fromLocation:ce,...se};return n.buildLocation(e)},[n,ce,se]),ue=le.maskedLocation?le.maskedLocation.publicHref:le.publicHref,de=le.maskedLocation?le.maskedLocation.external:le.external,fe=M.useMemo(()=>bs(ue,de,n.history,v),[v,de,ue,n.history]),pe=M.useMemo(()=>{if(fe?.external)return ci(fe.href,n.protocolAllowlist)?void 0:fe.href;if(!xs(s)&&!(typeof s!=`string`||s.indexOf(`:`)===-1))try{return new URL(s),ci(s,n.protocolAllowlist)?void 0:s}catch{}},[s,fe,n.protocolAllowlist]),me=M.useMemo(()=>{if(pe)return!1;if(o?.exact){if(!Wi(ce.pathname,le.pathname,n.basepath))return!1}else{let e=Ui(ce.pathname,n.basepath),t=Ui(le.pathname,n.basepath);if(!(e.startsWith(t)&&(e.length===t.length||e[t.length]===`/`)))return!1}return(o?.includeSearch??!0)&&!ni(ce.search,le.search,{partial:!o?.exact,ignoreUndefined:!o?.explicitUndefined})?!1:o?.includeHash?oe&&ce.hash===le.hash:!0},[o?.exact,o?.explicitUndefined,o?.includeHash,o?.includeSearch,ce,pe,oe,le.hash,le.pathname,le.search,n.basepath]),he=me?Gr(i,{})??ps:fs,ge=me?fs:Gr(a,{})??fs,_e=[b,he.className,ge.className].filter(Boolean).join(` `),ve=(y||he.style||ge.style)&&{...y,...he.style,...ge.style},[ye,be]=M.useState(!1),xe=M.useRef(!1),Se=e.reloadDocument||pe?!1:c??n.options.defaultPreload,Ce=l??n.options.defaultPreloadDelay??0,we=M.useCallback(()=>{n.preloadRoute({...se,_builtLocation:le}).catch(e=>{console.warn(e),console.warn(vo)})},[n,se,le]);Vr(r,M.useCallback(e=>{e?.isIntersecting&&we()},[we]),vs,{disabled:!!v||Se!==`viewport`}),M.useEffect(()=>{xe.current||!v&&Se===`render`&&(we(),xe.current=!0)},[v,we,Se]);let Te=e=>{let t=e.currentTarget.getAttribute(`target`),r=_===void 0?t:_;if(!v&&!Cs(e)&&!e.defaultPrevented&&(!r||r===`_self`)&&e.button===0){e.preventDefault(),(0,us.flushSync)(()=>{be(!0)});let t=n.subscribe(`onResolved`,()=>{t(),be(!1)});n.navigate({...se,replace:f,resetScroll:m,hashScrollIntoView:d,startTransition:p,viewTransition:h,ignoreBlocker:D})}};if(pe)return{...ae,ref:r,href:pe,...g&&{children:g},..._&&{target:_},...v&&{disabled:v},...y&&{style:y},...b&&{className:b},...x&&{onClick:x},...S&&{onBlur:S},...C&&{onFocus:C},...w&&{onMouseEnter:w},...T&&{onMouseLeave:T},...E&&{onTouchStart:E}};let Ee=e=>{if(v||Se!==`intent`)return;if(!Ce){we();return}let t=e.currentTarget;if(_s.has(t))return;let n=setTimeout(()=>{_s.delete(t),we()},Ce);_s.set(t,n)},De=e=>{v||Se!==`intent`||we()},Oe=e=>{if(v||!Se||!Ce)return;let t=e.currentTarget,n=_s.get(t);n&&(clearTimeout(n),_s.delete(t))};return{...ae,...he,...ge,href:fe?.href,ref:r,onClick:ys([x,Te]),onBlur:ys([S,Oe]),onFocus:ys([C,Ee]),onMouseEnter:ys([w,Ee]),onMouseLeave:ys([T,Oe]),onTouchStart:ys([E,De]),disabled:!!v,target:_,...ve&&{style:ve},..._e&&{className:_e},...v&&ms,...me&&hs,...oe&&ye&&gs}}var fs={},ps={className:`active`},ms={role:`link`,"aria-disabled":!0},hs={"data-status":`active`,"aria-current":`page`},gs={"data-transitioning":`transitioning`},_s=new WeakMap,vs={rootMargin:`100px`},ys=e=>t=>{for(let n of e)if(n){if(t.defaultPrevented)return;n(t)}};function bs(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||`/`,external:!1}}function xs(e){if(typeof e!=`string`)return!1;let t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var Ss=M.forwardRef((e,t)=>{let{_asChild:n,...r}=e,{type:i,...a}=ds(r,t),o=typeof r.children==`function`?r.children({isActive:a[`data-status`]===`active`}):r.children;if(!n){let{disabled:e,...t}=a;return M.createElement(`a`,t,o)}return M.createElement(n,a,o)});function Cs(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var ws=class extends yo{constructor(e){super(e),this.useMatch=e=>rs({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>ls({...e,from:this.id}),this.useSearch=e=>ss({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>os({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>as({...e,from:this.id}),this.useLoaderData=e=>is({...e,from:this.id}),this.useNavigate=()=>cs({from:this.fullPath}),this.Link=M.forwardRef((e,t)=>(0,F.jsx)(Ss,{ref:t,from:this.fullPath,...e}))}};function Ts(e){return new ws(e)}var Es=class extends bo{constructor(e){super(e),this.useMatch=e=>rs({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>ls({...e,from:this.id}),this.useSearch=e=>ss({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>os({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>as({...e,from:this.id}),this.useLoaderData=e=>is({...e,from:this.id}),this.useNavigate=()=>cs({from:this.fullPath}),this.Link=M.forwardRef((e,t)=>(0,F.jsx)(Ss,{ref:t,from:this.fullPath,...e}))}};function Ds(e){return new Es(e)}function Os(e){let t=Oo(),n=`not-found-${ts(t.stores.location,e=>e.pathname)}-${ts(t.stores.status,e=>e)}`;return(0,F.jsx)(xo,{getResetKey:()=>n,onCatch:(t,n)=>{if(Xi(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(Xi(t))return e.fallback?.(t);throw t},children:e.children})}function ks(){return(0,F.jsx)(`p`,{children:`Not Found`})}function As(e){return(0,F.jsx)(F.Fragment,{children:e.children})}function js(e,t,n){return t.options.notFoundComponent?(0,F.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,F.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,F.jsx)(ks,{})}var Ms=M.memo(function({matchId:e}){let t=Oo(),n=t.stores.matchStores.get(e);n||fi();let r=ts(t.stores.loadedAt,e=>e),i=ts(n,e=>e);return(0,F.jsx)(Ns,{router:t,matchId:e,resetKey:r,matchState:M.useMemo(()=>{let e=i.routeId,n=t.routesById[e].parentRoute?.id;return{routeId:e,ssr:i.ssr,_displayPending:i._displayPending,parentRouteId:n}},[i._displayPending,i.routeId,i.ssr,t.routesById])})});function Ns({router:e,matchId:t,resetKey:n,matchState:r}){let i=e.routesById[r.routeId],a=i.options.pendingComponent??e.options.defaultPendingComponent,o=a?(0,F.jsx)(a,{}):null,s=i.options.errorComponent??e.options.defaultErrorComponent,c=i.options.onCatch??e.options.defaultOnCatch,l=i.isRoot?i.options.notFoundComponent??e.options.notFoundRoute?.options.component:i.options.notFoundComponent,u=r.ssr===!1||r.ssr===`data-only`,d=(!i.isRoot||i.options.wrapInSuspense||u)&&(i.options.wrapInSuspense??a??(i.options.errorComponent?.preload||u))?M.Suspense:As,f=s?xo:As,p=l?Os:As;return(0,F.jsxs)(i.isRoot?i.options.shellComponent??As:As,{children:[(0,F.jsx)(ko.Provider,{value:t,children:(0,F.jsx)(d,{fallback:o,children:(0,F.jsx)(f,{getResetKey:()=>n,errorComponent:s||Co,onCatch:(e,t)=>{if(Xi(e))throw e.routeId??=r.routeId,e;c?.(e,t)},children:(0,F.jsx)(p,{fallback:e=>{if(e.routeId??=r.routeId,!l||e.routeId&&e.routeId!==r.routeId||!e.routeId&&!i.isRoot)throw e;return M.createElement(l,e)},children:u||r._displayPending?(0,F.jsx)(wo,{fallback:o,children:(0,F.jsx)(Fs,{matchId:t})}):(0,F.jsx)(Fs,{matchId:t})})})})}),r.parentRouteId===`__root__`?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(Ps,{resetKey:n}),(e.options.scrollRestoration,null)]}):null]})}function Ps({resetKey:e}){let t=Oo(),n=M.useRef(void 0);return zr(()=>{let e=t.latestLocation.href;(n.current===void 0||n.current!==e)&&(t.emit({type:`onRendered`,...Ga(t.stores.location.get(),t.stores.resolvedLocation.get())}),n.current=e)},[t.latestLocation.state.__TSR_key,e,t]),null}var Fs=M.memo(function({matchId:e}){let t=Oo(),n=(e,n)=>t.getMatch(e.id)?._nonReactive[n]??e._nonReactive[n],r=t.stores.matchStores.get(e);r||fi();let i=ts(r,e=>e),a=i.routeId,o=t.routesById[a],s=M.useMemo(()=>{let e=(t.routesById[a].options.remountDeps??t.options.defaultRemountDeps)?.({routeId:a,loaderDeps:i.loaderDeps,params:i._strictParams,search:i._strictSearch});return e?JSON.stringify(e):void 0},[a,i.loaderDeps,i._strictParams,i._strictSearch,t.options.defaultRemountDeps,t.routesById]),c=M.useMemo(()=>{let e=o.options.component??t.options.defaultComponent;return e?(0,F.jsx)(e,{},s):(0,F.jsx)(Is,{})},[s,o.options.component,t.options.defaultComponent]);if(i._displayPending)throw n(i,`displayPendingPromise`);if(i._forcePending)throw n(i,`minPendingPromise`);if(i.status===`pending`){let e=o.options.pendingMinMs??t.options.defaultPendingMinMs;if(e){let n=t.getMatch(i.id);if(n&&!n._nonReactive.minPendingPromise){let t=ri();n._nonReactive.minPendingPromise=t,setTimeout(()=>{t.resolve(),n._nonReactive.minPendingPromise=void 0},e)}}throw n(i,`loadPromise`)}if(i.status===`notFound`)return Xi(i.error)||fi(),js(t,o,i.error);if(i.status===`redirected`)throw oa(i.error)||fi(),n(i,`loadPromise`);if(i.status===`error`)throw i.error;return c}),Is=M.memo(function(){let e=Oo(),t=M.useContext(ko),n,r=!1,i;{let a=t?e.stores.matchStores.get(t):void 0;[n,r]=ts(a,e=>[e?.routeId,e?.globalNotFound??!1]),i=ts(e.stores.matchesId,e=>e[e.findIndex(e=>e===t)+1])}let a=n?e.routesById[n]:void 0,o=e.options.defaultPendingComponent?(0,F.jsx)(e.options.defaultPendingComponent,{}):null;if(r)return a||fi(),js(e,a,void 0);if(!i)return null;let s=(0,F.jsx)(Ms,{matchId:i});return n===`__root__`?(0,F.jsx)(M.Suspense,{fallback:o,children:s}):s});function Ls(){let e=Oo(),t=M.useRef({router:e,mounted:!1}),[n,r]=M.useState(!1),i=ts(e.stores.isLoading,e=>e),a=ts(e.stores.hasPending,e=>e),o=Br(i),s=i||n||a,c=Br(s),l=i||a,u=Br(l);return e.startTransition=e=>{r(!0),M.startTransition(()=>{e(),r(!1)})},M.useEffect(()=>{let t=e.history.subscribe(e.load),n=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Vi(e.latestLocation.publicHref)!==Vi(n.publicHref)&&e.commitLocation({...n,replace:!0}),()=>{t()}},[e,e.history]),zr(()=>{typeof window<`u`&&e.ssr||t.current.router===e&&t.current.mounted||(t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(e){console.error(e)}})())},[e]),zr(()=>{o&&!i&&e.emit({type:`onLoad`,...Ga(e.stores.location.get(),e.stores.resolvedLocation.get())})},[o,e,i]),zr(()=>{u&&!l&&e.emit({type:`onBeforeRouteMount`,...Ga(e.stores.location.get(),e.stores.resolvedLocation.get())})},[l,u,e]),zr(()=>{if(c&&!s){let t=Ga(e.stores.location.get(),e.stores.resolvedLocation.get());e.emit({type:`onResolved`,...t}),Go(()=>{e.stores.status.set(`idle`),e.stores.resolvedLocation.set(e.stores.location.get())})}},[s,c,e]),null}function Rs(){let e=Oo(),t=e.routesById.__root__.options.pendingComponent??e.options.defaultPendingComponent,n=t?(0,F.jsx)(t,{}):null,r=(0,F.jsxs)(typeof document<`u`&&e.ssr?As:M.Suspense,{fallback:n,children:[(0,F.jsx)(Ls,{}),(0,F.jsx)(zs,{})]});return e.options.InnerWrap?(0,F.jsx)(e.options.InnerWrap,{children:r}):r}function zs(){let e=Oo(),t=ts(e.stores.firstId,e=>e),n=ts(e.stores.loadedAt,e=>e),r=t?(0,F.jsx)(Ms,{matchId:t}):null;return(0,F.jsx)(ko.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:(0,F.jsx)(xo,{getResetKey:()=>n,errorComponent:Co,onCatch:void 0,children:r})})}function Bs(){let e=Oo();return ts(e.stores.matchRouteDeps,e=>e),M.useCallback(t=>{let{pending:n,caseSensitive:r,fuzzy:i,includeSearch:a,...o}=t;return e.matchRoute(o,{pending:n,caseSensitive:r,fuzzy:i,includeSearch:a})},[e])}var Vs=e=>({createMutableStore:Jo,createReadonlyStore:Jo,batch:Go}),Hs=e=>new Us(e),Us=class extends qa{constructor(e){super(e,Vs)}};function Ws({router:e,children:t,...n}){Jr(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let r=(0,F.jsx)(Do.Provider,{value:e,children:t});return e.options.Wrap?(0,F.jsx)(e.options.Wrap,{children:r}):r}function Gs({router:e,...t}){return(0,F.jsx)(Ws,{router:e,...t,children:(0,F.jsx)(Rs,{})})}function Ks(e){let t=Oo(),n=(0,M.useRef)(void 0);return ts(t.stores.location,r=>{let i=e?.select?e.select(r):r;if(e?.structuralSharing??t.options.defaultStructuralSharing){let e=Zr(n.current,i);return n.current=e,e}return i})}var qs;function I(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}var Js=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Ys=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(qs=globalThis).__zod_globalConfig??(qs.__zod_globalConfig={});var Xs=globalThis.__zod_globalConfig;function Zs(e){return e&&Object.assign(Xs,e),Xs}function Qs(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function $s(e,t){return typeof t==`bigint`?t.toString():t}function ec(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}throw Error(`cached value already set`)}}}function tc(e){return e==null}function nc(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function rc(e,t){let n=e/t,r=Math.round(n),i=2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}var ic=Symbol(`evaluating`);function ac(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==ic)return r===void 0&&(r=ic,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function oc(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function sc(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}function cc(e){return JSON.stringify(e)}function lc(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var uc=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function dc(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var fc=ec(()=>{if(Xs.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function pc(e){if(dc(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(dc(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function mc(e){return pc(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var hc=new Set([`string`,`number`,`symbol`]);function gc(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function _c(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function vc(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function yc(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var bc={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function xc(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return _c(e,sc(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return oc(this,`shape`,e),e},checks:[]}))}function Sc(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return _c(e,sc(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return oc(this,`shape`,r),r},checks:[]}))}function Cc(e,t){if(!pc(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return _c(e,sc(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return oc(this,`shape`,n),n}}))}function wc(e,t){if(!pc(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return _c(e,sc(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return oc(this,`shape`,n),n}}))}function Tc(e,t){if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return _c(e,sc(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return oc(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function Ec(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return _c(t,sc(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return oc(this,`shape`,i),i},checks:[]}))}function Dc(e,t,n){return _c(t,sc(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return oc(this,`shape`,i),i}}))}function Oc(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function kc(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function Ac(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function jc(e){return typeof e==`string`?e:e?.message}function Mc(e,t,n){let r=e.message?e.message:jc(e.inst?._zod.def?.error?.(e))??jc(t?.error?.(e))??jc(n.customError?.(e))??jc(n.localeError?.(e))??`Invalid input`,{inst:i,continue:a,input:o,...s}=e;return s.path??=[],s.message=r,t?.reportInput&&(s.input=o),s}function Nc(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function Pc(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var Fc=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,$s,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Ic=I(`$ZodError`,Fc),Lc=I(`$ZodError`,Fc,{Parent:Error});function Rc(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function zc(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i];i===e.length-1?(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(a))):r[n]=r[n]||{_errors:[]},r=r[n],i++}}}};return r(e),n}var Bc=e=>(t,n,r,i)=>{let a=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new Js;if(o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>Mc(e,a,Zs())));throw uc(t,i?.callee),t}return o.value},Vc=e=>async(t,n,r,i)=>{let a=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>Mc(e,a,Zs())));throw uc(t,i?.callee),t}return o.value},Hc=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new Js;return a.issues.length?{success:!1,error:new(e??Ic)(a.issues.map(e=>Mc(e,i,Zs())))}:{success:!0,data:a.value}},Uc=Hc(Lc),Wc=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>Mc(e,i,Zs())))}:{success:!0,data:a.value}},Gc=Wc(Lc),Kc=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Bc(e)(t,n,i)},qc=e=>(t,n,r)=>Bc(e)(t,n,r),Jc=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Vc(e)(t,n,i)},Yc=e=>async(t,n,r)=>Vc(e)(t,n,r),Xc=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Hc(e)(t,n,i)},Zc=e=>(t,n,r)=>Hc(e)(t,n,r),Qc=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Wc(e)(t,n,i)},$c=e=>async(t,n,r)=>Wc(e)(t,n,r),el=/^[cC][0-9a-z]{6,}$/,tl=/^[0-9a-z]+$/,nl=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,rl=/^[0-9a-vA-V]{20}$/,il=/^[A-Za-z0-9]{27}$/,al=/^[a-zA-Z0-9_-]{21}$/,ol=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,sl=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,cl=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,ll=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,ul=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function dl(){return new RegExp(ul,`u`)}var fl=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,pl=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,ml=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,hl=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,gl=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,_l=/^[A-Za-z0-9_-]*$/,vl=/^https?$/,yl=/^\+[1-9]\d{6,14}$/,bl=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,xl=RegExp(`^${bl}$`);function Sl(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Cl(e){return RegExp(`^${Sl(e)}$`)}function wl(e){let t=Sl({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${bl}T(?:${r})$`)}var Tl=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},El=/^-?\d+$/,Dl=/^-?\d+(?:\.\d+)?$/,Ol=/^[^A-Z]*$/,kl=/^[^a-z]*$/,Al=I(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),jl={number:`number`,bigint:`bigint`,object:`date`},Ml=I(`$ZodCheckLessThan`,(e,t)=>{Al.init(e,t);let n=jl[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Nl=I(`$ZodCheckGreaterThan`,(e,t)=>{Al.init(e,t);let n=jl[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Pl=I(`$ZodCheckMultipleOf`,(e,t)=>{Al.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):rc(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Fl=I(`$ZodCheckNumberFormat`,(e,t)=>{Al.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=bc[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=El)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),Il=I(`$ZodCheckMaxLength`,(e,t)=>{var n;Al.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!tc(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=Nc(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Ll=I(`$ZodCheckMinLength`,(e,t)=>{var n;Al.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!tc(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=Nc(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Rl=I(`$ZodCheckLengthEquals`,(e,t)=>{var n;Al.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!tc(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=Nc(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),zl=I(`$ZodCheckStringFormat`,(e,t)=>{var n,r;Al.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Bl=I(`$ZodCheckRegex`,(e,t)=>{zl.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Vl=I(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Ol,zl.init(e,t)}),Hl=I(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=kl,zl.init(e,t)}),Ul=I(`$ZodCheckIncludes`,(e,t)=>{Al.init(e,t);let n=gc(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Wl=I(`$ZodCheckStartsWith`,(e,t)=>{Al.init(e,t);let n=RegExp(`^${gc(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Gl=I(`$ZodCheckEndsWith`,(e,t)=>{Al.init(e,t);let n=RegExp(`.*${gc(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Kl=I(`$ZodCheckOverwrite`,(e,t)=>{Al.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),ql=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
13
|
+
`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
|
|
14
|
+
`))}},Jl={major:4,minor:4,patch:3},Yl=I(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Jl;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=Oc(e),i;for(let a of t){if(a._zod.def.when){if(kc(e)||!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new Js;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=Oc(e,t))});else{if(e.issues.length===t)continue;r||=Oc(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(Oc(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new Js;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new Js;return o.then(e=>t(e,r,a))}return t(o,r,a)}}ac(e,`~standard`,()=>({validate:t=>{try{let n=Uc(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return Gc(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),Xl=I(`$ZodString`,(e,t)=>{Yl.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Tl(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),Zl=I(`$ZodStringFormat`,(e,t)=>{zl.init(e,t),Xl.init(e,t)}),Ql=I(`$ZodGUID`,(e,t)=>{t.pattern??=sl,Zl.init(e,t)}),$l=I(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=cl(e)}else t.pattern??=cl();Zl.init(e,t)}),eu=I(`$ZodEmail`,(e,t)=>{t.pattern??=ll,Zl.init(e,t)}),tu=I(`$ZodURL`,(e,t)=>{Zl.init(e,t),e._zod.check=n=>{try{let r=n.value.trim();if(!t.normalize&&t.protocol?.source===vl.source&&!/^https?:\/\//i.test(r)){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}let i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),nu=I(`$ZodEmoji`,(e,t)=>{t.pattern??=dl(),Zl.init(e,t)}),ru=I(`$ZodNanoID`,(e,t)=>{t.pattern??=al,Zl.init(e,t)}),iu=I(`$ZodCUID`,(e,t)=>{t.pattern??=el,Zl.init(e,t)}),au=I(`$ZodCUID2`,(e,t)=>{t.pattern??=tl,Zl.init(e,t)}),ou=I(`$ZodULID`,(e,t)=>{t.pattern??=nl,Zl.init(e,t)}),su=I(`$ZodXID`,(e,t)=>{t.pattern??=rl,Zl.init(e,t)}),cu=I(`$ZodKSUID`,(e,t)=>{t.pattern??=il,Zl.init(e,t)}),lu=I(`$ZodISODateTime`,(e,t)=>{t.pattern??=wl(t),Zl.init(e,t)}),uu=I(`$ZodISODate`,(e,t)=>{t.pattern??=xl,Zl.init(e,t)}),du=I(`$ZodISOTime`,(e,t)=>{t.pattern??=Cl(t),Zl.init(e,t)}),fu=I(`$ZodISODuration`,(e,t)=>{t.pattern??=ol,Zl.init(e,t)}),pu=I(`$ZodIPv4`,(e,t)=>{t.pattern??=fl,Zl.init(e,t),e._zod.bag.format=`ipv4`}),mu=I(`$ZodIPv6`,(e,t)=>{t.pattern??=pl,Zl.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),hu=I(`$ZodCIDRv4`,(e,t)=>{t.pattern??=ml,Zl.init(e,t)}),gu=I(`$ZodCIDRv6`,(e,t)=>{t.pattern??=hl,Zl.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function _u(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var vu=I(`$ZodBase64`,(e,t)=>{t.pattern??=gl,Zl.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{_u(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function yu(e){if(!_l.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return _u(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var bu=I(`$ZodBase64URL`,(e,t)=>{t.pattern??=_l,Zl.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{yu(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),xu=I(`$ZodE164`,(e,t)=>{t.pattern??=yl,Zl.init(e,t)});function Su(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var Cu=I(`$ZodJWT`,(e,t)=>{Zl.init(e,t),e._zod.check=n=>{Su(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),wu=I(`$ZodNumber`,(e,t)=>{Yl.init(e,t),e._zod.pattern=e._zod.bag.pattern??Dl,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),Tu=I(`$ZodNumberFormat`,(e,t)=>{Fl.init(e,t),wu.init(e,t)}),Eu=I(`$ZodUnknown`,(e,t)=>{Yl.init(e,t),e._zod.parse=e=>e}),Du=I(`$ZodNever`,(e,t)=>{Yl.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function Ou(e,t,n){e.issues.length&&t.issues.push(...Ac(n,e.issues)),t.value[n]=e.value}var ku=I(`$ZodArray`,(e,t)=>{Yl.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>Ou(t,n,e))):Ou(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function Au(e,t,n,r,i,a){let o=n in r;if(e.issues.length){if(i&&a&&!o)return;t.issues.push(...Ac(n,e.issues))}if(!o&&!i){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}function ju(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=yc(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Mu(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optin===`optional`,d=c.optout===`optional`;for(let i in t){if(i===`__proto__`||s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>Au(e,n,i,t,u,d))):Au(a,n,i,t,u,d)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}var Nu=I(`$ZodObject`,(e,t)=>{if(Yl.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}let n=ec(()=>ju(t));ac(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=dc,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optin===`optional`,i=n._zod.optout===`optional`,a=n._zod.run({value:s[e],issues:[]},o);a instanceof Promise?c.push(a.then(n=>Au(n,t,e,s,r,i))):Au(a,t,e,s,r,i)}return i?Mu(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),Pu=I(`$ZodObjectJIT`,(e,t)=>{Nu.init(e,t);let n=e._zod.parse,r=ec(()=>ju(t)),i=e=>{let t=new ql([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=cc(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=a[r],o=cc(r),s=e[r],c=s?._zod?.optin===`optional`,l=s?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),c&&l?t.write(`
|
|
15
|
+
if (${n}.issues.length) {
|
|
16
|
+
if (${o} in input) {
|
|
17
|
+
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
18
|
+
...iss,
|
|
19
|
+
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
20
|
+
})));
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (${n}.value === undefined) {
|
|
25
|
+
if (${o} in input) {
|
|
26
|
+
newResult[${o}] = undefined;
|
|
27
|
+
}
|
|
28
|
+
} else {
|
|
29
|
+
newResult[${o}] = ${n}.value;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
`):c?t.write(`
|
|
33
|
+
if (${n}.issues.length) {
|
|
34
|
+
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
35
|
+
...iss,
|
|
36
|
+
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
37
|
+
})));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if (${n}.value === undefined) {
|
|
41
|
+
if (${o} in input) {
|
|
42
|
+
newResult[${o}] = undefined;
|
|
43
|
+
}
|
|
44
|
+
} else {
|
|
45
|
+
newResult[${o}] = ${n}.value;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
`):t.write(`
|
|
49
|
+
const ${n}_present = ${o} in input;
|
|
50
|
+
if (${n}.issues.length) {
|
|
51
|
+
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
52
|
+
...iss,
|
|
53
|
+
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
54
|
+
})));
|
|
55
|
+
}
|
|
56
|
+
if (!${n}_present && !${n}.issues.length) {
|
|
57
|
+
payload.issues.push({
|
|
58
|
+
code: "invalid_type",
|
|
59
|
+
expected: "nonoptional",
|
|
60
|
+
input: undefined,
|
|
61
|
+
path: [${o}]
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (${n}_present) {
|
|
66
|
+
if (${n}.value === undefined) {
|
|
67
|
+
newResult[${o}] = undefined;
|
|
68
|
+
} else {
|
|
69
|
+
newResult[${o}] = ${n}.value;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
`)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=dc,s=!Xs.jitless,c=s&&fc.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?Mu([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function Fu(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!Oc(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>Mc(e,r,Zs())))}),t)}var Iu=I(`$ZodUnion`,(e,t)=>{Yl.init(e,t),ac(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),ac(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),ac(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),ac(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>nc(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>Fu(t,r,e,i)):Fu(o,r,e,i)}}),Lu=I(`$ZodIntersection`,(e,t)=>{Yl.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>zu(e,t,n)):zu(e,i,a)}});function Ru(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(pc(e)&&pc(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=Ru(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Ru(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function zu(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),Oc(e))return e;let o=Ru(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var Bu=I(`$ZodEnum`,(e,t)=>{Yl.init(e,t);let n=Qs(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>hc.has(typeof e)).map(e=>typeof e==`string`?gc(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),Vu=I(`$ZodLiteral`,(e,t)=>{if(Yl.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?gc(e):e?gc(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),Hu=I(`$ZodTransform`,(e,t)=>{Yl.init(e,t),e._zod.optin=`optional`,e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Ys(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n.fallback=!0,n));if(i instanceof Promise)throw new Js;return n.value=i,n.fallback=!0,n}});function Uu(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var Wu=I(`$ZodOptional`,(e,t)=>{Yl.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,ac(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ac(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${nc(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=e.value,i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(e=>Uu(e,r)):Uu(i,r)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),Gu=I(`$ZodExactOptional`,(e,t)=>{Wu.init(e,t),ac(e._zod,`values`,()=>t.innerType._zod.values),ac(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Ku=I(`$ZodNullable`,(e,t)=>{Yl.init(e,t),ac(e._zod,`optin`,()=>t.innerType._zod.optin),ac(e._zod,`optout`,()=>t.innerType._zod.optout),ac(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${nc(e.source)}|null)$`):void 0}),ac(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),qu=I(`$ZodDefault`,(e,t)=>{Yl.init(e,t),e._zod.optin=`optional`,ac(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Ju(e,t)):Ju(r,t)}});function Ju(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Yu=I(`$ZodPrefault`,(e,t)=>{Yl.init(e,t),e._zod.optin=`optional`,ac(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Xu=I(`$ZodNonOptional`,(e,t)=>{Yl.init(e,t),ac(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>Zu(t,e)):Zu(i,e)}});function Zu(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var Qu=I(`$ZodCatch`,(e,t)=>{Yl.init(e,t),e._zod.optin=`optional`,ac(e._zod,`optout`,()=>t.innerType._zod.optout),ac(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>Mc(e,n,Zs()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>Mc(e,n,Zs()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),$u=I(`$ZodPipe`,(e,t)=>{Yl.init(e,t),ac(e._zod,`values`,()=>t.in._zod.values),ac(e._zod,`optin`,()=>t.in._zod.optin),ac(e._zod,`optout`,()=>t.out._zod.optout),ac(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>ed(e,t.in,n)):ed(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>ed(e,t.out,n)):ed(r,t.out,n)}});function ed(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}var td=I(`$ZodReadonly`,(e,t)=>{Yl.init(e,t),ac(e._zod,`propValues`,()=>t.innerType._zod.propValues),ac(e._zod,`values`,()=>t.innerType._zod.values),ac(e._zod,`optin`,()=>t.innerType?._zod?.optin),ac(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(nd):nd(r)}});function nd(e){return e.value=Object.freeze(e.value),e}var rd=I(`$ZodCustom`,(e,t)=>{Al.init(e,t),Yl.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>id(t,n,r,e));id(i,n,r,e)}});function id(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(Pc(e))}}var ad,od=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function sd(){return new od}(ad=globalThis).__zod_globalRegistry??(ad.__zod_globalRegistry=sd());var cd=globalThis.__zod_globalRegistry;function ld(e,t){return new e({type:`string`,...vc(t)})}function ud(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...vc(t)})}function dd(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...vc(t)})}function fd(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...vc(t)})}function pd(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...vc(t)})}function md(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...vc(t)})}function hd(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...vc(t)})}function gd(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...vc(t)})}function _d(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...vc(t)})}function vd(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...vc(t)})}function yd(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...vc(t)})}function bd(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...vc(t)})}function xd(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...vc(t)})}function Sd(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...vc(t)})}function Cd(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...vc(t)})}function wd(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...vc(t)})}function Td(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...vc(t)})}function Ed(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...vc(t)})}function Dd(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...vc(t)})}function Od(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...vc(t)})}function kd(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...vc(t)})}function Ad(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...vc(t)})}function jd(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...vc(t)})}function Md(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...vc(t)})}function Nd(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...vc(t)})}function Pd(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...vc(t)})}function Fd(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...vc(t)})}function Id(e,t){return new e({type:`number`,coerce:!0,checks:[],...vc(t)})}function Ld(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...vc(t)})}function Rd(e){return new e({type:`unknown`})}function zd(e,t){return new e({type:`never`,...vc(t)})}function Bd(e,t){return new Ml({check:`less_than`,...vc(t),value:e,inclusive:!1})}function Vd(e,t){return new Ml({check:`less_than`,...vc(t),value:e,inclusive:!0})}function Hd(e,t){return new Nl({check:`greater_than`,...vc(t),value:e,inclusive:!1})}function Ud(e,t){return new Nl({check:`greater_than`,...vc(t),value:e,inclusive:!0})}function Wd(e,t){return new Pl({check:`multiple_of`,...vc(t),value:e})}function Gd(e,t){return new Il({check:`max_length`,...vc(t),maximum:e})}function Kd(e,t){return new Ll({check:`min_length`,...vc(t),minimum:e})}function qd(e,t){return new Rl({check:`length_equals`,...vc(t),length:e})}function Jd(e,t){return new Bl({check:`string_format`,format:`regex`,...vc(t),pattern:e})}function Yd(e){return new Vl({check:`string_format`,format:`lowercase`,...vc(e)})}function Xd(e){return new Hl({check:`string_format`,format:`uppercase`,...vc(e)})}function Zd(e,t){return new Ul({check:`string_format`,format:`includes`,...vc(t),includes:e})}function Qd(e,t){return new Wl({check:`string_format`,format:`starts_with`,...vc(t),prefix:e})}function $d(e,t){return new Gl({check:`string_format`,format:`ends_with`,...vc(t),suffix:e})}function ef(e){return new Kl({check:`overwrite`,tx:e})}function tf(e){return ef(t=>t.normalize(e))}function nf(){return ef(e=>e.trim())}function rf(){return ef(e=>e.toLowerCase())}function af(){return ef(e=>e.toUpperCase())}function of(){return ef(e=>lc(e))}function sf(e,t,n){return new e({type:`array`,element:t,...vc(n)})}function cf(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...vc(n)})}function lf(e,t){let n=uf(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(Pc(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=t.value,r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(Pc(r))}},e(t.value,t)),t);return n}function uf(e,t){let n=new Al({check:`custom`,...vc(t)});return n._zod.check=e,n}function df(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??cd,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function ff(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,ff(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&hf(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function pf(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
74
|
+
|
|
75
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function mf(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:_f(t,`input`,e.processors),output:_f(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function hf(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return hf(r.element,n);if(r.type===`set`)return hf(r.valueType,n);if(r.type===`lazy`)return hf(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`)return hf(r.innerType,n);if(r.type===`intersection`)return hf(r.left,n)||hf(r.right,n);if(r.type===`record`||r.type===`map`)return hf(r.keyType,n)||hf(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:hf(r.in,n)||hf(r.out,n);if(r.type===`object`){for(let e in r.shape)if(hf(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(hf(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(hf(e,n))return!0;return!!(r.rest&&hf(r.rest,n))}return!1}var gf=(e,t={})=>n=>{let r=df({...n,processors:t});return ff(e,r),pf(r,e),mf(r,e)},_f=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=df({...i??{},target:a,io:t,processors:n});return ff(e,o),pf(o,e),mf(o,e)},vf={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},yf=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=vf[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},bf=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof s==`string`&&s.includes(`int`)?i.type=`integer`:i.type=`number`;let d=typeof u==`number`&&u>=(a??-1/0),f=typeof l==`number`&&l<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;d?p?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof o==`number`&&(i.maximum=o),typeof c==`number`&&(i.multipleOf=c)},xf=(e,t,n,r)=>{n.not={}},Sf=(e,t,n,r)=>{let i=e._zod.def,a=Qs(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},Cf=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},wf=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},Tf=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},Ef=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=ff(a.element,t,{...r,path:[...r.path,`items`]})},Df=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=ff(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=ff(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Of=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>ff(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},kf=(e,t,n,r)=>{let i=e._zod.def,a=ff(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=ff(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},Af=(e,t,n,r)=>{let i=e._zod.def,a=ff(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},jf=(e,t,n,r)=>{let i=e._zod.def;ff(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Mf=(e,t,n,r)=>{let i=e._zod.def;ff(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},Nf=(e,t,n,r)=>{let i=e._zod.def;ff(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},Pf=(e,t,n,r)=>{let i=e._zod.def;ff(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},Ff=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;ff(o,t,r);let s=t.seen.get(e);s.ref=o},If=(e,t,n,r)=>{let i=e._zod.def;ff(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Lf=(e,t,n,r)=>{let i=e._zod.def;ff(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Rf=I(`ZodISODateTime`,(e,t)=>{lu.init(e,t),dp.init(e,t)});function zf(e){return Md(Rf,e)}var Bf=I(`ZodISODate`,(e,t)=>{uu.init(e,t),dp.init(e,t)});function Vf(e){return Nd(Bf,e)}var Hf=I(`ZodISOTime`,(e,t)=>{du.init(e,t),dp.init(e,t)});function Uf(e){return Pd(Hf,e)}var Wf=I(`ZodISODuration`,(e,t)=>{fu.init(e,t),dp.init(e,t)});function Gf(e){return Fd(Wf,e)}var Kf=I(`ZodError`,(e,t)=>{Ic.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>zc(e,t)},flatten:{value:t=>Rc(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,$s,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,$s,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),qf=Bc(Kf),Jf=Vc(Kf),Yf=Hc(Kf),Xf=Wc(Kf),Zf=Kc(Kf),Qf=qc(Kf),$f=Jc(Kf),ep=Yc(Kf),tp=Xc(Kf),np=Zc(Kf),rp=Qc(Kf),ip=$c(Kf),ap=new WeakMap;function op(e,t,n){let r=Object.getPrototypeOf(e),i=ap.get(r);if(i||(i=new Set,ap.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}var sp=I(`ZodType`,(e,t)=>(Yl.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:_f(e,`input`),output:_f(e,`output`)}}),e.toJSONSchema=gf(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>qf(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Yf(e,t,n),e.parseAsync=async(t,n)=>Jf(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Xf(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Zf(e,t,n),e.decode=(t,n)=>Qf(e,t,n),e.encodeAsync=async(t,n)=>$f(e,t,n),e.decodeAsync=async(t,n)=>ep(e,t,n),e.safeEncode=(t,n)=>tp(e,t,n),e.safeDecode=(t,n)=>np(e,t,n),e.safeEncodeAsync=async(t,n)=>rp(e,t,n),e.safeDecodeAsync=async(t,n)=>ip(e,t,n),op(e,`ZodType`,{check(...e){let t=this.def;return this.clone(sc(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return _c(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(uee(e,t))},superRefine(e,t){return this.check(dee(e,t))},overwrite(e){return this.check(ef(e))},optional(){return $p(this)},exactOptional(){return tm(this)},nullable(){return rm(this)},nullish(){return $p(rm(this))},nonoptional(e){return am(this,e)},array(){return zp(this)},or(e){return Up([this,e])},and(e){return Gp(this,e)},transform(e){return om(this,Zp(e))},default(e){return tee(this,e)},prefault(e){return ree(this,e)},catch(e){return aee(this,e)},pipe(e){return om(this,e)},readonly(){return cee(this)},describe(e){let t=this.clone();return cd.add(t,{description:e}),t},meta(...e){if(e.length===0)return cd.get(this);let t=this.clone();return cd.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get(){return cd.get(e)?.description},configurable:!0}),e)),cp=I(`_ZodString`,(e,t)=>{Xl.init(e,t),sp.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yf(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,op(e,`_ZodString`,{regex(...e){return this.check(Jd(...e))},includes(...e){return this.check(Zd(...e))},startsWith(...e){return this.check(Qd(...e))},endsWith(...e){return this.check($d(...e))},min(...e){return this.check(Kd(...e))},max(...e){return this.check(Gd(...e))},length(...e){return this.check(qd(...e))},nonempty(...e){return this.check(Kd(1,...e))},lowercase(e){return this.check(Yd(e))},uppercase(e){return this.check(Xd(e))},trim(){return this.check(nf())},normalize(...e){return this.check(tf(...e))},toLowerCase(){return this.check(rf())},toUpperCase(){return this.check(af())},slugify(){return this.check(of())}})}),lp=I(`ZodString`,(e,t)=>{Xl.init(e,t),cp.init(e,t),e.email=t=>e.check(ud(fp,t)),e.url=t=>e.check(gd(hp,t)),e.jwt=t=>e.check(jd(Ap,t)),e.emoji=t=>e.check(_d(gp,t)),e.guid=t=>e.check(dd(pp,t)),e.uuid=t=>e.check(fd(mp,t)),e.uuidv4=t=>e.check(pd(mp,t)),e.uuidv6=t=>e.check(md(mp,t)),e.uuidv7=t=>e.check(hd(mp,t)),e.nanoid=t=>e.check(vd(_p,t)),e.guid=t=>e.check(dd(pp,t)),e.cuid=t=>e.check(yd(vp,t)),e.cuid2=t=>e.check(bd(yp,t)),e.ulid=t=>e.check(xd(bp,t)),e.base64=t=>e.check(Od(Dp,t)),e.base64url=t=>e.check(kd(Op,t)),e.xid=t=>e.check(Sd(xp,t)),e.ksuid=t=>e.check(Cd(Sp,t)),e.ipv4=t=>e.check(wd(Cp,t)),e.ipv6=t=>e.check(Td(wp,t)),e.cidrv4=t=>e.check(Ed(Tp,t)),e.cidrv6=t=>e.check(Dd(Ep,t)),e.e164=t=>e.check(Ad(kp,t)),e.datetime=t=>e.check(zf(t)),e.date=t=>e.check(Vf(t)),e.time=t=>e.check(Uf(t)),e.duration=t=>e.check(Gf(t))});function up(e){return ld(lp,e)}var dp=I(`ZodStringFormat`,(e,t)=>{Zl.init(e,t),cp.init(e,t)}),fp=I(`ZodEmail`,(e,t)=>{eu.init(e,t),dp.init(e,t)}),pp=I(`ZodGUID`,(e,t)=>{Ql.init(e,t),dp.init(e,t)}),mp=I(`ZodUUID`,(e,t)=>{$l.init(e,t),dp.init(e,t)}),hp=I(`ZodURL`,(e,t)=>{tu.init(e,t),dp.init(e,t)}),gp=I(`ZodEmoji`,(e,t)=>{nu.init(e,t),dp.init(e,t)}),_p=I(`ZodNanoID`,(e,t)=>{ru.init(e,t),dp.init(e,t)}),vp=I(`ZodCUID`,(e,t)=>{iu.init(e,t),dp.init(e,t)}),yp=I(`ZodCUID2`,(e,t)=>{au.init(e,t),dp.init(e,t)}),bp=I(`ZodULID`,(e,t)=>{ou.init(e,t),dp.init(e,t)}),xp=I(`ZodXID`,(e,t)=>{su.init(e,t),dp.init(e,t)}),Sp=I(`ZodKSUID`,(e,t)=>{cu.init(e,t),dp.init(e,t)}),Cp=I(`ZodIPv4`,(e,t)=>{pu.init(e,t),dp.init(e,t)}),wp=I(`ZodIPv6`,(e,t)=>{mu.init(e,t),dp.init(e,t)}),Tp=I(`ZodCIDRv4`,(e,t)=>{hu.init(e,t),dp.init(e,t)}),Ep=I(`ZodCIDRv6`,(e,t)=>{gu.init(e,t),dp.init(e,t)}),Dp=I(`ZodBase64`,(e,t)=>{vu.init(e,t),dp.init(e,t)}),Op=I(`ZodBase64URL`,(e,t)=>{bu.init(e,t),dp.init(e,t)}),kp=I(`ZodE164`,(e,t)=>{xu.init(e,t),dp.init(e,t)}),Ap=I(`ZodJWT`,(e,t)=>{Cu.init(e,t),dp.init(e,t)}),jp=I(`ZodNumber`,(e,t)=>{wu.init(e,t),sp.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bf(e,t,n,r),op(e,`ZodNumber`,{gt(e,t){return this.check(Hd(e,t))},gte(e,t){return this.check(Ud(e,t))},min(e,t){return this.check(Ud(e,t))},lt(e,t){return this.check(Bd(e,t))},lte(e,t){return this.check(Vd(e,t))},max(e,t){return this.check(Vd(e,t))},int(e){return this.check(Np(e))},safe(e){return this.check(Np(e))},positive(e){return this.check(Hd(0,e))},nonnegative(e){return this.check(Ud(0,e))},negative(e){return this.check(Bd(0,e))},nonpositive(e){return this.check(Vd(0,e))},multipleOf(e,t){return this.check(Wd(e,t))},step(e,t){return this.check(Wd(e,t))},finite(){return this}});let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null}),Mp=I(`ZodNumberFormat`,(e,t)=>{Tu.init(e,t),jp.init(e,t)});function Np(e){return Ld(Mp,e)}var Pp=I(`ZodUnknown`,(e,t)=>{Eu.init(e,t),sp.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Fp(){return Rd(Pp)}var Ip=I(`ZodNever`,(e,t)=>{Du.init(e,t),sp.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xf(e,t,n,r)});function Lp(e){return zd(Ip,e)}var Rp=I(`ZodArray`,(e,t)=>{ku.init(e,t),sp.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ef(e,t,n,r),e.element=t.element,op(e,`ZodArray`,{min(e,t){return this.check(Kd(e,t))},nonempty(e){return this.check(Kd(1,e))},max(e,t){return this.check(Gd(e,t))},length(e,t){return this.check(qd(e,t))},unwrap(){return this.element}})});function zp(e,t){return sf(Rp,e,t)}var Bp=I(`ZodObject`,(e,t)=>{Pu.init(e,t),sp.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Df(e,t,n,r),ac(e,`shape`,()=>t.shape),op(e,`ZodObject`,{keyof(){return qp(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:Fp()})},loose(){return this.clone({...this._zod.def,catchall:Fp()})},strict(){return this.clone({...this._zod.def,catchall:Lp()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return Cc(this,e)},safeExtend(e){return wc(this,e)},merge(e){return Tc(this,e)},pick(e){return xc(this,e)},omit(e){return Sc(this,e)},partial(...e){return Ec(Qp,this,e[0])},required(...e){return Dc(im,this,e[0])}})});function Vp(e,t){return new Bp({type:`object`,shape:e??{},...vc(t)})}var Hp=I(`ZodUnion`,(e,t)=>{Iu.init(e,t),sp.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Of(e,t,n,r),e.options=t.options});function Up(e,t){return new Hp({type:`union`,options:e,...vc(t)})}var Wp=I(`ZodIntersection`,(e,t)=>{Lu.init(e,t),sp.init(e,t),e._zod.processJSONSchema=(t,n,r)=>kf(e,t,n,r)});function Gp(e,t){return new Wp({type:`intersection`,left:e,right:t})}var Kp=I(`ZodEnum`,(e,t)=>{Bu.init(e,t),sp.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Sf(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Kp({...t,checks:[],...vc(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new Kp({...t,checks:[],...vc(r),entries:i})}});function qp(e,t){return new Kp({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...vc(t)})}var Jp=I(`ZodLiteral`,(e,t)=>{Vu.init(e,t),sp.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Cf(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Yp(e,t){return new Jp({type:`literal`,values:Array.isArray(e)?e:[e],...vc(t)})}var Xp=I(`ZodTransform`,(e,t)=>{Hu.init(e,t),sp.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Tf(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Ys(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Pc(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(Pc(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}});function Zp(e){return new Xp({type:`transform`,transform:e})}var Qp=I(`ZodOptional`,(e,t)=>{Wu.init(e,t),sp.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Lf(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function $p(e){return new Qp({type:`optional`,innerType:e})}var em=I(`ZodExactOptional`,(e,t)=>{Gu.init(e,t),sp.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Lf(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function tm(e){return new em({type:`optional`,innerType:e})}var nm=I(`ZodNullable`,(e,t)=>{Ku.init(e,t),sp.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Af(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function rm(e){return new nm({type:`nullable`,innerType:e})}var eee=I(`ZodDefault`,(e,t)=>{qu.init(e,t),sp.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mf(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function tee(e,t){return new eee({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():mc(t)}})}var nee=I(`ZodPrefault`,(e,t)=>{Yu.init(e,t),sp.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Nf(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ree(e,t){return new nee({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():mc(t)}})}var im=I(`ZodNonOptional`,(e,t)=>{Xu.init(e,t),sp.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jf(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function am(e,t){return new im({type:`nonoptional`,innerType:e,...vc(t)})}var iee=I(`ZodCatch`,(e,t)=>{Qu.init(e,t),sp.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Pf(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function aee(e,t){return new iee({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var oee=I(`ZodPipe`,(e,t)=>{$u.init(e,t),sp.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ff(e,t,n,r),e.in=t.in,e.out=t.out});function om(e,t){return new oee({type:`pipe`,in:e,out:t})}var see=I(`ZodReadonly`,(e,t)=>{td.init(e,t),sp.init(e,t),e._zod.processJSONSchema=(t,n,r)=>If(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function cee(e){return new see({type:`readonly`,innerType:e})}var lee=I(`ZodCustom`,(e,t)=>{rd.init(e,t),sp.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wf(e,t,n,r)});function uee(e,t={}){return cf(lee,e,t)}function dee(e,t){return lf(e,t)}function fee(e){return Id(jp,e)}var sm=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),pee=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),mee=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),cm=e=>{let t=mee(e);return t.charAt(0).toUpperCase()+t.slice(1)},lm={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`},hee=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},gee=(0,M.createContext)({}),_ee=()=>(0,M.useContext)(gee),um=(0,M.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=``}=_ee()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,M.createElement)(`svg`,{ref:c,...lm,width:t??l??lm.width,height:t??l??lm.height,stroke:e??f,strokeWidth:m,className:sm(`lucide`,p,i),...!a&&!hee(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,M.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),dm=(e,t)=>{let n=(0,M.forwardRef)(({className:n,...r},i)=>(0,M.createElement)(um,{ref:i,iconNode:t,className:sm(`lucide-${pee(cm(e))}`,`lucide-${e}`,n),...r}));return n.displayName=cm(e),n},fm=dm(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),pm=dm(`bell`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]),mm=dm(`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`}]]),vee=dm(`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`}]]),hm=dm(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),gm=dm(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),yee=dm(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),_m=dm(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),vm=dm(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),ym=dm(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),bm=dm(`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`}]]),xm=dm(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),bee=dm(`circle-dot`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}]]),xee=dm(`circle-question-mark`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),See=dm(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),Cee=dm(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),wee=dm(`code`,[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]),Tee=dm(`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`}]]),Sm=dm(`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`}]]),Cm=dm(`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`}]]),wm=dm(`ellipsis-vertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),Eee=dm(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Tm=dm(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),Dee=dm(`flag`,[[`path`,{d:`M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528`,key:`1jaruq`}]]),Em=dm(`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`}]]),Dm=dm(`grip-vertical`,[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]),Oee=dm(`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`}]]),kee=dm(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),Om=dm(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),km=dm(`lock`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]),Am=dm(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),jm=dm(`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`}]]),Aee=dm(`mic`,[[`path`,{d:`M12 19v3`,key:`npa21l`}],[`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2`,key:`1vc78b`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`13`,rx:`3`,key:`s6n7sd`}]]),jee=dm(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),Mee=dm(`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`}]]),Nee=dm(`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`}]]),Pee=dm(`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`}]]),Mm=dm(`palette`,[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]),Fee=dm(`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`}]]),Iee=dm(`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`}]]),Lee=dm(`paperclip`,[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]),Ree=dm(`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`}]]),zee=dm(`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`}]]),Bee=dm(`pin-off`,[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89`,key:`znwnzq`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11`,key:`c9qhm2`}]]),Nm=dm(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),Vee=dm(`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`}]]),Pm=dm(`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`}]]),Fm=dm(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),Im=dm(`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`}]]),Lm=dm(`shield-check`,[[`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`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Rm=dm(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),Hee=dm(`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`}]]),Uee=dm(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),zm=dm(`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`}]]),Wee=dm(`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`}]]),Bm=dm(`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`}]]),Vm=dm(`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`}]]),Hm=dm(`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`}]]),Um=dm(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),Gee=dm(`wifi-off`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}],[`path`,{d:`M5 12.859a10 10 0 0 1 5.17-2.69`,key:`1dl1wf`}],[`path`,{d:`M19 12.859a10 10 0 0 0-2.007-1.523`,key:`4k23kn`}],[`path`,{d:`M2 8.82a15 15 0 0 1 4.177-2.643`,key:`1grhjp`}],[`path`,{d:`M22 8.82a15 15 0 0 0-11.288-3.764`,key:`z3jwby`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Wm=dm(`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`}]]),Gm=dm(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);function Km(e,t){return new Proxy({},{get(n,r){if(typeof r==`string`)return Km(e,[...t,r]);if(r===St){if(t.length<1){let n=[e,...t].join(`.`);throw Error(`API path is expected to be of the form \`${e}.childComponent.functionName\`. Found: \`${n}\``)}return`_reference/childComponent/`+t.join(`/`)}else return}})}var Kee=()=>Km(`components`,[]),L=kt;Kee();var qm=null;function qee(e,t){e.currentIndex=0,e.wipContextDeps=null,e.wipCommitCallbacks=[];let n=qm;qm=e;try{if(t(),e.isFirstRender=!1,e.cells.length!==e.currentIndex)throw Error(`Rendered ${e.currentIndex} hooks but expected ${e.cells.length}. Hooks must be called in the exact same order in every render.`)}finally{qm=n}}function Jm(){if(!qm)throw Error(`No resource fiber available`);return qm}function Ym(){return qm}var Xm=Symbol(`tap.Context.defaultValue`),Jee=e=>e,Zm=new Map,Qm=new Set,$m=()=>new Map(Zm),eh=(e,t)=>{let n=Zm;Zm=e;try{return t()}finally{Zm=n}},th=(e,t)=>{e[Xm]=t},nh=e=>typeof e==`object`&&!!e&&Xm in e,rh=e=>typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Symbol.for(`react.context`),ih=e=>nh(e)||rh(e),ah=e=>{if(!nh(e)){if(rh(e)){th(e,e._currentValue??e._currentValue2);return}throw Error("A tap resource's `use()` only accepts a tap context.")}},oh=(e,t,n)=>{if(typeof e!=`object`||!e)throw Error(`useContextProvider only accepts a React context.`);ah(e);let r=e,i=Jm(),a=Vh(void 0),o=a.current===void 0||!Object.is(a.current.value,t);Wh(()=>{a.current={value:t}},[t]);let s=Zm.get(r),c=s!==void 0||Zm.has(r);Zm.set(r,{value:t,source:i});try{return Yee(r,o,n)}finally{c?Zm.set(r,s):Zm.delete(r)}},Yee=(e,t,n)=>{let r=Qm.has(e);t?Qm.add(e):Qm.delete(e);try{return n()}finally{r?Qm.add(e):Qm.delete(e)}},Xee=e=>{ah(e);let t=e,n=Zee(t,e),r=Jm();return(r.wipContextDeps??=new Map).set(t,n.source),n.value},Zee=(e,t)=>Zm.get(e)??{value:Jee(t)[Xm],source:null},Qee=(e,t,n,r)=>{if(!r)return n;let i=n;for(let[n,a]of r)a===t||a===e||(i??=new Map).set(n,a);return i},sh=(e,t=e.wipContextDeps)=>{let n=Ym();!n||!t||(n.wipContextDeps=Qee(n,e,n.wipContextDeps,t))},ch=()=>Qm.size>0,lh=e=>{if(!e.contextDeps||!ch())return!1;for(let t of Qm.keys())if(e.contextDeps.has(t))return!0;return!1},$ee=[0,1,2,3];function uh(e){let t=[];for(let n of $ee){let r=e[n];if(r!==void 0)for(let e=0;e<r.length;e++)try{r[e]()}catch(e){t.push(e)}}if(t.length>0){if(t.length===1)throw t[0];for(let e of t)console.error(e);throw AggregateError(t,`Errors during commit`)}}function dh(e){let t=[];for(let n of e.cells)if(n?.type===`effect`&&(n.deps=null,n.cleanup))try{n.cleanup?.()}catch(e){t.push(e)}finally{n.cleanup=void 0}if(t.length>0){if(t.length===1)throw t[0];for(let e of t)console.error(e);throw AggregateError(t,`Errors during cleanup`)}}var fh=typeof process<`u`&&!1,ph=e=>({version:0,committedVersion:0,context:$m(),dispatchUpdate:e,changelog:[],rollbackCallbacks:[]}),mh=e=>{e.committedVersion=e.version,e.changelog.length=0,e.rollbackCallbacks.length=0},hh=(e,t)=>{let n=e.version>t;if(e.version=t,n){for(let t=0;t<e.rollbackCallbacks.length;t++)e.rollbackCallbacks[t]();if(e.rollbackCallbacks.length=0,t===e.committedVersion)e.changelog.length=0;else{if(e.committedVersion>t)throw Error(`Version is less than committed version`);for(;e.committedVersion+e.changelog.length>t;)e.changelog.pop();for(let t=0;t<e.changelog.length;t++)gh(e.changelog[t]);mh(e)}}},gh=e=>{yh(e.fiber,e.cell),e.queued||(e.queued=!0,(e.cell.queue??=[]).push(e))},_h=(e,t,n)=>{let r=e.wipCommitCallbacks;(r[t]??=[]).push(n)},vh=(e,t)=>{e.rollbackCallbacks.push(t)},yh=(e,t)=>{t.isDirty||(t.isDirty=!0,e.markDirty?.(),vh(e.root,()=>{if(t.queue!==null){for(let e of t.queue)e.queued=!1;t.queue=null}t.workInProgress=t.current,t.isDirty=!1}))},bh=()=>{throw Error(`Rendered more hooks than during the previous render. Hooks must be called in the exact same order in every render.`)},xh=()=>{throw Error(`Hook order changed between renders`)},ete=(e,t,n)=>{if(e.isNeverMounted)throw Error(`Resource updated before mount`);let r=!1,i=!0;e.root.dispatchUpdate(()=>r?i:(r=!0,n&&e.root.changelog.length===0&&!t.cell.isDirty&&!t.hasEagerState&&(t.eagerState=n(t.cell.workInProgress,t.action),t.hasEagerState=!0,i=!Object.is(t.cell.current,t.eagerState)),i),()=>(r=!0,i=!0,gh(t),e.root.changelog.push(t),!0))},tte=(e,t,n,r,i)=>{let a=r?r(n):n;fh&&e.devStrictMode&&r&&r(n);let o={type:`reducer`,workInProgress:a,current:a,isDirty:!1,queue:null,renderQueue:null,reducer:t,dispatch:n=>{let r=Ym();if(r!==null){if(r!==e)throw Error(`Cannot update a resource while rendering a different resource.`);(e.renderPendingCells??=new Set).add(o),(o.renderQueue??=[]).push(n)}else ete(e,{fiber:e,cell:o,action:n,hasEagerState:!1,eagerState:void 0,queued:!1},i?t:void 0)}};return o};function Sh(e,t,n,r){let i=Jm(),a=i.currentIndex++,o=i.cells[a],s=(()=>{if(o!==void 0)return o.type===`reducer`?o:xh();!i.isFirstRender&&a>=i.cells.length&&bh();let s=tte(i,e,t,n,r);return i.cells[a]=s,s})(),c=s.queue;if(c!==null){let t=e===s.reducer;for(let n=0;n<c.length;n++){let r=c[n];!r.hasEagerState||!t?(r.eagerState=e(s.workInProgress,r.action),r.hasEagerState=!0,fh&&i.devStrictMode&&(r.eagerState=e(s.workInProgress,r.action))):fh&&i.devStrictMode&&e(s.workInProgress,r.action),r.queued=!1,s.workInProgress=r.eagerState}s.queue=null}if(s.reducer=e,s.renderQueue!==null){let t=s.workInProgress;for(let n of s.renderQueue)t=e(t,n);s.renderQueue=null,i.renderPendingCells?.delete(s),Object.is(t,s.workInProgress)||(yh(i,s),s.workInProgress=t)}return s.isDirty&&_h(i,0,()=>{s.current=s.workInProgress,s.isDirty=!1}),[s.workInProgress,s.dispatch]}function Ch(e,t,n){return Sh(e,t,n,!1)}var wh=(e,t)=>typeof t==`function`?t(e):t,Th=e=>e===void 0?void 0:typeof e==`function`?e():e;function Eh(e){return Sh(wh,e,Th,!0)}var Dh=(e,t)=>{fh&&e.length!==t.length&&console.error(`The final argument passed to a hook changed size between renders. The order and size of this array must remain constant.
|
|
76
|
+
|
|
77
|
+
Previous: [${e.join(`, `)}]\nIncoming: [${t.join(`, `)}]`);for(let n=0;n<e.length&&n<t.length;n++)if(!Object.is(e[n],t[n]))return!1;return!0},Oh=(e,t)=>{_h(e,0,()=>{t.current=t.wip,t.currentDeps=t.wipDeps,t.isDirty=!1})},kh=(e,t)=>{let n=Jm(),r=n.currentIndex++,i=n.cells[r];if(i===void 0){!n.isFirstRender&&r>=n.cells.length&&bh();let a=e();return fh&&n.devStrictMode&&e(),i={type:`memo`,current:a,currentDeps:t,wip:a,wipDeps:t,isDirty:!1},n.cells[r]=i,a}i.type!==`memo`&&xh();let a=i;if(Dh(a.wipDeps,t))return a.isDirty&&Oh(n,a),a.wip;let o=e();return fh&&n.devStrictMode&&e(),a.wip=o,a.wipDeps=t,a.isDirty||(a.isDirty=!0,vh(n.root,()=>{a.wip=a.current,a.wipDeps=a.currentDeps,a.isDirty=!1})),Oh(n,a),o};function Ah(e){return kh(()=>({current:e}),[])}var jh=(e,t)=>kh(()=>e,t),nte=()=>({type:`effect`,cleanup:void 0,deps:null});function Mh(e,t){let n=Jm(),r=n.currentIndex++,i=n.cells[r],a=i===void 0?nte():i.type===`effect`?i:xh();if(i===void 0&&(!n.isFirstRender&&r>=n.cells.length&&bh(),n.cells[r]=a),!(t&&a.deps&&Dh(a.deps,t))){if(a.deps!==null&&!!t!=!!a.deps)throw Error(`useEffect called with and without dependencies across re-renders`);_h(n,2,()=>{try{a.cleanup?.()}finally{a.cleanup=void 0}}),_h(n,3,()=>{try{let t=e();if(t!==void 0&&typeof t!=`function`)throw Error(`An effect function must either return a cleanup function or nothing. Received: ${typeof t}`);a.cleanup=t}finally{a.deps=t}})}}function Nh(e){let t=Jm(),n=Ah(e);return n.current!==e&&_h(t,1,()=>{n.current=e}),jh(((...e)=>{if(fh&&Ym())throw Error(`useEffectEvent cannot be called during render`);return n.current(...e)}),[])}var Ph=e=>{if(!ih(e))throw Error("A tap resource's `use()` only accepts a tap context.");return Xee(e)},Fh=(e,t,n=t)=>{let r=Ah(!0),i=r.current?n():t();r.current=!1;let[,a]=Eh(0),o=Nh(()=>{Object.is(i,t())||a(e=>e+1)});return Mh(()=>(o(),e(o)),[e]),i},rte=(e,t)=>{},ite=M.default;function ate(e){let t=(0,M.useRef)(e);return(0,M.useInsertionEffect)(()=>{t.current=e}),(0,M.useCallback)(((...e)=>t.current(...e)),[])}var ote=ite.useEffectEvent??ate,Ih=s({createContext:()=>Yh,default:()=>M.default,use:()=>Xh,useCallback:()=>Uh,useContext:()=>Zh,useDebugValue:()=>Jh,useEffect:()=>Wh,useEffectEvent:()=>Kh,useLayoutEffect:()=>Gh,useMemo:()=>Hh,useReducer:()=>Bh,useRef:()=>Vh,useState:()=>zh,useSyncExternalStore:()=>qh});l(Ih,u(f(),1));var Lh=()=>Ym()!==null,Rh=M.default,zh=e=>Lh()?Eh(e):Rh.useState(e),Bh=(e,t,n)=>Lh()?Ch(e,t,n):Rh.useReducer(e,t,n),Vh=e=>Lh()?Ah(e):Rh.useRef(e),Hh=(e,t)=>Lh()?kh(e,t):Rh.useMemo(e,t),Uh=(e,t)=>Lh()?jh(e,t):Rh.useCallback(e,t),Wh=(e,t)=>Lh()?Mh(e,t):Rh.useEffect(e,t),Gh=(e,t)=>Lh()?Mh(e,t):Rh.useLayoutEffect(e,t),Kh=e=>Lh()?Nh(e):ote(e),qh=(e,t,n)=>Lh()?Fh(e,t,n):Rh.useSyncExternalStore(e,t,n),Jh=(e,t)=>Lh()?void 0:Rh.useDebugValue(e,t),Yh=e=>{let t=Rh.createContext(e);return th(t,e),t},Xh=e=>Lh()&&ih(e)?Ph(e):Rh.use(e),Zh=e=>Lh()&&ih(e)?Ph(e):Rh.useContext(e),Qh=M.default,$h=Symbol.for(`react.memo_cache_sentinel`),eg=e=>Array(e).fill($h),ste=e=>Qh.useMemo(()=>{let t=eg(e);return t[$h]=!0,t},[]),R=e=>{let t=Ym();if(t===null)return(Qh.__COMPILER_RUNTIME?.c??ste)(e);let n=t.memoCache,r=n.workInProgress;if(r===null){let e=n.current;r=e===null?[]:e.map(e=>e.slice()),n.workInProgress=r}let i=n.index++,a=r[i];return a===void 0?(a=eg(e),r[i]=a):fh&&a.length!==e&&console.error(`Expected a constant size argument for each invocation of c(). The previous cache was allocated with size ${a.length} but size ${e} was requested.`),a};function tg(e){return(...t)=>({hook:e,args:t})}function ng(e,t,n){return n?{...t,key:e,deps:n}:{...t,key:e}}var cte=50,rg={schedulers:new Set([]),isScheduled:!1},lte=class{_task;_isDirty=!1;constructor(e){this._task=e}get isDirty(){return this._isDirty}markDirty(){this._isDirty=!0,rg.schedulers.add(this),ute()}runTask(){this._isDirty=!1,this._task()}},ute=()=>{rg.isScheduled||(rg.isScheduled=!0,dte())},ig=()=>{try{let e=[],t=0;for(let n of rg.schedulers)if(rg.schedulers.delete(n),n.isDirty){if(t++,t>cte)throw Error(`Maximum update depth exceeded. This can happen when a resource repeatedly calls setState inside useEffect.`);try{n.runTask()}catch(t){e.push(t)}}if(e.length>0){if(e.length===1)throw e[0];for(let t of e)console.error(t);throw AggregateError(e,`Errors occurred during flushSync`)}}finally{rg.schedulers.clear(),rg.isScheduled=!1}},dte=(()=>{if(typeof MessageChannel<`u`){let e=new MessageChannel;return e.port1.onmessage=ig,()=>e.port2.postMessage(null)}return()=>setTimeout(ig,0)})(),ag=e=>{let t=rg;rg={schedulers:new Set([]),isScheduled:!0};try{let t=e();return ig(),t}finally{rg=t}},fte={useState:Eh,useReducer:Ch,useRef:Ah,useMemo:kh,useCallback:jh,useEffect:Mh,useLayoutEffect:Mh,useInsertionEffect:Mh,useEffectEvent:Nh,useContext:Ph,use:Ph,useSyncExternalStore:Fh,useDebugValue:rte},og=M.default,sg=og.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE??og.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,cg=sg==null?null:`H`in sg?{get current(){return sg.H},set current(e){sg.H=e}}:`ReactCurrentDispatcher`in sg?{get current(){return sg.ReactCurrentDispatcher.current},set current(e){sg.ReactCurrentDispatcher.current=e}}:null;function pte(e){if(!cg)return e();let t=cg.current;cg.current=fte;try{return e()}finally{cg.current=t}}function lg(e,t,n=void 0,r){return{hook:e,root:t,markDirty:n,devStrictMode:r,cells:[],contextDeps:null,wipContextDeps:null,commitCallbacks:null,wipCommitCallbacks:null,memoCache:{current:null,workInProgress:null,index:0},renderPendingCells:null,currentIndex:0,isFirstRender:!0,isMounted:!1,isNeverMounted:!0}}function ug(e){if(!e.isMounted)throw Error(`Tried to unmount a fiber that is already unmounted`);e.isMounted=!1,dh(e)}function dg(e,t){if(e.memoCache.workInProgress=null,e.renderPendingCells!==null){for(let t of e.renderPendingCells)t.renderQueue=null;e.renderPendingCells.clear()}let n=0,r;do{if(++n>25)throw Error(`Too many re-renders. tap limits the number of renders to prevent an infinite loop.`);e.memoCache.index=0,qee(e,()=>{r=pte(()=>e.hook(...t))})}while((e.renderPendingCells?.size??0)>0);return sh(e),r}function fg(e){let t=e.wipCommitCallbacks??e.commitCallbacks??[];e.wipCommitCallbacks=null,e.commitCallbacks=t,e.isMounted=!0,e.contextDeps=e.wipContextDeps,mh(e.root),e.memoCache.workInProgress!==null&&(e.memoCache.current=e.memoCache.workInProgress,e.memoCache.workInProgress=null),fh&&e.isNeverMounted&&e.devStrictMode===`root`&&(e.isNeverMounted=!1,uh(t),dh(e)),e.isNeverMounted=!1,uh(t)}var mte=()=>{let e=Jm();return e.devStrictMode?e.isFirstRender?`child`:`root`:null},hte=()=>`child`,pg=()=>null,gte=()=>{if(!fh)return pg;let e=Vh(0);return zh(()=>e.current++),e.current===2?hte:pg},mg=()=>Ym()?mte:gte(),_te=e=>e(),vte=e=>{let t=Hh(()=>new lte(()=>p()),[]),n=Hh(()=>[],[]),r=mg(),i=Hh(()=>{let e=ph((r,i)=>{if(!t.isDirty){if(!r())return;i()}hh(e,e.committedVersion+e.changelog.length),n.push(i),t.markDirty()});return lg(_te,e,void 0,r())},[n,t,r]),a=$m(),o=i.root.version-i.root.committedVersion,s=eh(a,()=>dg(i,[e])),c=Vh(!1),l=Vh([e]),u=Vh(s),d=Hh(()=>new Set,[]),f=e=>{t.isDirty||u.current===e||(u.current=e,d.forEach(e=>e()))},p=Kh(()=>{hh(i.root,i.root.committedVersion),n.forEach(e=>{fh&&i.devStrictMode&&e(),e()}),hh(i.root,i.root.committedVersion+i.root.changelog.length),fh&&i.devStrictMode&&eh(i.root.context,()=>dg(i,l.current));let e=eh(i.root.context,()=>dg(i,l.current));if(t.isDirty)throw Error(`Scheduler is dirty, this should never happen`);mh(i.root),n.length=0,c.current&&fg(i),f(e)});return Wh(()=>(c.current=!0,()=>{c.current=!1,ug(i)}),[i]),Wh(()=>{l.current=[e],mh(i.root),n.splice(0,o),i.root.context=a,fg(i),f(s)}),Hh(()=>({getValue:()=>u.current,subscribe:e=>(d.add(e),()=>d.delete(e))}),[d])},yte=()=>{let e=Vh(0),t=e.current,n=Jm();return{version:t,markDirty:Hh(()=>()=>{e.current++,n?.markDirty?.()},[n]),root:n.root}},bte=()=>{let e=Hh(()=>ph((e,t)=>{let i=!1;r(t=>(i=!e(),i?t:t+1)),i||n(t)}),[]),[t,n]=Bh((t,n)=>(hh(e,t),t+ +!!n()),0),[,r]=zh(0);return hh(e,t),{root:e,version:t,markDirty:void 0}},hg=()=>{let e=mg(),{root:t,version:n,markDirty:r}=Ym()?yte():bte();return{version:n,createFiber:Uh((n,i,a)=>lg(n,t,a?()=>{a(),r?.()}:r,e()),[])}},gg=(e,t,n)=>{let r=Vh(null),i=r.current??={wipDeps:null,wip:null,currentDeps:null,current:null};return i.wipDeps=i.currentDeps,i.wip=i.current,Wh(()=>{i.currentDeps=i.wipDeps,i.current=i.wip}),!n&&i.currentDeps&&Dh(i.currentDeps,t)?i.current:(i.wipDeps=t,i.wip=e(),i.wip)};function _g(e){let{version:t,createFiber:n}=hg(),r=Hh(()=>n(e.hook,e.key),[e.hook,e.key,n]),i=gg(()=>({value:dg(r,e.args)}),[r,t,e.args],lh(r));return Wh(()=>()=>ug(r),[r]),Wh(()=>{fg(r)},[r,i]),i.value}var vg=(e,t)=>{let n=e.get(t);n&&(n.isDirty=!0)},xte=(e,t)=>!e.isDirty&&!lh(e.fiber)&&t!==void 0&&e.committedDeps!==void 0&&Dh(e.committedDeps,t),Ste=e=>{if(!ch())return!1;for(let{fiber:t}of e.values())if(lh(t))return!0;return!1};function yg(e){let t=Hh(()=>new Map,[]),{version:n,createFiber:r}=hg(),i=Ste(t),a=gg(()=>{let n=new Set,i=[],a=0;for(let o=0;o<e.length;o++){let s=e[o],c=s.key;if(c===void 0)throw Error(`useResources did not provide a key for array at index ${o}`);if(n.has(c))throw Error(`Duplicate key ${c} in useResources`);n.add(c);let l=t.get(c);if(!l){let e=r(s.hook,s.key,()=>vg(t,c));l={fiber:e,next:{value:dg(e,s.args),deps:s.deps},isDirty:!1,committedDeps:void 0,committedValue:void 0},a++,t.set(c,l)}else if(l.fiber.hook!==s.hook){let e=r(s.hook,s.key,()=>vg(t,c)),n=dg(e,s.args);l.next={value:n,deps:s.deps,remount:e}}else if(xte(l,s.deps))l.fiber.contextDeps&&sh(l.fiber,l.fiber.contextDeps),l.next=`skip`;else{let e=dg(l.fiber,s.args);l.next={value:e,deps:s.deps}}i.push(typeof l.next==`object`?l.next.value:l.committedValue)}if(t.size>i.length-a)for(let e of t.keys())n.has(e)||(t.get(e).next=`delete`);return i},[e,t,r,n],i);return Wh(()=>()=>{for(let e of t.keys()){let n=t.get(e).fiber;ug(n)}},[t]),Wh(()=>{for(let[e,n]of t.entries()){let r=n.next;r===`delete`?(n.fiber.isMounted&&ug(n.fiber),t.delete(e)):r===`skip`||(r.remount&&(ug(n.fiber),n.fiber=r.remount),fg(n.fiber),n.committedDeps=r.deps,n.committedValue=r.value,n.isDirty=!1)}},[a,t]),a}var Cte=e=>e(),wte=e=>{let{createFiber:t}=hg(),n=Hh(()=>t(Cte,void 0),[t]),r=dg(n,[e]);Wh(()=>()=>{ug(n)},[n]);let i=!1,a=()=>{i&&n.isMounted||(i=!0,fg(n))};return Wh(a),{value:r,effects:a}},Tte=tg(()=>{let e=R(4),[t,n]=zh(Ete),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(e,t)=>(n(n=>({...n,renderers:{...n.renderers,[e]:[...n.renderers[e]??[],t]}})),()=>{n(n=>({...n,renderers:{...n.renderers,[e]:n.renderers[e]?.filter(e=>e!==t)??[]}}))}),e[0]=r):r=e[0];let i=r,a;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(a=e=>(n(t=>({...t,fallbacks:[...t.fallbacks,e]})),()=>{n(t=>({...t,fallbacks:t.fallbacks.filter(t=>t!==e)}))}),e[1]=a):a=e[1];let o=a,s;return e[2]===t?s=e[3]:(s={getState:()=>t,setDataUI:i,setFallbackDataUI:o},e[2]=t,e[3]=s),s});function Ete(){return{renderers:{},fallbacks:[]}}var Dte=e=>{let t=Array.from(e).map(e=>e.getModelContext()).sort((e,t)=>(t.priority??0)-(e.priority??0)),n={};return t.reduce((e,t)=>{let r=t.priority??0;if(t.system&&(e.system?e.system+=`\n\n${t.system}`:e.system=t.system),t.tools)for(let[i,a]of Object.entries(t.tools)){let t=e.tools?.[i];if(t&&t!==a){let o=n[i];if(o===r)throw Error(`You tried to define a tool with the name ${i}, but it already exists.`);let s=o>r?t:a,c=o>r?a:t;e.tools[i]={...c,...s},n[i]=Math.max(o,r);continue}e.tools||={},e.tools[i]=a,n[i]??=r}return t.config&&(e.config={...e.config,...t.config}),t.callSettings&&(e.callSettings={...e.callSettings,...t.callSettings}),e},{})},bg=class{_providers=new Set;getModelContext(){return Dte(this._providers)}registerModelContextProvider(e){this._providers.add(e);let t=e.subscribe?.(()=>{this.notifySubscribers()});return this.notifySubscribers(),()=>{this._providers.delete(e),t?.(),this.notifySubscribers()}}_subscribers=new Set;notifySubscribers(){for(let e of this._subscribers)e()}subscribe(e){return this._subscribers.add(e),()=>{this._subscribers.delete(e)}}},xg=[],Ote={modelName:void 0,toolNames:xg},kte=(e,t)=>e===t||e.length===t.length&&e.every((e,n)=>e===t[n]),Sg=(e,t)=>{let n=e.getModelContext(),r=n.config?.modelName,i=n.tools?Object.keys(n.tools).sort():xg,a=i.length?i:xg;return r===t.modelName&&kte(a,t.toolNames)?t:{modelName:r,toolNames:a}},Cg=tg(()=>{let e=R(11),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=new bg,e[0]=t):t=e[0];let n=t,r;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>Sg(n,Ote),e[1]=r):r=e[1];let[i,a]=zh(r),o,s;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>(a(e=>Sg(n,e)),n.subscribe(()=>{a(e=>Sg(n,e))})),s=[n],e[2]=o,e[3]=s):(o=e[2],s=e[3]),Wh(o,s);let c;e[4]===i?c=e[5]:(c=()=>Sg(n,i),e[4]=i,e[5]=c);let l,u,d;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>n.getModelContext(),u=e=>n.subscribe(e),d=e=>n.registerModelContextProvider(e),e[6]=l,e[7]=u,e[8]=d):(l=e[6],u=e[7],d=e[8]);let f;return e[9]===c?f=e[10]:(f={getState:c,getModelContext:l,subscribe:u,register:d},e[9]=c,e[10]=f),f}),wg=e=>e.display===void 0?e.type===`human`:e.display===`standalone`,Tg=(e,t)=>{if(!(t.status?.type===`running`||t.status?.type===`requires-action`)){let n=e.complete;return typeof n==`function`?n({args:t.args,result:t.result}):n??null}let n=e.running;return typeof n==`function`?n({args:t.args}):n??null},Ate=e=>function(t){return Tg(e,t)},Eg=Symbol(`assistant-ui.store.clientIndex`),jte=e=>e[Eg],Dg=Yh([]),Og=()=>Xh(Dg),Mte=(e,t)=>{let n=R(3),r=Og(),i;return n[0]!==e||n[1]!==r?(i=[...r,e],n[0]=e,n[1]=r,n[2]=i):i=n[2],oh(Dg,i,t)},Nte=new Set([`$$typeof`,`nodeType`,`then`]),kg=(e,t)=>{if(e===Symbol.toStringTag)return t;if(typeof e!=`symbol`){if(e===`toJSON`)return()=>t;if(!Nte.has(e))return!1}},Ag=class{getOwnPropertyDescriptor(e,t){let n=this.get(e,t);if(n!==void 0)return{value:n,writable:!1,enumerable:!0,configurable:!1}}set(){return!1}setPrototypeOf(){return!1}defineProperty(){return!1}deleteProperty(){return!1}preventExtensions(){return!1}},jg=Symbol(`assistant-ui.store.getValue`),Pte=e=>{let t=e[jg];if(!t)throw Error(`Client scope contains a non-client resource. Ensure your Derived get() returns a client created with useClientResource(), not a plain resource.`);return t.getState?.()},Mg=new Map;function Fte(e){let t=Mg.get(e);return t||(t=function(...t){if(!this||typeof this!=`object`)throw Error(`Method "${String(e)}" called without proper context. This may indicate the function was called incorrectly.`);let n=this[jg];if(!n)throw Error(`Method "${String(e)}" called on invalid client proxy. Ensure you are calling this method on a valid client instance.`);let r=n[e];if(!r)throw Error(`Method "${String(e)}" is not implemented.`);if(typeof r!=`function`)throw Error(`"${String(e)}" is not a function.`);return r(...t)},Mg.set(e,t)),t}var Ite=class extends Ag{outputRef;index;boundFns;cachedReceiver;constructor(e,t){super(),this.outputRef=e,this.index=t}get(e,t,n){if(t===jg)return this.outputRef.current;if(t===Eg)return this.index;let r=kg(t,`ClientProxy`);if(r!==!1)return r;let i=this.outputRef.current[t];if(typeof i==`function`){this.cachedReceiver!==n&&(this.boundFns=new Map,this.cachedReceiver=n);let e=this.boundFns.get(t);return e||(e=Fte(t).bind(n),this.boundFns.set(t,e)),e}return i}ownKeys(){return Object.keys(this.outputRef.current)}has(e,t){return t===jg||t===Eg?!0:t in this.outputRef.current}},Ng=e=>{let t=Vh(null),n=Og().length,r=Hh(()=>new Proxy({},new Ite(t,n)),[n]),i=Mte(r,function(){return _g(e)});return t.current||=i,Wh(()=>{t.current=i}),{methods:r,state:i.getState?.(),key:e.key}},Lte=tg(Ng),Pg=Symbol(`assistant-ui.store.proxiedAssistantState`),Fg=e=>e===`on`||e===`subscribe`||typeof e==`symbol`,Ig=e=>{class t extends Ag{get(t,n){let r=kg(n,`AssistantState`);if(r!==!1)return r;let i=n;if(!Fg(i))return Pte(e[i]())}ownKeys(){return Object.keys(e).filter(e=>!Fg(e))}has(t,n){return!Fg(n)&&n in e}}return new Proxy({},new t)},Rte=e=>e[Pg],zte=()=>()=>{},Lg=e=>{let t=(()=>{throw Error(e)});return t.source=null,t.query=null,t},Rg=new Proxy({},new class extends Ag{get(e,t){if(t===`subscribe`||t===`on`)return zte;if(t===Pg)return Bte;let n=kg(t,`DefaultAssistantClient`);return n===!1?Lg(`You are using a component or hook that requires an AuiProvider. Wrap your component in an <AuiProvider> component.`):n}ownKeys(){return[`subscribe`,`on`,Pg]}has(e,t){return t===`subscribe`||t===`on`||t===Pg}}),Bte=Ig(Rg),Vte=()=>new Proxy({},{get(e,t){let n=kg(t,`AssistantClient`);return n===!1?Lg(`The current scope does not have a "${String(t)}" property.`):n}}),zg=Yh(Rg),Bg=Symbol(`assistant-ui.store.useEffects`),Hte=()=>{},Ute=e=>e[Bg]??Hte,Wte=()=>{"use no memo";return Wh(Ute(Vg())),null},Vg=()=>Zh(zg),Hg=({value:e,children:t})=>{"use no memo";return(0,F.jsxs)(zg.Provider,{value:e,children:[(0,F.jsx)(Wte,{}),t]})},Ug=e=>null,Wg=tg(Ug),Gg=Symbol(`assistant-ui.transform-scopes`);function Kg(e,t){let n=e;if(n[Gg])throw Error(`transformScopes is already attached to this resource`);n[Gg]=t}function Gte(e){return e[Gg]}var qg=e=>typeof e==`string`?{scope:e.split(`.`)[0],event:e}:{scope:e.scope,event:e.event},Jg=Yh(null),Kte=(e,t)=>oh(Jg,e,t),Yg=()=>{let e=Xh(Jg);if(!e)throw Error(`AssistantTapContext is not available`);return e},Xg=()=>Yg().clientRef,Zg=()=>{let e=R(3),{emit:t}=Yg(),n=Og(),r;return e[0]!==n||e[1]!==t?(r=(e,r)=>{t(e,r,n)},e[0]=n,e[1]=t,e[2]=r):r=e[2],Kh(r)};function qte(e,t){let n={...e},r=new Set,i=!0;for(;i;){i=!1;for(let e of Object.values(n)){if(e.hook===Ug||r.has(e.hook))continue;r.add(e.hook);let a=Gte(e.hook);if(a){a(n,t),i=!0;break}}}let a={},o={};for(let[e,t]of Object.entries(n))t.hook===Ug?o[e]=t:a[e]=t;return{rootClients:a,derivedClients:o}}var Qg=e=>Hh(()=>e,[...Object.entries(e).flat()]),Jte=(e,t)=>{let n=R(6),r;n[0]!==t||n[1]!==e?(r=qte(e,t),n[0]=t,n[1]=e,n[2]=r):r=n[2];let{rootClients:i,derivedClients:a}=r,o=Qg(i),s=Qg(a),c;return n[3]!==o||n[4]!==s?(c={rootClients:o,derivedClients:s},n[3]=o,n[4]=s,n[5]=c):c=n[5],c},Yte=tg(()=>{let e=R(3),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=new Map,e[0]=t):t=e[0];let n=t,r;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(r=new Set,e[1]=r):r=e[1];let i=r,a;if(e[2]===Symbol.for(`react.memo_cache_sentinel`)){let t=new Set;a={on(e,t){let r=t;if(e===`*`)return i.add(r),()=>i.delete(r);let a=n.get(e);return a||(a=new Set,n.set(e,a)),a.add(r),()=>{a.delete(r),a.size===0&&n.delete(e)}},emit(e,t,r){let a=n.get(e);!a&&i.size===0||queueMicrotask(()=>{let n=[];if(a)for(let e of a)try{e(t,r)}catch(e){let t=e;n.push(t)}if(i.size>0){let a={event:e,payload:t};for(let e of i)try{e(a,r)}catch(e){let t=e;n.push(t)}}if(n.length>0){if(n.length===1)throw n[0];for(let e of n)console.error(e);throw AggregateError(n,`Errors occurred during event emission`)}})},subscribe(e){return t.add(e),()=>t.delete(e)},notifySubscribers(){for(let e of t)try{e()}catch(e){console.error(`NotificationManager: subscriber callback error`,e)}}},e[2]=a}else a=e[2];return a}),$g=e=>Hh(()=>e,e),Xte=({element:e,emit:t,clientRef:n})=>{let{methods:r,state:i}=Kte({clientRef:n,emit:t},function(){return Ng(e)});return Hh(()=>({state:i,methods:r}),[r,i])},Zte=tg(({element:e,notifications:t,clientRef:n,name:r})=>{let i=vte(function(){return Xte({element:e,emit:t.emit,clientRef:n})});return Wh(()=>i.subscribe(t.notifySubscribers),[i,t]),Hh(()=>{let e=()=>i.getValue().methods;return Object.defineProperties(e,{source:{value:`root`,writable:!1},query:{value:{},writable:!1},name:{value:r,configurable:!0}}),e},[i,r])}),Qte=tg(()=>{let e=R(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n={clients:t,subscribe:void 0,on:void 0},e[1]=n):n=e[1],n}),$te=e=>{let t=R(14),{clients:n,clientRef:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=Yte(),t[0]=i):i=t[0];let a=_g(i),o;t[1]!==r.parent||t[2]!==a.notifySubscribers?(o=()=>r.parent.subscribe(a.notifySubscribers),t[1]=r.parent,t[2]=a.notifySubscribers,t[3]=o):o=t[3];let s;t[4]!==r||t[5]!==a?(s=[r,a],t[4]=r,t[5]=a,t[6]=s):s=t[6],Wh(o,s);let c;t[7]!==r||t[8]!==n||t[9]!==a?(c=Object.keys(n).map(e=>ng(e,Zte({element:n[e],notifications:a,clientRef:r,name:e}))),t[7]=r,t[8]=n,t[9]=a,t[10]=c):c=t[10];let l=$g(yg(c)),u;return t[11]!==a||t[12]!==l?(u={notifications:a,results:l},t[11]=a,t[12]=l,t[13]=u):u=t[13],u},ene=tg(e=>{let{clientRef:t}=e,{notifications:n,results:r}=$te(e);return Hh(()=>({clients:r,subscribe:n.subscribe,on:function(e,r){if(!this)throw Error(`const { on } = useAui() is not supported. Use aui.on() instead.`);let{scope:i,event:a}=qg(e);if(i!==`*`&&this[i].source===null)throw Error(`Scope "${i}" is not available. Use { scope: "*", event: "${a}" } to listen globally.`);let o=n.on(a,(e,t)=>{if(i===`*`){r(e);return}let n=this[i]();n===t[jte(n)]&&r(e)});if(i!==`*`&&t.parent[i].source===null)return o;let s=t.parent.on(e,r);return()=>{o(),s()}}}),[r,n,t])}),tne=tg(({element:e,clientRef:t,name:n})=>{let r=Vh(e.args[0]);return r.current=e.args[0],Hh(()=>{let e=()=>r.current.get(t.current);return Object.defineProperties(e,{source:{value:r.current.source},query:{value:r.current.query},name:{value:n,configurable:!0}}),e},[t,n])}),nne=(e,t)=>{let n;try{let e={};for(let n of Object.keys(t.query).sort())e[n]=t.query[n];n=JSON.stringify(e)}catch{n=String(t.query)}return`${e}::${t.source}::${n}`},rne=e=>{let t=R(3),{clients:n,clientRef:r}=e,i;return t[0]!==r||t[1]!==n?(i=Object.keys(n).map(e=>{let t=e,i=n[t];return ng(nne(t,i.args[0]),tne({element:i,clientRef:r,name:t}))}),t[0]=r,t[1]=n,t[2]=i):i=t[2],$g(yg(i))},ine=e=>{let t=R(3),{rootClients:n,clientRef:r}=e,i;return t[0]!==r||t[1]!==n?(i=Object.keys(n).length>0?ene({clients:n,clientRef:r}):Qte(),t[0]=r,t[1]=n,t[2]=i):i=t[2],_g(i)},ane=({parent:e,clients:t})=>{let{rootClients:n,derivedClients:r}=Jte(t,e),i=Vh({parent:e,current:null}).current;Wh(()=>{i.current=s});let a=ine({rootClients:n,clientRef:i}),o=rne({clients:r,clientRef:i}),s=Hh(()=>{let t=e===Rg?Vte():e,n=Object.create(t);Object.assign(n,{subscribe:a.subscribe??e.subscribe,on:a.on??e.on,[Pg]:Ig(n)});for(let e of a.clients)n[e.name]=e;for(let e of o)n[e.name]=e;return n},[e,a,o]);return i.current===null&&(i.current=s),s},one=e=>{let{value:t,effects:n}=wte(function(){return ane(e)});return t[Bg]=n,t};function e_(e,{parent:t}={parent:Vg()}){if(e)return one({parent:t??Rg,clients:e});if(t===null)throw Error(`received null parent, this usage is not allowed`);return t}var z=e=>{let t=R(6),n=e_(),r;t[0]===n?r=t[1]:(r=Rte(n),t[0]=n,t[1]=r);let i=r,a,o;t[2]!==i||t[3]!==e?(a=()=>e(i),o=()=>e(i),t[2]=i,t[3]=e,t[4]=a,t[5]=o):(a=t[4],o=t[5]);let s=qh(n.subscribe,a,o);if(s===i)throw Error(`You tried to return the entire AssistantState. This is not supported due to technical limitations.`);return Jh(s),s},sne=e=>{let t=e_(),n=Vh(!1),r=n.current?null:e(t);return z(()=>n.current?e(t):r),()=>(n.current=!0,e(t))},cne=Object.freeze({});function t_(e){let t=R(3),{getItemState:n,children:r}=e,i=sne(n),a;return t[0]!==r||t[1]!==i?(a=r(i),t[0]=r,t[1]=i,t[2]=a):a=t[2],lne(a)}var lne=e=>{let t=typeof e==`object`&&e&&`type`in e?e:null,n=t?.type,r=t?.key;return Hh(()=>t,[n,r,typeof t?.props==`object`&&t.props!=null&&Object.entries(t.props).length===0?cne:t?.props])??e},une=M.createContext(!0);function n_(){throw Error(`A function wrapped in useEffectEvent can't be called during rendering.`)}var dne=`use`in M.default?()=>{try{return M.use(une)}catch{return!1}}:()=>!1;function fne(e){let t=M.useRef(n_);return M.useInsertionEffect(()=>{t.current=e},[e]),(...e)=>{dne()&&n_();let n=t.current;return n(...e)}}var r_=(e,t)=>{let n=R(11),r=e_(),i=fne(t),a;n[0]===e?a=n[1]:(a=qg(e),n[0]=e,n[1]=a);let{scope:o,event:s}=a,c;n[2]!==r||n[3]!==i||n[4]!==s||n[5]!==o?(c=()=>r.on({scope:o,event:s},i),n[2]=r,n[3]=i,n[4]=s,n[5]=o,n[6]=c):c=n[6];let l;n[7]!==r||n[8]!==s||n[9]!==o?(l=[r,o,s],n[7]=r,n[8]=s,n[9]=o,n[10]=l):l=n[10],Wh(c,l)},pne=e=>{if(e.key===void 0)throw Error(`useClientLookup: Element has no key`);return e.key};function i_(e){let t=R(15),n;t[0]===e?n=t[1]:(n=e.map(s_),t[0]=e,t[1]=n);let r=yg(n),i;t[2]===r?i=t[3]:(i=Object.keys(r),t[2]=r,t[3]=i);let a=i,o;t[4]===r?o=t[5]:(o=r.reduce(o_,{}),t[4]=r,t[5]=o);let s=o,c;t[6]===r?c=t[7]:(c=r.map(a_),t[6]=r,t[7]=c);let l=c,u;t[8]!==s||t[9]!==a||t[10]!==r?(u=e=>{if(`index`in e){if(e.index<0||e.index>=a.length)throw Error(`useClientLookup: Index ${e.index} out of bounds (length: ${a.length})`);return r[e.index].methods}let t=s[e.key];if(t===void 0)throw Error(`useClientLookup: Key "${e.key}" not found`);return r[t].methods},t[8]=s,t[9]=a,t[10]=r,t[11]=u):u=t[11];let d;return t[12]!==l||t[13]!==u?(d={state:l,get:u},t[12]=l,t[13]=u,t[14]=d):d=t[14],d}function a_(e){return e.state}function o_(e,t,n){return e[t.key]=n,e}function s_(e){return ng(pne(e),Lte(e),e.deps)}var c_=e=>{let t=R(15),{toolkit:n,mcpApp:r}=e,i;t[0]===r?i=t[1]:(i=r?[ng(`mcpApp`,r)]:[],t[0]=r,t[1]=i);let a=yg(i)[0],[o,s]=zh(u_),c;t[2]===o?c=t[3]:(c=Object.fromEntries(Object.entries(o).map(hne)),t[2]=o,t[3]=c);let l;t[4]!==a||t[5]!==c||t[6]!==o?(l={toolUIs:o,mcpApp:a,tools:c},t[4]=a,t[5]=c,t[6]=o,t[7]=l):l=t[7];let u=l,d=Xg(),f;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(f=(e,t,n)=>{let r={render:t,standalone:n?.standalone??!1};return s(t=>({...t,[e]:[...t[e]??[],r]})),()=>{s(t=>{let n=t[e]?.filter(e=>e!==r)??[];if(n.length>0)return{...t,[e]:n};let i={...t};return delete i[e],i})}},t[8]=f):f=t[8];let p=f,m,h;t[9]!==d||t[10]!==n?(m=()=>{if(!n)return;let e=[];for(let[t,r]of Object.entries(n)){let n=`render`in r?r.render:void 0,i=`renderText`in r?r.renderText:void 0,a=n??(i?Ate(i):void 0);a&&e.push(p(t,a,{standalone:wg(r)}))}let t=Object.entries(n).reduce(gne,{});return e.push(d.current.modelContext().register({getModelContext:()=>({tools:t})})),()=>{e.forEach(_ne)}},h=[n,p,d],t[9]=d,t[10]=n,t[11]=m,t[12]=h):(m=t[11],h=t[12]),Wh(m,h);let g;return t[13]===u?g=t[14]:(g={getState:()=>u,setToolUI:p},t[13]=u,t[14]=g),g},l_=tg(c_);Kg(c_,(e,t)=>{!e.modelContext&&t.modelContext.source===null&&(e.modelContext=Cg())});function u_(){return{}}function mne(e){return e.render}function hne(e){let[t,n]=e;return[t,n.map(mne)]}function gne(e,t){let[n,r]=t;if(r.type===`mcp`)return e;let{display:i,render:a,renderText:o,...s}=r;return e[n]=s,e}function _ne(e){return e()}var d_=e=>qh(e.subscribe,e.getState),f_=tg(e=>{let t=R(8),{runtime:n}=e,r=d_(n),i;t[0]===r?i=t[1]:(i=()=>r,t[0]=r,t[1]=i);let a;t[2]===n?a=t[3]:(a=()=>n,t[2]=n,t[3]=a);let o;return t[4]!==n.remove||t[5]!==i||t[6]!==a?(o={getState:i,remove:n.remove,__internal_getRuntime:a},t[4]=n.remove,t[5]=i,t[6]=a,t[7]=o):o=t[7],o}),vne=tg(e=>{let t=R(5),{runtime:n,index:r}=e,i;t[0]!==r||t[1]!==n?(i=n.getAttachmentByIndex(r),t[0]=r,t[1]=n,t[2]=i):i=t[2];let a=i,o;return t[3]===a?o=t[4]:(o=f_({runtime:a}),t[3]=a,t[4]=o),_g(o)}),yne=tg(({item:e,onSteer:t,onRemove:n})=>({getState:()=>e,steer:t,remove:n})),p_=tg(e=>{let t=R(55),{threadIdRef:n,messageIdRef:r,runtime:i}=e,a=d_(i),o=Zg(),s,c;t[0]!==o||t[1]!==r||t[2]!==i||t[3]!==n?(s=()=>{let e=[];for(let t of[`send`,`attachmentAdd`]){let a=i.unstable_on(t,()=>{o(`composer.${t}`,{threadId:n.current,...r&&{messageId:r.current}})});e.push(a)}return e.push(i.unstable_on(`attachmentAddError`,e=>{o(`composer.attachmentAddError`,{threadId:n.current,...r&&{messageId:r.current},...e.attachmentId&&{attachmentId:e.attachmentId},reason:e.reason,message:e.message})})),()=>{for(let t of e)t()}},c=[i,o,n,r],t[0]=o,t[1]=r,t[2]=i,t[3]=n,t[4]=s,t[5]=c):(s=t[4],c=t[5]),Wh(s,c);let l;if(t[6]!==i||t[7]!==a.attachments){let e;t[9]===i?e=t[10]:(e=(e,t)=>ng(e.id,vne({runtime:i,index:t}),[i,t]),t[9]=i,t[10]=e),l=a.attachments.map(e),t[6]=i,t[7]=a.attachments,t[8]=l}else l=t[8];let u=i_(l),d=a.queue,f;if(t[11]!==d||t[12]!==i){let e;t[14]===i?e=t[15]:(e=e=>ng(e.id,yne({item:e,onSteer:()=>i.steerQueueItem(e.id),onRemove:()=>i.removeQueueItem(e.id)})),t[14]=i,t[15]=e),f=d.map(e),t[11]=d,t[12]=i,t[13]=f}else f=t[13];let p=i_(f),m=a.type??`thread`,h;t[16]!==u.state||t[17]!==d||t[18]!==a.attachmentAccept||t[19]!==a.canCancel||t[20]!==a.canSend||t[21]!==a.dictation||t[22]!==a.isEditing||t[23]!==a.isEmpty||t[24]!==a.quote||t[25]!==a.role||t[26]!==a.runConfig||t[27]!==a.text||t[28]!==m?(h={text:a.text,role:a.role,attachments:u.state,runConfig:a.runConfig,isEditing:a.isEditing,canCancel:a.canCancel,canSend:a.canSend,attachmentAccept:a.attachmentAccept,isEmpty:a.isEmpty,type:m,dictation:a.dictation,quote:a.quote,queue:d},t[16]=u.state,t[17]=d,t[18]=a.attachmentAccept,t[19]=a.canCancel,t[20]=a.canSend,t[21]=a.dictation,t[22]=a.isEditing,t[23]=a.isEmpty,t[24]=a.quote,t[25]=a.role,t[26]=a.runConfig,t[27]=a.text,t[28]=m,t[29]=h):h=t[29];let g=h,_;t[30]===g?_=t[31]:(_=()=>g,t[30]=g,t[31]=_);let v=i.beginEdit??bne,y;t[32]===u?y=t[33]:(y=e=>`id`in e?u.get({key:e.id}):u.get(e),t[32]=u,t[33]=y);let b;t[34]===p?b=t[35]:(b=e=>p.get(e),t[34]=p,t[35]=b);let x;t[36]===i?x=t[37]:(x=()=>i,t[36]=i,t[37]=x);let S;return t[38]!==i.addAttachment||t[39]!==i.cancel||t[40]!==i.clearAttachments||t[41]!==i.reset||t[42]!==i.send||t[43]!==i.setQuote||t[44]!==i.setRole||t[45]!==i.setRunConfig||t[46]!==i.setText||t[47]!==i.startDictation||t[48]!==i.stopDictation||t[49]!==b||t[50]!==x||t[51]!==_||t[52]!==v||t[53]!==y?(S={getState:_,setText:i.setText,setRole:i.setRole,setRunConfig:i.setRunConfig,addAttachment:i.addAttachment,reset:i.reset,clearAttachments:i.clearAttachments,send:i.send,cancel:i.cancel,beginEdit:v,startDictation:i.startDictation,stopDictation:i.stopDictation,setQuote:i.setQuote,attachment:y,queueItem:b,__internal_getRuntime:x},t[38]=i.addAttachment,t[39]=i.cancel,t[40]=i.clearAttachments,t[41]=i.reset,t[42]=i.send,t[43]=i.setQuote,t[44]=i.setRole,t[45]=i.setRunConfig,t[46]=i.setText,t[47]=i.startDictation,t[48]=i.stopDictation,t[49]=b,t[50]=x,t[51]=_,t[52]=v,t[53]=y,t[54]=S):S=t[54],S});function bne(){throw Error(`beginEdit is not supported in this runtime`)}var m_=e=>({get current(){return e()}}),xne=tg(e=>{let t=R(13),{runtime:n}=e,r=d_(n),i;t[0]===r?i=t[1]:(i=()=>r,t[0]=r,t[1]=i);let a,o,s,c;t[2]===n?(a=t[3],o=t[4],s=t[5],c=t[6]):(a=e=>n.addToolResult(e),o=e=>n.resumeToolCall(e),s=e=>n.respondToToolApproval(e),c=()=>n,t[2]=n,t[3]=a,t[4]=o,t[5]=s,t[6]=c);let l;return t[7]!==i||t[8]!==a||t[9]!==o||t[10]!==s||t[11]!==c?(l={getState:i,addToolResult:a,resumeToolCall:o,respondToToolApproval:s,__internal_getRuntime:c},t[7]=i,t[8]=a,t[9]=o,t[10]=s,t[11]=c,t[12]=l):l=t[12],l}),Sne=tg(e=>{let t=R(5),{runtime:n,index:r}=e,i;t[0]!==r||t[1]!==n?(i=n.getAttachmentByIndex(r),t[0]=r,t[1]=n,t[2]=i):i=t[2];let a=i,o;return t[3]===a?o=t[4]:(o=f_({runtime:a}),t[3]=a,t[4]=o),_g(o)}),Cne=tg(e=>{let t=R(5),{runtime:n,index:r}=e,i;t[0]!==r||t[1]!==n?(i=n.getMessagePartByIndex(r),t[0]=r,t[1]=n,t[2]=i):i=t[2];let a=i,o;return t[3]===a?o=t[4]:(o=xne({runtime:a}),t[3]=a,t[4]=o),_g(o)}),wne=tg(e=>{let t=R(55),{runtime:n,threadIdRef:r}=e,i=d_(n),[a,o]=zh(!1),[s,c]=zh(!1),l;t[0]===n?l=t[1]:(l=m_(()=>n.getState().id),t[0]=n,t[1]=l);let u=l,d;t[2]!==u||t[3]!==n.composer||t[4]!==r?(d=p_({runtime:n.composer,threadIdRef:r,messageIdRef:u}),t[2]=u,t[3]=n.composer,t[4]=r,t[5]=d):d=t[5];let f=Ng(d),p;if(t[6]!==n||t[7]!==i.content){let e;t[9]===n?e=t[10]:(e=(e,t)=>ng(`toolCallId`in e&&e.toolCallId!=null?`toolCallId-${e.toolCallId}`:`index-${t}`,Cne({runtime:n,index:t}),[n,t]),t[9]=n,t[10]=e),p=i.content.map(e),t[6]=n,t[7]=i.content,t[8]=p}else p=t[8];let m=i_(p),h;t[11]===i.attachments?h=t[12]:(h=i.attachments??[],t[11]=i.attachments,t[12]=h);let g;if(t[13]!==n||t[14]!==h){let e;t[16]===n?e=t[17]:(e=(e,t)=>ng(e.id,Sne({runtime:n,index:t}),[n,t]),t[16]=n,t[17]=e),g=h.map(e),t[13]=n,t[14]=h,t[15]=g}else g=t[15];let _=i_(g),v=i,y;t[18]!==f.state||t[19]!==a||t[20]!==s||t[21]!==m.state||t[22]!==v?(y={...v,parts:m.state,composer:f.state,isCopied:a,isHovering:s},t[18]=f.state,t[19]=a,t[20]=s,t[21]=m.state,t[22]=v,t[23]=y):y=t[23];let b=y,x;t[24]===b?x=t[25]:(x=()=>b,t[24]=b,t[25]=x);let S;t[26]===f.methods?S=t[27]:(S=()=>f.methods,t[26]=f.methods,t[27]=S);let C,w,T,E,D,O,ee;t[28]===n?(C=t[29],w=t[30],T=t[31],E=t[32],D=t[33],O=t[34],ee=t[35]):(C=()=>n.delete(),w=e=>n.reload(e),T=()=>n.speak(),E=()=>n.stopSpeaking(),D=e=>n.submitFeedback(e),O=e=>n.switchToBranch(e),ee=()=>n.unstable_getCopyText(),t[28]=n,t[29]=C,t[30]=w,t[31]=T,t[32]=E,t[33]=D,t[34]=O,t[35]=ee);let te;t[36]===m?te=t[37]:(te=e=>`index`in e?m.get({index:e.index}):m.get({key:`toolCallId-${e.toolCallId}`}),t[36]=m,t[37]=te);let k;t[38]===_?k=t[39]:(k=e=>`id`in e?_.get({key:e.id}):_.get(e),t[38]=_,t[39]=k);let A;t[40]===n?A=t[41]:(A=()=>n,t[40]=n,t[41]=A);let ne;return t[42]!==C||t[43]!==w||t[44]!==T||t[45]!==E||t[46]!==D||t[47]!==O||t[48]!==ee||t[49]!==te||t[50]!==k||t[51]!==A||t[52]!==x||t[53]!==S?(ne={getState:x,composer:S,delete:C,reload:w,speak:T,stopSpeaking:E,submitFeedback:D,switchToBranch:O,getCopyText:ee,part:te,attachment:k,setIsCopied:o,setIsHovering:c,__internal_getRuntime:A},t[42]=C,t[43]=w,t[44]=T,t[45]=E,t[46]=D,t[47]=O,t[48]=ee,t[49]=te,t[50]=k,t[51]=A,t[52]=x,t[53]=S,t[54]=ne):ne=t[54],ne}),Tne=tg(e=>{let t=R(6),{runtime:n,id:r,threadIdRef:i}=e,a;t[0]!==r||t[1]!==n?(a=n.getMessageById(r),t[0]=r,t[1]=n,t[2]=a):a=t[2];let o=a,s;return t[3]!==o||t[4]!==i?(s=wne({runtime:o,threadIdRef:i}),t[3]=o,t[4]=i,t[5]=s):s=t[5],_g(s)}),Ene=tg(e=>{let t=R(58),{runtime:n}=e,r=d_(n),i=Zg(),a,o;t[0]!==i||t[1]!==n?(a=()=>{let e=[];for(let t of[`runStart`,`runEnd`,`initialize`,`modelContextUpdate`]){let r=n.unstable_on(t,()=>{let e=n.getState()?.threadId||`unknown`;i(`thread.${t}`,{threadId:e})});e.push(r)}return()=>{for(let t of e)t()}},o=[n,i],t[0]=i,t[1]=n,t[2]=a,t[3]=o):(a=t[2],o=t[3]),Wh(a,o);let s;t[4]===n?s=t[5]:(s=m_(()=>n.getState().threadId),t[4]=n,t[5]=s);let c=s,l;t[6]!==n.composer||t[7]!==c?(l=p_({runtime:n.composer,threadIdRef:c}),t[6]=n.composer,t[7]=c,t[8]=l):l=t[8];let u=Ng(l),d;if(t[9]!==n||t[10]!==r.messages||t[11]!==c){let e;t[13]!==n||t[14]!==c?(e=e=>ng(e.id,Tne({runtime:n,id:e.id,threadIdRef:c}),[n,e.id,c]),t[13]=n,t[14]=c,t[15]=e):e=t[15],d=r.messages.map(e),t[9]=n,t[10]=r.messages,t[11]=c,t[12]=d}else d=t[12];let f=i_(d),p=f.state.length===0&&!r.isLoading,m;t[16]!==u.state||t[17]!==f.state||t[18]!==r.capabilities||t[19]!==r.extras||t[20]!==r.isDisabled||t[21]!==r.isLoading||t[22]!==r.isRunning||t[23]!==r.speech||t[24]!==r.state||t[25]!==r.suggestions||t[26]!==r.voice||t[27]!==p?(m={isEmpty:p,isDisabled:r.isDisabled,isLoading:r.isLoading,isRunning:r.isRunning,capabilities:r.capabilities,state:r.state,suggestions:r.suggestions,extras:r.extras,speech:r.speech,voice:r.voice,composer:u.state,messages:f.state},t[16]=u.state,t[17]=f.state,t[18]=r.capabilities,t[19]=r.extras,t[20]=r.isDisabled,t[21]=r.isLoading,t[22]=r.isRunning,t[23]=r.speech,t[24]=r.state,t[25]=r.suggestions,t[26]=r.voice,t[27]=p,t[28]=m):m=t[28];let h=m,g;t[29]===h?g=t[30]:(g=()=>h,t[29]=h,t[30]=g);let _;t[31]===u.methods?_=t[32]:(_=()=>u.methods,t[31]=u.methods,t[32]=_);let v;t[33]===f?v=t[34]:(v=e=>`id`in e?f.get({key:e.id}):f.get(e),t[33]=f,t[34]=v);let y;t[35]===n?y=t[36]:(y=()=>n,t[35]=n,t[36]=y);let b;return t[37]!==n.append||t[38]!==n.cancelRun||t[39]!==n.connectVoice||t[40]!==n.deleteMessage||t[41]!==n.disconnectVoice||t[42]!==n.export||t[43]!==n.getModelContext||t[44]!==n.getVoiceVolume||t[45]!==n.import||t[46]!==n.muteVoice||t[47]!==n.reset||t[48]!==n.resumeRun||t[49]!==n.startRun||t[50]!==n.stopSpeaking||t[51]!==n.subscribeVoiceVolume||t[52]!==n.unmuteVoice||t[53]!==v||t[54]!==y||t[55]!==g||t[56]!==_?(b={getState:g,composer:_,append:n.append,deleteMessage:n.deleteMessage,startRun:n.startRun,resumeRun:n.resumeRun,cancelRun:n.cancelRun,getModelContext:n.getModelContext,export:n.export,import:n.import,reset:n.reset,stopSpeaking:n.stopSpeaking,connectVoice:n.connectVoice,disconnectVoice:n.disconnectVoice,getVoiceVolume:n.getVoiceVolume,subscribeVoiceVolume:n.subscribeVoiceVolume,muteVoice:n.muteVoice,unmuteVoice:n.unmuteVoice,message:v,__internal_getRuntime:y},t[37]=n.append,t[38]=n.cancelRun,t[39]=n.connectVoice,t[40]=n.deleteMessage,t[41]=n.disconnectVoice,t[42]=n.export,t[43]=n.getModelContext,t[44]=n.getVoiceVolume,t[45]=n.import,t[46]=n.muteVoice,t[47]=n.reset,t[48]=n.resumeRun,t[49]=n.startRun,t[50]=n.stopSpeaking,t[51]=n.subscribeVoiceVolume,t[52]=n.unmuteVoice,t[53]=v,t[54]=y,t[55]=g,t[56]=_,t[57]=b):b=t[57],b}),Dne=tg(e=>{let t=R(20),{runtime:n}=e,r=d_(n),i=Zg(),a,o;t[0]!==i||t[1]!==n?(a=()=>{let e=[];for(let t of[`switchedTo`,`switchedAway`]){let r=n.unstable_on(t,()=>{i(`threadListItem.${t}`,{threadId:n.getState().id})});e.push(r)}return()=>{for(let t of e)t()}},o=[n,i],t[0]=i,t[1]=n,t[2]=a,t[3]=o):(a=t[2],o=t[3]),Wh(a,o);let s;t[4]===r?s=t[5]:(s=()=>r,t[4]=r,t[5]=s);let c;t[6]===n?c=t[7]:(c=()=>n,t[6]=n,t[7]=c);let l;return t[8]!==n.archive||t[9]!==n.delete||t[10]!==n.detach||t[11]!==n.generateTitle||t[12]!==n.initialize||t[13]!==n.rename||t[14]!==n.switchTo||t[15]!==n.unarchive||t[16]!==n.updateCustom||t[17]!==s||t[18]!==c?(l={getState:s,switchTo:n.switchTo,rename:n.rename,updateCustom:n.updateCustom,archive:n.archive,unarchive:n.unarchive,delete:n.delete,generateTitle:n.generateTitle,initialize:n.initialize,detach:n.detach,__internal_getRuntime:c},t[8]=n.archive,t[9]=n.delete,t[10]=n.detach,t[11]=n.generateTitle,t[12]=n.initialize,t[13]=n.rename,t[14]=n.switchTo,t[15]=n.unarchive,t[16]=n.updateCustom,t[17]=s,t[18]=c,t[19]=l):l=t[19],l}),One=tg(e=>{let t=R(5),{runtime:n,id:r}=e,i;t[0]!==r||t[1]!==n?(i=n.getItemById(r),t[0]=r,t[1]=n,t[2]=i):i=t[2];let a=i,o;return t[3]===a?o=t[4]:(o=Dne({runtime:a}),t[3]=a,t[4]=o),_g(o)}),kne=tg(e=>{let t=R(40),{runtime:n,__internal_assistantRuntime:r}=e,i=d_(n),a;t[0]===n.main?a=t[1]:(a=Ene({runtime:n.main}),t[0]=n.main,t[1]=a);let o=Ng(a),s;t[2]!==n||t[3]!==i.threadItems?(s=Object.keys(i.threadItems).map(e=>ng(e,One({runtime:n,id:e}),[n,e])),t[2]=n,t[3]=i.threadItems,t[4]=s):s=t[4];let c=i_(s),l=i.newThreadId??null,u;t[5]!==o.state||t[6]!==i.archivedThreadIds||t[7]!==i.hasMore||t[8]!==i.isLoading||t[9]!==i.isLoadingMore||t[10]!==i.mainThreadId||t[11]!==i.threadIds||t[12]!==l||t[13]!==c.state?(u={mainThreadId:i.mainThreadId,newThreadId:l,isLoading:i.isLoading,isLoadingMore:i.isLoadingMore,hasMore:i.hasMore,threadIds:i.threadIds,archivedThreadIds:i.archivedThreadIds,threadItems:c.state,main:o.state},t[5]=o.state,t[6]=i.archivedThreadIds,t[7]=i.hasMore,t[8]=i.isLoading,t[9]=i.isLoadingMore,t[10]=i.mainThreadId,t[11]=i.threadIds,t[12]=l,t[13]=c.state,t[14]=u):u=t[14];let d=u,f;t[15]===d?f=t[16]:(f=()=>d,t[15]=d,t[16]=f);let p;t[17]===o.methods?p=t[18]:(p=()=>o.methods,t[17]=o.methods,t[18]=p);let m;t[19]!==d||t[20]!==c?(m=e=>{if(e===`main`)return c.get({key:d.mainThreadId});if(`id`in e)return c.get({key:e.id});let{index:t,archived:n}=e,r=n!==void 0&&n?d.archivedThreadIds[t]:d.threadIds[t];return c.get({key:r})},t[19]=d,t[20]=c,t[21]=m):m=t[21];let h,g,_,v,y;t[22]===n?(h=t[23],g=t[24],_=t[25],v=t[26],y=t[27]):(v=async(e,t)=>{await n.switchToThread(e,t)},y=async()=>{await n.switchToNewThread()},h=()=>n.getLoadThreadsPromise(),g=()=>n.reload(),_=()=>n.loadMore(),t[22]=n,t[23]=h,t[24]=g,t[25]=_,t[26]=v,t[27]=y);let b;t[28]===r?b=t[29]:(b=()=>r,t[28]=r,t[29]=b);let x;return t[30]!==h||t[31]!==g||t[32]!==_||t[33]!==b||t[34]!==f||t[35]!==p||t[36]!==m||t[37]!==v||t[38]!==y?(x={getState:f,thread:p,item:m,switchToThread:v,switchToNewThread:y,getLoadThreadsPromise:h,reload:g,loadMore:_,__internal_getAssistantRuntime:b},t[30]=h,t[31]=g,t[32]=_,t[33]=b,t[34]=f,t[35]=p,t[36]=m,t[37]=v,t[38]=y,t[39]=x):x=t[39],x}),Ane=tg(e=>({getState:()=>e})),jne=tg(e=>{let t=R(11),n;t[0]===e?n=t[1]:(n=()=>({suggestions:(e??[]).map(Mne)}),t[0]=e,t[1]=n);let[r]=zh(n),i;t[2]===r.suggestions?i=t[3]:(i=r.suggestions.map(Nne),t[2]=r.suggestions,t[3]=i);let a=i_(i),o;t[4]===r?o=t[5]:(o=()=>r,t[4]=r,t[5]=o);let s;t[6]===a?s=t[7]:(s=e=>{let{index:t}=e;return a.get({index:t})},t[6]=a,t[7]=s);let c;return t[8]!==o||t[9]!==s?(c={getState:o,suggestion:s},t[8]=o,t[9]=s,t[10]=c):c=t[10],c});function Mne(e){return typeof e==`string`?{title:e,label:``,prompt:e}:{title:e.title,label:e.label,prompt:e.prompt}}function Nne(e,t){return ng(t,Ane(e),[e])}var Pne=(e,t)=>{e.thread??=Wg({source:`threads`,query:{type:`main`},get:e=>e.threads().thread(`main`)}),e.threadListItem??=Wg({source:`threads`,query:{type:`main`},get:e=>e.threads().item(`main`)}),e.composer??=Wg({source:`thread`,query:{},get:e=>e.threads().thread(`main`).composer()}),!e.modelContext&&t.modelContext.source===null&&(e.modelContext=Cg()),!e.suggestions&&t.suggestions.source===null&&(e.suggestions=jne())},h_=e=>{let t=R(6),n=Xg(),r,i;t[0]!==n||t[1]!==e?(r=()=>e.registerModelContextProvider(n.current.modelContext()),i=[e,n],t[0]=n,t[1]=e,t[2]=r,t[3]=i):(r=t[2],i=t[3]),Wh(r,i);let a;return t[4]===e?a=t[5]:(a=kne({runtime:e.threads,__internal_assistantRuntime:e}),t[4]=e,t[5]=a),_g(a)},Fne=tg(h_);Kg(h_,(e,t)=>{Pne(e,t),!e.tools&&t.tools.source===null&&(e.tools=l_({})),!e.dataRenderers&&t.dataRenderers.source===null&&(e.dataRenderers=Tte())});var Ine=e=>e._core?.RenderComponent,Lne=(0,Ih.memo)(({runtime:e,aui:t=null,children:n})=>{"use no memo";let r=e_({threads:Fne(e)},{parent:t}),i=Ine(e),a=(0,F.jsxs)(Hg,{value:r,children:[i&&(0,F.jsx)(i,{}),n]});return t?(0,F.jsx)(Hg,{value:t,children:a}):a}),g_=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},Rne=(e=>e?g_(e):g_),zne=e=>e;function Bne(e,t=zne){let n=M.useSyncExternalStore(e.subscribe,M.useCallback(()=>t(e.getState()),[e,t]),M.useCallback(()=>t(e.getInitialState()),[e,t]));return M.useDebugValue(n),n}var __=e=>{let t=Rne(e),n=e=>Bne(t,e);return Object.assign(n,t),n},Vne=(e=>e?__(e):__),v_=()=>{let e,t,n=new Promise((n,r)=>{e=n,t=r});if(!e||!t)throw Error(`Failed to create promise`);return{promise:n,resolve:e,reject:t}},Hne=()=>{let e=[],t=!1,n,r,i=i=>{i.promise||=i.reader.read().then(({done:a,value:o})=>{i.promise=void 0,a?(e.splice(e.indexOf(i),1),t&&e.length===0&&n.close()):n.enqueue(o),r?.resolve(),r=void 0}).catch(t=>{console.error(t),e.forEach(e=>{e.reader.cancel()}),e.length=0,n.error(t),r?.reject(t),r=void 0})};return{readable:new ReadableStream({start(e){n=e},pull(){return r=v_(),e.forEach(e=>{i(e)}),r.promise},cancel(){e.forEach(e=>{e.reader.cancel()}),e.length=0}}),isSealed(){return t},seal(){t=!0,e.length===0&&n.close()},addStream(n){if(t)throw Error(`Cannot add streams after the run callback has settled.`);let r={reader:n.getReader()};e.push(r),i(r)},enqueue(e){this.addStream(new ReadableStream({start(t){t.enqueue(e),t.close()}}))}}},y_=class{_controller;_isClosed=!1;constructor(e){this._controller=e}append(e){return this._controller.enqueue({type:`text-delta`,path:[],textDelta:e}),this}close(){this._isClosed||(this._isClosed=!0,this._controller.enqueue({type:`part-finish`,path:[]}),this._controller.close())}},b_=e=>new ReadableStream({start(t){return e.start?.(new y_(t))},pull(t){return e.pull?.(new y_(t))},cancel(t){return e.cancel?.(t)}}),x_=()=>{let e;return[b_({start(t){e=t}}),e]},S_=class{_controller;_isClosed=!1;_mergeTask;constructor(e){this._controller=e;let t=b_({start:e=>{this._argsTextController=e}}),n=!1;this._mergeTask=t.pipeTo(new WritableStream({write:e=>{switch(e.type){case`text-delta`:n=!0,this._controller.enqueue(e);break;case`part-finish`:n||this._controller.enqueue({type:`text-delta`,textDelta:`{}`,path:[]}),this._controller.enqueue({type:`tool-call-args-text-finish`,path:[]});break;default:throw Error(`Unexpected chunk type: ${e.type}`)}}}))}get argsText(){return this._argsTextController}_argsTextController;async setResponse(e){this._argsTextController.close(),await Promise.resolve(),this._controller.enqueue({type:`result`,path:[],...e.artifact===void 0?{}:{artifact:e.artifact},result:e.result,isError:e.isError??!1,...e.modelContent===void 0?{}:{modelContent:e.modelContent},...e.messages===void 0?{}:{messages:e.messages}})}async close(){this._isClosed||(this._isClosed=!0,this._argsTextController.close(),await this._mergeTask,this._controller.enqueue({type:`part-finish`,path:[]}),this._controller.close())}},Une=e=>new ReadableStream({start(t){return e.start?.(new S_(t))},pull(t){return e.pull?.(new S_(t))},cancel(t){return e.cancel?.(t)}}),Wne=()=>{let e;return[Une({start(t){e=t}}),e]},C_=class{value=-1;up(){return++this.value}},Gne=class extends TransformStream{constructor(e){super({transform(t,n){n.enqueue({...t,path:[e,...t.path]})}})}};TransformStream;var Kne=class extends TransformStream{constructor(e){let t=new C_,n=new Map;super({transform(r,i){r.type===`part-start`&&r.path.length===0&&n.set(t.up(),e.up());let[a,...o]=r.path;if(a===void 0){i.enqueue(r);return}let s=n.get(a);if(s===void 0)throw Error(`Path not found`);i.enqueue({...r,path:[s,...o]})}})}},qne=class extends TransformStream{constructor(e){super();let t=e(super.readable);Object.defineProperty(this,"readable",{value:t,writable:!1})}},w_=class extends TransformStream{constructor(){let e=[];super({transform(t,n){if(t.type===`part-start`){if(t.path.length!==0){n.error(Error(`Nested parts are not supported`));return}e.push(t.part),n.enqueue(t);return}if(t.type===`text-delta`||t.type===`result`||t.type===`part-finish`||t.type===`tool-call-args-text-finish`){if(t.path.length!==1){n.error(Error(`${t.type} chunks must have a path of length 1`));return}let r=t.path[0];if(r<0||r>=e.length){n.error(Error(`Invalid path index: ${r}`));return}let i=e[r];n.enqueue({...t,meta:i});return}n.enqueue(t)}})}},T_=(e,t=21)=>(n=t)=>{let r=``,i=n|0;for(;i-- >0;)r+=e[Math.random()*e.length|0];return r},Jne=T_(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`,7),Yne=class e{_state;_parentId;constructor(e){this._state=e||{merger:Hne(),contentCounter:new C_}}get __internal_isClosed(){return this._state.merger.isSealed()}__internal_getReadable(){return this._state.merger.readable}__internal_subscribeToClose(e){this._state.closeSubscriber=e}_addPart(e,t){this._state.append&&(this._state.append.controller.close(),this._state.append=void 0),this.enqueue({type:`part-start`,part:e,path:[]}),this._state.merger.addStream(t.pipeThrough(new Gne(this._state.contentCounter.value)))}merge(e){this._state.merger.addStream(e.pipeThrough(new Kne(this._state.contentCounter)))}appendText(e){(this._state.append?.kind!==`text`||this._state.append.parentId!==this._parentId)&&(this._state.append={kind:`text`,parentId:this._parentId,controller:this.addTextPart()}),this._state.append.controller.append(e)}appendReasoning(e){(this._state.append?.kind!==`reasoning`||this._state.append.parentId!==this._parentId)&&(this._state.append={kind:`reasoning`,parentId:this._parentId,controller:this.addReasoningPart()}),this._state.append.controller.append(e)}addTextPart(){let[e,t]=x_();return this._addPart(this._withParentIdOption({type:`text`}),e),t}addReasoningPart(){let[e,t]=x_();return this._addPart(this._withParentIdOption({type:`reasoning`}),e),t}addToolCallPart(e){let t=typeof e==`string`?{toolName:e}:e,n=t.toolName,r=t.toolCallId??Jne(),[i,a]=Wne();return this._addPart({type:`tool-call`,toolName:n,toolCallId:r,...this._parentId&&{parentId:this._parentId}},i),t.argsText!==void 0&&(a.argsText.append(t.argsText),a.argsText.close()),t.args!==void 0&&(a.argsText.append(JSON.stringify(t.args)),a.argsText.close()),t.response!==void 0&&a.setResponse(t.response),a}_finishedPartStream(){return new ReadableStream({start(e){e.enqueue({type:`part-finish`,path:[]}),e.close()}})}_withParentIdOption(e){return this._parentId?{...e,parentId:this._parentId}:e}appendSource(e){this._addPart(this._withParentIdOption(e),this._finishedPartStream())}appendFile(e){this._addPart(this._withParentIdOption(e),this._finishedPartStream())}appendData(e){this._addPart(this._withParentIdOption(e),this._finishedPartStream())}enqueue(e){this._state.merger.enqueue(e),e.type===`part-start`&&e.path.length===0&&this._state.contentCounter.up()}withParentId(t){let n=new e(this._state);return n._parentId=t,n}close(){this._state.append?.controller?.close(),this._state.merger.seal(),this._state.closeSubscriber?.()}};function Xne(e){let t=new Yne;return(async()=>{try{await e(t)}catch(e){throw t.__internal_isClosed||t.enqueue({type:`error`,path:[],error:String(e)}),e}finally{t.__internal_isClosed||t.close()}})(),t.__internal_getReadable()}function Zne(){let{resolve:e,promise:t}=v_(),n;return[Xne(r=>(n=r,n.__internal_subscribeToClose(e),t)),n]}function Qne(e){let t=[`ROOT`],n=-1,r=null,i=[],a;function o(){a!==void 0&&(i.push(JSON.parse(`"${a}"`)),a=void 0)}function s(e,i,a){switch(e){case`"`:n=i,t.pop(),t.push(a),t.push(`INSIDE_STRING`),o();break;case`f`:case`t`:case`n`:n=i,r=i,t.pop(),t.push(a),t.push(`INSIDE_LITERAL`);break;case`-`:t.pop(),t.push(a),t.push(`INSIDE_NUMBER`),o();break;case`0`:case`1`:case`2`:case`3`:case`4`:case`5`:case`6`:case`7`:case`8`:case`9`:n=i,t.pop(),t.push(a),t.push(`INSIDE_NUMBER`),o();break;case`{`:n=i,t.pop(),t.push(a),t.push(`INSIDE_OBJECT_START`),o();break;case`[`:n=i,t.pop(),t.push(a),t.push(`INSIDE_ARRAY_START`),o();break}}function c(e,r){switch(e){case`,`:t.pop(),t.push(`INSIDE_OBJECT_AFTER_COMMA`);break;case`}`:n=r,t.pop(),a=i.pop();break}}function l(e,r){switch(e){case`,`:t.pop(),t.push(`INSIDE_ARRAY_AFTER_COMMA`),a=(Number(a)+1).toString();break;case`]`:n=r,t.pop(),a=i.pop();break}}for(let o=0;o<e.length;o++){let u=e[o];switch(t[t.length-1]){case`ROOT`:s(u,o,`FINISH`);break;case`INSIDE_OBJECT_START`:switch(u){case`"`:t.pop(),t.push(`INSIDE_OBJECT_KEY`),a=``;break;case`}`:n=o,t.pop(),a=i.pop();break}break;case`INSIDE_OBJECT_AFTER_COMMA`:switch(u){case`"`:t.pop(),t.push(`INSIDE_OBJECT_KEY`),a=``;break}break;case`INSIDE_OBJECT_KEY`:switch(u){case`"`:t.pop(),t.push(`INSIDE_OBJECT_AFTER_KEY`);break;case`\\`:t.push(`INSIDE_STRING_ESCAPE`),a+=u;break;default:a+=u;break}break;case`INSIDE_OBJECT_AFTER_KEY`:switch(u){case`:`:t.pop(),t.push(`INSIDE_OBJECT_BEFORE_VALUE`);break}break;case`INSIDE_OBJECT_BEFORE_VALUE`:s(u,o,`INSIDE_OBJECT_AFTER_VALUE`);break;case`INSIDE_OBJECT_AFTER_VALUE`:c(u,o);break;case`INSIDE_STRING`:switch(u){case`"`:t.pop(),n=o,a=i.pop();break;case`\\`:t.push(`INSIDE_STRING_ESCAPE`);break;default:n=o}break;case`INSIDE_ARRAY_START`:switch(u){case`]`:n=o,t.pop(),a=i.pop();break;default:n=o,a=`0`,s(u,o,`INSIDE_ARRAY_AFTER_VALUE`);break}break;case`INSIDE_ARRAY_AFTER_VALUE`:switch(u){case`,`:t.pop(),t.push(`INSIDE_ARRAY_AFTER_COMMA`),a=(Number(a)+1).toString();break;case`]`:n=o,t.pop(),a=i.pop();break;default:n=o;break}break;case`INSIDE_ARRAY_AFTER_COMMA`:s(u,o,`INSIDE_ARRAY_AFTER_VALUE`);break;case`INSIDE_STRING_ESCAPE`:t.pop(),t[t.length-1]===`INSIDE_STRING`?n=o:t[t.length-1]===`INSIDE_OBJECT_KEY`&&(a+=u);break;case`INSIDE_NUMBER`:switch(u){case`0`:case`1`:case`2`:case`3`:case`4`:case`5`:case`6`:case`7`:case`8`:case`9`:n=o;break;case`e`:case`E`:case`-`:case`.`:break;case`,`:t.pop(),a=i.pop(),t[t.length-1]===`INSIDE_ARRAY_AFTER_VALUE`&&l(u,o),t[t.length-1]===`INSIDE_OBJECT_AFTER_VALUE`&&c(u,o);break;case`}`:t.pop(),a=i.pop(),t[t.length-1]===`INSIDE_OBJECT_AFTER_VALUE`&&c(u,o);break;case`]`:t.pop(),a=i.pop(),t[t.length-1]===`INSIDE_ARRAY_AFTER_VALUE`&&l(u,o);break;default:t.pop(),a=i.pop();break}break;case`INSIDE_LITERAL`:{let i=e.substring(r,o+1);!`false`.startsWith(i)&&!`true`.startsWith(i)&&!`null`.startsWith(i)?(t.pop(),t[t.length-1]===`INSIDE_OBJECT_AFTER_VALUE`?c(u,o):t[t.length-1]===`INSIDE_ARRAY_AFTER_VALUE`&&l(u,o)):n=o;break}}}let u=e.slice(0,n+1);for(let n=t.length-1;n>=0;n--)switch(t[n]){case`INSIDE_STRING`:u+=`"`;break;case`INSIDE_OBJECT_KEY`:case`INSIDE_OBJECT_AFTER_KEY`:case`INSIDE_OBJECT_AFTER_COMMA`:case`INSIDE_OBJECT_START`:case`INSIDE_OBJECT_BEFORE_VALUE`:case`INSIDE_OBJECT_AFTER_VALUE`:u+=`}`;break;case`INSIDE_ARRAY_START`:case`INSIDE_ARRAY_AFTER_COMMA`:case`INSIDE_ARRAY_AFTER_VALUE`:u+=`]`;break;case`INSIDE_LITERAL`:{let t=e.substring(r,e.length);`true`.startsWith(t)?u+=`true`.slice(t.length):`false`.startsWith(t)?u+=`false`.slice(t.length):`null`.startsWith(t)&&(u+=`null`.slice(t.length))}}return[u,i]}var E_=u(o(((e,t)=>{var n=typeof Buffer<`u`,r=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,i=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function a(e,t,a){a==null&&typeof t==`object`&&t&&(a=t,t=void 0),n&&Buffer.isBuffer(e)&&(e=e.toString()),e&&e.charCodeAt(0)===65279&&(e=e.slice(1));let s=JSON.parse(e,t);if(typeof s!=`object`||!s)return s;let c=a&&a.protoAction||`error`,l=a&&a.constructorAction||`error`;if(c===`ignore`&&l===`ignore`)return s;if(c!==`ignore`&&l!==`ignore`){if(r.test(e)===!1&&i.test(e)===!1)return s}else if(c!==`ignore`&&l===`ignore`){if(r.test(e)===!1)return s}else if(i.test(e)===!1)return s;return o(s,{protoAction:c,constructorAction:l,safe:a&&a.safe})}function o(e,{protoAction:t=`error`,constructorAction:n=`error`,safe:r}={}){let i=[e];for(;i.length;){let e=i;i=[];for(let a of e){if(t!==`ignore`&&Object.prototype.hasOwnProperty.call(a,`__proto__`)){if(r===!0)return null;if(t===`error`)throw SyntaxError(`Object contains forbidden prototype property`);delete a.__proto__}if(n!==`ignore`&&Object.prototype.hasOwnProperty.call(a,`constructor`)&&a.constructor!==null&&typeof a.constructor==`object`&&Object.prototype.hasOwnProperty.call(a.constructor,`prototype`)){if(r===!0)return null;if(n===`error`)throw SyntaxError(`Object contains forbidden prototype property`);delete a.constructor}for(let e in a){let t=a[e];t&&typeof t==`object`&&i.push(t)}}}return e}function s(e,t,n){let{stackTraceLimit:r}=Error;Error.stackTraceLimit=0;try{return a(e,t,n)}finally{Error.stackTraceLimit=r}}function c(e,t){let{stackTraceLimit:n}=Error;Error.stackTraceLimit=0;try{return a(e,t,{safe:!0})}catch{return}finally{Error.stackTraceLimit=n}}t.exports=s,t.exports.default=s,t.exports.parse=s,t.exports.safeParse=c,t.exports.scan=o}))(),1),D_=Symbol(`aui.parse-partial-json-object.meta`),$ne=e=>e?.[D_],O_=e=>{if(e.length===0)return{[D_]:{state:`partial`,partialPath:[]}};try{let t=E_.default.parse(e);if(typeof t!=`object`||!t)throw Error(`argsText is expected to be an object`);return t[D_]={state:`complete`,partialPath:[]},t}catch{try{let[t,n]=Qne(e),r=E_.default.parse(t);if(typeof r!=`object`||!r)throw Error(`argsText is expected to be an object`);return r[D_]={state:`partial`,partialPath:n},r}catch{return}}},k_=(e,t,n)=>{if(typeof e!=`object`||!e)return t.state;if(t.state===`complete`)return`complete`;if(n.length===0)return t.state;let[r,...i]=n;if(!Object.hasOwn(e,r))return`partial`;let[a,...o]=t.partialPath;if(r!==a)return`complete`;let s=e[r];return k_(s,{state:`partial`,partialPath:o},i)},A_=(e,t)=>{let n=$ne(e);if(!n)throw Error(`unable to determine object state`);return k_(e,n,t.map(String))};async function*ere(){let e=this.getReader();try{for(;;){let{done:t,value:n}=await e.read();if(t)break;yield n}}finally{e.releaseLock()}}function j_(e){return e[Symbol.asyncIterator]??=ere,e}var M_=Symbol.for(`aui.tool-response`),N_=class e{get[M_](){return!0}artifact;result;isError;modelContent;messages;constructor(e){e.artifact!==void 0&&(this.artifact=e.artifact),this.result=e.result,this.isError=e.isError??!1,e.modelContent!==void 0&&(this.modelContent=e.modelContent),e.messages!==void 0&&(this.messages=e.messages)}static[Symbol.hasInstance](e){return typeof e==`object`&&!!e&&M_ in e}static toResponse(t){return t instanceof e?t:new e({result:t===void 0?`<no result>`:t})}};function tre(e,t,n){try{let r=e();if(typeof r==`object`&&r&&`then`in r)return r.then(t,n);t(r)}catch(e){n(e)}}function P_(e,t){let n=e;for(let e of t){if(n==null)return;n=n[e]}return n}var nre=class{resolve;reject;disposed=!1;fieldPath;constructor(e,t,n){this.resolve=e,this.reject=t,this.fieldPath=n}update(e){if(!this.disposed)try{if(A_(e,this.fieldPath)===`complete`){let t=P_(e,this.fieldPath);t!==void 0&&(this.resolve(t),this.dispose())}}catch(e){this.reject(e),this.dispose()}}end(e){if(!this.disposed)try{let t=P_(e,this.fieldPath);this.resolve(t)}catch(e){this.reject(e)}finally{this.dispose()}}dispose(){this.disposed=!0}},rre=class{controller;disposed=!1;fieldPath;constructor(e,t){this.controller=e,this.fieldPath=t}update(e){if(!this.disposed)try{let t=P_(e,this.fieldPath);t!==void 0&&this.controller.enqueue(t),A_(e,this.fieldPath)===`complete`&&(this.controller.close(),this.dispose())}catch(e){this.controller.error(e),this.dispose()}}end(){this.disposed||(this.controller.close(),this.dispose())}dispose(){this.disposed=!0}},ire=class{controller;disposed=!1;fieldPath;lastValue=void 0;constructor(e,t){this.controller=e,this.fieldPath=t}update(e){if(!this.disposed)try{let t=P_(e,this.fieldPath);if(t!==void 0&&typeof t==`string`){let e=t.substring(this.lastValue?.length||0);this.lastValue=t,this.controller.enqueue(e)}A_(e,this.fieldPath)===`complete`&&(this.controller.close(),this.dispose())}catch(e){this.controller.error(e),this.dispose()}}end(){this.disposed||(this.controller.close(),this.dispose())}dispose(){this.disposed=!0}},are=class{controller;disposed=!1;fieldPath;processedIndexes=new Set;constructor(e,t){this.controller=e,this.fieldPath=t}update(e){if(!this.disposed)try{let t=P_(e,this.fieldPath);if(!Array.isArray(t))return;for(let n=0;n<t.length;n++)this.processedIndexes.has(n)||A_(e,[...this.fieldPath,n])===`complete`&&(this.controller.enqueue(t[n]),this.processedIndexes.add(n));A_(e,this.fieldPath)===`complete`&&(this.controller.close(),this.dispose())}catch(e){this.controller.error(e),this.dispose()}}end(){this.disposed||(this.controller.close(),this.dispose())}dispose(){this.disposed=!0}},ore=class{argTextDeltas;handles=new Set;args=O_(``);finished=!1;constructor(e){this.argTextDeltas=e,this.processStream()}async processStream(){try{let e=``,t=this.argTextDeltas.getReader();for(;;){let{value:n,done:r}=await t.read();if(r)break;e+=n;let i=O_(e);if(i!==void 0){this.args=i;for(let e of this.handles)e.update(i)}}}catch(e){console.error(`Error processing argument stream:`,e)}finally{this.finished=!0;for(let e of this.handles)e.end(this.args);this.handles.clear()}}get(...e){return new Promise((t,n)=>{let r=new nre(t,n,e);if(this.args&&A_(this.args,e)===`complete`){let n=P_(this.args,e);if(n!==void 0){t(n);return}}if(this.finished){r.end(this.args);return}this.handles.add(r),r.update(this.args)})}streamValues(...e){let t=e,n;return j_(new ReadableStream({start:e=>{n=new rre(e,t),this.finished||this.handles.add(n),n.update(this.args),this.finished&&n.end()},cancel:()=>{n&&(n.dispose(),this.handles.delete(n))}}))}streamText(...e){let t=e,n;return j_(new ReadableStream({start:e=>{n=new ire(e,t),this.finished||this.handles.add(n),n.update(this.args),this.finished&&n.end()},cancel:()=>{n&&(n.dispose(),this.handles.delete(n))}}))}forEach(...e){let t=e,n;return j_(new ReadableStream({start:e=>{n=new are(e,t),this.finished||this.handles.add(n),n.update(this.args),this.finished&&n.end()},cancel:()=>{n&&(n.dispose(),this.handles.delete(n))}}))}},sre=class{promise;constructor(e){this.promise=e}get(){return this.promise}},cre=class{args;response;writable;resolve;argsText=``;constructor(){let e=new TransformStream;this.writable=e.writable,this.args=new ore(e.readable);let{promise:t,resolve:n}=v_();this.resolve=n,this.response=new sre(t)}async appendArgsTextDelta(e){let t=this.writable.getWriter();try{await t.write(e)}catch(e){console.warn(e)}finally{t.releaseLock()}this.argsText+=e}async finishArgsText(){let e=this.writable.getWriter();try{await e.close()}catch(e){console.warn(e)}finally{e.releaseLock()}}setResponse(e){this.resolve(e)}result={get:async()=>(await this.response.get()).result}},lre=class extends qne{constructor(e){let t=new Map,n=new Map;super(r=>{let i=new TransformStream({async transform(r,i){switch((r.type!==`part-finish`||r.meta.type!==`tool-call`)&&i.enqueue(r),r.type){case`part-start`:if(r.part.type===`tool-call`){let t=new cre;n.set(r.part.toolCallId,t),e.streamCall({reader:t,toolCallId:r.part.toolCallId,toolName:r.part.toolName})}break;case`text-delta`:if(r.meta.type===`tool-call`){let e=r.meta.toolCallId,t=n.get(e);if(!t)throw Error(`No controller found for tool call`);await t.appendArgsTextDelta(r.textDelta)}break;case`result`:{if(r.meta.type!==`tool-call`)break;let{toolCallId:e}=r.meta,t=n.get(e);if(!t)throw Error(`No controller found for tool call`);t.setResponse(new N_({result:r.result,artifact:r.artifact,isError:r.isError,modelContent:r.modelContent}));break}case`tool-call-args-text-finish`:{if(r.meta.type!==`tool-call`)break;let{toolCallId:a,toolName:o}=r.meta,s=n.get(a);if(!s)throw Error(`No controller found for tool call`);await s.finishArgsText();let c=!1,l=tre(()=>{let t;try{t=E_.default.parse(s.argsText)}catch(e){throw Error(`Function parameter parsing failed. ${JSON.stringify(e.message)}`)}let n=e.execute({toolCallId:a,toolName:o,args:t});return n!==void 0&&(c=!0,e.onExecutionStart?.(a,o)),n},t=>{if(c&&e.onExecutionEnd?.(a,o),t===void 0)return;let n=new N_({artifact:t.artifact,result:t.result,isError:t.isError,messages:t.messages,modelContent:t.modelContent});s.setResponse(n),i.enqueue({type:`result`,path:r.path,...n})},t=>{c&&e.onExecutionEnd?.(a,o);let n=new N_({result:String(t),isError:!0});s.setResponse(n),i.enqueue({type:`result`,path:r.path,...n})});l&&t.set(a,l);break}case`part-finish`:{if(r.meta.type!==`tool-call`)break;let{toolCallId:e}=r.meta,a=t.get(e);a?a.then(()=>{t.delete(e),n.delete(e),i.enqueue(r)}):i.enqueue(r)}}},async flush(){await Promise.all(t.values())}});return r.pipeThrough(new w_).pipeThrough(i)})}},ure=e=>typeof e==`object`&&!!e&&`~standard`in e&&e[`~standard`].version===1;function dre(e,t,n,r){let i=e?.[n.toolName];return i?.execute?(async e=>{if(t.aborted)return new N_({result:`Tool execution was cancelled.`,isError:!0});let a=e;if(ure(i.parameters)){let e=i.parameters[`~standard`].validate(n.args);e instanceof Promise&&(e=await e),e.issues&&(a=i.experimental_onSchemaValidationError??(()=>{throw Error(`Function parameter validation failed. ${JSON.stringify(e.issues)}`)}))}let o=new Promise(e=>{let n=()=>{queueMicrotask(()=>{queueMicrotask(()=>{e(new N_({result:`Tool execution was cancelled.`,isError:!0}))})})};t.aborted?n():t.addEventListener(`abort`,n,{once:!0})}),s=(async()=>{let e=await a(n.args,{toolCallId:n.toolCallId,abortSignal:t,human:e=>r(n.toolCallId,e)}),o=N_.toResponse(e);if(i.toModelOutput&&!o.isError&&o.modelContent===void 0)try{let e=await i.toModelOutput({toolCallId:n.toolCallId,input:n.args,output:o.result});return new N_({result:o.result,artifact:o.artifact,isError:o.isError,messages:o.messages,modelContent:e})}catch(e){console.warn(`[assistant-stream] tool "${n.toolName}" toModelOutput threw; falling back to default projection.`,e)}return o})();return Promise.race([s,o])})(i.execute):void 0}function fre(e,t,n,r,i){e?.[r.toolName]?.streamCall?.(n,{toolCallId:r.toolCallId,abortSignal:t,human:e=>i(r.toolCallId,e)})}function pre(e,t,n,r){let i=typeof e==`function`?e:()=>e,a=typeof t==`function`?t:()=>t;return new lre({execute:e=>dre(i(),a(),e,n),streamCall:({reader:e,...t})=>fre(i(),a(),e,t,n),onExecutionStart:r?.onExecutionStart,onExecutionEnd:r?.onExecutionEnd})}var F_=e=>{let t=R(7),{index:n,children:r}=e,i;t[0]===n?i=t[1]:(i=Wg({source:`message`,query:{type:`index`,index:n},get:e=>e.message().attachment({index:n})}),t[0]=n,t[1]=i);let a;t[2]===i?a=t[3]:(a={attachment:i},t[2]=i,t[3]=a);let o=e_(a),s;return t[4]!==o||t[5]!==r?(s=(0,F.jsx)(Hg,{value:o,children:r}),t[4]=o,t[5]=r,t[6]=s):s=t[6],s},I_=e=>{let t=R(7),{index:n,children:r}=e,i;t[0]===n?i=t[1]:(i=Wg({source:`composer`,query:{type:`index`,index:n},get:e=>e.composer().attachment({index:n})}),t[0]=n,t[1]=i);let a;t[2]===i?a=t[3]:(a={attachment:i},t[2]=i,t[3]=a);let o=e_(a),s;return t[4]!==o||t[5]!==r?(s=(0,F.jsx)(Hg,{value:o,children:r}),t[4]=o,t[5]=r,t[6]=s):s=t[6],s},L_=e=>{let t=R(10),{index:n,children:r}=e,i;t[0]===n?i=t[1]:(i=Wg({source:`thread`,query:{type:`index`,index:n},get:e=>e.thread().message({index:n})}),t[0]=n,t[1]=i);let a;t[2]===n?a=t[3]:(a=Wg({source:`message`,query:{},get:e=>e.thread().message({index:n}).composer()}),t[2]=n,t[3]=a);let o;t[4]!==i||t[5]!==a?(o={message:i,composer:a},t[4]=i,t[5]=a,t[6]=o):o=t[6];let s=e_(o),c;return t[7]!==s||t[8]!==r?(c=(0,F.jsx)(Hg,{value:s,children:r}),t[7]=s,t[8]=r,t[9]=c):c=t[9],c},R_=e=>{let t=R(7),{index:n,children:r}=e,i;t[0]===n?i=t[1]:(i=Wg({source:`message`,query:{type:`index`,index:n},get:e=>e.message().part({index:n})}),t[0]=n,t[1]=i);let a;t[2]===i?a=t[3]:(a={part:i},t[2]=i,t[3]=a);let o=e_(a),s;return t[4]!==o||t[5]!==r?(s=(0,F.jsx)(Hg,{value:o,children:r}),t[4]=o,t[5]=r,t[6]=s):s=t[6],s},mre=tg(e=>{let t=R(7),{text:n,isRunning:r}=e,i;t[0]===r?i=t[1]:(i=r?{type:`running`}:{type:`complete`},t[0]=r,t[1]=i);let a;t[2]!==i||t[3]!==n?(a={type:`text`,text:n,status:i},t[2]=i,t[3]=n,t[4]=a):a=t[4];let o=a,s;return t[5]===o?s=t[6]:(s={getState:()=>o,addToolResult:hre,resumeToolCall:gre,respondToToolApproval:_re},t[5]=o,t[6]=s),s}),z_=e=>{let t=R(8),{text:n,isRunning:r,children:i}=e,a=r===void 0?!1:r,o;t[0]!==a||t[1]!==n?(o=mre({text:n,isRunning:a}),t[0]=a,t[1]=n,t[2]=o):o=t[2];let s;t[3]===o?s=t[4]:(s={part:o},t[3]=o,t[4]=s);let c=e_(s),l;return t[5]!==c||t[6]!==i?(l=(0,F.jsx)(Hg,{value:c,children:i}),t[5]=c,t[6]=i,t[7]=l):l=t[7],l};function hre(){throw Error(`Not supported`)}function gre(){throw Error(`Not supported`)}function _re(){throw Error(`Not supported`)}var vre=Object.freeze({type:`complete`}),yre=tg(e=>{let t=R(9),{parts:n,getMessagePart:r}=e,[i,a]=zh(!0),o=n[n.length-1]?.status??vre,s;t[0]!==i||t[1]!==n||t[2]!==o?(s={parts:n,collapsed:i,status:o},t[0]=i,t[1]=n,t[2]=o,t[3]=s):s=t[3];let c=s,l;t[4]===c?l=t[5]:(l=()=>c,t[4]=c,t[5]=l);let u;return t[6]!==r||t[7]!==l?(u={getState:l,setCollapsed:a,part:r},t[6]=r,t[7]=l,t[8]=u):u=t[8],u}),bre=e=>{let t=R(5),{startIndex:n,endIndex:r,children:i}=e,a=z(xre).slice(n,r+1),o=e_(),s=yre({parts:a,getMessagePart:e=>{let{index:t}=e;if(t<0||t>=a.length)throw Error(`ChainOfThought part index ${t} is out of bounds (0..${a.length-1})`);return o.message().part({index:n+t})}}),c;t[0]===s?c=t[1]:(c={chainOfThought:s},t[0]=s,t[1]=c);let l=e_(c),u;return t[2]!==l||t[3]!==i?(u=(0,F.jsx)(Hg,{value:l,children:i}),t[2]=l,t[3]=i,t[4]=u):u=t[4],u};function xre(e){return e.message.parts}var B_=e=>{let t=R(7),{index:n,children:r}=e,i;t[0]===n?i=t[1]:(i=Wg({source:`suggestions`,query:{index:n},get:e=>e.suggestions().suggestion({index:n})}),t[0]=n,t[1]=i);let a;t[2]===i?a=t[3]:(a={suggestion:i},t[2]=i,t[3]=a);let o=e_(a),s;return t[4]!==o||t[5]!==r?(s=(0,F.jsx)(Hg,{value:o,children:r}),t[4]=o,t[5]=r,t[6]=s):s=t[6],s},Sre=e=>{let t=R(7),{index:n,children:r}=e,i;t[0]===n?i=t[1]:(i=Wg({source:`composer`,query:{index:n},get:e=>e.composer().queueItem({index:n})}),t[0]=n,t[1]=i);let a;t[2]===i?a=t[3]:(a={queueItem:i},t[2]=i,t[3]=a);let o=e_(a),s;return t[4]!==o||t[5]!==r?(s=(0,F.jsx)(Hg,{value:o,children:r}),t[4]=o,t[5]=r,t[6]=s):s=t[6],s},V_=Symbol(`innerMessage`),H_=Symbol(`innerMessages`),Cre=[],wre=(e,t)=>{V_ in e||(e[V_]=t)},Tre=e=>{let t=`messages`in e?e.messages:e,n=t[H_]||t[V_];return n?Array.isArray(n)?n:(t[H_]=[n],t[H_]):Cre},U_=Symbol(`skip-update`);function Ere(e,t){if(e===void 0&&t===void 0)return!0;if(e===void 0||t===void 0)return!1;for(let n of Object.keys(e)){let r=e[n],i=t[n];if(!Object.is(r,i))return!1}return!0}var Dre=class{_subscribers=new Set;subscribe(e){return this._subscribers.add(e),()=>this._subscribers.delete(e)}waitForUpdate(){return new Promise(e=>{let t=this.subscribe(()=>{t(),e()})})}_notifySubscribers(){let e=[];for(let t of this._subscribers)try{t()}catch(t){e.push(t)}if(e.length>0){if(e.length===1)throw e[0];for(let t of e)console.error(t);throw AggregateError(e)}}},W_=class{_subscriptions=new Set;_connection;get isConnected(){return!!this._connection}notifySubscribers(e){for(let t of this._subscriptions)t(e)}_updateConnection(){if(this._subscriptions.size>0){if(this._connection)return;this._connection=this._connect()}else this._connection?.(),this._connection=void 0}subscribe(e){return this._subscriptions.add(e),this._updateConnection(),()=>{this._subscriptions.delete(e),this._updateConnection()}}},G_=class extends W_{binding;get path(){return this.binding.path}constructor(e){super(),this.binding=e;let t=e.getState();if(t===U_)throw Error(`Entry not available in the store`);this._previousState=t}_previousState;getState=()=>(this.isConnected||this._syncState(),this._previousState);_syncState(){let e=this.binding.getState();return e===U_||Ere(e,this._previousState)?!1:(this._previousState=e,!0)}_connect(){return this.binding.subscribe(()=>{this._syncState()&&this.notifySubscribers()})}},K_=class extends W_{binding;get path(){return this.binding.path}constructor(e){super(),this.binding=e}_previousStateDirty=!0;_previousState;getState=()=>{if(!this.isConnected||this._previousStateDirty){let e=this.binding.getState();e!==U_&&(this._previousState=e),this._previousStateDirty=!1}if(this._previousState===void 0)throw Error(`Entry not available in the store`);return this._previousState};_connect(){return this.binding.subscribe(()=>{this._previousStateDirty=!0,this.notifySubscribers()})}},q_=class extends W_{binding;get path(){return this.binding.path}constructor(e){super(),this.binding=e}getState(){return this.binding.getState()}outerSubscribe(e){return this.binding.subscribe(e)}_connect(){let e=()=>{this.notifySubscribers()},t=this.binding.getState(),n=t?.subscribe(e),r=this.outerSubscribe(()=>{let r=this.binding.getState();r!==t&&(t=r,n?.(),n=r?.subscribe(e),e())});return()=>{r?.(),n?.()}}},J_=class extends W_{config;constructor(e){super(),this.config=e}getState(){return this.config.binding.getState()}outerSubscribe(e){return this.config.binding.subscribe(e)}_connect(){let e=e=>{this.notifySubscribers(e)},t=this.config.binding.getState(),n=t?.unstable_on(this.config.event,e),r=this.outerSubscribe(()=>{let r=this.config.binding.getState();r!==t&&(t=r,n?.(),n=r?.unstable_on(this.config.event,e))});return()=>{r?.(),n?.()}}},Y_=class{_core;get path(){return this._core.path}constructor(e){this._core=e,this.__internal_bindMethods()}__internal_bindMethods(){this.getState=this.getState.bind(this),this.remove=this.remove.bind(this),this.subscribe=this.subscribe.bind(this)}getState(){return this._core.getState()}subscribe(e){return this._core.subscribe(e)}},X_=class extends Y_{_composerApi;constructor(e,t){super(e),this._composerApi=t}remove(){let e=this._composerApi.getState();if(!e)throw Error(`Composer is not available`);return e.removeAttachment(this.getState().id)}},Ore=class extends X_{get source(){return`thread-composer`}},kre=class extends X_{get source(){return`edit-composer`}},Are=class extends Y_{get source(){return`message`}remove(){throw Error(`Message attachments cannot be removed`)}},Z_=Object.freeze([]),Q_=Object.freeze({}),jre=e=>Object.freeze({type:`thread`,isEditing:e?.isEditing??!1,canCancel:e?.canCancel??!1,canSend:e?.canSend??!1,isEmpty:e?.isEmpty??!0,attachments:e?.attachments??Z_,text:e?.text??``,role:e?.role??`user`,runConfig:e?.runConfig??Q_,attachmentAccept:e?.attachmentAccept??``,dictation:e?.dictation,quote:e?.quote,queue:e?.queue??Z_,value:e?.text??``}),Mre=e=>Object.freeze({type:`edit`,isEditing:e?.isEditing??!1,canCancel:e?.canCancel??!1,canSend:e?.canSend??!1,isEmpty:e?.isEmpty??!0,text:e?.text??``,role:e?.role??`user`,attachments:e?.attachments??Z_,runConfig:e?.runConfig??Q_,attachmentAccept:e?.attachmentAccept??``,dictation:e?.dictation,quote:e?.quote,queue:e?.queue??Z_,parentId:e?.parentId??null,sourceId:e?.sourceId??null,value:e?.text??``}),$_=class{_core;get path(){return this._core.path}constructor(e){this._core=e}__internal_bindMethods(){this.setText=this.setText.bind(this),this.setRunConfig=this.setRunConfig.bind(this),this.getState=this.getState.bind(this),this.subscribe=this.subscribe.bind(this),this.addAttachment=this.addAttachment.bind(this),this.reset=this.reset.bind(this),this.clearAttachments=this.clearAttachments.bind(this),this.send=this.send.bind(this),this.cancel=this.cancel.bind(this),this.steerQueueItem=this.steerQueueItem.bind(this),this.removeQueueItem=this.removeQueueItem.bind(this),this.setRole=this.setRole.bind(this),this.getAttachmentByIndex=this.getAttachmentByIndex.bind(this),this.startDictation=this.startDictation.bind(this),this.stopDictation=this.stopDictation.bind(this),this.setQuote=this.setQuote.bind(this),this.unstable_on=this.unstable_on.bind(this)}setText(e){let t=this._core.getState();if(!t)throw Error(`Composer is not available`);t.setText(e)}setRunConfig(e){let t=this._core.getState();if(!t)throw Error(`Composer is not available`);t.setRunConfig(e)}addAttachment(e){let t=this._core.getState();if(!t)throw Error(`Composer is not available`);return t.addAttachment(e)}reset(){let e=this._core.getState();if(!e)throw Error(`Composer is not available`);return e.reset()}clearAttachments(){let e=this._core.getState();if(!e)throw Error(`Composer is not available`);return e.clearAttachments()}send(e){let t=this._core.getState();if(!t)throw Error(`Composer is not available`);t.send(e)}cancel(){let e=this._core.getState();if(!e)throw Error(`Composer is not available`);e.cancel()}steerQueueItem(e){let t=this._core.getState();if(!t)throw Error(`Composer is not available`);t.steerQueueItem(e)}removeQueueItem(e){let t=this._core.getState();if(!t)throw Error(`Composer is not available`);t.removeQueueItem(e)}setRole(e){let t=this._core.getState();if(!t)throw Error(`Composer is not available`);t.setRole(e)}startDictation(){let e=this._core.getState();if(!e)throw Error(`Composer is not available`);e.startDictation()}stopDictation(){let e=this._core.getState();if(!e)throw Error(`Composer is not available`);e.stopDictation()}setQuote(e){let t=this._core.getState();if(!t)throw Error(`Composer is not available`);t.setQuote(e)}subscribe(e){return this._core.subscribe(e)}_eventSubscriptionSubjects=new Map;unstable_on(e,t){let n=this._eventSubscriptionSubjects.get(e);return n||(n=new J_({event:e,binding:this._core}),this._eventSubscriptionSubjects.set(e,n)),n.subscribe(t)}},Nre=class extends $_{get path(){return this._core.path}get type(){return`thread`}_getState;constructor(e){let t=new K_({path:e.path,getState:()=>jre(e.getState()),subscribe:t=>e.subscribe(t)});super({path:e.path,getState:()=>e.getState(),subscribe:e=>t.subscribe(e)}),this._getState=t.getState.bind(t),this.__internal_bindMethods()}getState(){return this._getState()}getAttachmentByIndex(e){return new Ore(new G_({path:{...this.path,attachmentSource:`thread-composer`,attachmentSelector:{type:`index`,index:e},ref:`${this.path.ref}.attachments[${e}]`},getState:()=>{let t=this.getState().attachments[e];return t?{...t,source:`thread-composer`}:U_},subscribe:e=>this._core.subscribe(e)}),this._core)}},Pre=class extends $_{_beginEdit;get path(){return this._core.path}get type(){return`edit`}_getState;constructor(e,t){let n=new K_({path:e.path,getState:()=>Mre(e.getState()),subscribe:t=>e.subscribe(t)});super({path:e.path,getState:()=>e.getState(),subscribe:e=>n.subscribe(e)}),this._beginEdit=t,this._getState=n.getState.bind(n),this.__internal_bindMethods()}__internal_bindMethods(){super.__internal_bindMethods(),this.beginEdit=this.beginEdit.bind(this)}getState(){return this._getState()}beginEdit(){this._beginEdit()}getAttachmentByIndex(e){return new kre(new G_({path:{...this.path,attachmentSource:`edit-composer`,attachmentSelector:{type:`index`,index:e},ref:`${this.path.ref}.attachments[${e}]`},getState:()=>{let t=this.getState().attachments[e];return t?{...t,source:`edit-composer`}:U_},subscribe:e=>this._core.subscribe(e)}),this._core)}},ev=e=>e.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
|
|
78
|
+
|
|
79
|
+
`),tv={"allow-once":!0,"allow-always":!0,"reject-once":!1,"reject-always":!1},Fre=(e,t)=>{let n,r;if(`optionId`in t){let i=e.options?.find(e=>e.id===t.optionId);if(!i)throw Error(`Tool approval has no option with id "${t.optionId}"`);if(`approved`in t)n=t.approved;else{if(!Object.hasOwn(tv,i.kind))throw Error(`Tool approval option "${i.id}" has a custom kind "${i.kind}"; respond with an explicit approved value instead`);n=tv[i.kind]}r=i.id}else n=t.approved;return{approvalId:e.id,approved:n,...r!==void 0&&{optionId:r},...t.reason!=null&&{reason:t.reason}}},nv=class{contentBinding;messageApi;threadApi;get path(){return this.contentBinding.path}constructor(e,t,n){this.contentBinding=e,this.messageApi=t,this.threadApi=n,this.__internal_bindMethods()}__internal_bindMethods(){this.addToolResult=this.addToolResult.bind(this),this.resumeToolCall=this.resumeToolCall.bind(this),this.respondToToolApproval=this.respondToToolApproval.bind(this),this.getState=this.getState.bind(this),this.subscribe=this.subscribe.bind(this)}getState(){return this.contentBinding.getState()}addToolResult(e){let t=this.contentBinding.getState();if(!t)throw Error(`Message part is not available`);if(t.type!==`tool-call`)throw Error(`Tried to add tool result to non-tool message part`);if(!this.messageApi)throw Error(`Message API is not available. This is likely a bug in assistant-ui.`);if(!this.threadApi)throw Error(`Thread API is not available`);let n=this.messageApi.getState();if(!n)throw Error(`Message is not available`);let r=t.toolName,i=t.toolCallId,a=N_.toResponse(e);this.threadApi.getState().addToolResult({messageId:n.id,toolName:r,toolCallId:i,result:a.result,artifact:a.artifact,isError:a.isError})}resumeToolCall(e){let t=this.contentBinding.getState();if(!t)throw Error(`Message part is not available`);if(t.type!==`tool-call`)throw Error(`Tried to resume tool call on non-tool message part`);if(!this.threadApi)throw Error(`Thread API is not available`);let n=t.toolCallId;this.threadApi.getState().resumeToolCall({toolCallId:n,payload:e})}respondToToolApproval(e){let t=this.contentBinding.getState();if(!t)throw Error(`Message part is not available`);if(t.type!==`tool-call`)throw Error(`Tried to respond to tool approval on non-tool message part`);if(!t.approval||t.approval.approved!==void 0||t.approval.resolution!==void 0)throw Error(`Tool call has no pending approval`);if(!this.threadApi)throw Error(`Thread API is not available`);this.threadApi.getState().respondToToolApproval(Fre(t.approval,e))}subscribe(e){return this.contentBinding.subscribe(e)}},rv=Object.freeze({type:`complete`}),Ire=(e,t,n)=>{if(e.role!==`assistant`)return rv;if(n.type===`tool-call`)return n.result?rv:e.status;let r=t===Math.max(0,e.content.length-1);return e.status.type===`requires-action`?rv:r?e.status:rv},iv=(e,t)=>{let n=e.content[t];if(!n)return U_;let r=Ire(e,t,n);return Object.freeze({...n,[V_]:n[V_],status:r})},Lre=class{_core;_threadBinding;get path(){return this._core.path}constructor(e,t){this._core=e,this._threadBinding=t,this.composer=new Pre(new q_({path:{...this.path,ref:`${this.path.ref}${this.path.ref}.composer`,composerSource:`edit`},getState:this._getEditComposerRuntimeCore,subscribe:e=>this._threadBinding.subscribe(e)}),()=>this._threadBinding.getState().beginEdit(this._core.getState().id)),this.__internal_bindMethods()}__internal_bindMethods(){this.reload=this.reload.bind(this),this.delete=this.delete.bind(this),this.getState=this.getState.bind(this),this.subscribe=this.subscribe.bind(this),this.getMessagePartByIndex=this.getMessagePartByIndex.bind(this),this.getMessagePartByToolCallId=this.getMessagePartByToolCallId.bind(this),this.getAttachmentByIndex=this.getAttachmentByIndex.bind(this),this.unstable_getCopyText=this.unstable_getCopyText.bind(this),this.speak=this.speak.bind(this),this.stopSpeaking=this.stopSpeaking.bind(this),this.submitFeedback=this.submitFeedback.bind(this),this.switchToBranch=this.switchToBranch.bind(this)}composer;_getEditComposerRuntimeCore=()=>this._threadBinding.getState().getEditComposer(this._core.getState().id);getState(){return this._core.getState()}delete(){let e=this._core.getState();return this._threadBinding.getState().deleteMessage(e.id)}reload(e={}){let t=this._getEditComposerRuntimeCore(),n=t??this._threadBinding.getState().composer,r=t??n,{runConfig:i=r.runConfig}=e,a=this._core.getState();if(a.role!==`assistant`)throw Error(`Can only reload assistant messages`);this._threadBinding.getState().startRun({parentId:a.parentId,sourceId:a.id,runConfig:i})}speak(){let e=this._core.getState();return this._threadBinding.getState().speak(e.id)}stopSpeaking(){let e=this._core.getState();if(this._threadBinding.getState().speech?.messageId===e.id)this._threadBinding.getState().stopSpeaking();else throw Error(`Message is not being spoken`)}submitFeedback({type:e}){let t=this._core.getState();this._threadBinding.getState().submitFeedback({messageId:t.id,type:e})}switchToBranch({position:e,branchId:t}){let n=this._core.getState();if(t&&e)throw Error(`May not specify both branchId and position`);if(!t&&!e)throw Error(`Must specify either branchId or position`);let r=this._threadBinding.getState().getBranches(n.id),i=t;if(e===`previous`?i=r[n.branchNumber-2]:e===`next`&&(i=r[n.branchNumber]),!i)throw Error(`Branch not found`);this._threadBinding.getState().switchToBranch(i)}unstable_getCopyText(){return ev(this.getState())}subscribe(e){return this._core.subscribe(e)}getMessagePartByIndex(e){if(e<0)throw Error(`Message part index must be >= 0`);return new nv(new G_({path:{...this.path,ref:`${this.path.ref}${this.path.ref}.content[${e}]`,messagePartSelector:{type:`index`,index:e}},getState:()=>iv(this.getState(),e),subscribe:e=>this._core.subscribe(e)}),this._core,this._threadBinding)}getMessagePartByToolCallId(e){return new nv(new G_({path:{...this.path,ref:this.path.ref+`${this.path.ref}.content[toolCallId=${JSON.stringify(e)}]`,messagePartSelector:{type:`toolCallId`,toolCallId:e}},getState:()=>{let t=this._core.getState(),n=t.content.findIndex(t=>t.type===`tool-call`&&t.toolCallId===e);return n===-1?U_:iv(t,n)},subscribe:e=>this._core.subscribe(e)}),this._core,this._threadBinding)}getAttachmentByIndex(e){return new Are(new G_({path:{...this.path,ref:`${this.path.ref}${this.path.ref}.attachments[${e}]`,attachmentSource:`message`,attachmentSelector:{type:`index`,index:e}},getState:()=>{let t=this.getState().attachments?.[e];return t?{...t,source:`message`}:U_},subscribe:e=>this._core.subscribe(e)}))}},Rre=e=>({parentId:e.parentId??null,sourceId:e.sourceId??null,runConfig:e.runConfig??{},...e.stream?{stream:e.stream}:{}}),zre=e=>({parentId:e.parentId??null,sourceId:e.sourceId??null,runConfig:e.runConfig??{}}),Bre=(e,t)=>typeof t==`string`?{createdAt:new Date,parentId:e.at(-1)?.id??null,sourceId:null,runConfig:{},role:`user`,content:[{type:`text`,text:t}],attachments:[],metadata:{custom:{}}}:{createdAt:t.createdAt??new Date,parentId:t.parentId??e.at(-1)?.id??null,sourceId:t.sourceId??null,role:t.role??`user`,content:t.content,attachments:t.attachments??[],metadata:t.metadata??{custom:{}},runConfig:t.runConfig??{},startRun:t.startRun},Vre=(e,t)=>{let n=e.messages.at(-1);return Object.freeze({threadId:t.id,metadata:t,capabilities:e.capabilities,isDisabled:e.isDisabled,isLoading:e.isLoading,isRunning:e.isRunning??(n?.role===`assistant`?n.status.type===`running`:!1),messages:e.messages,state:e.state,suggestions:e.suggestions,extras:e.extras,speech:e.speech,voice:e.voice})},Hre=class{get path(){return this._threadBinding.path}get __internal_threadBinding(){return this._threadBinding}_threadBinding;constructor(e,t){let n=new G_({path:e.path,getState:()=>Vre(e.getState(),t.getState()),subscribe:n=>{let r=e.subscribe(n),i=t.subscribe(n);return()=>{r(),i()}}});this._threadBinding={path:e.path,getState:()=>e.getState(),getStateState:()=>n.getState(),outerSubscribe:t=>e.outerSubscribe(t),subscribe:t=>e.subscribe(t)},this.composer=new Nre(new q_({path:{...this.path,ref:`${this.path.ref}.composer`,composerSource:`thread`},getState:()=>this._threadBinding.getState().composer,subscribe:e=>this._threadBinding.subscribe(e)})),this.__internal_bindMethods()}__internal_bindMethods(){this.append=this.append.bind(this),this.deleteMessage=this.deleteMessage.bind(this),this.resumeRun=this.resumeRun.bind(this),this.importExternalState=this.importExternalState.bind(this),this.exportExternalState=this.exportExternalState.bind(this),this.startRun=this.startRun.bind(this),this.cancelRun=this.cancelRun.bind(this),this.stopSpeaking=this.stopSpeaking.bind(this),this.connectVoice=this.connectVoice.bind(this),this.disconnectVoice=this.disconnectVoice.bind(this),this.muteVoice=this.muteVoice.bind(this),this.unmuteVoice=this.unmuteVoice.bind(this),this.getVoiceVolume=this.getVoiceVolume.bind(this),this.subscribeVoiceVolume=this.subscribeVoiceVolume.bind(this),this.export=this.export.bind(this),this.import=this.import.bind(this),this.reset=this.reset.bind(this),this.getMessageByIndex=this.getMessageByIndex.bind(this),this.getMessageById=this.getMessageById.bind(this),this.subscribe=this.subscribe.bind(this),this.unstable_on=this.unstable_on.bind(this),this.getModelContext=this.getModelContext.bind(this),this.getState=this.getState.bind(this)}composer;getState(){return this._threadBinding.getStateState()}append(e){this._threadBinding.getState().append(Bre(this._threadBinding.getState().messages,e))}deleteMessage(e){return this._threadBinding.getState().deleteMessage(e)}subscribe(e){return this._threadBinding.subscribe(e)}getModelContext(){return this._threadBinding.getState().getModelContext()}startRun(e){return this._threadBinding.getState().startRun(zre(e))}resumeRun(e){return this._threadBinding.getState().resumeRun(Rre(e))}exportExternalState(){return this._threadBinding.getState().exportExternalState()}importExternalState(e){this._threadBinding.getState().importExternalState(e)}cancelRun(){this._threadBinding.getState().cancelRun()}stopSpeaking(){return this._threadBinding.getState().stopSpeaking()}connectVoice(){this._threadBinding.getState().connectVoice()}disconnectVoice(){this._threadBinding.getState().disconnectVoice()}getVoiceVolume(){return this._threadBinding.getState().getVoiceVolume()}subscribeVoiceVolume(e){return this._threadBinding.getState().subscribeVoiceVolume(e)}muteVoice(){this._threadBinding.getState().muteVoice()}unmuteVoice(){this._threadBinding.getState().unmuteVoice()}export(){return this._threadBinding.getState().export()}import(e){this._threadBinding.getState().import(e)}reset(e){this._threadBinding.getState().reset(e)}getMessageByIndex(e){if(e<0)throw Error(`Message index must be >= 0`);return this._getMessageRuntime({...this.path,ref:`${this.path.ref}.messages[${e}]`,messageSelector:{type:`index`,index:e}},()=>{let t=this._threadBinding.getState().messages,n=t[e];if(n)return{message:n,parentId:t[e-1]?.id??null,index:e}})}getMessageById(e){return this._getMessageRuntime({...this.path,ref:`${this.path.ref}.messages[messageId=${JSON.stringify(e)}]`,messageSelector:{type:`messageId`,messageId:e}},()=>this._threadBinding.getState().getMessageById(e))}_getMessageRuntime(e,t){return new Lre(new G_({path:e,getState:()=>{let{message:e,parentId:n,index:r}=t()??{},{messages:i,speech:a}=this._threadBinding.getState();if(!e||n===void 0||r===void 0)return U_;let o=this._threadBinding.getState().getBranches(e.id);return{...e,[V_]:e[V_],index:r,isLast:i.at(-1)?.id===e.id,parentId:n,branchNumber:o.indexOf(e.id)+1,branchCount:o.length,speech:a?.messageId===e.id?a:void 0}},subscribe:e=>this._threadBinding.subscribe(e)}),this._threadBinding)}_eventSubscriptionSubjects=new Map;unstable_on(e,t){let n=this._eventSubscriptionSubjects.get(e);return n||(n=new J_({event:e,binding:this._threadBinding}),this._eventSubscriptionSubjects.set(e,n)),n.subscribe(t)}},Ure=Yh(null),Wre=()=>Zh(Ure),av=class{_core;_threadListBinding;get path(){return this._core.path}constructor(e,t){this._core=e,this._threadListBinding=t,this.__internal_bindMethods()}__internal_bindMethods(){this.switchTo=this.switchTo.bind(this),this.rename=this.rename.bind(this),this.updateCustom=this.updateCustom.bind(this),this.archive=this.archive.bind(this),this.unarchive=this.unarchive.bind(this),this.delete=this.delete.bind(this),this.initialize=this.initialize.bind(this),this.generateTitle=this.generateTitle.bind(this),this.subscribe=this.subscribe.bind(this),this.unstable_on=this.unstable_on.bind(this),this.getState=this.getState.bind(this),this.detach=this.detach.bind(this)}getState(){return this._core.getState()}switchTo(e){let t=this._core.getState();return this._threadListBinding.switchToThread(t.id,e)}rename(e){let t=this._core.getState();return this._threadListBinding.rename(t.id,e)}updateCustom(e){let t=this._core.getState();if(!this._threadListBinding.updateCustom)throw Error(`Thread list runtime does not support updating custom metadata`);return this._threadListBinding.updateCustom(t.id,e)}archive(){let e=this._core.getState();return this._threadListBinding.archive(e.id)}unarchive(){let e=this._core.getState();return this._threadListBinding.unarchive(e.id)}delete(){let e=this._core.getState();return this._threadListBinding.delete(e.id)}initialize(){let e=this._core.getState();return this._threadListBinding.initialize(e.id)}generateTitle(){let e=this._core.getState();return this._threadListBinding.generateTitle(e.id)}unstable_on(e,t){let n=this._core.getState().isMain,r=this._core.getState().id;return this.subscribe(()=>{let i=this._core.getState(),a=i.isMain,o=i.id;n===a&&r===o||(n=a,r=o,!(e===`switchedTo`&&!a)&&(e===`switchedAway`&&a||t({})))})}subscribe(e){return this._core.subscribe(e)}detach(){let e=this._core.getState();this._threadListBinding.detach(e.id)}__internal_getRuntime(){return this}},ov=Promise.resolve(),Gre=e=>({mainThreadId:e.mainThreadId,newThreadId:e.newThreadId,threadIds:e.threadIds,archivedThreadIds:e.archivedThreadIds,isLoading:e.isLoading,isLoadingMore:e.isLoadingMore??!1,hasMore:e.hasMore??!1,threadItems:e.threadItems}),sv=(e,t)=>{if(t===void 0)return U_;let n=e.getItemById(t);return n?{id:n.id,remoteId:n.remoteId,externalId:n.externalId,title:n.title,status:n.status,lastMessageAt:n.lastMessageAt,custom:n.custom,isMain:n.id===e.mainThreadId}:U_},Kre=class{_core;_runtimeFactory;_getState;constructor(e,t=Hre){this._core=e,this._runtimeFactory=t;let n=new K_({path:{},getState:()=>Gre(e),subscribe:t=>e.subscribe(t)});this._getState=n.getState.bind(n),this._mainThreadListItemRuntime=new av(new G_({path:{ref:`threadItems[main]`,threadSelector:{type:`main`}},getState:()=>sv(this._core,this._core.mainThreadId),subscribe:e=>this._core.subscribe(e)}),this._core),this.main=new t(new q_({path:{ref:`threads.main`,threadSelector:{type:`main`}},getState:()=>e.getMainThreadRuntimeCore(),subscribe:t=>e.subscribe(t)}),this._mainThreadListItemRuntime),this.__internal_bindMethods()}__internal_bindMethods(){this.switchToThread=this.switchToThread.bind(this),this.switchToNewThread=this.switchToNewThread.bind(this),this.getLoadThreadsPromise=this.getLoadThreadsPromise.bind(this),this.reload=this.reload.bind(this),this.loadMore=this.loadMore.bind(this),this.getState=this.getState.bind(this),this.subscribe=this.subscribe.bind(this),this.getById=this.getById.bind(this),this.getItemById=this.getItemById.bind(this),this.getItemByIndex=this.getItemByIndex.bind(this),this.getArchivedItemByIndex=this.getArchivedItemByIndex.bind(this)}switchToThread(e,t){return this._core.switchToThread(e,t)}switchToNewThread(){return this._core.switchToNewThread()}getLoadThreadsPromise(){return this._core.getLoadThreadsPromise()}reload(){return this._core.reload?.()??ov}loadMore(){return this._core.loadMore?.()??ov}getState(){return this._getState()}subscribe(e){return this._core.subscribe(e)}_mainThreadListItemRuntime;main;get mainItem(){return this._mainThreadListItemRuntime}getById(e){return new this._runtimeFactory(new q_({path:{ref:`threads[threadId=${JSON.stringify(e)}]`,threadSelector:{type:`threadId`,threadId:e}},getState:()=>this._core.getThreadRuntimeCore(e),subscribe:e=>this._core.subscribe(e)}),this.mainItem)}getItemByIndex(e){return new av(new G_({path:{ref:`threadItems[${e}]`,threadSelector:{type:`index`,index:e}},getState:()=>sv(this._core,this._core.threadIds[e]),subscribe:e=>this._core.subscribe(e)}),this._core)}getArchivedItemByIndex(e){return new av(new G_({path:{ref:`archivedThreadItems[${e}]`,threadSelector:{type:`archiveIndex`,index:e}},getState:()=>sv(this._core,this._core.archivedThreadIds[e]),subscribe:e=>this._core.subscribe(e)}),this._core)}getItemById(e){return new av(new G_({path:{ref:`threadItems[threadId=${e}]`,threadSelector:{type:`threadId`,threadId:e}},getState:()=>sv(this._core,e),subscribe:e=>this._core.subscribe(e)}),this._core)}},qre=class{_core;threads;_thread;constructor(e){this._core=e,this.threads=new Kre(e.threads),this._thread=this.threads.main,this.__internal_bindMethods()}__internal_bindMethods(){this.registerModelContextProvider=this.registerModelContextProvider.bind(this)}get thread(){return this._thread}registerModelContextProvider(e){return this._core.registerModelContextProvider(e)}},Jre=class{_contextProvider=new bg;registerModelContextProvider(e){return this._contextProvider.registerModelContextProvider(e)}getModelContextProvider(){return this._contextProvider}},cv=Object.freeze([]),lv=`DEFAULT_THREAD_ID`,Yre=Object.freeze([lv]),Xre=Object.freeze({id:lv,remoteId:void 0,externalId:void 0,status:`regular`}),Zre=Promise.resolve(),uv=Object.freeze({[lv]:Xre}),Qre=class{threadFactory;_mainThreadId=lv;_threads=Yre;_archivedThreads=cv;_threadData=uv;adapter={};get isLoading(){return this.adapter.isLoading??!1}get newThreadId(){}get threadIds(){return this._threads}get archivedThreadIds(){return this._archivedThreads}get threadItems(){return this._threadData}getLoadThreadsPromise(){return Zre}_mainThread;get mainThreadId(){return this._mainThreadId}constructor(e={},t){this.threadFactory=t,this.__internal_setAdapter(e,!0)}getMainThreadRuntimeCore(){return this._mainThread}getThreadRuntimeCore(){throw Error(`Method not implemented.`)}getItemById(e){return this._threadData[e]}__internal_setAdapter(e,t=!1){let n=this.adapter;this.adapter=e;let r=e.threadId??lv,i=e.threads??cv,a=e.archivedThreads??cv,o=n.threadId??lv,s=n.threads??cv,c=n.archivedThreads??cv;!t&&o===r&&s===i&&c===a||((s!==i||c!==a||o!==r)&&(this._threadData={...uv,...Object.fromEntries(e.threads?.map(e=>[e.id,{...e,remoteId:e.remoteId,externalId:e.externalId,status:`regular`}])??[]),...Object.fromEntries(e.archivedThreads?.map(e=>[e.id,{...e,remoteId:e.remoteId,externalId:e.externalId,status:`archived`}])??[])}),s!==i&&(this._threads=this.adapter.threads?.map(e=>e.id)??cv),c!==a&&(this._archivedThreads=this.adapter.archivedThreads?.map(e=>e.id)??cv),(t||o!==r)&&(this._mainThreadId=r,this._mainThread=this.threadFactory()),this._threadData[this._mainThreadId]||(this._threadData={...this._threadData,[this._mainThreadId]:{id:this._mainThreadId,remoteId:void 0,externalId:void 0,status:`regular`}}),this._notifySubscribers())}async switchToThread(e,t){if(this._mainThreadId===e)return;let n=this.adapter.onSwitchToThread;if(!n)throw Error(`External store adapter does not support switching to thread`);await n(e)}async switchToNewThread(){let e=this.adapter.onSwitchToNewThread;if(!e)throw Error(`External store adapter does not support switching to new thread`);await e()}async rename(e,t){let n=this.adapter.onRename;if(!n)throw Error(`External store adapter does not support renaming`);await n(e,t)}async updateCustom(e,t){let n=this.adapter.onUpdateCustom;if(!n)throw Error(`External store adapter does not support updating custom metadata`);await n(e,t)}async detach(){}async archive(e){let t=this.adapter.onArchive;if(!t)throw Error(`External store adapter does not support archiving`);await t(e)}async unarchive(e){let t=this.adapter.onUnarchive;if(!t)throw Error(`External store adapter does not support unarchiving`);await t(e)}async delete(e){let t=this.adapter.onDelete;if(!t)throw Error(`External store adapter does not support deleting`);await t(e)}initialize(e){return Promise.resolve({remoteId:e,externalId:void 0})}generateTitle(){throw Error(`Method not implemented.`)}_subscriptions=new Set;subscribe(e){return this._subscriptions.add(e),()=>this._subscriptions.delete(e)}_notifySubscribers(){for(let e of this._subscriptions)e()}},dv=T_(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`,7),fv=(e,t)=>{if(e.startsWith(`data-`))return{type:`data`,name:e.substring(5),data:t}},pv=(e,t,n)=>{let{role:r,id:i,createdAt:a,attachments:o,status:s,metadata:c}=e,l={id:i??t,createdAt:a??new Date},u=typeof e.content==`string`?[{type:`text`,text:e.content}]:e.content,d=({image:e,...t})=>e.match(/^data:image\/(png|jpeg|jpg|gif|webp|svg\+xml);base64,(.*)$/)||/^(https:\/\/|blob:)/.test(e)?{...t,image:e}:(console.warn(`Invalid image data format detected`),null);if(r!==`user`&&o?.length)throw Error(`attachments are only supported for user messages`);if(r!==`assistant`&&s)throw Error(`status is only supported for assistant messages`);if(r!==`assistant`&&c?.steps)throw Error(`metadata.steps is only supported for assistant messages`);switch(r){case`assistant`:return{...l,role:r,content:u.map(e=>{let t=e.type;switch(t){case`text`:case`reasoning`:return e.text.trim().length===0?null:e;case`file`:case`source`:return e;case`image`:return d(e);case`data`:return e;case`generative-ui`:return e;case`tool-call`:{let{parentId:t,messages:n,...r}=e,i={...r,toolCallId:e.toolCallId??`tool-${dv()}`,...t!==void 0&&{parentId:t},...n!==void 0&&{messages:n}};return e.args?{...i,args:e.args,argsText:e.argsText??JSON.stringify(e.args)}:{...i,args:O_(e.argsText??``)??{},argsText:e.argsText??``}}default:{let n=fv(t,e.data);if(n)return n;throw Error(`Unsupported assistant message part type: ${t}`)}}}).filter(e=>!!e),status:s??n,metadata:{unstable_state:c?.unstable_state??null,unstable_annotations:c?.unstable_annotations??[],unstable_data:c?.unstable_data??[],custom:c?.custom??{},steps:c?.steps??[],...c?.timing&&{timing:c.timing},...c?.submittedFeedback&&{submittedFeedback:c.submittedFeedback},...c?.isOptimistic&&{isOptimistic:!0}}};case`user`:return{...l,role:r,content:u.map(e=>{let t=e.type;switch(t){case`text`:case`image`:case`audio`:case`file`:case`data`:return e;default:{let n=fv(t,e.data);if(n)return n;throw Error(`Unsupported user message part type: ${t}`)}}}),attachments:(o??[]).map(e=>({...e,content:e.content.map(e=>fv(e.type,e.data)??e)})),metadata:{custom:c?.custom??{}}};case`system`:if(u.length!==1||u[0].type!==`text`)throw Error(`System messages must have exactly one text message part.`);return{...l,role:r,content:u,metadata:{custom:c?.custom??{}}};default:throw Error(`Unknown message role: ${r}`)}},mv=Symbol(`autoStatus`),$re=Object.freeze(Object.assign({type:`running`},{[mv]:!0})),eie=Object.freeze(Object.assign({type:`complete`,reason:`unknown`},{[mv]:!0})),tie=Object.freeze(Object.assign({type:`requires-action`,reason:`tool-calls`},{[mv]:!0})),nie=Object.freeze(Object.assign({type:`requires-action`,reason:`interrupt`},{[mv]:!0})),rie=e=>e[mv]===!0,hv=(e,t,n,r,i)=>e&&i?Object.assign({type:`incomplete`,reason:`error`,error:i},{[mv]:!0}):e&&t?$re:n?nie:r?tie:eie,gv={fromArray:e=>{let t=e.map(e=>pv(e,dv(),hv(!1,!1,!1,!1,void 0)));return{messages:t.map((e,n)=>({parentId:n>0?t[n-1].id:null,message:e}))}},fromBranchableArray:(e,t)=>{let n=hv(!1,!1,!1,!1,void 0);return{...t?.headId===void 0?void 0:{headId:t.headId},messages:e.map(({message:e,parentId:t})=>{if(!e.id)throw Error(`ExportedMessageRepository.fromBranchableArray: Each message must have an 'id' field set.`);return{parentId:t,message:pv(e,e.id,n)}})}}},_v=e=>e.next?_v(e.next):`current`in e?e:null,iie=class{func;_value=null;constructor(e){this.func=e}get value(){return this._value===null&&(this._value=this.func()),this._value}dirty(){this._value=null}},vv=class{messages=new Map;head=null;root={children:[],next:null};updateLevels(e,t){e.level=t;for(let n of e.children){let e=this.messages.get(n);e&&this.updateLevels(e,t+1)}}performOp(e,t,n){let r=t.prev??this.root,i=e??this.root;if(!(n===`relink`&&r===i)){if(n!==`link`&&(r.children=r.children.filter(e=>e!==t.current.id),r.next===t)){let e=r.children.at(-1),t=e?this.messages.get(e):null;if(t===void 0)throw Error(`MessageRepository(performOp/cut): Fallback sibling message not found. This is likely an internal bug in assistant-ui.`);r.next=t}if(n!==`cut`){for(let n=e;n;n=n.prev)if(n.current.id===t.current.id)throw Error(`MessageRepository(performOp/link): A message with the same id already exists in the parent tree. This error occurs if the same message id is found multiple times. This is likely an internal bug in assistant-ui.`);i.children=[...i.children,t.current.id],(_v(t)===this.head||i.next===null)&&(i.next=t),t.prev=e;let n=e?e.level+1:0;this.updateLevels(t,n)}}}_messages=new iie(()=>{let e=Array((this.head?.level??-1)+1);for(let t=this.head;t;t=t.prev)e[t.level]=t.current;return e});get headId(){return this.head?.current.id??null}getMessages(e){if(e===void 0||e===this.head?.current.id)return this._messages.value;let t=this.messages.get(e);if(!t)throw Error(`MessageRepository(getMessages): Head message not found. This is likely an internal bug in assistant-ui.`);let n=Array(t.level+1);for(let e=t;e;e=e.prev)n[e.level]=e.current;return n}addOrUpdateMessage(e,t){let n=this.messages.get(t.id),r=e?this.messages.get(e):null;if(r===void 0)throw Error(`MessageRepository(addOrUpdateMessage): Parent message not found. This is likely an internal bug in assistant-ui.`);if(n){n.current=t,this.performOp(r,n,`relink`),this._messages.dirty();return}let i={prev:r,current:t,next:null,children:[],level:r?r.level+1:0};this.messages.set(t.id,i),this.performOp(r,i,`link`),this.head===r&&(this.head=i),this._messages.dirty()}getMessage(e){let t=this.messages.get(e);if(!t)throw Error(`MessageRepository(updateMessage): Message not found. This is likely an internal bug in assistant-ui.`);return{parentId:t.prev?.current.id??null,message:t.current,index:t.level}}deleteMessage(e,t){let n=this.messages.get(e);if(!n)throw Error(`MessageRepository(deleteMessage): Message not found. This is likely an internal bug in assistant-ui.`);let r=t===void 0?n.prev:t===null?null:this.messages.get(t);if(r===void 0)throw Error(`MessageRepository(deleteMessage): Replacement not found. This is likely an internal bug in assistant-ui.`);for(let e of n.children){let t=this.messages.get(e);if(!t)throw Error(`MessageRepository(deleteMessage): Child message not found. This is likely an internal bug in assistant-ui.`);this.performOp(r,t,`relink`)}this.performOp(null,n,`cut`),this.messages.delete(e),this.head===n&&(this.head=_v(r??this.root)),this._messages.dirty()}getBranches(e){let t=this.messages.get(e);if(!t)throw Error(`MessageRepository(getBranches): Message not found. This is likely an internal bug in assistant-ui.`);let{children:n}=t.prev??this.root;return n}evictOffBranchOptimisticMessages(e,t){if(!e)return;let n=new Set;for(let e=t;e;e=e.prev)n.add(e.current.id);let r=[];for(let t=e;t&&!n.has(t.current.id);t=t.prev)t.current.metadata?.isOptimistic&&r.push(t.current.id);for(let e of r)this.messages.has(e)&&this.deleteMessage(e)}switchToBranch(e){let t=this.messages.get(e);if(!t)throw Error(`MessageRepository(switchToBranch): Branch not found. This is likely an internal bug in assistant-ui.`);let n=this.head,r=t.prev??this.root;r.next=t,this.head=_v(t),this.evictOffBranchOptimisticMessages(n,this.head),this._messages.dirty()}resetHead(e){if(e===null){this.clear();return}let t=this.messages.get(e);if(!t)throw Error(`MessageRepository(resetHead): Branch not found. This is likely an internal bug in assistant-ui.`);let n=this.head;if(t.children.length>0){let e=t=>{for(let n of t.children){let t=this.messages.get(n);t&&(e(t),this.messages.delete(n))}};e(t),t.children=[],t.next=null}this.head=t;for(let e=t;e;e=e.prev)e.prev?e.prev.next=e:this.root.next=e;this.evictOffBranchOptimisticMessages(n,this.head),this._messages.dirty()}clear(){this.messages.clear(),this.head=null,this.root={children:[],next:null},this._messages.dirty()}export(){let e=[];for(let[,t]of this.messages)t.current.metadata?.isOptimistic||e.push({message:t.current,parentId:t.prev?.current.id??null});let t=this.head;for(;t?.current.metadata?.isOptimistic;)t=t.prev;return{headId:t?.current.id??null,messages:e}}import({headId:e,messages:t}){for(let{message:e,parentId:n}of t)this.addOrUpdateMessage(n,e);this.resetHead(e??t.at(-1)?.message.id??null)}},yv=Object.freeze([]);function bv(e,t){if(t===`*`)return!0;let n=t.split(`,`).map(e=>e.trim().toLowerCase()),r=`.${e.name.split(`.`).pop().toLowerCase()}`,i=e.type.toLowerCase();for(let e of n){if(e.startsWith(`.`)&&e===r||e.includes(`/`)&&e===i)return!0;if(e.endsWith(`/*`)){let t=e.split(`/`)[0];if(i.startsWith(`${t}/`))return!0}}return!1}function aie(e,t){return e.length===t.length?e.every((e,n)=>e.id===t[n].id):!1}function oie(e){let t=dv();return e.type===`image`?{id:t,type:`image`,name:e.filename??`image`,content:[e],status:{type:`complete`}}:e.type===`file`?{id:t,type:`document`,name:e.filename??`document`,contentType:e.mimeType,content:[e],status:{type:`complete`}}:e.type===`audio`?{id:t,type:`audio`,name:`audio.${e.audio.format}`,contentType:`audio/${e.audio.format}`,content:[e],status:{type:`complete`}}:{id:t,type:`data`,name:e.name,content:[e],status:{type:`complete`}}}function sie(e){let t=[];for(let n of e)n.type!==`text`&&t.push(oie(n));return t}var xv=e=>e.status.type===`complete`,Sv=class extends Dre{isEditing=!0;get attachmentAccept(){return this.getAttachmentAdapter()?.accept??`*`}_attachments=[];get attachments(){return this._attachments}setAttachments(e){this._attachments=e,this._notifySubscribers()}get isEmpty(){return!this.text.trim()&&!this.attachments.length}_text=``;get text(){return this._text}_role=`user`;get role(){return this._role}_runConfig={};get runConfig(){return this._runConfig}_quote=void 0;get quote(){return this._quote}setQuote(e){this._quote!==e&&(this._quote=e,this._notifySubscribers())}setText(e){if(this._text!==e){if(this._text=e,this._dictation){this._dictationBaseText=e,this._currentInterimText=``;let{status:t,inputDisabled:n}=this._dictation;this._dictation=n?{status:t,inputDisabled:n}:{status:t}}this._notifySubscribers()}}setRole(e){this._role!==e&&(this._role=e,this._notifySubscribers())}setRunConfig(e){this._runConfig!==e&&(this._runConfig=e,this._notifySubscribers())}_emptyTextAndAttachments(){this._attachments=[],this._text=``,this._notifySubscribers()}async _onClearAttachments(){let e=this.getAttachmentAdapter();if(e){let t=this._attachments.filter(e=>!xv(e));await Promise.all(t.map(t=>e.remove(t)))}}async reset(){if(this._attachments.length===0&&this._text===``&&this._role===`user`&&Object.keys(this._runConfig).length===0&&this._quote===void 0)return;this._role=`user`,this._runConfig={},this._quote=void 0;let e=this._onClearAttachments();this._emptyTextAndAttachments(),await e}async clearAttachments(){let e=this._onClearAttachments();this.setAttachments([]),await e}async send(e){if(!this.canSend)return;this._dictationSession&&(this._dictationSession.cancel(),this._cleanupDictation());let t=this.getAttachmentAdapter(),n=this.attachments.length>0?Promise.all(this.attachments.map(async e=>{if(xv(e))return e;if(!t)throw Error(`Attachments are not supported`);return await t.send(e)})):[],r=this.text,i=this._quote;this._quote=void 0,this._emptyTextAndAttachments();let a={createdAt:new Date,role:this.role,content:r?[{type:`text`,text:r}]:[],attachments:await n,runConfig:this.runConfig,metadata:{custom:{...i?{quote:i}:{}}}};this.handleSend(a,e),this._notifyEventSubscribers(`send`,{})}cancel(){this.handleCancel()}get queue(){return yv}steerQueueItem(e){}removeQueueItem(e){}async addAttachment(e){if(!(e instanceof File)){let t=this.getAttachmentAdapter();if(t&&!bv({name:e.name,type:e.contentType??``},t.accept)){let n=`File type ${e.contentType||`unknown`} is not accepted. Accepted types: ${t.accept}`,r=Error(n);throw this._safeEmitAttachmentAddError(`not-accepted`,n,void 0,r),r}let n={id:e.id??dv(),type:e.type??`document`,name:e.name,contentType:e.contentType,content:e.content,status:{type:`complete`}};this._attachments=[...this._attachments,n],this._notifySubscribers(),this._notifyEventSubscribers(`attachmentAdd`,{});return}let t=e=>{let t=this._attachments.findIndex(t=>t.id===e.id);t===-1?this._attachments=[...this._attachments,e]:this._attachments=[...this._attachments.slice(0,t),e,...this._attachments.slice(t+1)],this._notifySubscribers()},n=this.getAttachmentAdapter();if(!n){let e=`Attachments are not supported`,t=Error(e);throw this._safeEmitAttachmentAddError(`no-adapter`,e,void 0,t),t}if(!bv({name:e.name,type:e.type},n.accept)){let t=`File type ${e.type||`unknown`} is not accepted. Accepted types: ${n.accept}`,r=Error(t);throw this._safeEmitAttachmentAddError(`not-accepted`,t,void 0,r),r}let r;try{let i=n.add({file:e});if(Symbol.asyncIterator in i)for await(let e of i)r=e,t(e);else r=await i,t(r)}catch(e){throw r&&t({...r,status:{type:`incomplete`,reason:`error`}}),this._safeEmitAttachmentAddError(`adapter-error`,e instanceof Error?e.message:String(e),r?.id,e instanceof Error?e:void 0),e}r?.status.type===`incomplete`&&r.status.reason===`error`?this._safeEmitAttachmentAddError(`adapter-error`,`Attachment upload did not complete successfully.`,r?.id):this._notifyEventSubscribers(`attachmentAdd`,{})}_safeEmitAttachmentAddError(e,t,n,r){try{this._notifyEventSubscribers(`attachmentAddError`,{reason:e,message:t,...n!==void 0&&{attachmentId:n},...r!==void 0&&{error:r}})}catch(e){console.error(`[assistant-ui] attachmentAddError subscriber threw:`,e)}}async removeAttachment(e){let t=this._attachments.findIndex(t=>t.id===e);if(t===-1)throw Error(`Attachment not found`);let n=this._attachments[t];if(!xv(n)){let e=this.getAttachmentAdapter();if(!e)throw Error(`Attachments are not supported`);await e.remove(n)}this._attachments=this._attachments.filter(t=>t.id!==e),this._notifySubscribers()}_dictation;_dictationSession;_dictationUnsubscribes=[];_dictationBaseText=``;_currentInterimText=``;_dictationSessionIdCounter=0;_activeDictationSessionId;_isCleaningDictation=!1;get dictation(){return this._dictation}_isActiveSession(e,t){return this._activeDictationSessionId===e&&this._dictationSession===t}startDictation(){let e=this.getDictationAdapter();if(!e)throw Error(`Dictation adapter not configured`);if(this._dictationSession){for(let e of this._dictationUnsubscribes)e();this._dictationUnsubscribes=[],this._dictationSession.stop().catch(()=>{}),this._dictationSession=void 0}let t=e.disableInputDuringDictation??!1;this._dictationBaseText=this._text,this._currentInterimText=``;let n=e.listen();this._dictationSession=n;let r=++this._dictationSessionIdCounter;this._activeDictationSessionId=r,this._dictation={status:n.status,inputDisabled:t},this._notifySubscribers();let i=n.onSpeech(e=>{if(!this._isActiveSession(r,n))return;let t=e.isFinal!==!1,i=this._dictationBaseText&&!this._dictationBaseText.endsWith(` `)&&e.transcript?` `:``;if(t){if(this._dictationBaseText=this._dictationBaseText+i+e.transcript,this._currentInterimText=``,this._text=this._dictationBaseText,this._dictation){let{transcript:e,...t}=this._dictation;this._dictation=t}this._notifySubscribers()}else this._currentInterimText=i+e.transcript,this._text=this._dictationBaseText+this._currentInterimText,this._dictation&&={...this._dictation,transcript:e.transcript},this._notifySubscribers()});this._dictationUnsubscribes.push(i);let a=n.onSpeechStart(()=>{this._isActiveSession(r,n)&&(this._dictation={status:{type:`running`},inputDisabled:t,...this._dictation?.transcript&&{transcript:this._dictation.transcript}},this._notifySubscribers())});this._dictationUnsubscribes.push(a);let o=n.onSpeechEnd(()=>{this._cleanupDictation({sessionId:r})});this._dictationUnsubscribes.push(o);let s=setInterval(()=>{this._isActiveSession(r,n)&&n.status.type===`ended`&&this._cleanupDictation({sessionId:r})},100);this._dictationUnsubscribes.push(()=>clearInterval(s))}stopDictation(){if(!this._dictationSession)return;let e=this._dictationSession,t=this._activeDictationSessionId;e.stop().finally(()=>{this._cleanupDictation({sessionId:t})})}_cleanupDictation(e){if(!(e?.sessionId!==void 0&&e.sessionId!==this._activeDictationSessionId||this._isCleaningDictation)){this._isCleaningDictation=!0;try{for(let e of this._dictationUnsubscribes)e();this._dictationUnsubscribes=[],this._dictationSession=void 0,this._activeDictationSessionId=void 0,this._dictation=void 0,this._dictationBaseText=``,this._currentInterimText=``,this._notifySubscribers()}finally{this._isCleaningDictation=!1}}}_eventSubscribers=new Map;_notifyEventSubscribers(e,t){let n=this._eventSubscribers.get(e);if(n)for(let e of n)e(t)}unstable_on(e,t){let n=t,r=this._eventSubscribers.get(e);return r||(r=new Set,this._eventSubscribers.set(e,r)),r.add(n),()=>{this._eventSubscribers.get(e)?.delete(n)}}},cie=class extends Sv{runtime;_canCancel=!1;get canCancel(){return this._canCancel}get canSend(){return!this.isEmpty&&!this.runtime.isSendDisabled}get queue(){return this.runtime.getQueueItems?.()??yv}steerQueueItem(e){this.runtime.steerQueueItem?.(e)}removeQueueItem(e){this.runtime.removeQueueItem?.(e)}getAttachmentAdapter(){return this.runtime.adapters?.attachments}getDictationAdapter(){return this.runtime.adapters?.dictation}constructor(e){super(),this.runtime=e,this.connect()}connect(){let e=this.runtime.isSendDisabled,t=this.queue;return this.runtime.subscribe(()=>{let n=!1;this.canCancel!==this.runtime.capabilities.cancel&&(this._canCancel=this.runtime.capabilities.cancel,n=!0),e!==this.runtime.isSendDisabled&&(e=this.runtime.isSendDisabled,n=!0),t!==this.queue&&(t=this.queue,n=!0),n&&this._notifySubscribers()})}async handleSend(e,t){this.runtime.append({...e,parentId:this.runtime.messages.at(-1)?.id??null,sourceId:null,startRun:t?.startRun,steer:t?.steer})}async handleCancel(){this.runtime.cancelRun()}},lie=class extends Sv{runtime;endEditCallback;get canCancel(){return!0}get canSend(){return!this.isEmpty}getAttachmentAdapter(){return this.runtime.adapters?.attachments}getDictationAdapter(){return this.runtime.adapters?.dictation}_previousText;_previousAttachments;_nonTextPassthrough;_parentId;_sourceId;constructor(e,t,{parentId:n,message:r}){super(),this.runtime=e,this.endEditCallback=t,this._parentId=n,this._sourceId=r.id,this._previousText=ev(r),this.setText(this._previousText),this.setRole(r.role),r.role===`user`?(this._previousAttachments=[...r.attachments??[],...sie(r.content)],this._nonTextPassthrough=[]):(this._previousAttachments=r.attachments??[],this._nonTextPassthrough=r.content.filter(e=>e.type!==`text`)),this.setAttachments(this._previousAttachments),this.setRunConfig({...e.composer.runConfig})}get parentId(){return this._parentId}get sourceId(){return this._sourceId}async handleSend(e,t){let n=ev(e),r=!aie(e.attachments??[],this._previousAttachments);if(n!==this._previousText||r||t?.startRun){let n=this._nonTextPassthrough.length>0?[...e.content,...this._nonTextPassthrough]:e.content;this.runtime.append({...e,content:n,parentId:this._parentId,sourceId:this._sourceId,startRun:t?.startRun})}this.handleCancel()}handleCancel(){this.endEditCallback(),this._notifySubscribers()}},uie=class{_contextProvider;_subscriptions=new Set;_isInitialized=!1;repository=new vv;_voiceMessages=[];_voiceGeneration=0;_cachedMergedMessages=null;_cachedVoiceGeneration=-1;_cachedMergedBase=null;_markVoiceMessagesDirty(){this._voiceGeneration++,this._cachedMergedMessages=null}_getBaseMessages(){return this.repository.getMessages()}get messages(){if(this._voiceMessages.length===0)return this._getBaseMessages();let e=this._getBaseMessages();return(this._cachedVoiceGeneration!==this._voiceGeneration||this._cachedMergedBase!==e)&&(this._cachedMergedMessages=[...e,...this._voiceMessages],this._cachedVoiceGeneration=this._voiceGeneration,this._cachedMergedBase=e),this._cachedMergedMessages}get state(){let e;for(let t of this.messages)t.role===`assistant`&&(e=t);return e?.metadata.unstable_state??null}composer=new cie(this);constructor(e){this._contextProvider=e}getModelContext(){return this._contextProvider.getModelContext()}_editComposers=new Map;getEditComposer(e){return this._editComposers.get(e)}beginEdit(e){if(this._editComposers.has(e))throw Error(`Edit already in progress`);this._editComposers.set(e,new lie(this,()=>this._editComposers.delete(e),this.repository.getMessage(e))),this._notifySubscribers()}getMessageById(e){try{return this.repository.getMessage(e)}catch{let t=this.repository.getMessages(),n=this._voiceMessages.findIndex(t=>t.id===e);return n===-1?void 0:{parentId:n>0?this._voiceMessages[n-1].id:t.at(-1)?.id??null,message:this._voiceMessages[n],index:t.length+n}}}getBranches(e){return this._voiceMessages.some(t=>t.id===e)?[]:this.repository.getBranches(e)}switchToBranch(e){this.repository.switchToBranch(e),this._notifySubscribers()}_notifySubscribers(){for(let e of this._subscriptions)e()}_notifyEventSubscribers(e,t){let n=this._eventSubscribers.get(e);if(n)for(let e of n)e(t)}subscribe(e){return this._subscriptions.add(e),()=>this._subscriptions.delete(e)}submitFeedback({messageId:e,type:t}){let n=this.adapters?.feedback;if(!n)throw Error(`Feedback adapter not configured`);let{message:r,parentId:i}=this.repository.getMessage(e);if(n.submit({message:r,type:t}),r.role===`assistant`){let e={...r,metadata:{...r.metadata,submittedFeedback:{type:t}}};this.repository.addOrUpdateMessage(i,e)}this._notifySubscribers()}_stopSpeaking;speech;speak(e){let t=this.adapters?.speech;if(!t)throw Error(`Speech adapter not configured`);let{message:n}=this.repository.getMessage(e);this._stopSpeaking?.();let r=t.speak(ev(n)),i=r.subscribe(()=>{r.status.type===`ended`?(this._stopSpeaking=void 0,this.speech=void 0):this.speech={messageId:e,status:r.status},this._notifySubscribers()});this.speech={messageId:e,status:r.status},this._notifySubscribers(),this._stopSpeaking=()=>{r.cancel(),i(),this.speech=void 0,this._stopSpeaking=void 0}}stopSpeaking(){if(!this._stopSpeaking)throw Error(`No message is being spoken`);this._stopSpeaking(),this._notifySubscribers()}_voiceSession;_voiceUnsubs=[];voice;_voiceVolume=0;_voiceVolumeSubscribers=new Set;getVoiceVolume=()=>this._voiceVolume;subscribeVoiceVolume=e=>(this._voiceVolumeSubscribers.add(e),()=>this._voiceVolumeSubscribers.delete(e));connectVoice(){let e=this.adapters?.voice;if(!e)throw Error(`Voice adapter not configured`);this.disconnectVoice();let t=e.connect({});this._voiceSession=t;let n=[],r=`listening`;this.voice={status:t.status,isMuted:t.isMuted,mode:r},this._voiceVolume=0,this._notifySubscribers(),n.push(t.onStatusChange(e=>{e.type===`ended`?(this._finishVoiceAssistantMessage(),this._voiceSession=void 0,this.voice=void 0):this.voice={status:e,isMuted:t.isMuted,mode:r},this._notifySubscribers()})),n.push(t.onModeChange(e=>{r=e,this.voice&&(this.voice={...this.voice,mode:e},this._notifySubscribers())})),n.push(t.onVolumeChange(e=>{this._voiceVolume=e;for(let e of this._voiceVolumeSubscribers)e()})),n.push(t.onTranscript(e=>{this._handleVoiceTranscript(e)})),this._voiceUnsubs=n}_currentAssistantMsg=null;_handleVoiceTranscript(e){if(this.ensureInitialized(),e.role===`user`)this._finishVoiceAssistantMessage(),this._currentAssistantMsg=null,e.isFinal&&(this._voiceMessages.push({id:dv(),role:`user`,content:[{type:`text`,text:e.text}],metadata:{custom:{}},createdAt:new Date,status:{type:`complete`,reason:`unknown`},attachments:[]}),this._markVoiceMessagesDirty(),this._notifySubscribers());else{if(!this._currentAssistantMsg)this._currentAssistantMsg={id:dv(),role:`assistant`,content:[{type:`text`,text:e.text}],metadata:{unstable_state:this.state,unstable_annotations:[],unstable_data:[],steps:[],custom:{}},status:{type:`running`},createdAt:new Date},this._voiceMessages.push(this._currentAssistantMsg);else{let t=this._voiceMessages.indexOf(this._currentAssistantMsg);if(t===-1)return;let n={...this._currentAssistantMsg,content:[{type:`text`,text:e.text}],...e.isFinal?{status:{type:`complete`,reason:`stop`}}:{}};this._voiceMessages[t]=n,this._currentAssistantMsg=n}e.isFinal&&(this._currentAssistantMsg=null),this._markVoiceMessagesDirty(),this._notifySubscribers()}}_finishVoiceAssistantMessage(){let e=this._voiceMessages.at(-1);if(e?.role===`assistant`&&e.status.type===`running`){let t=this._voiceMessages.length-1;this._voiceMessages[t]={...e,status:{type:`complete`,reason:`stop`}},this._markVoiceMessagesDirty(),this._notifySubscribers()}}disconnectVoice(){this._finishVoiceAssistantMessage(),this._currentAssistantMsg=null;for(let e of this._voiceUnsubs)e();this._voiceUnsubs=[],this._voiceSession?.disconnect(),this._voiceSession=void 0,this.voice=void 0,this._voiceVolume=0;for(let e of this._voiceVolumeSubscribers)e();this._voiceMessages=[],this._markVoiceMessagesDirty(),this._notifySubscribers()}muteVoice(){if(!this._voiceSession)throw Error(`No active voice session`);this._voiceSession.mute(),this.voice={...this.voice,isMuted:!0},this._notifySubscribers()}unmuteVoice(){if(!this._voiceSession)throw Error(`No active voice session`);this._voiceSession.unmute(),this.voice={...this.voice,isMuted:!1},this._notifySubscribers()}ensureInitialized(){this._isInitialized||(this._isInitialized=!0,this._notifyEventSubscribers(`initialize`,{}))}export(){return this.repository.export()}import(e){this.ensureInitialized(),this.repository.clear(),this.repository.import(e),this._notifySubscribers()}reset(e){this.import(gv.fromArray(e??[]))}_eventSubscribers=new Map;unstable_on(e,t){let n=t;if(e===`modelContextUpdate`)return this._contextProvider.subscribe?.(()=>n({}))??(()=>{});let r=this._eventSubscribers.get(e);return r||(r=new Set,this._eventSubscribers.set(e,r)),r.add(n),e===`initialize`&&this._isInitialized&&queueMicrotask(()=>{r.has(n)&&n({})}),()=>{this._eventSubscribers.get(e)?.delete(n)}}},Cv=class{cache=new WeakMap;convertMessages(e,t){return e.map((e,n)=>{let r=t(this.cache.get(e),e,n);return this.cache.set(e,r),r})}};function wv(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Tv(e,t=0){return t>100?!1:e===null||typeof e==`string`||typeof e==`boolean`?!0:typeof e==`number`?!Number.isNaN(e)&&Number.isFinite(e):Array.isArray(e)?e.every(e=>Tv(e,t+1)):wv(e)?Object.entries(e).every(([e,n])=>typeof e==`string`&&Tv(n,t+1)):!1}var die=100,Ev=(e,t,n)=>{if(e===t)return!0;if(n>die||e==null||t==null)return!1;if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:e.every((e,r)=>Ev(e,t[r],n+1));if(Array.isArray(t)||!wv(e)||!wv(t))return!1;let r=Object.keys(e),i=Object.keys(t);return r.length===i.length?r.every(r=>Object.hasOwn(t,r)&&Ev(e[r],t[r],n+1)):!1},fie=(e,t)=>!Tv(e)||!Tv(t)?!1:Ev(e,t,0),Dv=e=>{try{return JSON.parse(e),!0}catch{return!1}},Ov=e=>{try{return JSON.parse(e)}catch{return}},kv=(e,t)=>{let n=Ov(e),r=Ov(t);return n===void 0||r===void 0?!1:fie(n,r)},pie=class{_getTools;_callbacks;_entries=new Map;_skipExecuteStreamIds=new Set;_humanInput=new Map;_executing=new Set;_settledResolvers=[];_statuses=new Map;_ac=new AbortController;_pendingRestore=!0;_lastSnapshot=null;_isRunning=!1;_controller;_pipelineDead=!1;_pipelineRestartUsed=!1;constructor(e,t){this._getTools=e,this._callbacks=t,this._initPipeline()}_initPipeline(){let[e,t]=Zne();this._controller=t;let n=pre(()=>this._getWrappedTools(),()=>this._ac.signal,(e,t)=>this._onHumanInput(e,t),{onExecutionStart:e=>this._onExecutionStart(e),onExecutionEnd:e=>this._onExecutionEnd(e)});e.pipeThrough(n).pipeThrough(new w_).pipeTo(new WritableStream({write:e=>{try{if(e.type!==`result`)return;this._handleResultChunk(e)}catch(e){console.error(`[ToolInvocationTracker] result chunk handling failed`,e)}}})).catch(e=>{console.error(`[ToolInvocationTracker] stream pipeline failed; will attempt single restart on next setState`,e),this._pipelineDead=!0})}setState(e){try{if(this._pipelineDead){if(this._pipelineRestartUsed)return;this._pipelineRestartUsed=!0,this._pipelineDead=!1,this._demoteEntriesToRestored(),this._executing.clear(),this._ac=new AbortController,this._initPipeline()}if(this._lastSnapshot&&this._lastSnapshot.messages===e.messages&&this._lastSnapshot.isRunning===e.isRunning&&this._lastSnapshot.isLoading===e.isLoading)return;e.isLoading===!0&&(this._pendingRestore=!0);let t=this._isRunning;this._isRunning=e.isRunning;try{this._processMessages(e.messages)}catch(e){throw this._isRunning=t,e}this._lastSnapshot=e,this._pendingRestore=!1}catch(e){console.error(`[ToolInvocationTracker] setState failed; snapshot dropped`,e)}}reset(){try{this._pendingRestore=!0,this._entries.clear(),this._lastSnapshot=null,this.abort().finally(()=>{this._executing.clear()})}catch(e){console.error(`[ToolInvocationTracker] reset failed`,e)}}abort(){try{return this._humanInput.forEach(({reject:e})=>{try{e(Error(`Tool execution aborted`))}catch{}}),this._humanInput.clear(),this._ac.abort(),this._ac=new AbortController,this._executing.size===0?Promise.resolve():new Promise(e=>{this._settledResolvers.push(e)})}catch(e){return console.error(`[ToolInvocationTracker] abort failed`,e),Promise.resolve()}}resume(e,t){try{let n=this._humanInput.get(e);return n?(this._humanInput.delete(e),this._setStatus(e,{type:`executing`}),n.resolve(t),!0):!1}catch(e){return console.error(`[ToolInvocationTracker] resume failed`,e),!1}}getStatuses(){return this._statuses}_getWrappedTools(){let e=this._getTools();if(e)return Object.fromEntries(Object.entries(e).map(([e,t])=>{let n=t.execute;return n===void 0?[e,t]:[e,{...t,execute:(...[e,t])=>this._skipExecuteStreamIds.has(t.toolCallId)?new Promise(()=>{}):n(e,t)}]}))}_onHumanInput(e,t){return new Promise((n,r)=>{let i=this._humanInput.get(e);if(i)try{i.reject(Error(`Human input request was superseded by a new request`))}catch{}this._humanInput.set(e,{resolve:n,reject:r}),this._setStatus(e,{type:`interrupt`,payload:{type:`human`,payload:t}})})}_onExecutionStart(e){this._skipExecuteStreamIds.has(e)||(this._executing.add(e),this._setStatus(e,{type:`executing`}))}_onExecutionEnd(e){this._executing.delete(e)&&(this._deleteStatus(e),this._executing.size===0&&this._settledResolvers.splice(0).forEach(e=>{try{e()}catch{}}))}_handleResultChunk(e){let t=e.meta.toolCallId,n=this._entries.get(t);!n&&this._skipExecuteStreamIds.has(t)||n?.hasResult||this._invokeOnResult({type:`add-tool-result`,toolCallId:t,toolName:e.meta.toolName,result:e.result,isError:e.isError,...e.artifact!==void 0&&{artifact:e.artifact},...e.modelContent!==void 0&&{modelContent:e.modelContent}})}_invokeOnResult(e){try{this._callbacks.onResult(e)}catch(e){console.error(`[ToolInvocationTracker] onResult callback threw; result dropped`,e)}}_invokeOnStatusesChange(){try{this._callbacks.onStatusesChange(this._statuses)}catch(e){console.error(`[ToolInvocationTracker] onStatusesChange callback threw; status change not propagated`,e)}}_setStatus(e,t){let n=new Map(this._statuses);n.set(e,t),this._statuses=n,this._invokeOnStatusesChange()}_deleteStatus(e){if(!this._statuses.has(e))return;let t=new Map(this._statuses);t.delete(e),this._statuses=t,this._invokeOnStatusesChange()}_hasExecutableTool(e){let t=this._getTools()?.[e];return t?.execute!==void 0||t?.streamCall!==void 0}_shouldCloseArgsStream({toolName:e,argsText:t,hasResult:n}){return n?!0:(this._hasExecutableTool(e)||!this._isRunning)&&Dv(t)}_startActiveEntry(e,t,n){let r=this._controller.addToolCallPart({toolName:t,toolCallId:e});n&&this._skipExecuteStreamIds.add(e);let i={toolName:t,controller:r,argsText:``,hasResult:!1,argsComplete:!1};return this._entries.set(e,i),i}_demoteEntriesToRestored(){for(let[e,t]of this._entries)t.controller&&this._entries.set(e,{toolName:t.toolName,argsText:t.argsText,hasResult:t.hasResult})}_processArgsText(e,t){if(!e.controller)return;let n=t.result!==void 0;if(t.argsText!==e.argsText){let r=!0;if(e.argsComplete)kv(e.argsText,t.argsText)&&(e.argsText=t.argsText),r=!1;else if(!t.argsText.startsWith(e.argsText))if(Dv(e.argsText)&&Dv(t.argsText)&&kv(e.argsText,t.argsText)){let i=this._shouldCloseArgsStream({toolName:t.toolName,argsText:t.argsText,hasResult:n});i&&e.controller.argsText.close(),e.argsText=t.argsText,e.argsComplete=i,r=!1}else r=!1;if(r&&e.controller){let r=t.argsText.slice(e.argsText.length);e.controller.argsText.append(r);let i=this._shouldCloseArgsStream({toolName:t.toolName,argsText:t.argsText,hasResult:n});i&&e.controller.argsText.close(),e.argsText=t.argsText,e.argsComplete=i}}!e.argsComplete&&e.controller&&this._shouldCloseArgsStream({toolName:t.toolName,argsText:t.argsText,hasResult:n})&&(e.controller.argsText.close(),e.argsText=t.argsText,e.argsComplete=!0)}_processMessages(e){let t=this._pendingRestore;for(let n of e)if(!(!n||!Array.isArray(n.content)))for(let e of n.content){if(!e||e.type!==`tool-call`)continue;let n=this._entries.get(e.toolCallId);if(t){n?.controller||this._entries.set(e.toolCallId,{toolName:e.toolName,argsText:e.argsText,hasResult:e.result!==void 0}),e.messages&&this._processMessages(e.messages);continue}let r=n;if(r&&!r.controller){if(!(e.argsText!==r.argsText||e.result!==void 0!==r.hasResult)){e.messages&&this._processMessages(e.messages);continue}this._entries.delete(e.toolCallId),r=void 0}if(r||=this._startActiveEntry(e.toolCallId,e.toolName,e.result!==void 0),this._processArgsText(r,e),e.result!==void 0&&!r.hasResult){let{controller:t}=r;if(!t)continue;r.hasResult=!0,r.argsComplete=!0,t.setResponse(new N_({result:e.result,artifact:e.artifact,isError:e.isError,...e.modelContent===void 0?{}:{modelContent:e.modelContent}})),t.close()}e.messages&&this._processMessages(e.messages)}}},mie=Object.freeze([]),Av=(e,t)=>{let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r of n)if(e[r]!==t[r])return!1;return!0},hie=(e,t)=>e&&t[t.length-1]?.role!==`assistant`,gie=class extends uie{_capabilities={switchToBranch:!1,switchBranchDuringRun:!1,edit:!1,delete:!1,reload:!1,cancel:!1,unstable_copy:!1,speech:!1,dictation:!1,voice:!1,attachments:!1,feedback:!1,queue:!1};get capabilities(){return this._capabilities}_messages;isDisabled;isSendDisabled;get isLoading(){return this._store.isLoading??!1}get isRunning(){return this._store.isRunning}_getBaseMessages(){return this._messages}get state(){return this._store.state??super.state}get adapters(){return this._store.adapters}suggestions=[];extras=void 0;_converter=new Cv;_store;_toolInvocations=null;beginEdit(e){if(!this._store.onEdit)throw Error(`Runtime does not support editing.`);super.beginEdit(e)}constructor(e,t){super(e),this.__internal_setAdapter(t)}__internal_setAdapter(e){if(this._store===e)return;let t=e.isRunning??!1;this.isDisabled=e.isDisabled??!1,this.isSendDisabled=e.isSendDisabled??!1;let n=this._store;this._store=e,this.extras!==e.extras&&(this.extras=e.extras);let r=e.suggestions??mie;Av(this.suggestions,r)||(this.suggestions=r);let i={switchToBranch:this._store.setMessages!==void 0,switchBranchDuringRun:!1,edit:this._store.onEdit!==void 0,delete:this._store.onDelete!==void 0||this._store.setMessages!==void 0,reload:this._store.onReload!==void 0,cancel:this._store.onCancel!==void 0,speech:this._store.adapters?.speech!==void 0,dictation:this._store.adapters?.dictation!==void 0,voice:this._store.adapters?.voice!==void 0,unstable_copy:this._store.unstable_capabilities?.copy!==!1,attachments:!!this._store.adapters?.attachments,feedback:!!this._store.adapters?.feedback,queue:this._store.queue!==void 0};Av(this._capabilities,i)||(this._capabilities=i);let a;if(e.messageRepository){if(n&&n.isRunning===e.isRunning&&n.messageRepository===e.messageRepository){this._notifySubscribers();return}let t=e.messageRepository.messages,r=e.messageRepository.headId??t.at(-1)?.message.id??null;if(n&&n.messageRepository===e.messageRepository)this.repository.resetHead(r),a=this.repository.getMessages();else{let e=new Set(t.map(({message:e})=>e.id));for(let{message:e,parentId:n}of t)this.repository.addOrUpdateMessage(n,e);for(let{message:t}of this.repository.export().messages)e.has(t.id)||this.repository.deleteMessage(t.id);this.repository.resetHead(r),a=this.repository.getMessages()}}else if(e.messages){if(n){if(n.convertMessage!==e.convertMessage)this._converter=new Cv;else if(n.isRunning===e.isRunning&&n.messages===e.messages){this._notifySubscribers();return}}a=e.convertMessage?this._converter.convertMessages(e.messages,(n,r,i)=>{if(!e.convertMessage)return r;let a=hv(i===(e.messages?.length??0)-1,t,!1,!1,void 0);if(n&&(n.role!==`assistant`||!rie(n.status)||n.status===a))return n;let o=pv(e.convertMessage(r,i),i.toString(),a);return wre(o,r),o}):e.messages;for(let e=0;e<a.length;e++){let t=a[e],n=a[e-1];this.repository.addOrUpdateMessage(n?.id??null,t)}}else throw Error(`ExternalStoreAdapter must provide either 'messages' or 'messageRepository'`);a.length>0&&this.ensureInitialized(),(n?.isRunning??!1)!==(e.isRunning??!1)&&(e.isRunning?this._notifyEventSubscribers(`runStart`,{}):this._notifyEventSubscribers(`runEnd`,{}));let o=null;hie(t,a)&&(o=dv(),this.repository.addOrUpdateMessage(a.at(-1)?.id??null,pv({role:`assistant`,content:[],metadata:{isOptimistic:!0}},o,{type:`running`}))),this.repository.resetHead(o??a.at(-1)?.id??null),this._messages=this.repository.getMessages(),this._driveToolInvocations(),this._notifySubscribers()}_driveToolInvocations(){if(!this._store.unstable_enableToolInvocations){this._toolInvocations&&(this._toolInvocations.reset(),this._toolInvocations=null,this._store.setToolStatuses?.({}));return}this._toolInvocations||=new pie(()=>this.getModelContext().tools,{onResult:e=>{try{let t=this._findMessageIdForToolCall(e.toolCallId);if(t===void 0)return;this._store.onAddToolResult?.({messageId:t,toolCallId:e.toolCallId,toolName:e.toolName,result:e.result,isError:e.isError,...e.artifact!==void 0&&{artifact:e.artifact},...e.modelContent!==void 0&&{modelContent:e.modelContent}})}catch(e){console.error(`[ExternalStoreThreadRuntimeCore] onAddToolResult dispatch failed`,e)}},onStatusesChange:e=>{this._store.setToolStatuses?.(Object.fromEntries(e))}}),this._toolInvocations.setState({messages:this._messages,isRunning:this._store.isRunning??!1,...this._store.isLoading!==void 0&&{isLoading:this._store.isLoading}})}_toolCallToMessageId=new Map;_messagesForToolCallIndex=null;_findMessageIdForToolCall(e){if(this._messagesForToolCallIndex!==this._messages){this._toolCallToMessageId.clear();let e=t=>{for(let n of t)if(Array.isArray(n.content))for(let t of n.content)!t||t.type!==`tool-call`||(this._toolCallToMessageId.set(t.toolCallId,n.id),t.messages&&e(t.messages))};e(this._messages),this._messagesForToolCallIndex=this._messages}return this._toolCallToMessageId.get(e)}switchToBranch(e){if(!this._store.setMessages)throw Error(`Runtime does not support switching branches.`);this._store.isRunning||(this.repository.switchToBranch(e),this.updateMessages(this.repository.getMessages()))}async append(e){let t=e.parentId!==(this.messages.at(-1)?.id??null);if(!t&&this._store.queue){this._store.queue.enqueue(e,{steer:e.steer??!1});return}if((e.startRun??e.role===`user`)&&await this._toolInvocations?.abort(),t){if(!this._store.onEdit)throw Error(`Runtime does not support editing messages.`);this._store.queue?.clear(`edit`),await this._store.onEdit(e)}else await this._store.onNew(e)}async deleteMessage(e){if(this._store.onDelete){await this._store.onDelete(e);return}if(!this._store.setMessages)throw Error(`Runtime does not support deleting messages.`);this._store.isRunning&&await this._toolInvocations?.abort();let t=this.repository.getMessages();if(t.findIndex(t=>t.id===e)===-1)throw Error(`Message not found.`);this.updateMessages(t.filter(t=>t.id!==e))}getQueueItems(){return this._store?.queue?.items??yv}steerQueueItem(e){this._store?.queue?.steer(e)}removeQueueItem(e){this._store?.queue?.remove(e)}async startRun(e){if(!this._store.onReload)throw Error(`Runtime does not support reloading messages.`);this._store.queue?.clear(`reload`),await this._toolInvocations?.abort(),await this._store.onReload(e.parentId,e)}async resumeRun(e){if(!this._store.onResume)throw Error(`Runtime does not support resuming runs.`);await this._store.onResume(e)}exportExternalState(){if(!this._store.onExportExternalState)throw Error(`Runtime does not support exporting external states.`);return this._store.onExportExternalState()}importExternalState(e){if(!this._store.onLoadExternalState)throw Error(`Runtime does not support importing external states.`);this._toolInvocations&&(this._toolInvocations.reset(),this._store.setToolStatuses?.({})),this._store.onLoadExternalState(e)}cancelRun(){if(!this._store.onCancel)throw Error(`Runtime does not support cancelling runs.`);this._store.queue?.clear(`cancel-run`),this._toolInvocations?.abort(),this._store.onCancel();let e=this.repository.getMessages().at(-1);e&&e.metadata.isOptimistic&&e.content.length===0&&this.repository.deleteMessage(e.id);let t=this.repository.getMessages(),n=t[t.length-1];n?.role===`user`&&n.id===t.at(-1)?.id?(this.repository.deleteMessage(n.id),this.composer.text.trim()||this.composer.setText(ev(n)),t=this.repository.getMessages()):this._notifySubscribers(),setTimeout(()=>{this.updateMessages(t)},0)}addToolResult(e){if(!this._store.onAddToolResult)throw Error(`Runtime does not support tool results.`);this._store.onAddToolResult?.(e)}resumeToolCall(e){if(!(this._toolInvocations?.resume(e.toolCallId,e.payload)??!1)){if(this._store.onResumeToolCall){this._store.onResumeToolCall(e);return}throw Error(`Tool call ${e.toolCallId} is not waiting for resume.`)}}respondToToolApproval(e){if(!this._store.onRespondToToolApproval)throw Error(`Runtime does not support tool approvals.`);this._store.onRespondToToolApproval(e)}reset(e){let t=new vv;t.import(gv.fromArray(e??[])),this.updateMessages(t.getMessages())}import(e){super.import(e),this._store.onImport&&this._store.onImport(this.repository.getMessages())}updateMessages=e=>{this._store.convertMessage===void 0?this._store.setMessages?.(e):this._store.setMessages?.(e.flatMap(Tre))}},jv=e=>e.adapters?.threadList??{},_ie=class extends Jre{threads;constructor(e){super(),this.threads=new Qre(jv(e),()=>new gie(this._contextProvider,e))}setAdapter(e){this.threads.__internal_setAdapter(jv(e)),this.threads.getMainThreadRuntimeCore().__internal_setAdapter(e)}},vie=e=>{let t=R(11),n;t[0]===e?n=t[1]:(n=()=>new _ie(e),t[0]=e,t[1]=n);let[r]=zh(n),i;t[2]!==r||t[3]!==e?(i=()=>{r.setAdapter(e)},t[2]=r,t[3]=e,t[4]=i):i=t[4],Wh(i);let{modelContext:a}=Wre()??{},o,s;t[5]!==a||t[6]!==r?(o=()=>{if(a)return r.registerModelContextProvider(a)},s=[a,r],t[5]=a,t[6]=r,t[7]=o,t[8]=s):(o=t[7],s=t[8]),Wh(o,s);let c;return t[9]===r?c=t[10]:(c=new qre(r),t[9]=r,t[10]=c),c},Mv=(e,t)=>e.Message===t.Message&&e.EditComposer===t.EditComposer&&e.UserEditComposer===t.UserEditComposer&&e.AssistantEditComposer===t.AssistantEditComposer&&e.SystemEditComposer===t.SystemEditComposer&&e.UserMessage===t.UserMessage&&e.AssistantMessage===t.AssistantMessage&&e.SystemMessage===t.SystemMessage,yie=()=>null,bie=(e,t,n)=>{switch(t){case`user`:return n?e.UserEditComposer??e.EditComposer??e.UserMessage??e.Message:e.UserMessage??e.Message;case`assistant`:return n?e.AssistantEditComposer??e.EditComposer??e.AssistantMessage??e.Message:e.AssistantMessage??e.Message;case`system`:return n?e.SystemEditComposer??e.EditComposer??e.SystemMessage??e.Message:e.SystemMessage??e.Message??yie;default:throw Error(`Unknown message role: ${t}`)}},Nv=e=>{let t=R(6),{components:n}=e,r=z(Sie),i=z(Cie),a;t[0]!==n||t[1]!==i||t[2]!==r?(a=bie(n,r,i),t[0]=n,t[1]=i,t[2]=r,t[3]=a):a=t[3];let o=a,s;return t[4]===o?s=t[5]:(s=(0,F.jsx)(o,{}),t[4]=o,t[5]=s),s},Pv=(0,Ih.memo)(e=>{let t=R(5),{index:n,components:r}=e,i;t[0]===r?i=t[1]:(i=(0,F.jsx)(Nv,{components:r}),t[0]=r,t[1]=i);let a;return t[2]!==n||t[3]!==i?(a=(0,F.jsx)(L_,{index:n,children:i}),t[2]=n,t[3]=i,t[4]=a):a=t[4],a},(e,t)=>e.index===t.index&&Mv(e.components,t.components));Pv.displayName=`ThreadPrimitive.MessageByIndex`;var Fv=({children:e})=>{let t=z(e=>e.thread.messages.length);return Hh(()=>t===0?null:Array.from({length:t},(t,n)=>(0,F.jsx)(L_,{index:n,children:(0,F.jsx)(t_,{getItemState:e=>e.thread().message({index:n}).getState(),children:t=>e({get message(){return t()}})})},n)),[t,e])},Iv=e=>{let t=R(4),{components:n,children:r}=e;if(n){let e;return t[0]===n?e=t[1]:(e=(0,F.jsx)(Fv,{children:()=>(0,F.jsx)(Nv,{components:n})}),t[0]=n,t[1]=e),e}let i;return t[2]===r?i=t[3]:(i=(0,F.jsx)(Fv,{children:r}),t[2]=r,t[3]=i),i};Iv.displayName=`ThreadPrimitive.Messages`;var xie=(0,Ih.memo)(Iv,(e,t)=>e.children||t.children?e.children===t.children:Mv(e.components,t.components));function Sie(e){return e.message.role}function Cie(e){return e.message.composer.isEditing}var Lv=e=>{let t=e.message.metadata;if(!(!t||typeof t!=`object`))return t.custom?.quote},wie=class extends Error{componentName;constructor(e,t=`Component "${e}" is not in the generative-ui allowlist.`){super(t),this.name=`GenerativeUIRenderError`,this.componentName=e}},Tie=e=>typeof e==`object`&&!!e,Rv=(e,t,n,r)=>{if(e==null)return null;if(typeof e==`string`)return e;if(!Tie(e)||!(`component`in e))return null;let{component:i,props:a,children:o,key:s}=e,c=t[i];if(!c){if(n)return(0,F.jsx)(n,{component:i,props:a},s??r);throw new wie(i)}let l=o?.length?o.map((e,i)=>Rv(e,t,n,`${r}/${i}`)):void 0;return(0,Ih.createElement)(c,{...a??{},key:s??r},...l??[])},Eie=e=>{if(!e||e.root===void 0||e.root===null)return[];let t=e.root;return Array.isArray(t)?t:[t]},zv=e=>{let t=R(11),{spec:n,components:r,Fallback:i}=e,a;t[0]===n?a=t[1]:(a=Eie(n),t[0]=n,t[1]=a);let o=a,s;if(t[2]!==i||t[3]!==r||t[4]!==o){let e;t[6]!==i||t[7]!==r?(e=(e,t)=>Rv(e,r,i,`${t}`),t[6]=i,t[7]=r,t[8]=e):e=t[8],s=o.map(e),t[2]=i,t[3]=r,t[4]=o,t[5]=s}else s=t[5];let c;return t[9]===s?c=t[10]:(c=(0,F.jsx)(F.Fragment,{children:s}),t[9]=s,t[10]=c),c};zv.displayName=`GenerativeUIRender`;var Bv=e=>{let t=R(4),{components:n,spec:r,Fallback:i}=e,a=z(Die),o=r??a;if(!o)return null;let s;return t[0]!==i||t[1]!==n||t[2]!==o?(s=(0,F.jsx)(zv,{spec:o,components:n,Fallback:i}),t[0]=i,t[1]=n,t[2]=o,t[3]=s):s=t[3],s};Bv.displayName=`MessagePrimitive.GenerativeUI`;function Die(e){let t=e.part;return t?.type===`generative-ui`?t.spec:void 0}var Oie=`ui://`,kie=e=>!!e?.startsWith(Oie),Vv=e=>Symbol.iterator in e,Hv=e=>`entries`in e,Uv=(e,t)=>{let n=e instanceof Map?e:new Map(e.entries()),r=t instanceof Map?t:new Map(t.entries());if(n.size!==r.size)return!1;for(let[e,t]of n)if(!r.has(e)||!Object.is(t,r.get(e)))return!1;return!0},Aie=(e,t)=>{let n=e[Symbol.iterator](),r=t[Symbol.iterator](),i=n.next(),a=r.next();for(;!i.done&&!a.done;){if(!Object.is(i.value,a.value))return!1;i=n.next(),a=r.next()}return!!i.done&&!!a.done};function jie(e,t){return Object.is(e,t)?!0:typeof e!=`object`||!e||typeof t!=`object`||!t||Object.getPrototypeOf(e)!==Object.getPrototypeOf(t)?!1:Vv(e)&&Vv(t)?Hv(e)&&Hv(t)?Uv(e,t):Aie(e,t):Uv({entries:()=>Object.entries(e)},{entries:()=>Object.entries(t)})}function Wv(e){let t=M.useRef(void 0);return n=>{let r=e(n);return jie(t.current,r)?t.current:t.current=r}}var Gv=e=>{let t=-1;return{startGroup:e=>{t===-1&&(t=e)},endGroup:(n,r)=>{t!==-1&&(r.push({type:e,startIndex:t,endIndex:n}),t=-1)},finalize:(n,r)=>{t!==-1&&r.push({type:e,startIndex:t,endIndex:n})}}},Mie=(e,t,n)=>{let r=[];if(t){let t=Gv(`chainOfThoughtGroup`);for(let n=0;n<e.length;n++){let i=e[n];i===`tool-call`||i===`reasoning`?t.startGroup(n):(t.endGroup(n-1,r),r.push({type:`single`,index:n}))}t.finalize(e.length-1,r)}else{let t=Gv(`toolGroup`),n=Gv(`reasoningGroup`);for(let i=0;i<e.length;i++){let a=e[i];a===`tool-call`?(n.endGroup(i-1,r),t.startGroup(i)):a===`reasoning`?(t.endGroup(i-1,r),n.startGroup(i)):(t.endGroup(i-1,r),n.endGroup(i-1,r),r.push({type:`single`,index:i}))}t.finalize(e.length-1,r),n.finalize(e.length-1,r)}if(n){let e=new Set;for(let t of r){if(t.type===`single`)continue;let r=n[t.startIndex];r!==void 0&&!e.has(r)&&(e.add(r),t.idKey=`id:${r}`)}}return r},Nie=e=>{let t=R(10),n=z(Wv(qie)),r=z(Wv(Yie)),i;bb0:{if(n.length===0){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=[],t[0]=e):e=t[0];let n;t[1]===r?n=t[2]:(n={ranges:e,partIds:r},t[1]=r,t[2]=n),i=n;break bb0}let a;t[3]!==n||t[4]!==r||t[5]!==e?(a=Mie(n,e,r),t[3]=n,t[4]=r,t[5]=e,t[6]=a):a=t[6];let o;t[7]!==r||t[8]!==a?(o={ranges:a,partIds:r},t[7]=r,t[8]=a,t[9]=o):o=t[9],i=o}return i},Pie=e=>{let t=R(9),n,r;t[0]===e?(n=t[1],r=t[2]):({Fallback:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]!==n||t[4]!==r.toolName?(i=e=>e.tools.toolUIs[r.toolName]?.[0]?.render??n,t[3]=n,t[4]=r.toolName,t[5]=i):i=t[5];let a=z(i);if(!a)return null;let o;return t[6]!==a||t[7]!==r?(o=(0,F.jsx)(a,{...r}),t[6]=a,t[7]=r,t[8]=o):o=t[8],o},Kv=(e,t,n)=>e.renderers[t]?.[0]||(e.fallbacks[0]??n),Fie=e=>{let t=R(9),n,r;t[0]===e?(n=t[1],r=t[2]):({Fallback:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]!==n||t[4]!==r.name?(i=e=>Kv(e.dataRenderers,r.name,n),t[3]=n,t[4]=r.name,t[5]=i):i=t[5];let a=z(i);if(!a)return null;let o;return t[6]!==a||t[7]!==r?(o=(0,F.jsx)(a,{...r}),t[6]=a,t[7]=r,t[8]=o):o=t[8],o},qv={Text:()=>null,Reasoning:()=>null,Source:()=>null,Image:()=>null,File:()=>null,Unstable_Audio:()=>null,ToolGroup:({children:e})=>e,ReasoningGroup:({children:e})=>e},Iie=e=>{let t=R(47),{components:n}=e,r;t[0]===n?r=t[1]:(r=n===void 0?{}:n,t[0]=n,t[1]=r);let{Text:i,Reasoning:a,Image:o,Source:s,File:c,Unstable_Audio:l,tools:u,data:d,generativeUI:f}=r,p=i===void 0?qv.Text:i,m=a===void 0?qv.Reasoning:a,h=o===void 0?qv.Image:o,g=s===void 0?qv.Source:s,_=c===void 0?qv.File:c,v=l===void 0?qv.Unstable_Audio:l,y;t[2]===u?y=t[3]:(y=u===void 0?{}:u,t[2]=u,t[3]=y);let b=y,x=e_(),S=z(Xie),C=S.type;if(C===`tool-call`){let e;t[4]===x?e=t[5]:(e=x.part(),t[4]=x,t[5]=e);let n=e.addToolResult,r;t[6]===x?r=t[7]:(r=x.part(),t[6]=x,t[7]=r);let i=r.resumeToolCall,a;t[8]===x?a=t[9]:(a=x.part(),t[8]=x,t[9]=a);let o=a.respondToToolApproval;if(`Override`in b){let e;return t[10]!==n||t[11]!==S||t[12]!==o||t[13]!==i||t[14]!==b.Override?(e=(0,F.jsx)(b.Override,{...S,addResult:n,resume:i,respondToApproval:o}),t[10]=n,t[11]=S,t[12]=o,t[13]=i,t[14]=b.Override,t[15]=e):e=t[15],e}let s=b.by_name?.[S.toolName]??b.Fallback,c;return t[16]!==s||t[17]!==n||t[18]!==S||t[19]!==o||t[20]!==i?(c=(0,F.jsx)(Pie,{...S,Fallback:s,addResult:n,resume:i,respondToApproval:o}),t[16]=s,t[17]=n,t[18]=S,t[19]=o,t[20]=i,t[21]=c):c=t[21],c}if(S.status?.type===`requires-action`)throw Error(`Encountered unexpected requires-action status`);switch(C){case`text`:{let e;return t[22]!==p||t[23]!==S?(e=(0,F.jsx)(p,{...S}),t[22]=p,t[23]=S,t[24]=e):e=t[24],e}case`reasoning`:{let e;return t[25]!==m||t[26]!==S?(e=(0,F.jsx)(m,{...S}),t[25]=m,t[26]=S,t[27]=e):e=t[27],e}case`source`:{let e;return t[28]!==g||t[29]!==S?(e=(0,F.jsx)(g,{...S}),t[28]=g,t[29]=S,t[30]=e):e=t[30],e}case`image`:{let e;return t[31]!==h||t[32]!==S?(e=(0,F.jsx)(h,{...S}),t[31]=h,t[32]=S,t[33]=e):e=t[33],e}case`file`:{let e;return t[34]!==_||t[35]!==S?(e=(0,F.jsx)(_,{...S}),t[34]=_,t[35]=S,t[36]=e):e=t[36],e}case`audio`:{let e;return t[37]!==v||t[38]!==S?(e=(0,F.jsx)(v,{...S}),t[37]=v,t[38]=S,t[39]=e):e=t[39],e}case`data`:{let e=d?.by_name?.[S.name]??d?.Fallback,n;return t[40]!==e||t[41]!==S?(n=(0,F.jsx)(Fie,{...S,Fallback:e}),t[40]=e,t[41]=S,t[42]=n):n=t[42],n}case`generative-ui`:{if(!f?.components)return null;let e=S,n;return t[43]!==f.Fallback||t[44]!==f.components||t[45]!==e.spec?(n=(0,F.jsx)(zv,{spec:e.spec,components:f.components,Fallback:f.Fallback}),t[43]=f.Fallback,t[44]=f.components,t[45]=e.spec,t[46]=n):n=t[46],n}default:return console.warn(`Unknown message part type: ${C}`),null}},Jv=(0,Ih.memo)(e=>{let t=R(5),{index:n,components:r}=e,i;t[0]===r?i=t[1]:(i=(0,F.jsx)(Iie,{components:r}),t[0]=r,t[1]=i);let a;return t[2]!==n||t[3]!==i?(a=(0,F.jsx)(R_,{index:n,children:i}),t[2]=n,t[3]=i,t[4]=a):a=t[4],a},(e,t)=>e.index===t.index&&e.components?.Text===t.components?.Text&&e.components?.Reasoning===t.components?.Reasoning&&e.components?.Source===t.components?.Source&&e.components?.Image===t.components?.Image&&e.components?.File===t.components?.File&&e.components?.Unstable_Audio===t.components?.Unstable_Audio&&e.components?.tools===t.components?.tools&&e.components?.data===t.components?.data&&e.components?.generativeUI===t.components?.generativeUI&&e.components?.ToolGroup===t.components?.ToolGroup&&e.components?.ReasoningGroup===t.components?.ReasoningGroup);Jv.displayName=`MessagePrimitive.PartByIndex`;var Lie=e=>{let t=R(6),{status:n,component:r}=e,i=n.type===`running`,a;t[0]!==r||t[1]!==n?(a=(0,F.jsx)(r,{type:`text`,text:``,status:n}),t[0]=r,t[1]=n,t[2]=a):a=t[2];let o;return t[3]!==i||t[4]!==a?(o=(0,F.jsx)(z_,{text:``,isRunning:i,children:a}),t[3]=i,t[4]=a,t[5]=o):o=t[5],o},Rie=Object.freeze({type:`complete`}),zie=Object.freeze({type:`running`}),Yv=(0,Ih.memo)(e=>{let t=R(6),{components:n}=e,r=z(Zie);if(n?.Empty){let e;return t[0]!==n.Empty||t[1]!==r?(e=(0,F.jsx)(n.Empty,{status:r}),t[0]=n.Empty,t[1]=r,t[2]=e):e=t[2],e}if(r.type!==`running`)return null;let i=n?.Text??qv.Text,a;return t[3]!==r||t[4]!==i?(a=(0,F.jsx)(Lie,{status:r,component:i}),t[3]=r,t[4]=i,t[5]=a):a=t[5],a},(e,t)=>e.components?.Empty===t.components?.Empty&&e.components?.Text===t.components?.Text),Bie=(0,Ih.memo)(e=>{let t=R(4),{components:n,enabled:r}=e,i;if(t[0]===r?i=t[1]:(i=e=>{if(!r||e.message.parts.length===0)return!1;let t=e.message.parts[e.message.parts.length-1];return t?.type!==`text`&&t?.type!==`reasoning`},t[0]=r,t[1]=i),!z(i))return null;let a;return t[2]===n?a=t[3]:(a=(0,F.jsx)(Yv,{components:n}),t[2]=n,t[3]=a),a},(e,t)=>e.enabled===t.enabled&&e.components?.Empty===t.components?.Empty&&e.components?.Text===t.components?.Text),Vie=(0,Ih.memo)(e=>{let t=R(4),{Quote:n}=e,r=z(Lv);if(!r)return null;let i;return t[0]!==n||t[1]!==r.messageId||t[2]!==r.text?(i=(0,F.jsx)(n,{text:r.text,messageId:r.messageId}),t[0]=n,t[1]=r.messageId,t[2]=r.text,t[3]=i):i=t[3],i});function Xv(e,t){return(e.toolUIs[t.toolName]?.[0]?.render??null)||(kie(t.mcp?.app?.resourceUri)&&e.mcpApp?e.mcpApp.render:null)}var Zv=()=>{let e=R(12),t=e_(),n=z(Qie),r=z($ie);if(!r||n.type!==`tool-call`)return null;let i;e[0]===t?i=e[1]:(i=t.part(),e[0]=t,e[1]=i);let a=i.addToolResult,o;e[2]===t?o=e[3]:(o=t.part(),e[2]=t,e[3]=o);let s=o.resumeToolCall,c;e[4]===t?c=e[5]:(c=t.part(),e[4]=t,e[5]=c);let l;return e[6]!==r||e[7]!==n||e[8]!==i.addToolResult||e[9]!==o.resumeToolCall||e[10]!==c.respondToToolApproval?(l=(0,F.jsx)(r,{...n,addResult:a,resume:s,respondToApproval:c.respondToToolApproval}),e[6]=r,e[7]=n,e[8]=i.addToolResult,e[9]=o.resumeToolCall,e[10]=c.respondToToolApproval,e[11]=l):l=e[11],l},Qv=()=>{let e=R(3),t=z(eae),n=z(tae);if(!n||t.type!==`data`)return null;let r=t,i;return e[0]!==n||e[1]!==r?(i=(0,F.jsx)(n,{...r}),e[0]=n,e[1]=r,e[2]=i):i=e[2],i},Hie=()=>{let e=R(2),t=z(nae);if(t===`tool-call`){let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,F.jsx)(Zv,{}),e[0]=t):t=e[0],t}if(t===`data`){let t;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,F.jsx)(Qv,{}),e[1]=t):t=e[1],t}return null},Uie=Object.freeze({type:`text`,text:``,status:zie}),$v=({index:e,children:t})=>{let n=e_(),r=z(e=>e.dataRenderers);return(0,F.jsx)(R_,{index:e,children:(0,F.jsx)(t_,{getItemState:t=>t.message().part({index:e}).getState(),children:i=>t({get part(){let t=i();if(t.type===`tool-call`){let r=Xv(n.tools().getState(),t)!==null,i=n.message().part({index:e});return{...t,toolUI:r?(0,F.jsx)(Zv,{}):null,addResult:i.addToolResult,resume:i.resumeToolCall,respondToApproval:i.respondToToolApproval}}if(t.type===`data`){let e=Kv(r,t.name,void 0)!==void 0;return{...t,dataRendererUI:e?(0,F.jsx)(Qv,{}):null}}return t}})})})},Wie=e=>{let t=R(9),{children:n}=e,r=z(rae),i=z(iae),a=r===0&&i;if(r===0){if(!a)return null;let e;t[0]===n?e=t[1]:(e=n({part:Uie}),t[0]=n,t[1]=e);let r;return t[2]===e?r=t[3]:(r=(0,F.jsx)(z_,{text:``,isRunning:!0,children:e}),t[2]=e,t[3]=r),r}let o;if(t[4]!==n||t[5]!==r){let e;t[7]===n?e=t[8]:(e=(e,t)=>(0,F.jsx)($v,{index:t,children:e=>n(e)??(0,F.jsx)(Hie,{})},t),t[7]=n,t[8]=e),o=(0,F.jsx)(F.Fragment,{children:Array.from({length:r},e)}),t[4]=n,t[5]=r,t[6]=o}else o=t[6];return o},ey=e=>{let t=R(5),{components:n,unstable_showEmptyOnNonTextEnd:r,children:i}=e,a=r===void 0?!0:r;if(i){let e;return t[0]===i?e=t[1]:(e=(0,F.jsx)(Wie,{children:i}),t[0]=i,t[1]=e),e}let o;return t[2]!==n||t[3]!==a?(o=(0,F.jsx)(Gie,{components:n,unstable_showEmptyOnNonTextEnd:a}),t[2]=n,t[3]=a,t[4]=o):o=t[4],o};ey.displayName=`MessagePrimitive.Parts`;var Gie=e=>{let t=R(15),{components:n,unstable_showEmptyOnNonTextEnd:r}=e,i=z(aae),{ranges:a,partIds:o}=Nie(!!n?.ChainOfThought),s;bb0:{if(i===0){let e;t[0]===n?e=t[1]:(e=(0,F.jsx)(Yv,{components:n}),t[0]=n,t[1]=e),s=e;break bb0}let e;if(t[2]!==n||t[3]!==a||t[4]!==o){let r=new Set,i=e=>{let t=o[e];return t!==void 0&&!r.has(t)?(r.add(t),`part-id:${t}`):`part-${e}`};e=a.map(e=>{if(e.type===`single`)return(0,F.jsx)(Jv,{index:e.index,components:n},e.index);if(e.type===`chainOfThoughtGroup`){let t=n?.ChainOfThought;return t?(0,F.jsx)(bre,{startIndex:e.startIndex,endIndex:e.endIndex,children:(0,F.jsx)(t,{})},`chainOfThought-${e.idKey??e.startIndex}`):null}else if(e.type===`toolGroup`)return(0,F.jsx)(n?.ToolGroup??qv.ToolGroup,{startIndex:e.startIndex,endIndex:e.endIndex,children:Array.from({length:e.endIndex-e.startIndex+1},(t,r)=>{let a=e.startIndex+r;return(0,F.jsx)(Jv,{index:a,components:n},i(a))})},`tool-${e.idKey??e.startIndex}`);else return(0,F.jsx)(n?.ReasoningGroup??qv.ReasoningGroup,{startIndex:e.startIndex,endIndex:e.endIndex,children:Array.from({length:e.endIndex-e.startIndex+1},(t,r)=>{let i=e.startIndex+r;return(0,F.jsx)(Jv,{index:i,components:n},`part-${i}`)})},`reasoning-${e.startIndex}`)}),t[2]=n,t[3]=a,t[4]=o,t[5]=e}else e=t[5];s=e}let c=s,l;t[6]===n?l=t[7]:(l=n?.Quote&&(0,F.jsx)(Vie,{Quote:n.Quote}),t[6]=n,t[7]=l);let u;t[8]!==n||t[9]!==r?(u=(0,F.jsx)(Bie,{components:n,enabled:r}),t[8]=n,t[9]=r,t[10]=u):u=t[10];let d;return t[11]!==c||t[12]!==l||t[13]!==u?(d=(0,F.jsxs)(F.Fragment,{children:[l,c,u]}),t[11]=c,t[12]=l,t[13]=u,t[14]=d):d=t[14],d};function Kie(e){return e.type}function qie(e){return e.message.parts.map(Kie)}function Jie(e){return e.type===`tool-call`?e.toolCallId:void 0}function Yie(e){return e.message.parts.map(Jie)}function Xie(e){return e.part}function Zie(e){return e.message.status??Rie}function Qie(e){return e.part}function $ie(e){return e.part.type===`tool-call`?Xv(e.tools,e.part):null}function eae(e){return e.part}function tae(e){return e.part.type===`data`?Kv(e.dataRenderers,e.part.name,void 0)??null:null}function nae(e){return e.part.type}function rae(e){return e.message.parts.length}function iae(e){return(e.message.status?.type??`complete`)===`running`}function aae(e){return e.message.parts.length}var oae=Symbol.for(`@assistant-ui/groupBy.memoKey`),ty=e=>{let t=e.nextChildIdx++;return e.nodeKey===``?String(t):`${e.nodeKey}.${t}`},ny=(e,t)=>{if(!(t===void 0||e.claimed.has(t)))return e.claimed.add(t),`id:${t}`},sae=(e,t)=>{let n={key:``,nodeKey:``,indices:[],children:[],nextChildIdx:0,claimed:new Set},r=[n],i=()=>{let e=r.pop(),n=r[r.length-1];n.children.push({type:`group`,key:e.key,nodeKey:e.nodeKey,idKey:ny(n,t?.[e.indices[0]]),indices:e.indices,children:e.children})};for(let n=0;n<e.length;n++){let a=e[n],o=0;for(;o<r.length-1&&o<a.length&&r[o+1].key===a[o];)o++;for(;r.length-1>o;)i();for(;r.length-1<a.length;){let e=r[r.length-1];r.push({key:a[r.length-1],nodeKey:ty(e),indices:[],children:[],nextChildIdx:0,claimed:new Set})}let s=r[r.length-1];s.children.push({type:`part`,index:n,nodeKey:ty(s),idKey:ny(s,t?.[n])});for(let e=1;e<r.length;e++)r[e].indices.push(n)}for(;r.length>1;)i();return n.children},cae=Object.freeze({type:`complete`}),lae=(e,t,n)=>{if(!n)return!1;switch(e){case`never`:return!1;case`always`:return!0;case`empty`:return t.length===0;case`no-text`:{let e=t[t.length-1];return e===void 0||e.type!==`text`&&e.type!==`reasoning`}}},ry=()=>{throw Error("MessagePrimitive.GroupedParts: rendered `children` under a leaf part. `children` is only meaningful for `group-…` cases — add a matching case for the part type or return `null` to skip it.")},iy=(e,t,n)=>{if(e.type===`part`)return(0,F.jsx)($v,{index:e.index,children:({part:e})=>n({part:e,children:(0,F.jsx)(ry,{})})},e.idKey?`part-${e.idKey}`:`part-${e.index}`);let r=t[e.indices.at(-1)]?.status??cae;return(0,F.jsx)(Ih.Fragment,{children:n({part:{type:e.key,status:r,indices:e.indices},children:(0,F.jsx)(F.Fragment,{children:e.children.map(e=>iy(e,t,n))})})},e.idKey??e.nodeKey)},ay=({groupBy:e,indicator:t=`no-text`,children:n})=>{let r=z(Wv(e=>e.message.parts)),i=z(e=>e.tools.toolUIs),a=z(e=>t===`never`?!1:e.message.status?.type===`running`);return(0,F.jsxs)(F.Fragment,{children:[Hh(()=>{let t={toolUIs:i};return sae(r.map(n=>e(n,t)??[]),r.map(e=>e.type===`tool-call`?e.toolCallId:void 0))},[r,e[oae]??e,i]).map(e=>iy(e,r,n)),lae(t,r,a)&&n({part:{type:`indicator`},children:(0,F.jsx)(ry,{})})]})};ay.displayName=`MessagePrimitive.GroupedParts`;var oy=(0,Ih.memo)(e=>{let t=R(5),{children:n}=e,r=z(Lv);if(!r)return null;let i;t[0]!==n||t[1]!==r?(i=n(r),t[0]=n,t[1]=r,t[2]=i):i=t[2];let a;return t[3]===i?a=t[4]:(a=(0,F.jsx)(F.Fragment,{children:i}),t[3]=i,t[4]=a),a});oy.displayName=`MessagePrimitive.Quote`;var sy=(e,t)=>{switch(t.type){case`image`:return e?.Image??e?.Attachment;case`document`:return e?.Document??e?.Attachment;case`file`:return e?.File??e?.Attachment;default:return e?.Attachment}},uae=e=>{let t=R(5),{components:n}=e,r=z(dae);if(!r)return null;let i=r,a;t[0]!==n||t[1]!==i?(a=sy(n,i),t[0]=n,t[1]=i,t[2]=a):a=t[2];let o=a;if(!o)return null;let s;return t[3]===o?s=t[4]:(s=(0,F.jsx)(o,{}),t[3]=o,t[4]=s),s},cy=(0,Ih.memo)(e=>{let t=R(5),{index:n,components:r}=e,i;t[0]===r?i=t[1]:(i=(0,F.jsx)(uae,{components:r}),t[0]=r,t[1]=i);let a;return t[2]!==n||t[3]!==i?(a=(0,F.jsx)(F_,{index:n,children:i}),t[2]=n,t[3]=i,t[4]=a):a=t[4],a},(e,t)=>e.index===t.index&&e.components?.Image===t.components?.Image&&e.components?.Document===t.components?.Document&&e.components?.File===t.components?.File&&e.components?.Attachment===t.components?.Attachment);cy.displayName=`MessagePrimitive.AttachmentByIndex`;var ly=({children:e})=>{let t=z(e=>e.message.role===`user`?(e.message.attachments??[]).length:0);return Hh(()=>Array.from({length:t},(t,n)=>(0,F.jsx)(F_,{index:n,children:(0,F.jsx)(t_,{getItemState:e=>e.message().attachment({index:n}).getState(),children:t=>e({get attachment(){return t()}})})},n)),[t,e])},uy=e=>{let t=R(4),{components:n,children:r}=e;if(n){let e;return t[0]===n?e=t[1]:(e=(0,F.jsx)(ly,{children:e=>{let{attachment:t}=e,r=sy(n,t);return r?(0,F.jsx)(r,{}):null}}),t[0]=n,t[1]=e),e}let i;return t[2]===r?i=t[3]:(i=(0,F.jsx)(ly,{children:r}),t[2]=r,t[3]=i),i};uy.displayName=`MessagePrimitive.Attachments`;function dae(e){return e.attachment}var dy=(e,t)=>{switch(t.type){case`image`:return e?.Image??e?.Attachment;case`document`:return e?.Document??e?.Attachment;case`file`:return e?.File??e?.Attachment;default:return e?.Attachment}},fae=e=>{let t=R(5),{components:n}=e,r=z(pae);if(!r)return null;let i;t[0]!==r||t[1]!==n?(i=dy(n,r),t[0]=r,t[1]=n,t[2]=i):i=t[2];let a=i;if(!a)return null;let o;return t[3]===a?o=t[4]:(o=(0,F.jsx)(a,{}),t[3]=a,t[4]=o),o},fy=(0,Ih.memo)(e=>{let t=R(5),{index:n,components:r}=e,i;t[0]===r?i=t[1]:(i=(0,F.jsx)(fae,{components:r}),t[0]=r,t[1]=i);let a;return t[2]!==n||t[3]!==i?(a=(0,F.jsx)(I_,{index:n,children:i}),t[2]=n,t[3]=i,t[4]=a):a=t[4],a},(e,t)=>e.index===t.index&&e.components?.Image===t.components?.Image&&e.components?.Document===t.components?.Document&&e.components?.File===t.components?.File&&e.components?.Attachment===t.components?.Attachment);fy.displayName=`ComposerPrimitive.AttachmentByIndex`;var py=({children:e})=>{let t=z(e=>e.composer.attachments.length);return Hh(()=>Array.from({length:t},(t,n)=>(0,F.jsx)(I_,{index:n,children:(0,F.jsx)(t_,{getItemState:e=>e.composer().attachment({index:n}).getState(),children:t=>e({get attachment(){return t()}})})},n)),[t,e])},my=e=>{let t=R(4),{components:n,children:r}=e;if(n){let e;return t[0]===n?e=t[1]:(e=(0,F.jsx)(py,{children:e=>{let{attachment:t}=e,r=dy(n,t);return r?(0,F.jsx)(r,{}):null}}),t[0]=n,t[1]=e),e}let i;return t[2]===r?i=t[3]:(i=(0,F.jsx)(py,{children:r}),t[2]=r,t[3]=i),i};my.displayName=`ComposerPrimitive.Attachments`;function pae(e){return e.attachment}var hy=(0,Ih.memo)(({children:e})=>{let t=z(e=>e.composer.queue.length);return Hh(()=>Array.from({length:t},(t,n)=>(0,F.jsx)(Sre,{index:n,children:(0,F.jsx)(t_,{getItemState:e=>e.composer().queueItem({index:n}).getState(),children:t=>e({get queueItem(){return t()}})})},n)),[t,e])});hy.displayName=`ComposerPrimitive.Queue`;var gy=e=>{let{children:t}=e;return z(mae)?t:null};gy.displayName=`MessagePartPrimitive.InProgress`;function mae(e){return e.part.status.type===`running`}var _y=e=>{let t=R(2),{components:n}=e,r=n.Suggestion,i;return t[0]===r?i=t[1]:(i=(0,F.jsx)(r,{}),t[0]=r,t[1]=i),i},vy=(0,Ih.memo)(e=>{let t=R(5),{index:n,components:r}=e,i;t[0]===r?i=t[1]:(i=(0,F.jsx)(_y,{components:r}),t[0]=r,t[1]=i);let a;return t[2]!==n||t[3]!==i?(a=(0,F.jsx)(B_,{index:n,children:i}),t[2]=n,t[3]=i,t[4]=a):a=t[4],a},(e,t)=>e.index===t.index&&e.components.Suggestion===t.components.Suggestion);vy.displayName=`ThreadPrimitive.SuggestionByIndex`;var yy=({children:e})=>{let t=z(e=>e.suggestions.suggestions.length);return Hh(()=>t===0?null:Array.from({length:t},(t,n)=>(0,F.jsx)(B_,{index:n,children:(0,F.jsx)(t_,{getItemState:e=>e.suggestions().suggestion({index:n}).getState(),children:t=>e({get suggestion(){return t()}})})},n)),[t,e])},by=e=>{let t=R(4),{components:n,children:r}=e;if(n){let e;return t[0]===n?e=t[1]:(e=(0,F.jsx)(yy,{children:()=>(0,F.jsx)(_y,{components:n})}),t[0]=n,t[1]=e),e}let i;return t[2]===r?i=t[3]:(i=(0,F.jsx)(yy,{children:r}),t[2]=r,t[3]=i),i};by.displayName=`ThreadPrimitive.Suggestions`;var hae=(0,Ih.memo)(by,(e,t)=>e.children||t.children?e.children===t.children:e.components.Suggestion===t.components.Suggestion),gae=e=>{let t=R(3),n;return t[0]!==e.dictation||t[1]!==e.editing?(n=t=>{if(e.editing===!0&&!t.composer.isEditing||e.editing===!1&&t.composer.isEditing)return!1;let n=t.composer.dictation!=null;return!(e.dictation===!0&&!n||e.dictation===!1&&n)},t[0]=e.dictation,t[1]=e.editing,t[2]=n):n=t[2],z(n)},xy=e=>{let t=R(3),n,r;return t[0]===e?(n=t[1],r=t[2]):({children:n,...r}=e,t[0]=e,t[1]=n,t[2]=r),gae(r)?n:null};xy.displayName=`ComposerPrimitive.If`;var _ae=()=>{let e=R(5),t=e_(),n=z(vae),r;e[0]===t?r=e[1]:(r=e=>{t.composer().send(e)},e[0]=t,e[1]=r);let i=r,a;return e[2]!==n||e[3]!==i?(a={send:i,disabled:n},e[2]=n,e[3]=i,e[4]=a):a=e[4],a};function vae(e){return!e.composer.canSend||e.thread.isRunning&&!e.thread.capabilities.queue}var yae=()=>{let e=R(5),t=e_(),n=z(bae),r;e[0]===t?r=e[1]:(r=()=>{t.composer().cancel()},e[0]=t,e[1]=r);let i=r,a;return e[2]!==i||e[3]!==n?(a={cancel:i,disabled:n},e[2]=i,e[3]=n,e[4]=a):a=e[4],a};function bae(e){return!e.composer.canCancel}var xae=()=>{let e=R(5),t=e_(),n=z(Sae),r;e[0]===t?r=e[1]:(r=()=>{t.composer().startDictation()},e[0]=t,e[1]=r);let i=r,a;return e[2]!==n||e[3]!==i?(a={startDictation:i,disabled:n},e[2]=n,e[3]=i,e[4]=a):a=e[4],a};function Sae(e){return e.composer.dictation!=null||!e.thread.capabilities.dictation||!e.composer.isEditing}var Cae=()=>{let e=R(5),t=e_(),n=z(wae),r;e[0]===t?r=e[1]:(r=e=>t.composer().addAttachment(e),e[0]=t,e[1]=r);let i=r,a;return e[2]!==i||e[3]!==n?(a={addAttachment:i,disabled:n},e[2]=i,e[3]=n,e[4]=a):a=e[4],a};function wae(e){return!e.composer.isEditing}var Tae=e=>{let t=R(12),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let{copiedDuration:r,copyToClipboard:i}=n,a=r===void 0?3e3:r,o=e_(),s=z(Dae),c=z(Oae),l=z(kae),u=z(Aae),d;t[2]!==o||t[3]!==u||t[4]!==a||t[5]!==i||t[6]!==l?(d=()=>{let e=l?u:o.message().getCopyText();if(!e)return;let t=i??jae;Promise.resolve(t(e)).then(()=>{o.message().setIsCopied(!0),setTimeout(()=>o.message().setIsCopied(!1),a)},Mae)},t[2]=o,t[3]=u,t[4]=a,t[5]=i,t[6]=l,t[7]=d):d=t[7];let f=d,p;return t[8]!==f||t[9]!==s||t[10]!==c?(p={copy:f,disabled:s,isCopied:c},t[8]=f,t[9]=s,t[10]=c,t[11]=p):p=t[11],p};function Eae(e){return e.type===`text`&&e.text.length>0}function Dae(e){return!((e.message.role!==`assistant`||e.message.status?.type!==`running`)&&e.message.parts.some(Eae))}function Oae(e){return e.message.isCopied}function kae(e){return e.composer.isEditing}function Aae(e){return e.composer.text}function jae(){}function Mae(){}var Nae=()=>{let e=R(5),t=e_(),n=z(Pae),r;e[0]===t?r=e[1]:(r=()=>{t.composer().beginEdit()},e[0]=t,e[1]=r);let i=r,a;return e[2]!==n||e[3]!==i?(a={edit:i,disabled:n},e[2]=n,e[3]=i,e[4]=a):a=e[4],a};function Pae(e){return e.composer.isEditing}var Fae=()=>{let e=R(5),t=e_(),n=z(Iae),r;e[0]===t?r=e[1]:(r=()=>{t.message().reload()},e[0]=t,e[1]=r);let i=r,a;return e[2]!==n||e[3]!==i?(a={reload:i,disabled:n},e[2]=n,e[3]=i,e[4]=a):a=e[4],a};function Iae(e){return e.thread.isRunning||e.thread.isDisabled||e.message.role!==`assistant`}var Lae=()=>{let e=R(5),t=e_(),n=z(zae),r;e[0]===t?r=e[1]:(r=()=>{t.message().submitFeedback({type:`positive`})},e[0]=t,e[1]=r);let i=r,a;return e[2]!==n||e[3]!==i?(a={submit:i,isSubmitted:n},e[2]=n,e[3]=i,e[4]=a):a=e[4],a},Rae=()=>{let e=R(5),t=e_(),n=z(Bae),r;e[0]===t?r=e[1]:(r=()=>{t.message().submitFeedback({type:`negative`})},e[0]=t,e[1]=r);let i=r,a;return e[2]!==n||e[3]!==i?(a={submit:i,isSubmitted:n},e[2]=n,e[3]=i,e[4]=a):a=e[4],a};function zae(e){return e.message.metadata.submittedFeedback?.type===`positive`}function Bae(e){return e.message.metadata.submittedFeedback?.type===`negative`}var Vae=()=>{let e=R(5),t=e_(),n=z(Uae),r;e[0]===t?r=e[1]:(r=async()=>{t.message().speak()},e[0]=t,e[1]=r);let i=r,a;return e[2]!==n||e[3]!==i?(a={speak:i,disabled:n},e[2]=n,e[3]=i,e[4]=a):a=e[4],a};function Hae(e){return e.type===`text`&&e.text.length>0}function Uae(e){return!((e.message.role!==`assistant`||e.message.status?.type!==`running`)&&e.message.parts.some(Hae))}var Wae=()=>{let e=R(5),t=e_(),n=z(Gae),r;e[0]===t?r=e[1]:(r=()=>{t.message().stopSpeaking()},e[0]=t,e[1]=r);let i=r,a;return e[2]!==n||e[3]!==i?(a={stopSpeaking:i,disabled:n},e[2]=n,e[3]=i,e[4]=a):a=e[4],a};function Gae(e){return e.message.speech==null}var Kae=e=>{let t=R(8),{prompt:n,send:r,clearComposer:i}=e,a=i===void 0?!0:i,o=e_(),s=z(qae),c=r??!1,l;t[0]!==o||t[1]!==a||t[2]!==n||t[3]!==c?(l=()=>{let e=o.thread().getState().isRunning;if(c&&!e)o.thread().append({content:[{type:`text`,text:n}],runConfig:o.composer().getState().runConfig}),a&&o.composer().setText(``);else if(a)o.composer().setText(n);else{let e=o.composer().getState().text;o.composer().setText(e.trim()?`${e} ${n}`:n)}},t[0]=o,t[1]=a,t[2]=n,t[3]=c,t[4]=l):l=t[4];let u=l,d;return t[5]!==s||t[6]!==u?(d={trigger:u,disabled:s},t[5]=s,t[6]=u,t[7]=d):d=t[7],d};function qae(e){return e.thread.isDisabled}var Jae=()=>z(Yae);function Yae(e){return e.message.status?.type===`incomplete`&&e.message.status.reason===`error`?e.message.status.error??`An error occurred`:void 0}var Xae=/:([\w-]{1,64})\[([^\]\n]{1,1024})\](?:\{name=([^}\n]{1,1024})\})?/gu,Sy={serialize(e){let t=e.id===e.label?``:`{name=${e.id}}`;return`:${e.type}[${e.label}]${t}`},parse(e){let t=[],n=0;for(let r of e.matchAll(Xae)){r.index>n&&t.push({kind:`text`,text:e.slice(n,r.index)});let i=r[2];t.push({kind:`mention`,type:r[1],label:i,id:r[3]??i}),n=r.index+r[0].length}return n<e.length&&t.push({kind:`text`,text:e.slice(n)}),t}};function Zae(e,t){function n(n){let r=Zh(e);if(!n?.optional&&!r)throw Error(`This component must be used within ${t}.`);return r}return n}function Cy(e,t){function n(n){let r=e(n);return r?r[t]:null}function r(e){let t=!1,r;typeof e==`function`?r=e:e&&typeof e==`object`&&(t=!!e.optional,r=e.selector);let i=n({optional:t});return i?r?i(r):i():null}return{[t]:r,[`${t}Store`]:n}}var wy=Yh(null),{useThreadViewport:Ty,useThreadViewportStore:Ey}=Cy(Zae(wy,`ThreadPrimitive.Viewport`),`useThreadViewport`),Dy=e=>{let t=new Map,n=()=>{let n=0;for(let e of t.values())n+=e;e(n)};return{register:()=>{let e=Symbol();return t.set(e,0),{setHeight:r=>{t.get(e)!==r&&(t.set(e,r),n())},unregister:()=>{t.delete(e),n()}}}}},Qae=(e={})=>{let t=new Set,n=Dy(e=>{a.setState({height:{...a.getState().height,viewport:e}})}),r=Dy(e=>{a.setState({height:{...a.getState().height,inset:e}})}),i=(e,t)=>(a.setState({element:{...a.getState().element,[e]:t}}),()=>{a.getState().element[e]===t&&a.setState({element:{...a.getState().element,[e]:null}})}),a=Vne(()=>({isAtBottom:!0,scrollToBottom:({behavior:e=`auto`}={})=>{for(let n of t)n({behavior:e})},onScrollToBottom:e=>(t.add(e),()=>{t.delete(e)}),turnAnchor:e.turnAnchor??`bottom`,topAnchorMessageClamp:{tallerThan:e.topAnchorMessageClamp?.tallerThan??`10em`,visibleHeight:e.topAnchorMessageClamp?.visibleHeight??`6em`},height:{viewport:0,inset:0},element:{viewport:null,anchor:null,target:null},targetConfig:null,topAnchorTurn:null,registerViewport:n.register,registerContentInset:r.register,registerViewportElement:e=>i(`viewport`,e),registerAnchorElement:e=>i(`anchor`,e),registerAnchorTargetElement:(e,t)=>(a.setState({element:{...a.getState().element,target:e},targetConfig:e&&t?t:null}),()=>{a.getState().element.target===e&&a.setState({element:{...a.getState().element,target:null},targetConfig:null})}),setTopAnchorTurn:e=>{a.setState({topAnchorTurn:e})}}));return a},Oy=e=>e,$ae=e=>{let t=R(11),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={optional:!0},t[0]=n):n=t[0];let r=Ey(n),i;t[1]===e?i=t[2]:(i=()=>Qae(e),t[1]=e,t[2]=i);let[a]=zh(i),o,s;t[3]!==r||t[4]!==a?(o=()=>r?.getState().onScrollToBottom(()=>{a.getState().scrollToBottom()}),s=[r,a],t[3]=r,t[4]=a,t[5]=o,t[6]=s):(o=t[5],s=t[6]),Wh(o,s);let c,l;return t[7]!==r||t[8]!==a?(c=()=>{if(r)return a.subscribe(e=>{r.getState().isAtBottom!==e.isAtBottom&&Oy(r).setState({isAtBottom:e.isAtBottom})})},l=[a,r],t[7]=r,t[8]=a,t[9]=c,t[10]=l):(c=t[9],l=t[10]),Wh(c,l),a},ky=e=>{let t=R(7),{children:n,options:r}=e,i;t[0]===r?i=t[1]:(i=r===void 0?{}:r,t[0]=r,t[1]=i);let a=$ae(i),o;t[2]===a?o=t[3]:(o=()=>({useThreadViewport:a}),t[2]=a,t[3]=o);let[s]=zh(o),c;return t[4]!==n||t[5]!==s?(c=(0,F.jsx)(wy.Provider,{value:s,children:n}),t[4]=n,t[5]=s,t[6]=c):c=t[6],c},eoe=()=>{let e=R(3),t=e_(),n,r;return e[0]===t?(n=e[1],r=e[2]):(n=()=>{},r=[t],e[0]=t,e[1]=n,e[2]=r),Wh(n,r),null},toe=(0,Ih.memo)(e=>{let t=R(7),{children:n,aui:r,runtime:i}=e,a=r??null,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,F.jsx)(eoe,{}),t[0]=o):o=t[0];let s;t[1]===n?s=t[2]:(s=(0,F.jsx)(ky,{children:n}),t[1]=n,t[2]=s);let c;return t[3]!==i||t[4]!==a||t[5]!==s?(c=(0,F.jsxs)(Lne,{runtime:i,aui:a,children:[o,s]}),t[3]=i,t[4]=a,t[5]=s,t[6]=c):c=t[6],c}),noe=e=>{let t=e;t.__isBound||=(t.__internal_bindMethods?.(),!0)};function roe(e,t){let n=R(4),r=t===void 0?ioe:t;noe(e);let i,a;n[0]!==e||n[1]!==r?(i=()=>r(e.getState()),a=()=>r(e.getState()),n[0]=e,n[1]=r,n[2]=i,n[3]=a):(i=n[2],a=n[3]);let o=qh(e.subscribe,i,a);return Jh(o),o}var ioe=e=>e;function Ay(e){function t(t){let n=!1,r;typeof t==`function`?r=t:t&&(n=!!t.optional,r=t.selector);let i=e({optional:n});return i?roe(i,r):null}return t}function aoe(e){let t=R(2),n=e_(),r;t[0]===n?r=t[1]:(r=()=>n.attachment.source?n.attachment().__internal_getRuntime?.()??null:null,t[0]=n,t[1]=r);let i=z(r);if(!i&&!e?.optional)throw Error(`AttachmentRuntime is not available`);return i}var jy=Ay(aoe);function My(e){let t=R(2),n=e_(),r;t[0]===n?r=t[1]:(r=()=>n.composer.source?n.composer().__internal_getRuntime?.()??null:null,t[0]=n,t[1]=r);let i=z(r);if(!i&&!e?.optional)throw Error(`ComposerRuntime is not available`);return i}var ooe=Ay(My);function soe(e){let t=R(2),n=e_(),r;t[0]===n?r=t[1]:(r=()=>n.message.source?n.message().__internal_getRuntime?.()??null:null,t[0]=n,t[1]=r);let i=z(r);if(!i&&!e?.optional)throw Error(`MessageRuntime is not available`);return i}var Ny=Ay(soe);function coe(e){let t=R(2),n=e_(),r;t[0]===n?r=t[1]:(r=()=>n.thread.source?n.thread().__internal_getRuntime?.()??null:null,t[0]=n,t[1]=r);let i=z(r);if(!i&&!e?.optional)throw Error(`ThreadRuntime is not available`);return i}var loe=Ay(coe);function Py(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Fy(...e){return t=>{let n=!1,r=e.map(e=>{let r=Py(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():Py(e[t],null)}}}}function Iy(...e){return M.useCallback(Fy(...e),e)}var Ly=Object.defineProperty,Ry=(e,t)=>{let n={};for(var r in e)Ly(n,r,{get:e[r],enumerable:!0});return t||Ly(n,Symbol.toStringTag,{value:`Module`}),n};function zy(e){let t=M.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];Uy(r)&&typeof Wy==`function`&&(r=Wy(r._payload)),M.Children.forEach(r,e=>{if(poe(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;Uy(n)&&typeof Wy==`function`&&(n=Wy(n._payload)),a=uoe(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=M.cloneElement(a,void 0,s):!o&&M.Children.count(r)===1&&M.isValidElement(r)&&(a=r);let c=a?foe(a):void 0,l=Iy(n,c);if(!a){if(r||r===0)throw Error(o?_oe(e):goe(e));return r}let u=doe(i,a.props??{});return a.type!==M.Fragment&&(u.ref=n?l:c),M.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}var By=zy(`Slot`),Vy=Symbol.for(`radix.slottable`);function Hy(e){let t=e=>`child`in e?e.children(e.child):e.children;return t.displayName=`${e}.Slottable`,t.__radixId=Vy,t}var uoe=(e,t)=>{if(`child`in e.props){let t=e.props.child;return M.isValidElement(t)?M.cloneElement(t,void 0,e.props.children(t.props.children)):null}return M.isValidElement(t)?t:null};function doe(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}}function foe(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)}function poe(e){return M.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Vy}var moe=Symbol.for(`react.lazy`);function Uy(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===moe&&`_payload`in e&&hoe(e._payload)}function hoe(e){return typeof e==`object`&&!!e&&`then`in e}var goe=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,_oe=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,Wy=M.use,Gy=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=zy(`Primitive.${t}`),r=M.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,F.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Ky(e,t){e&&us.flushSync(()=>e.dispatchEvent(t))}var voe=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`];function yoe(e){let t=(0,Ih.forwardRef)((t,n)=>{let r=R(17),i,a,o,s;r[0]===t?(i=r[1],a=r[2],o=r[3],s=r[4]):({render:o,asChild:i,children:a,...s}=t,r[0]=t,r[1]=i,r[2]=a,r[3]=o,r[4]=s);let c=e;if(o&&(0,Ih.isValidElement)(o)){let e=a===void 0?o.props.children:a,t=s,i;r[5]!==o||r[6]!==e?(i=(0,Ih.cloneElement)(o,void 0,e),r[5]=o,r[6]=e,r[7]=i):i=r[7];let l;return r[8]!==n||r[9]!==t||r[10]!==i?(l=(0,F.jsx)(c,{...t,asChild:!0,ref:n,children:i}),r[8]=n,r[9]=t,r[10]=i,r[11]=l):l=r[11],l}let l=s,u;return r[12]!==i||r[13]!==a||r[14]!==n||r[15]!==l?(u=(0,F.jsx)(c,{...l,asChild:i,ref:n,children:a}),r[12]=i,r[13]=a,r[14]=n,r[15]=l,r[16]=u):u=r[16],u});return t.displayName=typeof e==`string`?e:e.displayName??e.name??`Component`,t}function boe(e){let t=Gy[e],n=yoe(t);return n.displayName=`Primitive.${e}`,n}var qy=voe.reduce((e,t)=>(e[t]=boe(t),e),{}),xoe=e=>{let t=R(5),{hideWhenRunning:n,autohide:r,autohideFloat:i,forceVisible:a}=e,o;return t[0]!==r||t[1]!==i||t[2]!==a||t[3]!==n?(o=e=>{if(n&&e.thread.isRunning)return`hidden`;let t=r===`always`||r===`not-last`&&!e.message.isLast,o=a||e.message.isHovering;return t?o?i===`always`||i===`single-branch`&&e.message.branchCount<=1?`floating`:`normal`:`hidden`:`normal`},t[0]=r,t[1]=i,t[2]=a,t[3]=n,t[4]=o):o=t[4],z(o)},Soe=Yh(null),Jy=(0,Ih.forwardRef)((e,t)=>{let n=R(18),r,i,a,o;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4]):({hideWhenRunning:a,autohide:r,autohideFloat:i,...o}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o);let[s,c]=zh(0),l;n[5]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>{let e=!1;return c(Coe),()=>{e||(e=!0,c(woe))}},n[5]=l):l=n[5];let u=l,d;n[6]===Symbol.for(`react.memo_cache_sentinel`)?(d={acquireInteractionLock:u},n[6]=d):d=n[6];let f=d,p=s>0,m;n[7]!==r||n[8]!==i||n[9]!==a||n[10]!==p?(m={hideWhenRunning:a,autohide:r,autohideFloat:i,forceVisible:p},n[7]=r,n[8]=i,n[9]=a,n[10]=p,n[11]=m):m=n[11];let h=xoe(m);if(h===`hidden`)return null;let g;n[12]===h?g=n[13]:(g=h===`floating`?{"data-floating":`true`}:null,n[12]=h,n[13]=g);let _;return n[14]!==t||n[15]!==o||n[16]!==g?(_=(0,F.jsx)(Soe.Provider,{value:f,children:(0,F.jsx)(qy.div,{...g,...o,ref:t})}),n[14]=t,n[15]=o,n[16]=g,n[17]=_):_=n[17],_});Jy.displayName=`ActionBarPrimitive.Root`;function Coe(e){return e+1}function woe(e){return Math.max(0,e-1)}typeof window<`u`&&window.document&&window.document.createElement;function B(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}var Toe=e=>{let t=R(4),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let{copiedDuration:r}=n,i=r===void 0?3e3:r,a;t[2]===i?a=t[3]:(a={copiedDuration:i,copyToClipboard:Eoe},t[2]=i,t[3]=a);let{copy:o,disabled:s}=Tae(a);return s?null:o},Yy=(0,Ih.forwardRef)((e,t)=>{let n=R(20),r,i,a,o;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4]):({copiedDuration:r,onClick:a,disabled:i,...o}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o);let s=z(Doe),c;n[5]===r?c=n[6]:(c={copiedDuration:r},n[5]=r,n[6]=c);let l=Toe(c),u;n[7]===s?u=n[8]:(u=s?{"data-copied":`true`}:{},n[7]=s,n[8]=u);let d=i||!l,f;n[9]===l?f=n[10]:(f=()=>{l?.()},n[9]=l,n[10]=f);let p;n[11]!==a||n[12]!==f?(p=B(a,f),n[11]=a,n[12]=f,n[13]=p):p=n[13];let m;return n[14]!==t||n[15]!==o||n[16]!==u||n[17]!==d||n[18]!==p?(m=(0,F.jsx)(qy.button,{type:`button`,...u,...o,ref:t,disabled:d,onClick:p}),n[14]=t,n[15]=o,n[16]=u,n[17]=d,n[18]=p,n[19]=m):m=n[19],m});Yy.displayName=`ActionBarPrimitive.Copy`;function Eoe(e){return typeof navigator>`u`||!navigator.clipboard?Promise.reject(Error(`Clipboard API is unavailable`)):navigator.clipboard.writeText(e)}function Doe(e){return e.message.isCopied}var Xy=(e,t,n=[])=>{let r=(0,Ih.forwardRef)((e,r)=>{let i=R(6),a={},o={};Object.keys(e).forEach(t=>{n.includes(t)?a[t]=e[t]:o[t]=e[t]});let s=t(a)??void 0,c=qy,l=o.disabled||!s,u=B(o.onClick,s),d;return i[0]!==r||i[1]!==o||i[2]!==c.button||i[3]!==l||i[4]!==u?(d=(0,F.jsx)(c.button,{...o,type:`button`,ref:r,disabled:l,onClick:u}),i[0]=r,i[1]=o,i[2]=c.button,i[3]=l,i[4]=u,i[5]=d):d=i[5],d});return r.displayName=e,r},Ooe=Xy(`ActionBarPrimitive.Reload`,()=>{let{disabled:e,reload:t}=Fae();return e?null:t}),koe=Xy(`ActionBarPrimitive.Edit`,()=>{let{disabled:e,edit:t}=Nae();return e?null:t}),Aoe=Xy(`ActionBarPrimitive.Speak`,()=>{let{disabled:e,speak:t}=Vae();return e?null:t});function Zy(e){let t=M.useRef(e);return M.useEffect(()=>{t.current=e}),M.useMemo(()=>((...e)=>t.current?.(...e)),[])}function Qy(e,t=globalThis?.document){let n=Zy(e);M.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var joe=()=>{let{disabled:e,stopSpeaking:t}=Wae();return e?null:t},$y=(0,Ih.forwardRef)((e,t)=>{let n=R(12),r=joe(),i;n[0]===r?i=n[1]:(i=e=>{r&&(e.preventDefault(),r())},n[0]=r,n[1]=i),Qy(i);let a=!r,o;n[2]===r?o=n[3]:(o=()=>{r?.()},n[2]=r,n[3]=o);let s;n[4]!==e.onClick||n[5]!==o?(s=B(e.onClick,o),n[4]=e.onClick,n[5]=o,n[6]=s):s=n[6];let c;return n[7]!==e||n[8]!==t||n[9]!==a||n[10]!==s?(c=(0,F.jsx)(qy.button,{type:`button`,disabled:a,...e,ref:t,onClick:s}),n[7]=e,n[8]=t,n[9]=a,n[10]=s,n[11]=c):c=n[11],c});$y.displayName=`ActionBarPrimitive.StopSpeaking`;var Moe=()=>{let{submit:e}=Lae();return e},eb=(0,Ih.forwardRef)((e,t)=>{let n=R(17),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({onClick:i,disabled:r,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let o=z(Noe),s=Moe(),c;n[4]===o?c=n[5]:(c=o?{"data-submitted":`true`}:{},n[4]=o,n[5]=c);let l=r||!s,u;n[6]===s?u=n[7]:(u=()=>{s?.()},n[6]=s,n[7]=u);let d;n[8]!==i||n[9]!==u?(d=B(i,u),n[8]=i,n[9]=u,n[10]=d):d=n[10];let f;return n[11]!==t||n[12]!==a||n[13]!==c||n[14]!==l||n[15]!==d?(f=(0,F.jsx)(qy.button,{type:`button`,...c,...a,ref:t,disabled:l,onClick:d}),n[11]=t,n[12]=a,n[13]=c,n[14]=l,n[15]=d,n[16]=f):f=n[16],f});eb.displayName=`ActionBarPrimitive.FeedbackPositive`;function Noe(e){return e.message.metadata.submittedFeedback?.type===`positive`}var Poe=()=>{let{submit:e}=Rae();return e},tb=(0,Ih.forwardRef)((e,t)=>{let n=R(17),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({onClick:i,disabled:r,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let o=z(Foe),s=Poe(),c;n[4]===o?c=n[5]:(c=o?{"data-submitted":`true`}:{},n[4]=o,n[5]=c);let l=r||!s,u;n[6]===s?u=n[7]:(u=()=>{s?.()},n[6]=s,n[7]=u);let d;n[8]!==i||n[9]!==u?(d=B(i,u),n[8]=i,n[9]=u,n[10]=d):d=n[10];let f;return n[11]!==t||n[12]!==a||n[13]!==c||n[14]!==l||n[15]!==d?(f=(0,F.jsx)(qy.button,{type:`button`,...c,...a,ref:t,disabled:l,onClick:d}),n[11]=t,n[12]=a,n[13]=c,n[14]=l,n[15]=d,n[16]=f):f=n[16],f});tb.displayName=`ActionBarPrimitive.FeedbackNegative`;function Foe(e){return e.message.metadata.submittedFeedback?.type===`negative`}var Ioe=e=>{let t=R(6),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let{filename:r,onExport:i}=n,a=e_(),o=z(Roe),s;return t[2]!==a||t[3]!==r||t[4]!==i?(s=async()=>{let e=a.message().getCopyText();if(!e)return;if(i){await i(e);return}let t=new Blob([e],{type:`text/markdown`}),n=URL.createObjectURL(t),o=document.createElement(`a`);o.href=n,o.download=r??`message-${Date.now()}.md`,o.click(),URL.revokeObjectURL(n)},t[2]=a,t[3]=r,t[4]=i,t[5]=s):s=t[5],o?s:null},nb=(0,Ih.forwardRef)((e,t)=>{let n=R(19),r,i,a,o,s;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4],s=n[5]):({filename:i,onExport:o,onClick:a,disabled:r,...s}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o,n[5]=s);let c;n[6]!==i||n[7]!==o?(c={filename:i,onExport:o},n[6]=i,n[7]=o,n[8]=c):c=n[8];let l=Ioe(c),u=r||!l,d;n[9]===l?d=n[10]:(d=()=>{l?.()},n[9]=l,n[10]=d);let f;n[11]!==a||n[12]!==d?(f=B(a,d),n[11]=a,n[12]=d,n[13]=f):f=n[13];let p;return n[14]!==t||n[15]!==s||n[16]!==u||n[17]!==f?(p=(0,F.jsx)(qy.button,{type:`button`,...s,ref:t,disabled:u,onClick:f}),n[14]=t,n[15]=s,n[16]=u,n[17]=f,n[18]=p):p=n[18],p});nb.displayName=`ActionBarPrimitive.ExportMarkdown`;function Loe(e){return e.type===`text`&&e.text.length>0}function Roe(e){return(e.message.role!==`assistant`||e.message.status?.type!==`running`)&&e.message.parts.some(Loe)}var rb=Ry({Copy:()=>Yy,Edit:()=>koe,ExportMarkdown:()=>nb,FeedbackNegative:()=>tb,FeedbackPositive:()=>eb,Reload:()=>Ooe,Root:()=>Jy,Speak:()=>Aoe,StopSpeaking:()=>$y}),ib=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),zoe=`VisuallyHidden`,ab=M.forwardRef((e,t)=>(0,F.jsx)(Gy.span,{...e,ref:t,style:{...ib,...e.style}}));ab.displayName=zoe;var Boe=ab;function Voe(e,t){let n=M.createContext(t);n.displayName=e+`Context`;let r=e=>{let{children:t,...r}=e,i=M.useMemo(()=>r,Object.values(r));return(0,F.jsx)(n.Provider,{value:i,children:t})};r.displayName=e+`Provider`;function i(r){let i=M.useContext(n);if(i)return i;if(t!==void 0)return t;throw Error(`\`${r}\` must be used within \`${e}\``)}return[r,i]}function ob(e,t=[]){let n=[];function r(t,r){let i=M.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=M.useMemo(()=>o,Object.values(o));return(0,F.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=M.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>M.createContext(e));return function(n){let r=n?.[e]||t;return M.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,Hoe(i,...t)]}function Hoe(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return M.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}function sb(e){let t=e+`CollectionProvider`,[n,r]=ob(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=M.useRef(null),a=M.useRef(new Map).current;return(0,F.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=zy(s),l=M.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,F.jsx)(c,{ref:Iy(t,a(s,n).collectionRef),children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=zy(u),p=M.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=M.useRef(null),s=Iy(t,o),c=a(u,n);return M.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,F.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return M.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:l,ItemSlot:p},m,r]}var cb=globalThis?.document?M.useLayoutEffect:()=>{},Uoe=M.useInsertionEffect||cb;function lb({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=Woe({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=M.useRef(e!==void 0);M.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[c,M.useCallback(t=>{if(s){let n=Goe(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function Woe({defaultProp:e,onChange:t}){let[n,r]=M.useState(e),i=M.useRef(n),a=M.useRef(t);return Uoe(()=>{a.current=t},[t]),M.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function Goe(e){return typeof e==`function`}function Koe(e,t){return M.useReducer((e,n)=>t[e][n]??e,e)}var ub=e=>{let{present:t,children:n}=e,r=qoe(t),i=typeof n==`function`?n({present:r.isPresent}):M.Children.only(n),a=Joe(r.ref,Yoe(i));return typeof n==`function`||r.isPresent?M.cloneElement(i,{ref:a}):null};ub.displayName=`Presence`;function qoe(e){let[t,n]=M.useState(),r=M.useRef(null),i=M.useRef(e),a=M.useRef(`none`),[o,s]=Koe(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return M.useEffect(()=>{let e=fb(r.current);a.current=o===`mounted`?e:`none`},[o]),cb(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=fb(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),cb(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=fb(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=fb(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:M.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function db(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Joe(...e){let t=M.useRef(e);return t.current=e,M.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=db(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():db(n[e],null)}}},[])}function fb(e){return e?.animationName||`none`}function Yoe(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)}var Xoe=M.useId||(()=>void 0),Zoe=0;function pb(e){let[t,n]=M.useState(Xoe());return cb(()=>{e||n(e=>e??String(Zoe++))},[e]),e||(t?`radix-${t}`:``)}var Qoe=M.createContext(void 0);function mb(e){let t=M.useContext(Qoe);return e||t||`ltr`}var $oe=`DismissableLayer`,hb=`dismissableLayer.update`,ese=`dismissableLayer.pointerDownOutside`,tse=`dismissableLayer.focusOutside`,gb,_b=M.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),vb=M.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...c}=e,l=M.useContext(_b),[u,d]=M.useState(null),f=u?.ownerDocument??globalThis?.document,[,p]=M.useState({}),m=Iy(t,e=>d(e)),h=Array.from(l.layers),[g]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),_=h.indexOf(g),v=u?h.indexOf(u):-1,y=l.layersWithOutsidePointerEventsDisabled.size>0,b=v>=_,x=ise(e=>{let t=e.target,n=[...l.branches].some(e=>e.contains(t));!b||n||(i?.(e),o?.(e),e.defaultPrevented||s?.())},f),S=ase(e=>{let t=e.target;[...l.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||s?.())},f);return Qy(e=>{v===l.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},f),M.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(gb=f.body.style.pointerEvents,f.body.style.pointerEvents=`none`),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),yb(),()=>{n&&(l.layersWithOutsidePointerEventsDisabled.delete(u),l.layersWithOutsidePointerEventsDisabled.size===0&&(f.body.style.pointerEvents=gb))}},[u,f,n,l]),M.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),yb())},[u,l]),M.useEffect(()=>{let e=()=>p({});return document.addEventListener(hb,e),()=>document.removeEventListener(hb,e)},[]),(0,F.jsx)(Gy.div,{...c,ref:m,style:{pointerEvents:y?b?`auto`:`none`:void 0,...e.style},onFocusCapture:B(e.onFocusCapture,S.onFocusCapture),onBlurCapture:B(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:B(e.onPointerDownCapture,x.onPointerDownCapture)})});vb.displayName=$oe;var nse=`DismissableLayerBranch`,rse=M.forwardRef((e,t)=>{let n=M.useContext(_b),r=M.useRef(null),i=Iy(t,r);return M.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,F.jsx)(Gy.div,{...e,ref:i})});rse.displayName=nse;function ise(e,t=globalThis?.document){let n=Zy(e),r=M.useRef(!1),i=M.useRef(()=>{});return M.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){bb(ese,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function ase(e,t=globalThis?.document){let n=Zy(e),r=M.useRef(!1);return M.useEffect(()=>{let e=e=>{e.target&&!r.current&&bb(tse,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function yb(){let e=new CustomEvent(hb);document.dispatchEvent(e)}function bb(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?Ky(i,a):i.dispatchEvent(a)}var xb=`focusScope.autoFocusOnMount`,Sb=`focusScope.autoFocusOnUnmount`,Cb={bubbles:!1,cancelable:!0},ose=`FocusScope`,wb=M.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=M.useState(null),l=Zy(i),u=Zy(a),d=M.useRef(null),f=Iy(t,e=>c(e)),p=M.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;M.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:Db(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||Db(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&Db(s)};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]),M.useEffect(()=>{if(s){Ob.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(xb,Cb);s.addEventListener(xb,l),s.dispatchEvent(t),t.defaultPrevented||(sse(fse(Tb(s)),{select:!0}),document.activeElement===e&&Db(s))}return()=>{s.removeEventListener(xb,l),setTimeout(()=>{let t=new CustomEvent(Sb,Cb);s.addEventListener(Sb,u),s.dispatchEvent(t),t.defaultPrevented||Db(e??document.body,{select:!0}),s.removeEventListener(Sb,u),Ob.remove(p)},0)}}},[s,l,u,p]);let m=M.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]=cse(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&Db(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&Db(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,F.jsx)(Gy.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});wb.displayName=ose;function sse(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(Db(r,{select:t}),document.activeElement!==n)return}function cse(e){let t=Tb(e);return[Eb(t,e),Eb(t.reverse(),e)]}function Tb(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode: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}});for(;n.nextNode();)t.push(n.currentNode);return t}function Eb(e,t){for(let n of e)if(!lse(n,{upTo:t}))return n}function lse(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}function use(e){return e instanceof HTMLInputElement&&`select`in e}function Db(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&use(e)&&t&&e.select()}}var Ob=dse();function dse(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=kb(e,t),e.unshift(t)},remove(t){e=kb(e,t),e[0]?.resume()}}}function kb(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function fse(e){return e.filter(e=>e.tagName!==`A`)}var pse=`Portal`,Ab=M.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=M.useState(!1);cb(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?us.createPortal((0,F.jsx)(Gy.div,{...r,ref:t}),o):null});Ab.displayName=pse;var jb=0,Mb=null;function Nb(){M.useEffect(()=>{Mb||={start:Pb(),end:Pb()};let{start:e,end:t}=Mb;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),jb++,()=>{jb===1&&(Mb?.start.remove(),Mb?.end.remove(),Mb=null),jb=Math.max(0,jb-1)}},[])}function Pb(){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}var Fb=function(){return Fb=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},Fb.apply(this,arguments)};function Ib(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 mse(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 Lb=`right-scroll-bar-position`,Rb=`width-before-scroll-bar`,hse=`with-scroll-bars-hidden`,gse=`--removed-body-scroll-bar-size`;function zb(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function _se(e,t){var n=(0,M.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 vse=typeof window<`u`?M.useLayoutEffect:M.useEffect,Bb=new WeakMap;function yse(e,t){var n=_se(t||null,function(t){return e.forEach(function(e){return zb(e,t)})});return vse(function(){var t=Bb.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||zb(e,null)}),i.forEach(function(e){r.has(e)||zb(e,a)})}Bb.set(n,e)},[e]),n}function Vb(e){return e}function bse(e,t){t===void 0&&(t=Vb);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 xse(e){e===void 0&&(e={});var t=bse(null);return t.options=Fb({async:!0,ssr:!1},e),t}var Hb=function(e){var t=e.sideCar,n=Ib(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 M.createElement(r,Fb({},n))};Hb.isSideCarExport=!0;function Sse(e,t){return e.useMedium(t),Hb}var Ub=xse(),Wb=function(){},Gb=M.forwardRef(function(e,t){var n=M.useRef(null),r=M.useState({onScrollCapture:Wb,onWheelCapture:Wb,onTouchMoveCapture:Wb}),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,v=_===void 0?`div`:_,y=e.gapMode,b=Ib(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=yse([n,t]),C=Fb(Fb({},b),i);return M.createElement(M.Fragment,null,u&&M.createElement(x,{sideCar:Ub,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?M.cloneElement(M.Children.only(s),Fb(Fb({},C),{ref:S})):M.createElement(v,Fb({},C,{className:c,ref:S}),s))});Gb.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Gb.classNames={fullWidth:Rb,zeroRight:Lb};var Kb,Cse=function(){if(Kb)return Kb;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function wse(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Cse();return t&&e.setAttribute(`nonce`,t),e}function Tse(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Ese(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Dse=function(){var e=0,t=null;return{add:function(n){e==0&&(t=wse())&&(Tse(t,n),Ese(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Ose=function(){var e=Dse();return function(t,n){M.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},qb=function(){var e=Ose();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},kse={left:0,top:0,right:0,gap:0},Jb=function(e){return parseInt(e||``,10)||0},Ase=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[Jb(n),Jb(r),Jb(i)]},jse=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return kse;var t=Ase(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])}},Mse=qb(),Yb=`data-scroll-locked`,Nse=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
80
|
+
.${hse} {
|
|
81
|
+
overflow: hidden ${r};
|
|
82
|
+
padding-right: ${s}px ${r};
|
|
83
|
+
}
|
|
84
|
+
body[${Yb}] {
|
|
85
|
+
overflow: hidden ${r};
|
|
86
|
+
overscroll-behavior: contain;
|
|
87
|
+
${[t&&`position: relative ${r};`,n===`margin`&&`
|
|
88
|
+
padding-left: ${i}px;
|
|
89
|
+
padding-top: ${a}px;
|
|
90
|
+
padding-right: ${o}px;
|
|
91
|
+
margin-left:0;
|
|
92
|
+
margin-top:0;
|
|
93
|
+
margin-right: ${s}px ${r};
|
|
94
|
+
`,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.${Lb} {
|
|
98
|
+
right: ${s}px ${r};
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.${Rb} {
|
|
102
|
+
margin-right: ${s}px ${r};
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.${Lb} .${Lb} {
|
|
106
|
+
right: 0 ${r};
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.${Rb} .${Rb} {
|
|
110
|
+
margin-right: 0 ${r};
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
body[${Yb}] {
|
|
114
|
+
${gse}: ${s}px;
|
|
115
|
+
}
|
|
116
|
+
`},Xb=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},Pse=function(){M.useEffect(function(){return document.body.setAttribute(Yb,(Xb()+1).toString()),function(){var e=Xb()-1;e<=0?document.body.removeAttribute(Yb):document.body.setAttribute(Yb,e.toString())}},[])},Fse=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;Pse();var a=M.useMemo(function(){return jse(i)},[i]);return M.createElement(Mse,{styles:Nse(a,!t,i,n?``:`!important`)})},Zb=!1;if(typeof window<`u`)try{var Qb=Object.defineProperty({},"passive",{get:function(){return Zb=!0,!0}});window.addEventListener(`test`,Qb,Qb),window.removeEventListener(`test`,Qb,Qb)}catch{Zb=!1}var $b=Zb?{passive:!1}:!1,Ise=function(e){return e.tagName===`TEXTAREA`},ex=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!Ise(e)&&n[t]===`visible`)},Lse=function(e){return ex(e,`overflowY`)},tx=function(e){return ex(e,`overflowX`)},nx=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),ax(e,r)){var i=ox(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},rx=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},ix=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},ax=function(e,t){return e===`v`?Lse(t):tx(t)},ox=function(e,t){return e===`v`?rx(t):ix(t)},Rse=function(e,t){return e===`h`&&t===`rtl`?-1:1},zse=function(e,t,n,r,i){var a=Rse(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=ox(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&ax(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},sx=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},cx=function(e){return[e.deltaX,e.deltaY]},lx=function(e){return e&&`current`in e?e.current:e},Bse=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Vse=function(e){return`
|
|
117
|
+
.block-interactivity-${e} {pointer-events: none;}
|
|
118
|
+
.allow-interactivity-${e} {pointer-events: all;}
|
|
119
|
+
`},Hse=0,ux=[];function Use(e){var t=M.useRef([]),n=M.useRef([0,0]),r=M.useRef(),i=M.useState(Hse++)[0],a=M.useState(qb)[0],o=M.useRef(e);M.useEffect(function(){o.current=e},[e]),M.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=mse([e.lockRef.current],(e.shards||[]).map(lx),!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=M.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=sx(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=nx(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=nx(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 zse(h,t,e,h===`h`?s:c,!0)},[]),c=M.useCallback(function(e){var n=e;if(!(!ux.length||ux[ux.length-1]!==a)){var r=`deltaY`in n?cx(n):sx(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Bse(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(lx).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=M.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Wse(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=M.useCallback(function(e){n.current=sx(e),r.current=void 0},[]),d=M.useCallback(function(t){l(t.type,cx(t),t.target,s(t,e.lockRef.current))},[]),f=M.useCallback(function(t){l(t.type,sx(t),t.target,s(t,e.lockRef.current))},[]);M.useEffect(function(){return ux.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,$b),document.addEventListener(`touchmove`,c,$b),document.addEventListener(`touchstart`,u,$b),function(){ux=ux.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,$b),document.removeEventListener(`touchmove`,c,$b),document.removeEventListener(`touchstart`,u,$b)}},[]);var p=e.removeScrollBar,m=e.inert;return M.createElement(M.Fragment,null,m?M.createElement(a,{styles:Vse(i)}):null,p?M.createElement(Fse,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Wse(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Gse=Sse(Ub,Use),dx=M.forwardRef(function(e,t){return M.createElement(Gb,Fb({},e,{ref:t,sideCar:Gse}))});dx.classNames=Gb.classNames;var Kse=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},fx=new WeakMap,px=new WeakMap,mx={},hx=0,gx=function(e){return e&&(e.host||gx(e.parentNode))},qse=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=gx(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})},Jse=function(e,t,n,r){var i=qse(t,Array.isArray(e)?e:[e]);mx[n]||(mx[n]=new WeakMap);var a=mx[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=(fx.get(e)||0)+1,l=(a.get(e)||0)+1;fx.set(e,c),a.set(e,l),o.push(e),c===1&&i&&px.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(),hx++,function(){o.forEach(function(e){var t=fx.get(e)-1,i=a.get(e)-1;fx.set(e,t),a.set(e,i),t||(px.has(e)||e.removeAttribute(r),px.delete(e)),i||e.removeAttribute(n)}),hx--,hx||(fx=new WeakMap,fx=new WeakMap,px=new WeakMap,mx={})}},_x=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Kse(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Jse(r,i,n,`aria-hidden`)):function(){return null}},vx=`Dialog`,[yx,bx]=ob(vx),[Yse,xx]=yx(vx),Sx=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=M.useRef(null),c=M.useRef(null),[l,u]=lb({prop:r,defaultProp:i??!1,onChange:a,caller:vx});return(0,F.jsx)(Yse,{scope:t,triggerRef:s,contentRef:c,contentId:pb(),titleId:pb(),descriptionId:pb(),open:l,onOpenChange:u,onOpenToggle:M.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})};Sx.displayName=vx;var Cx=`DialogTrigger`,wx=M.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=xx(Cx,n),a=Iy(t,i.triggerRef);return(0,F.jsx)(Gy.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":Hx(i.open),...r,ref:a,onClick:B(e.onClick,i.onOpenToggle)})});wx.displayName=Cx;var Tx=`DialogPortal`,[Xse,Ex]=yx(Tx,{forceMount:void 0}),Dx=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=xx(Tx,t);return(0,F.jsx)(Xse,{scope:t,forceMount:n,children:M.Children.map(r,e=>(0,F.jsx)(ub,{present:n||a.open,children:(0,F.jsx)(Ab,{asChild:!0,container:i,children:e})}))})};Dx.displayName=Tx;var Ox=`DialogOverlay`,kx=M.forwardRef((e,t)=>{let n=Ex(Ox,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=xx(Ox,e.__scopeDialog);return a.modal?(0,F.jsx)(ub,{present:r||a.open,children:(0,F.jsx)(Ax,{...i,ref:t})}):null});kx.displayName=Ox;var Zse=zy(`DialogOverlay.RemoveScroll`),Ax=M.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=xx(Ox,n);return(0,F.jsx)(dx,{as:Zse,allowPinchZoom:!0,shards:[i.contentRef],children:(0,F.jsx)(Gy.div,{"data-state":Hx(i.open),...r,ref:t,style:{pointerEvents:`auto`,...r.style}})})}),jx=`DialogContent`,Mx=M.forwardRef((e,t)=>{let n=Ex(jx,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=xx(jx,e.__scopeDialog);return(0,F.jsx)(ub,{present:r||a.open,children:a.modal?(0,F.jsx)(Nx,{...i,ref:t}):(0,F.jsx)(Px,{...i,ref:t})})});Mx.displayName=jx;var Nx=M.forwardRef((e,t)=>{let n=xx(jx,e.__scopeDialog),r=M.useRef(null),i=Iy(t,n.contentRef,r);return M.useEffect(()=>{let e=r.current;if(e)return _x(e)},[]),(0,F.jsx)(Fx,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:B(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:B(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:B(e.onFocusOutside,e=>e.preventDefault())})}),Px=M.forwardRef((e,t)=>{let n=xx(jx,e.__scopeDialog),r=M.useRef(!1),i=M.useRef(!1);return(0,F.jsx)(Fx,{...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()}})}),Fx=M.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=xx(jx,n),c=M.useRef(null),l=Iy(t,c);return Nb(),(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(wb,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,F.jsx)(vb,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":Hx(s.open),...o,ref:l,onDismiss:()=>s.onOpenChange(!1)})}),(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)($se,{titleId:s.titleId}),(0,F.jsx)(tce,{contentRef:c,descriptionId:s.descriptionId})]})]})}),Ix=`DialogTitle`,Lx=M.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=xx(Ix,n);return(0,F.jsx)(Gy.h2,{id:i.titleId,...r,ref:t})});Lx.displayName=Ix;var Rx=`DialogDescription`,zx=M.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=xx(Rx,n);return(0,F.jsx)(Gy.p,{id:i.descriptionId,...r,ref:t})});zx.displayName=Rx;var Bx=`DialogClose`,Vx=M.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=xx(Bx,n);return(0,F.jsx)(Gy.button,{type:`button`,...r,ref:t,onClick:B(e.onClick,()=>i.onOpenChange(!1))})});Vx.displayName=Bx;function Hx(e){return e?`open`:`closed`}var Ux=`DialogTitleWarning`,[Qse,Wx]=Voe(Ux,{contentName:jx,titleName:Ix,docsSlug:`dialog`}),$se=({titleId:e})=>{let t=Wx(Ux),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
120
|
+
|
|
121
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
122
|
+
|
|
123
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return M.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},ece=`DialogDescriptionWarning`,tce=({contentRef:e,descriptionId:t})=>{let n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Wx(ece).contentName}}.`;return M.useEffect(()=>{let r=e.current?.getAttribute(`aria-describedby`);t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},Gx=Sx,nce=wx,Kx=Dx,qx=kx,Jx=Mx,Yx=Lx,Xx=zx,Zx=Vx,Qx=`AlertDialog`,[rce,ice]=ob(Qx,[bx]),$x=bx(),eS=e=>{let{__scopeAlertDialog:t,...n}=e,r=$x(t);return(0,F.jsx)(Gx,{...r,...n,modal:!0})};eS.displayName=Qx;var ace=`AlertDialogTrigger`,oce=M.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=$x(n);return(0,F.jsx)(nce,{...i,...r,ref:t})});oce.displayName=ace;var sce=`AlertDialogPortal`,tS=e=>{let{__scopeAlertDialog:t,...n}=e,r=$x(t);return(0,F.jsx)(Kx,{...r,...n})};tS.displayName=sce;var cce=`AlertDialogOverlay`,nS=M.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=$x(n);return(0,F.jsx)(qx,{...i,...r,ref:t})});nS.displayName=cce;var rS=`AlertDialogContent`,[lce,uce]=rce(rS),dce=Hy(`AlertDialogContent`),iS=M.forwardRef((e,t)=>{let{__scopeAlertDialog:n,children:r,...i}=e,a=$x(n),o=M.useRef(null),s=Iy(t,o),c=M.useRef(null);return(0,F.jsx)(Qse,{contentName:rS,titleName:aS,docsSlug:`alert-dialog`,children:(0,F.jsx)(lce,{scope:n,cancelRef:c,children:(0,F.jsxs)(Jx,{role:`alertdialog`,...a,...i,ref:s,onOpenAutoFocus:B(i.onOpenAutoFocus,e=>{e.preventDefault(),c.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[(0,F.jsx)(dce,{children:r}),(0,F.jsx)(pce,{contentRef:o})]})})})});iS.displayName=rS;var aS=`AlertDialogTitle`,oS=M.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=$x(n);return(0,F.jsx)(Yx,{...i,...r,ref:t})});oS.displayName=aS;var sS=`AlertDialogDescription`,cS=M.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=$x(n);return(0,F.jsx)(Xx,{...i,...r,ref:t})});cS.displayName=sS;var fce=`AlertDialogAction`,lS=M.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=$x(n);return(0,F.jsx)(Zx,{...i,...r,ref:t})});lS.displayName=fce;var uS=`AlertDialogCancel`,dS=M.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=uce(uS,n),a=$x(n),o=Iy(t,i);return(0,F.jsx)(Zx,{...a,...r,ref:o})});dS.displayName=uS;var pce=({contentRef:e})=>{let t=`\`${rS}\` requires a description for the component to be accessible for screen reader users.
|
|
124
|
+
|
|
125
|
+
You can add a description to the \`${rS}\` by passing a \`${sS}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
126
|
+
|
|
127
|
+
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${rS}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
|
|
128
|
+
|
|
129
|
+
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return M.useEffect(()=>{document.getElementById(e.current?.getAttribute(`aria-describedby`))||console.warn(t)},[t,e]),null},mce=eS,hce=tS,gce=nS,_ce=iS,vce=lS,yce=dS,bce=oS,xce=cS;function fS(e){let t=M.useRef({value:e,previous:e});return M.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function pS(e){let[t,n]=M.useState(void 0);return cb(()=>{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)}else n(void 0)},[e]),t}var mS=`Checkbox`,[Sce,Cce]=ob(mS),[wce,hS]=Sce(mS);function Tce(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]=lb({prop:n,defaultProp:i??!1,onChange:c,caller:mS}),[m,h]=M.useState(null),[g,_]=M.useState(null),v=M.useRef(!1),y=m?!!o||!!m.closest(`form`):!0,b={checked:f,disabled:a,setChecked:p,control:m,setControl:h,name:s,form:o,value:u,hasConsumerStoppedPropagationRef:v,required:l,defaultChecked:CS(i)?!1:i,isFormControl:y,bubbleInput:g,setBubbleInput:_};return(0,F.jsx)(wce,{scope:t,...b,children:Ece(d)?d(b):r})}var gS=`CheckboxTrigger`,_S=M.forwardRef(({__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,isFormControl:p,bubbleInput:m}=hS(gS,e),h=Iy(i,u),g=M.useRef(c);return M.useEffect(()=>{let e=a?.form;if(e){let t=()=>d(g.current);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[a,d]),(0,F.jsx)(Gy.button,{type:`button`,role:`checkbox`,"aria-checked":CS(c)?`mixed`:c,"aria-required":l,"data-state":wS(c),"data-disabled":s?``:void 0,disabled:s,value:o,...r,ref:h,onKeyDown:B(t,e=>{e.key===`Enter`&&e.preventDefault()}),onClick:B(n,e=>{d(e=>CS(e)?!0:!e),m&&p&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})})});_S.displayName=gS;var vS=M.forwardRef((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,F.jsx)(Tce,{__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,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(_S,{...d,ref:t,__scopeCheckbox:n}),e&&(0,F.jsx)(SS,{__scopeCheckbox:n})]})})});vS.displayName=mS;var yS=`CheckboxIndicator`,bS=M.forwardRef((e,t)=>{let{__scopeCheckbox:n,forceMount:r,...i}=e,a=hS(yS,n);return(0,F.jsx)(ub,{present:r||CS(a.checked)||a.checked===!0,children:(0,F.jsx)(Gy.span,{"data-state":wS(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t,style:{pointerEvents:`none`,...e.style}})})});bS.displayName=yS;var xS=`CheckboxBubbleInput`,SS=M.forwardRef(({__scopeCheckbox:e,...t},n)=>{let{control:r,hasConsumerStoppedPropagationRef:i,checked:a,defaultChecked:o,required:s,disabled:c,name:l,value:u,form:d,bubbleInput:f,setBubbleInput:p}=hS(xS,e),m=Iy(n,p),h=fS(a),g=pS(r);M.useEffect(()=>{let e=f;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=!i.current;if(h!==a&&n){let t=new Event(`click`,{bubbles:r});e.indeterminate=CS(a),n.call(e,CS(a)?!1:a),e.dispatchEvent(t)}},[f,h,a,i]);let _=M.useRef(CS(a)?!1:a);return(0,F.jsx)(Gy.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:o??_.current,required:s,disabled:c,name:l,value:u,form:d,...t,tabIndex:-1,ref:m,style:{...t.style,...g,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})});SS.displayName=xS;function Ece(e){return typeof e==`function`}function CS(e){return e===`indeterminate`}function wS(e){return CS(e)?`indeterminate`:e?`checked`:`unchecked`}var Dce=[`top`,`right`,`bottom`,`left`],TS=Math.min,ES=Math.max,DS=Math.round,OS=Math.floor,kS=e=>({x:e,y:e}),AS={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function jS(e,t,n){return ES(e,TS(t,n))}function MS(e,t){return typeof e==`function`?e(t):e}function NS(e){return e.split(`-`)[0]}function PS(e){return e.split(`-`)[1]}function FS(e){return e===`x`?`y`:`x`}function IS(e){return e===`y`?`height`:`width`}function LS(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function RS(e){return FS(LS(e))}function zS(e,t,n){n===void 0&&(n=!1);let r=PS(e),i=RS(e),a=IS(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=WS(o)),[o,WS(o)]}function BS(e){let t=WS(e);return[VS(e),t,VS(t)]}function VS(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var HS=[`left`,`right`],US=[`right`,`left`],Oce=[`top`,`bottom`],kce=[`bottom`,`top`];function Ace(e,t,n){switch(e){case`top`:case`bottom`:return n?t?US:HS:t?HS:US;case`left`:case`right`:return t?Oce:kce;default:return[]}}function jce(e,t,n,r){let i=PS(e),a=Ace(NS(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(VS)))),a}function WS(e){let t=NS(e);return AS[t]+e.slice(t.length)}function Mce(e){return{top:0,right:0,bottom:0,left:0,...e}}function GS(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Mce(e)}function KS(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function qS(e,t,n){let{reference:r,floating:i}=e,a=LS(t),o=RS(t),s=IS(o),c=NS(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(PS(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function Nce(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=MS(t,e),p=GS(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=KS(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=KS(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Pce=50,Fce=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Nce},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=qS(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Pce&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=qS(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Ice=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=MS(e,t)||{};if(l==null)return{};let d=GS(u),f={x:n,y:r},p=RS(i),m=IS(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=TS(d[_],T),D=TS(d[v],T),O=E,ee=C-h[m]-D,te=C/2-h[m]/2+w,k=jS(O,te,ee),A=!c.arrow&&PS(i)!=null&&te!==k&&a.reference[m]/2-(te<O?E:D)-h[m]/2<0,ne=A?te<O?te-O:te-ee:0;return{[p]:f[p]+ne,data:{[p]:k,centerOffset:te-k-ne,...A&&{alignmentOffset:ne}},reset:A}}}),Lce=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=MS(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=NS(r),_=LS(o),v=NS(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[WS(o)]:BS(o)),x=p!==`none`;!d&&x&&b.push(...jce(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=zS(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==LS(t))||T.every(e=>LS(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=LS(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function JS(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function YS(e){return Dce.some(t=>e[t]>=0)}var Rce=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=MS(e,t);switch(i){case`referenceHidden`:{let e=JS(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:YS(e)}}}case`escaped`:{let e=JS(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:YS(e)}}}default:return{}}}}},XS=new Set([`left`,`top`]);async function zce(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=NS(n),s=PS(n),c=LS(n)===`y`,l=XS.has(o)?-1:1,u=a&&c?-1:1,d=MS(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Bce=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await zce(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Vce=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=MS(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=LS(NS(i)),p=FS(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=jS(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=jS(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},Hce=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=MS(e,t),u={x:n,y:r},d=LS(i),f=FS(d),p=u[f],m=u[d],h=MS(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=XS.has(NS(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Uce=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=MS(e,t),u=await o.detectOverflow(t,l),d=NS(i),f=PS(i),p=LS(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=TS(h-u[g],v),x=TS(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=ES(u.left,0),t=ES(u.right,0),n=ES(u.top,0),r=ES(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:ES(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:ES(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function ZS(){return typeof window<`u`}function QS(e){return tC(e)?(e.nodeName||``).toLowerCase():`#document`}function $S(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function eC(e){return((tC(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function tC(e){return ZS()?e instanceof Node||e instanceof $S(e).Node:!1}function nC(e){return ZS()?e instanceof Element||e instanceof $S(e).Element:!1}function rC(e){return ZS()?e instanceof HTMLElement||e instanceof $S(e).HTMLElement:!1}function iC(e){return!ZS()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof $S(e).ShadowRoot}function aC(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=fC(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Wce(e){return/^(table|td|th)$/.test(QS(e))}function oC(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Gce=/transform|translate|scale|rotate|perspective|filter/,Kce=/paint|layout|strict|content/,sC=e=>!!e&&e!==`none`,cC;function lC(e){let t=nC(e)?fC(e):e;return sC(t.transform)||sC(t.translate)||sC(t.scale)||sC(t.rotate)||sC(t.perspective)||!uC()&&(sC(t.backdropFilter)||sC(t.filter))||Gce.test(t.willChange||``)||Kce.test(t.contain||``)}function qce(e){let t=mC(e);for(;rC(t)&&!dC(t);){if(lC(t))return t;if(oC(t))return null;t=mC(t)}return null}function uC(){return cC??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),cC}function dC(e){return/^(html|body|#document)$/.test(QS(e))}function fC(e){return $S(e).getComputedStyle(e)}function pC(e){return nC(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function mC(e){if(QS(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||iC(e)&&e.host||eC(e);return iC(t)?t.host:t}function hC(e){let t=mC(e);return dC(t)?e.ownerDocument?e.ownerDocument.body:e.body:rC(t)&&aC(t)?t:hC(t)}function gC(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=hC(e),i=r===e.ownerDocument?.body,a=$S(r);if(i){let e=_C(a);return t.concat(a,a.visualViewport||[],aC(r)?r:[],e&&n?gC(e):[])}else return t.concat(r,gC(r,[],n))}function _C(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function vC(e){let t=fC(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=rC(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=DS(n)!==a||DS(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function yC(e){return nC(e)?e:e.contextElement}function bC(e){let t=yC(e);if(!rC(t))return kS(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=vC(t),o=(a?DS(n.width):n.width)/r,s=(a?DS(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Jce=kS(0);function xC(e){let t=$S(e);return!uC()||!t.visualViewport?Jce:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Yce(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==$S(e)?!1:t}function SC(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=yC(e),o=kS(1);t&&(r?nC(r)&&(o=bC(r)):o=bC(e));let s=Yce(a,n,r)?xC(a):kS(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=$S(a),t=r&&nC(r)?$S(r):r,n=e,i=_C(n);for(;i&&r&&t!==n;){let e=bC(i),t=i.getBoundingClientRect(),r=fC(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=$S(i),i=_C(n)}}return KS({width:u,height:d,x:c,y:l})}function CC(e,t){let n=pC(e).scrollLeft;return t?t.left+n:SC(eC(e)).left+n}function wC(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-CC(e,n),y:n.top+t.scrollTop}}function Xce(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=eC(r),s=t?oC(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=kS(1),u=kS(0),d=rC(r);if((d||!d&&!a)&&((QS(r)!==`body`||aC(o))&&(c=pC(r)),d)){let e=SC(r);l=bC(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?wC(o,c):kS(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Zce(e){return Array.from(e.getClientRects())}function Qce(e){let t=eC(e),n=pC(e),r=e.ownerDocument.body,i=ES(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=ES(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+CC(e),s=-n.scrollTop;return fC(r).direction===`rtl`&&(o+=ES(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var TC=25;function $ce(e,t){let n=$S(e),r=eC(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=uC();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=CC(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=TC&&(a-=o)}else l<=TC&&(a+=l);return{width:a,height:o,x:s,y:c}}function ele(e,t){let n=SC(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=rC(e)?bC(e):kS(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function EC(e,t,n){let r;if(t===`viewport`)r=$ce(e,n);else if(t===`document`)r=Qce(eC(e));else if(nC(t))r=ele(t,n);else{let n=xC(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return KS(r)}function DC(e,t){let n=mC(e);return n===t||!nC(n)||dC(n)?!1:fC(n).position===`fixed`||DC(n,t)}function tle(e,t){let n=t.get(e);if(n)return n;let r=gC(e,[],!1).filter(e=>nC(e)&&QS(e)!==`body`),i=null,a=fC(e).position===`fixed`,o=a?mC(e):e;for(;nC(o)&&!dC(o);){let t=fC(o),n=lC(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||aC(o)&&!n&&DC(e,o))?r=r.filter(e=>e!==o):i=t,o=mC(o)}return t.set(e,r),r}function nle(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?oC(t)?[]:tle(t,this._c):[].concat(n),r],o=EC(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=EC(t,a[e],i);s=ES(n.top,s),c=TS(n.right,c),l=TS(n.bottom,l),u=ES(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function rle(e){let{width:t,height:n}=vC(e);return{width:t,height:n}}function ile(e,t,n){let r=rC(t),i=eC(t),a=n===`fixed`,o=SC(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=kS(0);function l(){c.x=CC(i)}if(r||!r&&!a)if((QS(t)!==`body`||aC(i))&&(s=pC(t)),r){let e=SC(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?wC(i,s):kS(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function OC(e){return fC(e).position===`static`}function kC(e,t){if(!rC(e)||fC(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return eC(e)===n&&(n=n.ownerDocument.body),n}function AC(e,t){let n=$S(e);if(oC(e))return n;if(!rC(e)){let t=mC(e);for(;t&&!dC(t);){if(nC(t)&&!OC(t))return t;t=mC(t)}return n}let r=kC(e,t);for(;r&&Wce(r)&&OC(r);)r=kC(r,t);return r&&dC(r)&&OC(r)&&!lC(r)?n:r||qce(e)||n}var ale=async function(e){let t=this.getOffsetParent||AC,n=this.getDimensions,r=await n(e.floating);return{reference:ile(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function ole(e){return fC(e).direction===`rtl`}var sle={convertOffsetParentRelativeRectToViewportRelativeRect:Xce,getDocumentElement:eC,getClippingRect:nle,getOffsetParent:AC,getElementRects:ale,getClientRects:Zce,getDimensions:rle,getScale:bC,isElement:nC,isRTL:ole};function jC(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function cle(e,t){let n=null,r,i=eC(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=OS(d),h=OS(i.clientWidth-(u+f)),g=OS(i.clientHeight-(d+p)),_=OS(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:ES(0,TS(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!jC(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function lle(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=yC(e),u=i||a?[...l?gC(l):[],...t?gC(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?cle(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?SC(e):null;c&&g();function g(){let t=SC(e);h&&!jC(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var ule=Bce,dle=Vce,fle=Lce,ple=Uce,mle=Rce,MC=Ice,hle=Hce,gle=(e,t,n)=>{let r=new Map,i={platform:sle,...n},a={...i.platform,_c:r};return Fce(e,t,{...i,platform:a})},NC=typeof document<`u`?M.useLayoutEffect:function(){};function PC(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!PC(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!PC(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function FC(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function IC(e,t){let n=FC(e);return Math.round(t*n)/n}function LC(e){let t=M.useRef(e);return NC(()=>{t.current=e}),t}function _le(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=M.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=M.useState(r);PC(f,r)||p(r);let[m,h]=M.useState(null),[g,_]=M.useState(null),v=M.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=M.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=M.useRef(null),C=M.useRef(null),w=M.useRef(u),T=c!=null,E=LC(c),D=LC(i),O=LC(l),ee=M.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),gle(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};te.current&&!PC(w.current,t)&&(w.current=t,us.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);NC(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let te=M.useRef(!1);NC(()=>(te.current=!0,()=>{te.current=!1}),[]),NC(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,ee);ee()}},[b,x,ee,E,T]);let k=M.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),A=M.useMemo(()=>({reference:b,floating:x}),[b,x]),ne=M.useMemo(()=>{let e={position:n,left:0,top:0};if(!A.floating)return e;let t=IC(A.floating,u.x),r=IC(A.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...FC(A.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,A.floating,u.x,u.y]);return M.useMemo(()=>({...u,update:ee,refs:k,elements:A,floatingStyles:ne}),[u,ee,k,A,ne])}var vle=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:MC({element:r.current,padding:i}).fn(n):r?MC({element:r,padding:i}).fn(n):{}}}},yle=(e,t)=>{let n=ule(e);return{name:n.name,fn:n.fn,options:[e,t]}},ble=(e,t)=>{let n=dle(e);return{name:n.name,fn:n.fn,options:[e,t]}},xle=(e,t)=>({fn:hle(e).fn,options:[e,t]}),Sle=(e,t)=>{let n=fle(e);return{name:n.name,fn:n.fn,options:[e,t]}},Cle=(e,t)=>{let n=ple(e);return{name:n.name,fn:n.fn,options:[e,t]}},wle=(e,t)=>{let n=mle(e);return{name:n.name,fn:n.fn,options:[e,t]}},Tle=(e,t)=>{let n=vle(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ele=`Arrow`,RC=M.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,F.jsx)(Gy.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,F.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});RC.displayName=Ele;var Dle=RC,zC=`Popper`,[BC,VC]=ob(zC),[Ole,HC]=BC(zC),UC=e=>{let{__scopePopper:t,children:n}=e,[r,i]=M.useState(null),[a,o]=M.useState(void 0);return(0,F.jsx)(Ole,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})};UC.displayName=zC;var WC=`PopperAnchor`,GC=M.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=HC(WC,n),o=M.useRef(null),s=a.onAnchorChange,c=Iy(t,M.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=M.useRef(null);M.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&XC(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,F.jsx)(Gy.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})});GC.displayName=WC;var KC=`PopperContent`,[kle,Ale]=BC(KC),qC=M.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l,collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=HC(KC,n),[_,v]=M.useState(null),y=Iy(t,e=>v(e)),[b,x]=M.useState(null),S=pS(b),C=S?.width??0,w=S?.height??0,T=r+(a===`center`?``:`-`+a),E=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},D=l?Array.isArray(l)?l:[l]:void 0,O=D!==void 0&&D.length>0,ee={padding:E,boundary:D?.filter(Mle),altBoundary:O},{refs:te,floatingStyles:k,placement:A,isPositioned:ne,middlewareData:re}=_le({strategy:`fixed`,placement:T,whileElementsMounted:(...e)=>lle(...e,{animationFrame:p===`always`}),elements:{reference:g.anchor},middleware:[yle({mainAxis:i+w,alignmentAxis:o}),c&&ble({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?xle():void 0,...ee}),c&&Sle({...ee}),Cle({...ee,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),b&&Tle({element:b,padding:s}),Nle({arrowWidth:C,arrowHeight:w}),f&&wle({strategy:`referenceHidden`,...ee})]}),ie=g.setPlacementState;cb(()=>(ie(A),()=>{ie(void 0)}),[A,ie]);let[j,ae]=XC(A),oe=Zy(m);cb(()=>{ne&&oe?.()},[ne,oe]);let se=re.arrow?.x,ce=re.arrow?.y,le=re.arrow?.centerOffset!==0,[ue,de]=M.useState();return cb(()=>{_&&de(window.getComputedStyle(_).zIndex)},[_]),(0,F.jsx)(`div`,{ref:te.setFloating,"data-radix-popper-content-wrapper":``,style:{...k,transform:ne?k.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:ue,"--radix-popper-transform-origin":[re.transformOrigin?.x,re.transformOrigin?.y].join(` `),...re.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,F.jsx)(kle,{scope:n,placedSide:j,placedAlign:ae,onArrowChange:x,arrowX:se,arrowY:ce,shouldHideArrow:le,children:(0,F.jsx)(Gy.div,{"data-side":j,"data-align":ae,...h,ref:y,style:{...h.style,animation:ne?void 0:`none`}})})})});qC.displayName=KC;var JC=`PopperArrow`,jle={top:`bottom`,right:`left`,bottom:`top`,left:`right`},YC=M.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=Ale(JC,n),a=jle[i.placedSide];return(0,F.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,F.jsx)(Dle,{...r,ref:t,style:{...r.style,display:`block`}})})});YC.displayName=JC;function Mle(e){return e!==null}var Nle=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=XC(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function XC(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var ZC=UC,QC=GC,$C=qC,ew=YC,tw=`rovingFocusGroup.onEntryFocus`,Ple={bubbles:!1,cancelable:!0},nw=`RovingFocusGroup`,[rw,iw,Fle]=sb(nw),[Ile,aw]=ob(nw,[Fle]),[Lle,Rle]=Ile(nw),ow=M.forwardRef((e,t)=>(0,F.jsx)(rw.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,F.jsx)(rw.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,F.jsx)(zle,{...e,ref:t})})}));ow.displayName=nw;var zle=M.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=M.useRef(null),p=Iy(t,f),m=mb(a),[h,g]=lb({prop:o,defaultProp:s??null,onChange:c,caller:nw}),[_,v]=M.useState(!1),y=Zy(l),b=iw(n),x=M.useRef(!1),[S,C]=M.useState(0);return M.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(tw,y),()=>e.removeEventListener(tw,y)},[y]),(0,F.jsx)(Lle,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:M.useCallback(e=>g(e),[g]),onItemShiftTab:M.useCallback(()=>v(!0),[]),onFocusableItemAdd:M.useCallback(()=>C(e=>e+1),[]),onFocusableItemRemove:M.useCallback(()=>C(e=>e-1),[]),children:(0,F.jsx)(Gy.div,{tabIndex:_||S===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:B(e.onMouseDown,()=>{x.current=!0}),onFocus:B(e.onFocus,e=>{let t=!x.current;if(e.target===e.currentTarget&&t&&!_){let t=new CustomEvent(tw,Ple);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=b().filter(e=>e.focusable);lw([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}x.current=!1}),onBlur:B(e.onBlur,()=>v(!1))})})}),sw=`RovingFocusGroupItem`,cw=M.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=pb(),l=a||c,u=Rle(sw,n),d=u.currentTabStopId===l,f=iw(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u;return M.useEffect(()=>{if(r)return p(),()=>m()},[r,p,m]),(0,F.jsx)(rw.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,F.jsx)(Gy.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:B(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:B(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:B(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=Hle(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?Ule(n,r+1):n.slice(r+1)}setTimeout(()=>lw(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})});cw.displayName=sw;var Ble={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function Vle(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function Hle(e,t,n){let r=Vle(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return Ble[r]}function lw(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Ule(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var uw=ow,dw=cw,fw=[`Enter`,` `],Wle=[`ArrowDown`,`PageUp`,`Home`],pw=[`ArrowUp`,`PageDown`,`End`],Gle=[...Wle,...pw],Kle={ltr:[...fw,`ArrowRight`],rtl:[...fw,`ArrowLeft`]},qle={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},mw=`Menu`,[hw,Jle,Yle]=sb(mw),[gw,_w]=ob(mw,[Yle,VC,aw]),vw=VC(),yw=aw(),[bw,xw]=gw(mw),[Xle,Sw]=gw(mw),Cw=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=vw(t),[c,l]=M.useState(null),u=M.useRef(!1),d=Zy(a),f=mb(i);return M.useEffect(()=>{let e=()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},t=()=>u.current=!1;return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),(0,F.jsx)(ZC,{...s,children:(0,F.jsx)(bw,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,F.jsx)(Xle,{scope:t,onClose:M.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})};Cw.displayName=mw;var Zle=`MenuAnchor`,ww=M.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=vw(n);return(0,F.jsx)(QC,{...i,...r,ref:t})});ww.displayName=Zle;var Tw=`MenuPortal`,[Qle,Ew]=gw(Tw,{forceMount:void 0}),Dw=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=xw(Tw,t);return(0,F.jsx)(Qle,{scope:t,forceMount:n,children:(0,F.jsx)(ub,{present:n||a.open,children:(0,F.jsx)(Ab,{asChild:!0,container:i,children:r})})})};Dw.displayName=Tw;var Ow=`MenuContent`,[$le,kw]=gw(Ow),Aw=M.forwardRef((e,t)=>{let n=Ew(Ow,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=xw(Ow,e.__scopeMenu),o=Sw(Ow,e.__scopeMenu);return(0,F.jsx)(hw.Provider,{scope:e.__scopeMenu,children:(0,F.jsx)(ub,{present:r||a.open,children:(0,F.jsx)(hw.Slot,{scope:e.__scopeMenu,children:o.modal?(0,F.jsx)(eue,{...i,ref:t}):(0,F.jsx)(tue,{...i,ref:t})})})})}),eue=M.forwardRef((e,t)=>{let n=xw(Ow,e.__scopeMenu),r=M.useRef(null),i=Iy(t,r);return M.useEffect(()=>{let e=r.current;if(e)return _x(e)},[]),(0,F.jsx)(jw,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:B(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),tue=M.forwardRef((e,t)=>{let n=xw(Ow,e.__scopeMenu);return(0,F.jsx)(jw,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),nue=zy(`MenuContent.ScrollLock`),jw=M.forwardRef((e,t)=>{let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...h}=e,g=xw(Ow,n),_=Sw(Ow,n),v=vw(n),y=yw(n),b=Jle(n),[x,S]=M.useState(null),C=M.useRef(null),w=Iy(t,C,g.onContentChange),T=M.useRef(0),E=M.useRef(``),D=M.useRef(0),O=M.useRef(null),ee=M.useRef(`right`),te=M.useRef(0),k=m?dx:M.Fragment,A=m?{as:nue,allowPinchZoom:!0}:void 0,ne=e=>{let t=E.current+e,n=b().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=lue(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){E.current=t,window.clearTimeout(T.current),t!==``&&(T.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};M.useEffect(()=>()=>window.clearTimeout(T.current),[]),Nb();let re=M.useCallback(e=>ee.current===O.current?.side&&due(e,O.current?.area),[]);return(0,F.jsx)($le,{scope:n,searchRef:E,onItemEnter:M.useCallback(e=>{re(e)&&e.preventDefault()},[re]),onItemLeave:M.useCallback(e=>{re(e)||(C.current?.focus(),S(null))},[re]),onTriggerLeave:M.useCallback(e=>{re(e)&&e.preventDefault()},[re]),pointerGraceTimerRef:D,onPointerGraceIntentChange:M.useCallback(e=>{O.current=e},[]),children:(0,F.jsx)(k,{...A,children:(0,F.jsx)(wb,{asChild:!0,trapped:i,onMountAutoFocus:B(a,e=>{e.preventDefault(),C.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,F.jsx)(vb,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,F.jsx)(uw,{asChild:!0,...y,dir:_.dir,orientation:`vertical`,loop:r,currentTabStopId:x,onCurrentTabStopIdChange:S,onEntryFocus:B(c,e=>{_.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,F.jsx)($C,{role:`menu`,"aria-orientation":`vertical`,"data-state":oT(g.open),"data-radix-menu-content":``,dir:_.dir,...v,...h,ref:w,style:{outline:`none`,...h.style},onKeyDown:B(h.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&ne(e.key));let i=C.current;if(e.target!==i||!Gle.includes(e.key))return;e.preventDefault();let a=b().filter(e=>!e.disabled).map(e=>e.ref.current);pw.includes(e.key)&&a.reverse(),sue(a)}),onBlur:B(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(T.current),E.current=``)}),onPointerMove:B(e.onPointerMove,lT(e=>{let t=e.target,n=te.current!==e.clientX;e.currentTarget.contains(t)&&n&&(ee.current=e.clientX>te.current?`right`:`left`,te.current=e.clientX)}))})})})})})})});Aw.displayName=Ow;var rue=`MenuGroup`,Mw=M.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,F.jsx)(Gy.div,{role:`group`,...r,ref:t})});Mw.displayName=rue;var iue=`MenuLabel`,Nw=M.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,F.jsx)(Gy.div,{...r,ref:t})});Nw.displayName=iue;var Pw=`MenuItem`,Fw=`menu.itemSelect`,Iw=M.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:r,...i}=e,a=M.useRef(null),o=Sw(Pw,e.__scopeMenu),s=kw(Pw,e.__scopeMenu),c=Iy(t,a),l=M.useRef(!1),u=()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(Fw,{bubbles:!0,cancelable:!0});e.addEventListener(Fw,e=>r?.(e),{once:!0}),Ky(e,t),t.defaultPrevented?l.current=!1:o.onClose()}};return(0,F.jsx)(Lw,{...i,ref:c,disabled:n,onClick:B(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:B(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:B(e.onKeyDown,e=>{let t=s.searchRef.current!==``;n||t&&e.key===` `||fw.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});Iw.displayName=Pw;var Lw=M.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=kw(Pw,n),s=yw(n),c=M.useRef(null),l=Iy(t,c),[u,d]=M.useState(!1),[f,p]=M.useState(``);return M.useEffect(()=>{let e=c.current;e&&p((e.textContent??``).trim())},[a.children]),(0,F.jsx)(hw.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:(0,F.jsx)(dw,{asChild:!0,...s,focusable:!r,children:(0,F.jsx)(Gy.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:B(e.onPointerMove,lT(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:B(e.onPointerLeave,lT(e=>o.onItemLeave(e))),onFocus:B(e.onFocus,()=>d(!0)),onBlur:B(e.onBlur,()=>d(!1))})})})}),Rw=`MenuCheckboxItem`,zw=M.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,F.jsx)(qw,{scope:e.__scopeMenu,checked:n,children:(0,F.jsx)(Iw,{role:`menuitemcheckbox`,"aria-checked":sT(n)?`mixed`:n,...i,ref:t,"data-state":cT(n),onSelect:B(i.onSelect,()=>r?.(sT(n)?!0:!n),{checkForDefaultPrevented:!1})})})});zw.displayName=Rw;var Bw=`MenuRadioGroup`,[Vw,Hw]=gw(Bw,{value:void 0,onValueChange:()=>{}}),Uw=M.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=Zy(r);return(0,F.jsx)(Vw,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,F.jsx)(Mw,{...i,ref:t})})});Uw.displayName=Bw;var Ww=`MenuRadioItem`,Gw=M.forwardRef((e,t)=>{let{value:n,...r}=e,i=Hw(Ww,e.__scopeMenu),a=n===i.value;return(0,F.jsx)(qw,{scope:e.__scopeMenu,checked:a,children:(0,F.jsx)(Iw,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":cT(a),onSelect:B(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});Gw.displayName=Ww;var Kw=`MenuItemIndicator`,[qw,Jw]=gw(Kw,{checked:!1}),Yw=M.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=Jw(Kw,n);return(0,F.jsx)(ub,{present:r||sT(a.checked)||a.checked===!0,children:(0,F.jsx)(Gy.span,{...i,ref:t,"data-state":cT(a.checked)})})});Yw.displayName=Kw;var Xw=`MenuSeparator`,Zw=M.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,F.jsx)(Gy.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});Zw.displayName=Xw;var Qw=`MenuArrow`,$w=M.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=vw(n);return(0,F.jsx)(ew,{...i,...r,ref:t})});$w.displayName=Qw;var eT=`MenuSub`,[aue,tT]=gw(eT),oue=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=xw(eT,t),o=vw(t),[s,c]=M.useState(null),[l,u]=M.useState(null),d=Zy(i);return M.useEffect(()=>(a.open===!1&&d(!1),()=>d(!1)),[a.open,d]),(0,F.jsx)(ZC,{...o,children:(0,F.jsx)(bw,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:u,children:(0,F.jsx)(aue,{scope:t,contentId:pb(),triggerId:pb(),trigger:s,onTriggerChange:c,children:n})})})};oue.displayName=eT;var nT=`MenuSubTrigger`,rT=M.forwardRef((e,t)=>{let n=xw(nT,e.__scopeMenu),r=Sw(nT,e.__scopeMenu),i=tT(nT,e.__scopeMenu),a=kw(nT,e.__scopeMenu),o=M.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,l={__scopeMenu:e.__scopeMenu},u=M.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return M.useEffect(()=>u,[u]),M.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]),(0,F.jsx)(ww,{asChild:!0,...l,children:(0,F.jsx)(Lw,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":n.open?i.contentId:void 0,"data-state":oT(n.open),...e,ref:Fy(t,i.onTriggerChange),onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:B(e.onPointerMove,lT(t=>{a.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:B(e.onPointerLeave,lT(e=>{u();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,o=i?-5:5,c=t[i?`left`:`right`],l=t[i?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:c,y:t.bottom}],side:r}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:B(e.onKeyDown,t=>{let i=a.searchRef.current!==``;e.disabled||i&&t.key===` `||Kle[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});rT.displayName=nT;var iT=`MenuSubContent`,aT=M.forwardRef((e,t)=>{let n=Ew(Ow,e.__scopeMenu),{forceMount:r=n.forceMount,align:i=`start`,...a}=e,o=xw(Ow,e.__scopeMenu),s=Sw(Ow,e.__scopeMenu),c=tT(iT,e.__scopeMenu),l=M.useRef(null),u=Iy(t,l);return(0,F.jsx)(hw.Provider,{scope:e.__scopeMenu,children:(0,F.jsx)(ub,{present:r||o.open,children:(0,F.jsx)(hw.Slot,{scope:e.__scopeMenu,children:(0,F.jsx)(jw,{id:c.contentId,"aria-labelledby":c.triggerId,...a,ref:u,align:i,side:s.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{s.isUsingKeyboardRef.current&&l.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:B(e.onFocusOutside,e=>{e.target!==c.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:B(e.onEscapeKeyDown,e=>{s.onClose(),e.preventDefault()}),onKeyDown:B(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=qle[s.dir].includes(e.key);t&&n&&(o.onOpenChange(!1),c.trigger?.focus(),e.preventDefault())})})})})})});aT.displayName=iT;function oT(e){return e?`open`:`closed`}function sT(e){return e===`indeterminate`}function cT(e){return sT(e)?`indeterminate`:e?`checked`:`unchecked`}function sue(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function cue(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function lue(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=cue(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function uue(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function due(e,t){return t?uue({x:e.clientX,y:e.clientY},t):!1}function lT(e){return t=>t.pointerType===`mouse`?e(t):void 0}var fue=Cw,pue=ww,mue=Dw,hue=Aw,gue=Mw,_ue=Nw,vue=Iw,yue=zw,bue=Uw,xue=Gw,Sue=Yw,Cue=Zw,wue=$w,Tue=rT,Eue=aT,uT=`DropdownMenu`,[Due,Oue]=ob(uT,[_w]),dT=_w(),[kue,fT]=Due(uT),pT=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=dT(t),l=M.useRef(null),[u,d]=lb({prop:i,defaultProp:a??!1,onChange:o,caller:uT});return(0,F.jsx)(kue,{scope:t,triggerId:pb(),triggerRef:l,contentId:pb(),open:u,onOpenChange:d,onOpenToggle:M.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,F.jsx)(fue,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})};pT.displayName=uT;var mT=`DropdownMenuTrigger`,hT=M.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=fT(mT,n),o=dT(n);return(0,F.jsx)(pue,{asChild:!0,...o,children:(0,F.jsx)(Gy.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:Fy(t,a.triggerRef),onPointerDown:B(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:B(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})});hT.displayName=mT;var Aue=`DropdownMenuPortal`,gT=e=>{let{__scopeDropdownMenu:t,...n}=e,r=dT(t);return(0,F.jsx)(mue,{...r,...n})};gT.displayName=Aue;var _T=`DropdownMenuContent`,vT=M.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=fT(_T,n),a=dT(n),o=M.useRef(!1);return(0,F.jsx)(hue,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:B(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:B(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});vT.displayName=_T;var jue=`DropdownMenuGroup`,Mue=M.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=dT(n);return(0,F.jsx)(gue,{...i,...r,ref:t})});Mue.displayName=jue;var Nue=`DropdownMenuLabel`,yT=M.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=dT(n);return(0,F.jsx)(_ue,{...i,...r,ref:t})});yT.displayName=Nue;var Pue=`DropdownMenuItem`,bT=M.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=dT(n);return(0,F.jsx)(vue,{...i,...r,ref:t})});bT.displayName=Pue;var Fue=`DropdownMenuCheckboxItem`,Iue=M.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=dT(n);return(0,F.jsx)(yue,{...i,...r,ref:t})});Iue.displayName=Fue;var Lue=`DropdownMenuRadioGroup`,xT=M.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=dT(n);return(0,F.jsx)(bue,{...i,...r,ref:t})});xT.displayName=Lue;var Rue=`DropdownMenuRadioItem`,ST=M.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=dT(n);return(0,F.jsx)(xue,{...i,...r,ref:t})});ST.displayName=Rue;var zue=`DropdownMenuItemIndicator`,CT=M.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=dT(n);return(0,F.jsx)(Sue,{...i,...r,ref:t})});CT.displayName=zue;var Bue=`DropdownMenuSeparator`,wT=M.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=dT(n);return(0,F.jsx)(Cue,{...i,...r,ref:t})});wT.displayName=Bue;var Vue=`DropdownMenuArrow`,Hue=M.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=dT(n);return(0,F.jsx)(wue,{...i,...r,ref:t})});Hue.displayName=Vue;var Uue=`DropdownMenuSubTrigger`,Wue=M.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=dT(n);return(0,F.jsx)(Tue,{...i,...r,ref:t})});Wue.displayName=Uue;var Gue=`DropdownMenuSubContent`,Kue=M.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=dT(n);return(0,F.jsx)(Eue,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});Kue.displayName=Gue;var que=pT,Jue=hT,Yue=gT,Xue=vT,Zue=yT,Que=bT,$ue=xT,ede=ST,tde=CT,nde=wT;function TT(e,[t,n]){return Math.min(n,Math.max(t,e))}var ET=`Popover`,[DT,rde]=ob(ET,[VC]),OT=VC(),[ide,kT]=DT(ET),AT=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=OT(t),c=M.useRef(null),[l,u]=M.useState(!1),[d,f]=lb({prop:r,defaultProp:i??!1,onChange:a,caller:ET});return(0,F.jsx)(ZC,{...s,children:(0,F.jsx)(ide,{scope:t,contentId:pb(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:M.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:M.useCallback(()=>u(!0),[]),onCustomAnchorRemove:M.useCallback(()=>u(!1),[]),modal:o,children:n})})};AT.displayName=ET;var jT=`PopoverAnchor`,ade=M.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=kT(jT,n),a=OT(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return M.useEffect(()=>(o(),()=>s()),[o,s]),(0,F.jsx)(QC,{...a,...r,ref:t})});ade.displayName=jT;var MT=`PopoverTrigger`,NT=M.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=kT(MT,n),a=OT(n),o=Iy(t,i.triggerRef),s=(0,F.jsx)(Gy.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":BT(i.open),...r,ref:o,onClick:B(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,F.jsx)(QC,{asChild:!0,...a,children:s})});NT.displayName=MT;var PT=`PopoverPortal`,[ode,sde]=DT(PT,{forceMount:void 0}),FT=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=kT(PT,t);return(0,F.jsx)(ode,{scope:t,forceMount:n,children:(0,F.jsx)(ub,{present:n||a.open,children:(0,F.jsx)(Ab,{asChild:!0,container:i,children:r})})})};FT.displayName=PT;var IT=`PopoverContent`,LT=M.forwardRef((e,t)=>{let n=sde(IT,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=kT(IT,e.__scopePopover);return(0,F.jsx)(ub,{present:r||a.open,children:a.modal?(0,F.jsx)(lde,{...i,ref:t}):(0,F.jsx)(ude,{...i,ref:t})})});LT.displayName=IT;var cde=zy(`PopoverContent.RemoveScroll`),lde=M.forwardRef((e,t)=>{let n=kT(IT,e.__scopePopover),r=M.useRef(null),i=Iy(t,r),a=M.useRef(!1);return M.useEffect(()=>{let e=r.current;if(e)return _x(e)},[]),(0,F.jsx)(dx,{as:cde,allowPinchZoom:!0,children:(0,F.jsx)(RT,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:B(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:B(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;a.current=t.button===2||n},{checkForDefaultPrevented:!1}),onFocusOutside:B(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),ude=M.forwardRef((e,t)=>{let n=kT(IT,e.__scopePopover),r=M.useRef(!1),i=M.useRef(!1);return(0,F.jsx)(RT,{...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()}})}),RT=M.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=kT(IT,n),p=OT(n);return Nb(),(0,F.jsx)(wb,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,F.jsx)(vb,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),children:(0,F.jsx)($C,{"data-state":BT(f.open),role:`dialog`,id:f.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})}),zT=`PopoverClose`,dde=M.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=kT(zT,n);return(0,F.jsx)(Gy.button,{type:`button`,...r,ref:t,onClick:B(e.onClick,()=>i.onOpenChange(!1))})});dde.displayName=zT;var fde=`PopoverArrow`,pde=M.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=OT(n);return(0,F.jsx)(ew,{...i,...r,ref:t})});pde.displayName=fde;function BT(e){return e?`open`:`closed`}var VT=AT,HT=NT,UT=FT,WT=LT,mde=[` `,`Enter`,`ArrowUp`,`ArrowDown`],hde=[` `,`Enter`],GT=`Select`,[KT,qT,gde]=sb(GT),[JT,_de]=ob(GT,[gde,VC]),YT=VC(),[vde,XT]=JT(GT),[yde,bde]=JT(GT),xde=`SelectProvider`;function ZT(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:f,required:p,form:m,internal_do_not_use_render:h}=e,g=YT(t),[_,v]=M.useState(null),[y,b]=M.useState(null),[x,S]=M.useState(!1),C=mb(l),[w,T]=lb({prop:r,defaultProp:i??!1,onChange:a,caller:GT}),[E,D]=lb({prop:o,defaultProp:s,onChange:c,caller:GT}),O=M.useRef(null),ee=_?!!m||!!_.closest(`form`):!0,[te,k]=M.useState(new Set),A=pb(),ne=Array.from(te).map(e=>e.props.value).join(`;`),re=M.useCallback(e=>{k(t=>new Set(t).add(e))},[]),ie=M.useCallback(e=>{k(t=>{let n=new Set(t);return n.delete(e),n})},[]),j={required:p,trigger:_,onTriggerChange:v,valueNode:y,onValueNodeChange:b,valueNodeHasChildren:x,onValueNodeHasChildrenChange:S,contentId:A,value:E,onValueChange:D,open:w,onOpenChange:T,dir:C,triggerPointerDownPosRef:O,disabled:f,name:u,autoComplete:d,form:m,nativeOptions:te,nativeSelectKey:ne,isFormControl:ee};return(0,F.jsx)(ZC,{...g,children:(0,F.jsx)(vde,{scope:t,...j,children:(0,F.jsx)(KT.Provider,{scope:t,children:(0,F.jsx)(yde,{scope:t,onNativeOptionAdd:re,onNativeOptionRemove:ie,children:Rde(h)?h(j):n})})})})}ZT.displayName=xde;var QT=e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,F.jsx)(ZT,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,F.jsxs)(F.Fragment,{children:[n,e?(0,F.jsx)(PE,{__scopeSelect:t}):null]})})};QT.displayName=GT;var $T=`SelectTrigger`,eE=M.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...i}=e,a=YT(n),o=XT($T,n),s=o.disabled||r,c=Iy(t,o.onTriggerChange),l=qT(n),u=M.useRef(`touch`),[d,f,p]=IE(e=>{let t=l().filter(e=>!e.disabled),n=LE(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),m=e=>{s||(o.onOpenChange(!0),p()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,F.jsx)(QC,{asChild:!0,...a,children:(0,F.jsx)(Gy.button,{type:`button`,role:`combobox`,"aria-controls":o.open?o.contentId:void 0,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":FE(o.value)?``:void 0,...i,ref:c,onClick:B(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&m(e)}),onPointerDown:B(i.onPointerDown,e=>{u.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(m(e),e.preventDefault())}),onKeyDown:B(i.onKeyDown,e=>{let t=d.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&f(e.key),!(t&&e.key===` `)&&mde.includes(e.key)&&(m(),e.preventDefault())})})})});eE.displayName=$T;var tE=`SelectValue`,nE=M.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=XT(tE,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=Iy(t,c.onValueNodeChange);cb(()=>{l(u)},[l,u]);let f=FE(c.value);return(0,F.jsx)(Gy.span,{...s,asChild:f?!1:s.asChild,ref:d,style:{pointerEvents:`none`},children:(0,F.jsx)(M.Fragment,{children:f?o:a},f?`placeholder`:`value`)})});nE.displayName=tE;var Sde=`SelectIcon`,rE=M.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,F.jsx)(Gy.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})});rE.displayName=Sde;var iE=`SelectPortal`,[Cde,wde]=JT(iE,{forceMount:void 0}),aE=e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,F.jsx)(Cde,{scope:e.__scopeSelect,forceMount:n,children:(0,F.jsx)(Ab,{asChild:!0,...r})})};aE.displayName=iE;var oE=`SelectContent`,sE=M.forwardRef((e,t)=>{let n=wde(oE,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,a=XT(oE,e.__scopeSelect),[o,s]=M.useState();return cb(()=>{s(new DocumentFragment)},[]),(0,F.jsx)(ub,{present:r||a.open,children:({present:e})=>e?(0,F.jsx)(fE,{...i,ref:t}):(0,F.jsx)(cE,{...i,fragment:o})})});sE.displayName=oE;var cE=M.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,fragment:i}=e;return i?us.createPortal((0,F.jsx)(uE,{scope:n,children:(0,F.jsx)(KT.Slot,{scope:n,children:(0,F.jsx)(`div`,{ref:t,children:r})})}),i):null});cE.displayName=`SelectContentFragment`;var lE=10,[uE,dE]=JT(oE),Tde=`SelectContentImpl`,Ede=zy(`SelectContent.RemoveScroll`),fE=M.forwardRef((e,t)=>{let{__scopeSelect:n}=e,{position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g,..._}=e,v=XT(oE,n),[y,b]=M.useState(null),[x,S]=M.useState(null),C=Iy(t,e=>b(e)),[w,T]=M.useState(null),[E,D]=M.useState(null),O=qT(n),[ee,te]=M.useState(!1),k=M.useRef(!1);M.useEffect(()=>{if(y)return _x(y)},[y]),Nb();let A=M.useCallback(e=>{let[t,...n]=O().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&x&&(x.scrollTop=0),n===r&&x&&(x.scrollTop=x.scrollHeight),n?.focus(),document.activeElement!==i))return},[O,x]),ne=M.useCallback(()=>A([w,y]),[A,w,y]);M.useEffect(()=>{ee&&ne()},[ee,ne]);let{onOpenChange:re,triggerPointerDownPosRef:ie}=v;M.useEffect(()=>{if(y){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(ie.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(ie.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(y)||re(!1),document.removeEventListener(`pointermove`,t),ie.current=null};return ie.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[y,re,ie]),M.useEffect(()=>{let e=()=>re(!1);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[re]);let[j,ae]=IE(e=>{let t=O().filter(e=>!e.disabled),n=LE(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current.focus())}),oe=M.useCallback((e,t,n)=>{let r=!k.current&&!n;(v.value!==void 0&&v.value===t||r)&&(T(e),r&&(k.current=!0))},[v.value]),se=M.useCallback(()=>y?.focus(),[y]),ce=M.useCallback((e,t,n)=>{let r=!k.current&&!n;(v.value!==void 0&&v.value===t||r)&&D(e)},[v.value]),le=r===`popper`?mE:pE,ue=le===mE?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g}:{};return(0,F.jsx)(uE,{scope:n,content:y,viewport:x,onViewportChange:S,itemRefCallback:oe,selectedItem:w,onItemLeave:se,itemTextRefCallback:ce,focusSelectedItem:ne,selectedItemText:E,position:r,isPositioned:ee,searchRef:j,children:(0,F.jsx)(dx,{as:Ede,allowPinchZoom:!0,children:(0,F.jsx)(wb,{asChild:!0,trapped:v.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:B(i,e=>{v.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,F.jsx)(vb,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:(0,F.jsx)(le,{role:`listbox`,id:v.contentId,"data-state":v.open?`open`:`closed`,dir:v.dir,onContextMenu:e=>e.preventDefault(),..._,...ue,onPlaced:()=>te(!0),ref:C,style:{display:`flex`,flexDirection:`column`,outline:`none`,..._.style},onKeyDown:B(_.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&ae(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=O().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>A(t)),e.preventDefault()}})})})})})})});fE.displayName=Tde;var Dde=`SelectItemAlignedPosition`,pE=M.forwardRef((e,t)=>{let{__scopeSelect:n,onPlaced:r,...i}=e,a=XT(oE,n),o=dE(oE,n),[s,c]=M.useState(null),[l,u]=M.useState(null),d=Iy(t,e=>u(e)),f=qT(n),p=M.useRef(!1),m=M.useRef(!0),{viewport:h,selectedItem:g,selectedItemText:_,focusSelectedItem:v}=o,y=M.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&h&&g&&_){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=_.getBoundingClientRect();if(a.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-lE,d=TT(a,[lE,Math.max(lE,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-lE,d=TT(a,[lE,Math.max(lE,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=f(),c=window.innerHeight-lE*2,u=h.scrollHeight,d=window.getComputedStyle(l),m=parseInt(d.borderTopWidth,10),v=parseInt(d.paddingTop,10),y=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=m+v+u+b+y,S=Math.min(g.offsetHeight*5,x),C=window.getComputedStyle(h),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-lE,D=c-E,O=g.offsetHeight/2,ee=g.offsetTop+O,te=m+v+ee,k=x-te;if(te<=E){let e=o.length>0&&g===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=l.clientHeight-h.offsetTop-h.offsetHeight,n=te+Math.max(D,O+(e?T:0)+t+y);s.style.height=n+`px`}else{let e=o.length>0&&g===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,m+h.offsetTop+(e?w:0)+O)+k;s.style.height=t+`px`,h.scrollTop=te-E+h.offsetTop}s.style.margin=`${lE}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>p.current=!0)}},[f,a.trigger,a.valueNode,s,l,h,g,_,a.dir,r]);cb(()=>y(),[y]);let[b,x]=M.useState();return cb(()=>{l&&x(window.getComputedStyle(l).zIndex)},[l]),(0,F.jsx)(kde,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:M.useCallback(e=>{e&&m.current===!0&&(y(),v?.(),m.current=!1)},[y,v]),children:(0,F.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:b},children:(0,F.jsx)(Gy.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})});pE.displayName=Dde;var Ode=`SelectPopperPosition`,mE=M.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=`start`,collisionPadding:i=lE,...a}=e,o=YT(n);return(0,F.jsx)($C,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})});mE.displayName=Ode;var[kde,hE]=JT(oE,{}),gE=`SelectViewport`,_E=M.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...i}=e,a=dE(gE,n),o=hE(gE,n),s=Iy(t,a.onViewportChange),c=M.useRef(0);return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,F.jsx)(KT.Slot,{scope:n,children:(0,F.jsx)(Gy.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:B(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-lE*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})});_E.displayName=gE;var vE=`SelectGroup`,[Ade,jde]=JT(vE),Mde=M.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=pb();return(0,F.jsx)(Ade,{scope:n,id:i,children:(0,F.jsx)(Gy.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})});Mde.displayName=vE;var yE=`SelectLabel`,Nde=M.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=jde(yE,n);return(0,F.jsx)(Gy.div,{id:i.id,...r,ref:t})});Nde.displayName=yE;var bE=`SelectItem`,[Pde,xE]=JT(bE),SE=M.forwardRef((e,t)=>{let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=XT(bE,n),c=dE(bE,n),l=s.value===r,[u,d]=M.useState(a??``),[f,p]=M.useState(!1),m=Iy(t,e=>c.itemRefCallback?.(e,r,i)),h=pb(),g=M.useRef(`touch`),_=()=>{i||(s.onValueChange(r),s.onOpenChange(!1))};if(r===``)throw Error(`A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.`);return(0,F.jsx)(Pde,{scope:n,value:r,disabled:i,textId:h,isSelected:l,onItemTextChange:M.useCallback(e=>{d(t=>t||(e?.textContent??``).trim())},[]),children:(0,F.jsx)(KT.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:(0,F.jsx)(Gy.div,{role:`option`,"aria-labelledby":h,"data-highlighted":f?``:void 0,"aria-selected":l&&f,"data-state":l?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:m,onFocus:B(o.onFocus,()=>p(!0)),onBlur:B(o.onBlur,()=>p(!1)),onClick:B(o.onClick,()=>{g.current!==`mouse`&&_()}),onPointerUp:B(o.onPointerUp,()=>{g.current===`mouse`&&_()}),onPointerDown:B(o.onPointerDown,e=>{g.current=e.pointerType}),onPointerMove:B(o.onPointerMove,e=>{g.current=e.pointerType,i?c.onItemLeave?.():g.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:B(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:B(o.onKeyDown,e=>{c.searchRef?.current!==``&&e.key===` `||(hde.includes(e.key)&&_(),e.key===` `&&e.preventDefault())})})})})});SE.displayName=bE;var CE=`SelectItemText`,wE=M.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,...a}=e,o=XT(CE,n),s=dE(CE,n),c=xE(CE,n),l=bde(CE,n),[u,d]=M.useState(null),f=Iy(t,e=>d(e),c.onItemTextChange,e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),p=u?.textContent,m=M.useMemo(()=>(0,F.jsx)(`option`,{value:c.value,disabled:c.disabled,children:p},c.value),[c.disabled,c.value,p]),{onNativeOptionAdd:h,onNativeOptionRemove:g}=l;return cb(()=>(h(m),()=>g(m)),[h,g,m]),(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(Gy.span,{id:c.textId,...a,ref:f}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?us.createPortal(a.children,o.valueNode):null]})});wE.displayName=CE;var TE=`SelectItemIndicator`,EE=M.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return xE(TE,n).isSelected?(0,F.jsx)(Gy.span,{"aria-hidden":!0,...r,ref:t}):null});EE.displayName=TE;var DE=`SelectScrollUpButton`,OE=M.forwardRef((e,t)=>{let n=dE(DE,e.__scopeSelect),r=hE(DE,e.__scopeSelect),[i,a]=M.useState(!1),o=Iy(t,r.onScrollButtonChange);return cb(()=>{if(n.viewport&&n.isPositioned){let e=function(){a(t.scrollTop>0)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,F.jsx)(jE,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});OE.displayName=DE;var kE=`SelectScrollDownButton`,AE=M.forwardRef((e,t)=>{let n=dE(kE,e.__scopeSelect),r=hE(kE,e.__scopeSelect),[i,a]=M.useState(!1),o=Iy(t,r.onScrollButtonChange);return cb(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;a(Math.ceil(t.scrollTop)<e)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,F.jsx)(jE,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});AE.displayName=kE;var jE=M.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=dE(`SelectScrollButton`,n),o=M.useRef(null),s=qT(n),c=M.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return M.useEffect(()=>()=>c(),[c]),cb(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,F.jsx)(Gy.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:B(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:B(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:B(i.onPointerLeave,()=>{c()})})}),Fde=`SelectSeparator`,Ide=M.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return(0,F.jsx)(Gy.div,{"aria-hidden":!0,...r,ref:t})});Ide.displayName=Fde;var ME=`SelectArrow`,Lde=M.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=YT(n);return dE(ME,n).position===`popper`?(0,F.jsx)(ew,{...i,...r,ref:t}):null});Lde.displayName=ME;var NE=`SelectBubbleInput`,PE=M.forwardRef(({__scopeSelect:e,...t},n)=>{let r=XT(NE,e),{value:i,onValueChange:a,required:o,disabled:s,name:c,autoComplete:l,form:u}=r,{nativeOptions:d,nativeSelectKey:f}=r,p=M.useRef(null),m=Iy(n,p),h=i??``,g=fS(h);return M.useEffect(()=>{let e=p.current;if(!e)return;let t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set;if(g!==h&&n){let t=new Event(`change`,{bubbles:!0});n.call(e,h),e.dispatchEvent(t)}},[g,h]),(0,F.jsxs)(Gy.select,{"aria-hidden":!0,required:o,tabIndex:-1,name:c,autoComplete:l,disabled:s,form:u,onChange:e=>a(e.target.value),...t,style:{...ib,...t.style},ref:m,defaultValue:h,children:[FE(i)?(0,F.jsx)(`option`,{value:``}):null,Array.from(d)]},f)});PE.displayName=NE;function Rde(e){return typeof e==`function`}function FE(e){return e===``||e===void 0}function IE(e){let t=Zy(e),n=M.useRef(``),r=M.useRef(0),i=M.useCallback(e=>{let i=n.current+e;t(i),(function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))})(i)},[t]),a=M.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return M.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function LE(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=zde(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function zde(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var RE=`Tabs`,[Bde,Vde]=ob(RE,[aw]),zE=aw(),[Hde,BE]=Bde(RE),VE=M.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,dir:s,activationMode:c=`automatic`,...l}=e,u=mb(s),[d,f]=lb({prop:r,onChange:i,defaultProp:a??``,caller:RE});return(0,F.jsx)(Hde,{scope:n,baseId:pb(),value:d,onValueChange:f,orientation:o,dir:u,activationMode:c,children:(0,F.jsx)(Gy.div,{dir:u,"data-orientation":o,...l,ref:t})})});VE.displayName=RE;var HE=`TabsList`,UE=M.forwardRef((e,t)=>{let{__scopeTabs:n,loop:r=!0,...i}=e,a=BE(HE,n),o=zE(n);return(0,F.jsx)(uw,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,F.jsx)(Gy.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})});UE.displayName=HE;var WE=`TabsTrigger`,GE=M.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=BE(WE,n),s=zE(n),c=JE(o.baseId,r),l=YE(o.baseId,r),u=r===o.value;return(0,F.jsx)(dw,{asChild:!0,...s,focusable:!i,active:u,children:(0,F.jsx)(Gy.button,{type:`button`,role:`tab`,"aria-selected":u,"aria-controls":l,"data-state":u?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:c,...a,ref:t,onMouseDown:B(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?o.onValueChange(r):e.preventDefault()}),onKeyDown:B(e.onKeyDown,e=>{[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:B(e.onFocus,()=>{let e=o.activationMode!==`manual`;!u&&!i&&e&&o.onValueChange(r)})})})});GE.displayName=WE;var KE=`TabsContent`,qE=M.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,s=BE(KE,n),c=JE(s.baseId,r),l=YE(s.baseId,r),u=r===s.value,d=M.useRef(u);return M.useEffect(()=>{let e=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,F.jsx)(ub,{present:i||u,children:({present:n})=>(0,F.jsx)(Gy.div,{"data-state":u?`active`:`inactive`,"data-orientation":s.orientation,role:`tabpanel`,"aria-labelledby":c,hidden:!n,id:l,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:d.current?`0s`:void 0},children:n&&a})})});qE.displayName=KE;function JE(e,t){return`${e}-trigger-${t}`}function YE(e,t){return`${e}-content-${t}`}var Ude=VE,Wde=UE,Gde=GE,Kde=qE,[XE,qde]=ob(`Tooltip`,[VC]),ZE=VC(),QE=`TooltipProvider`,Jde=700,$E=`tooltip.open`,[Yde,eD]=XE(QE),tD=e=>{let{__scopeTooltip:t,delayDuration:n=Jde,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=M.useRef(!0),s=M.useRef(!1),c=M.useRef(0);return M.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,F.jsx)(Yde,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:M.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:M.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:M.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};tD.displayName=QE;var nD=`Tooltip`,[Xde,rD]=XE(nD),iD=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=eD(nD,e.__scopeTooltip),l=ZE(t),[u,d]=M.useState(null),f=pb(),p=M.useRef(0),m=o??c.disableHoverableContent,h=s??c.delayDuration,g=M.useRef(!1),[_,v]=lb({prop:r,defaultProp:i??!1,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent($E))):c.onClose(),a?.(e)},caller:nD}),y=M.useMemo(()=>_?g.current?`delayed-open`:`instant-open`:`closed`,[_]),b=M.useCallback(()=>{window.clearTimeout(p.current),p.current=0,g.current=!1,v(!0)},[v]),x=M.useCallback(()=>{window.clearTimeout(p.current),p.current=0,v(!1)},[v]),S=M.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{g.current=!0,v(!0),p.current=0},h)},[h,v]);return M.useEffect(()=>()=>{p.current&&=(window.clearTimeout(p.current),0)},[]),(0,F.jsx)(ZC,{...l,children:(0,F.jsx)(Xde,{scope:t,contentId:f,open:_,stateAttribute:y,trigger:u,onTriggerChange:d,onTriggerEnter:M.useCallback(()=>{c.isOpenDelayedRef.current?S():b()},[c.isOpenDelayedRef,S,b]),onTriggerLeave:M.useCallback(()=>{m?x():(window.clearTimeout(p.current),p.current=0)},[x,m]),onOpen:b,onClose:x,disableHoverableContent:m,children:n})})};iD.displayName=nD;var aD=`TooltipTrigger`,oD=M.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=rD(aD,n),a=eD(aD,n),o=ZE(n),s=Iy(t,M.useRef(null),i.onTriggerChange),c=M.useRef(!1),l=M.useRef(!1),u=M.useCallback(()=>c.current=!1,[]);return M.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,F.jsx)(QC,{asChild:!0,...o,children:(0,F.jsx)(Gy.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:B(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:B(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:B(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:B(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:B(e.onBlur,i.onClose),onClick:B(e.onClick,i.onClose)})})});oD.displayName=aD;var sD=`TooltipPortal`,[Zde,Qde]=XE(sD,{forceMount:void 0}),cD=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=rD(sD,t);return(0,F.jsx)(Zde,{scope:t,forceMount:n,children:(0,F.jsx)(ub,{present:n||a.open,children:(0,F.jsx)(Ab,{asChild:!0,container:i,children:r})})})};cD.displayName=sD;var lD=`TooltipContent`,uD=M.forwardRef((e,t)=>{let n=Qde(lD,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=rD(lD,e.__scopeTooltip);return(0,F.jsx)(ub,{present:r||o.open,children:o.disableHoverableContent?(0,F.jsx)(dD,{side:i,...a,ref:t}):(0,F.jsx)($de,{side:i,...a,ref:t})})}),$de=M.forwardRef((e,t)=>{let n=rD(lD,e.__scopeTooltip),r=eD(lD,e.__scopeTooltip),i=M.useRef(null),a=Iy(t,i),[o,s]=M.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=M.useCallback(()=>{s(null),d(!1)},[d]),p=M.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=ife(r,rfe(r,n.getBoundingClientRect())),a=afe(t.getBoundingClientRect());s(sfe([...i,...a])),d(!0)},[d]);return M.useEffect(()=>()=>f(),[f]),M.useEffect(()=>{if(c&&u){let e=e=>p(e,u),t=e=>p(e,c);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),M.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!ofe(n,o);r?f():i&&(f(),l())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,F.jsx)(dD,{...e,ref:a})}),[efe,tfe]=XE(nD,{isInside:!1}),nfe=Hy(`TooltipContent`),dD=M.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,c=rD(lD,n),l=ZE(n),{onClose:u}=c;return M.useEffect(()=>(document.addEventListener($E,u),()=>document.removeEventListener($E,u)),[u]),M.useEffect(()=>{if(c.trigger){let e=e=>{e.target instanceof Node&&e.target.contains(c.trigger)&&u()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[c.trigger,u]),(0,F.jsx)(vb,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:u,children:(0,F.jsxs)($C,{"data-state":c.stateAttribute,...l,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,F.jsx)(nfe,{children:r}),(0,F.jsx)(efe,{scope:n,isInside:!0,children:(0,F.jsx)(Boe,{id:c.contentId,role:`tooltip`,children:i||r})})]})})});uD.displayName=lD;var fD=`TooltipArrow`,pD=M.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=ZE(n);return tfe(fD,n).isInside?null:(0,F.jsx)(ew,{...i,...r,ref:t})});pD.displayName=fD;function rfe(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function ife(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function afe(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function ofe(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function sfe(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),cfe(t)}function cfe(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var lfe=tD,ufe=iD,dfe=oD,ffe=cD,pfe=uD,mfe=pD,mD=(0,Ih.forwardRef)((e,t)=>{let n=R(3),r;return n[0]!==e||n[1]!==t?(r=(0,F.jsx)(qy.div,{...e,ref:t}),n[0]=e,n[1]=t,n[2]=r):r=n[2],r});mD.displayName=`AttachmentPrimitive.Root`;var hD=(0,Ih.forwardRef)((e,t)=>{let n=R(4),r=z(hfe),i;return n[0]!==r||n[1]!==e||n[2]!==t?(i=(0,F.jsxs)(qy.div,{...e,ref:t,children:[`.`,r]}),n[0]=r,n[1]=e,n[2]=t,n[3]=i):i=n[3],i});hD.displayName=`AttachmentPrimitive.unstable_Thumb`;function hfe(e){let t=e.attachment.name.split(`.`);return t.length>1?t.pop():``}var gD=()=>{let e=R(2),t=z(gfe),n;return e[0]===t?n=e[1]:(n=(0,F.jsx)(F.Fragment,{children:t}),e[0]=t,e[1]=n),n};gD.displayName=`AttachmentPrimitive.Name`;function gfe(e){return e.attachment.name}var _fe=Xy(`AttachmentPrimitive.Remove`,()=>{let e=R(2),t=e_(),n;return e[0]===t?n=e[1]:(n=()=>{t.attachment().remove()},e[0]=t,e[1]=n),n}),_D=Ry({Name:()=>gD,Remove:()=>_fe,Root:()=>mD,unstable_Thumb:()=>hD}),vfe=e=>{let t=R(12),n;return t[0]!==e.assistant||t[1]!==e.copied||t[2]!==e.hasAttachments||t[3]!==e.hasBranches||t[4]!==e.hasContent||t[5]!==e.last||t[6]!==e.lastOrHover||t[7]!==e.speaking||t[8]!==e.submittedFeedback||t[9]!==e.system||t[10]!==e.user?(n=t=>{let{role:n,attachments:r,parts:i,branchCount:a,isLast:o,speech:s,isCopied:c,isHovering:l}=t.message;return!(e.hasBranches===!0&&a<2||e.user&&n!==`user`||e.assistant&&n!==`assistant`||e.system&&n!==`system`||e.lastOrHover===!0&&!l&&!o||e.last!==void 0&&e.last!==o||e.copied===!0&&!c||e.copied===!1&&c||e.speaking===!0&&s==null||e.speaking===!1&&s!=null||e.hasAttachments===!0&&(n!==`user`||!r?.length)||e.hasAttachments===!1&&n===`user`&&r?.length||e.hasContent===!0&&i.length===0||e.hasContent===!1&&i.length>0||e.submittedFeedback!==void 0&&(t.message.metadata.submittedFeedback?.type??null)!==e.submittedFeedback)},t[0]=e.assistant,t[1]=e.copied,t[2]=e.hasAttachments,t[3]=e.hasBranches,t[4]=e.hasContent,t[5]=e.last,t[6]=e.lastOrHover,t[7]=e.speaking,t[8]=e.submittedFeedback,t[9]=e.system,t[10]=e.user,t[11]=n):n=t[11],z(n)},vD=e=>{let t=R(3),n,r;return t[0]===e?(n=t[1],r=t[2]):({children:n,...r}=e,t[0]=e,t[1]=n,t[2]=r),vfe(r)?n:null};vD.displayName=`MessagePrimitive.If`;var yD=Yh(null),bD=()=>Zh(yD),yfe=e=>{let t=R(8),{children:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=new Map,t[0]=r):r=t[0];let i=Vh(r),a;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(a=[],t[1]=a):a=t[1];let o=Vh(a),s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=()=>{let e=Array.from(i.current.entries());e.sort(bfe),o.current=e.map(xfe)},t[2]=s):s=t[2];let c=s,l;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(l=(e,t)=>{let n=t?.priority??0;return i.current.set(e,n),c(),()=>{i.current.delete(e),c()}},t[3]=l):l=t[3];let u=l,d;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(d=()=>o.current,t[4]=d):d=t[4];let f=d,p;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(p={register:u,getPlugins:f},t[5]=p):p=t[5];let m=p,h;return t[6]===n?h=t[7]:(h=(0,F.jsx)(yD.Provider,{value:m,children:n}),t[6]=n,t[7]=h),h};function bfe(e,t){return t[1]-e[1]}function xfe(e){let[t]=e;return t}var xD=Yh(null),SD=Yh(null),CD=()=>{let e=Zh(xD);if(!e)throw Error(`useTriggerPopoverRootContext must be used within ComposerPrimitive.TriggerPopoverRoot`);return e},wD=()=>Zh(xD),Sfe=()=>{let e=Zh(SD);if(!e)throw Error(`useTriggerPopoverAriaPublish must be used within ComposerPrimitive.TriggerPopoverRoot`);return e},Cfe=()=>{let e=CD();return qh(e.subscribe,e.getTriggers,e.getTriggers)},wfe=new Map,TD=()=>()=>{},ED=()=>wfe,Tfe=()=>{let e=wD();return qh(e?e.subscribe:TD,e?e.getTriggers:ED,e?e.getTriggers:ED)},DD=()=>null,Efe=()=>{let e=wD();return qh(e?e.subscribeAria:TD,e?e.getActiveAria:DD,e?e.getActiveAria:DD)};function OD(){let e=R(4),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=new Set,e[0]=t):t=e[0];let n=Vh(t),r;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{for(let e of n.current)e()},e[1]=r):r=e[1];let i=r,a;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=e=>(n.current.add(e),()=>{n.current.delete(e)}),e[2]=a):a=e[2];let o=a,s;return e[3]===Symbol.for(`react.memo_cache_sentinel`)?(s={notify:i,subscribe:o},e[3]=s):s=e[3],s}var kD=e=>{let t=R(21),{children:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=new Map,t[0]=r):r=t[0];let i=Vh(r),a;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(a=new Set,t[1]=a):a=t[1];let o=Vh(a),{notify:s,subscribe:c}=OD(),l;t[2]===s?l=t[3]:(l=e=>{let{char:t}=e;if(i.current.has(t))return Dfe;let n=new Map(i.current);n.set(t,e),i.current=n,s();for(let t of o.current)t.added(e);return()=>{let e=new Map(i.current);e.delete(t),i.current=e,s();for(let e of o.current)e.removed(t)}},t[2]=s,t[3]=l);let u=l,d;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(d=()=>i.current,t[4]=d):d=t[4];let f=d,p;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(p=e=>(o.current.add(e),()=>{o.current.delete(e)}),t[5]=p):p=t[5];let m=p,h=Vh(null),g=Vh(null),{notify:_,subscribe:v}=OD(),y;t[6]===_?y=t[7]:(y=(e,t)=>{if(t===null){if(g.current!==e)return;h.current=null,g.current=null,_();return}let n=h.current;g.current===e&&n!==null&&n.popoverId===t.popoverId&&n.highlightedItemId===t.highlightedItemId||(h.current=t,g.current=e,_())},t[6]=_,t[7]=y);let b=y,x;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(x=()=>h.current,t[8]=x):x=t[8];let S=x,C;t[9]!==u||t[10]!==c||t[11]!==v?(C={register:u,getTriggers:f,subscribe:c,subscribeLifecycle:m,getActiveAria:S,subscribeAria:v},t[9]=u,t[10]=c,t[11]=v,t[12]=C):C=t[12];let w=C,T;t[13]===b?T=t[14]:(T={setActiveAria:b},t[13]=b,t[14]=T);let E=T,D;t[15]!==E||t[16]!==n?(D=(0,F.jsx)(SD.Provider,{value:E,children:n}),t[15]=E,t[16]=n,t[17]=D):D=t[17];let O;return t[18]!==D||t[19]!==w?(O=(0,F.jsx)(xD.Provider,{value:w,children:D}),t[18]=D,t[19]=w,t[20]=O):O=t[20],O},AD=e=>{let t=R(4),{children:n}=e;if(bD()){let e;return t[0]===n?e=t[1]:(e=(0,F.jsx)(kD,{children:n}),t[0]=n,t[1]=e),e}let r;return t[2]===n?r=t[3]:(r=(0,F.jsx)(yfe,{children:(0,F.jsx)(kD,{children:n})}),t[2]=n,t[3]=r),r};AD.displayName=`ComposerPrimitive.TriggerPopoverRoot`;function Dfe(){}var jD=/\s/u;function Ofe(e,t,n){let r=e.slice(0,n);for(let e=r.length-1;e>=0;e--){let n=r[e];if(jD.test(n))return null;if(r.startsWith(t,e)){if(e>0&&!jD.test(r[e-1]))continue;return{query:r.slice(e+t.length),offset:e}}}return null}var kfe=tg(e=>{let t=R(7),{text:n,triggerChar:r}=e,[i,a]=zh(n.length),o=Math.min(i,n.length),s;t[0]!==o||t[1]!==n||t[2]!==r?(s=Ofe(n,r,o),t[0]=o,t[1]=n,t[2]=r,t[3]=s):s=t[3];let c=s,l=c?.query??``,u;return t[4]!==l||t[5]!==c?(u={trigger:c,query:l,setCursorPosition:a},t[4]=l,t[5]=c,t[6]=u):u=t[6],u});function Afe(e){return`type`in e}var jfe=tg(e=>{let t=R(25),{navigableList:n,isSearchMode:r,activeCategoryId:i,query:a,popoverId:o,open:s,selectItem:c,selectCategory:l,goBack:u,close:d}=e,[f,p]=zh(0),m;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(m=()=>{p(0)},t[0]=m):m=t[0];let h;t[1]===n?h=t[2]:(h=[n],t[1]=n,t[2]=h),Wh(m,h);let g;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>{p(0)},t[3]=g):g=t[3];let _;t[4]!==i||t[5]!==r?(_=[r,i],t[4]=i,t[5]=r,t[6]=_):_=t[6],Wh(g,_);let v;t[7]!==f||t[8]!==n.length?(v=e=>{e<0||e>=n.length||e!==f&&p(e)},t[7]=f,t[8]=n.length,t[9]=v):v=t[9];let y=Kh(v),b;t[10]!==i||t[11]!==d||t[12]!==u||t[13]!==f||t[14]!==n||t[15]!==s||t[16]!==a||t[17]!==l||t[18]!==c?(b=e=>{if(!s)return!1;switch(e.key){case`ArrowDown`:return e.preventDefault(),p(e=>{let t=n.length;return t===0?0:e<t-1?e+1:0}),!0;case`ArrowUp`:return e.preventDefault(),p(e=>{let t=n.length;return t===0?0:e>0?e-1:t-1}),!0;case`Enter`:case`Tab`:{if(e.shiftKey)return!1;e.preventDefault();let t=n[f];return t&&(Afe(t)?c(t):l(t.id)),!0}case`Escape`:return e.preventDefault(),d(),!0;case`Backspace`:return i&&a===``?(e.preventDefault(),u(),!0):!1;default:return!1}},t[10]=i,t[11]=d,t[12]=u,t[13]=f,t[14]=n,t[15]=s,t[16]=a,t[17]=l,t[18]=c,t[19]=b):b=t[19];let x=Kh(b),S=n[f],C=s&&S?`${o}-option-${S.id}`:void 0,w;return t[20]!==x||t[21]!==y||t[22]!==f||t[23]!==C?(w={highlightedIndex:f,highlightedItemId:C,highlightIndex:y,handleKeyDown:x},t[20]=x,t[21]=y,t[22]=f,t[23]=C,t[24]=w):w=t[24],w});function MD(e,t){return e.id.toLowerCase().includes(t)||e.label.toLowerCase().includes(t)||(e.description?.toLowerCase().includes(t)??!1)}var Mfe=tg(e=>{let t=R(38),{adapter:n,query:r,open:i}=e,[a,o]=zh(null),s,c;t[0]===i?(s=t[1],c=t[2]):(s=()=>{i||o(null)},c=[i],t[0]=i,t[1]=s,t[2]=c),Wh(s,c);let l;bb0:{if(!i||!n){let e;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=[],t[3]=e):e=t[3],l=e;break bb0}let e;t[4]===n?e=t[5]:(e=n.categories(),t[4]=n,t[5]=e),l=e}let u=l,d=i?a:null,f;bb1:{if(!d||!n){let e;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(e=[],t[6]=e):e=t[6],f=e;break bb1}let e;t[7]!==n||t[8]!==d?(e=n.categoryItems(d),t[7]=n,t[8]=d,t[9]=e):e=t[9],f=e}let p=f,m;bb2:{if(!i||!n||d){m=null;break bb2}if(!r&&u.length>0){m=null;break bb2}if(n.search){let e;t[10]!==n||t[11]!==r?(e=n.search(r),t[10]=n,t[11]=r,t[12]=e):e=t[12],m=e;break bb2}let e;if(t[13]!==n||t[14]!==u||t[15]!==r){e=[];let i=r.toLowerCase();for(let t of u)for(let r of n.categoryItems(t.id))MD(r,i)&&e.push(r);t[13]=n,t[14]=u,t[15]=r,t[16]=e}else e=t[16];m=e}let h=m,g=h!==null,_;bb3:{if(g){let e;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(e=[],t[17]=e):e=t[17],_=e;break bb3}if(!r){_=u;break bb3}let e;if(t[18]!==u||t[19]!==r){let n=r.toLowerCase();e=u.filter(e=>e.label.toLowerCase().includes(n)),t[18]=u,t[19]=r,t[20]=e}else e=t[20];_=e}let v=_,y;bb4:{if(g){let e;t[21]===h?e=t[22]:(e=h??[],t[21]=h,t[22]=e),y=e;break bb4}if(!r){y=p;break bb4}let e;if(t[23]!==p||t[24]!==r){let n=r.toLowerCase();e=p.filter(e=>MD(e,n)),t[23]=p,t[24]=r,t[25]=e}else e=t[25];y=e}let b=y,x;bb5:{if(g){let e;t[26]===h?e=t[27]:(e=h??[],t[26]=h,t[27]=e),x=e;break bb5}if(d){x=b;break bb5}x=v}let S=x,C;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(C=e=>{o(e)},t[28]=C):C=t[28];let w=Kh(C),T;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(T=()=>{o(null)},t[29]=T):T=t[29];let E=Kh(T),D;return t[30]!==d||t[31]!==v||t[32]!==b||t[33]!==E||t[34]!==g||t[35]!==S||t[36]!==w?(D={categories:v,items:b,isSearchMode:g,activeCategoryId:d,navigableList:S,selectCategory:w,goBack:E},t[30]=d,t[31]=v,t[32]=b,t[33]=E,t[34]=g,t[35]=S,t[36]=w,t[37]=D):D=t[37],D}),Nfe=tg(e=>{let t=R(15),{behavior:n,trigger:r,aui:i,triggerChar:a,setCursorPosition:o,onSelected:s}=e,c=Vh(null),l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=e=>(c.current=e,()=>{c.current===e&&(c.current=null)}),t[0]=l):l=t[0];let u=Kh(l),d;t[1]!==i||t[2]!==n||t[3]!==s||t[4]!==r||t[5]!==a?(d=e=>{if(!r||!n)return;if(c.current?.(e)){s();return}let t=i.composer().getState().text,o=t.slice(0,r.offset),l=t.slice(r.offset+a.length+r.query.length),u=()=>{let t=n.formatter.serialize(e);i.composer().setText(o+t+(l.startsWith(` `)?l:` ${l}`))};n.kind===`directive`?(u(),n.onInserted?.(e)):(n.removeOnExecute?i.composer().setText(o+(l.startsWith(` `)?l.slice(1):l)):u(),n.onExecute(e)),s()},t[1]=i,t[2]=n,t[3]=s,t[4]=r,t[5]=a,t[6]=d):d=t[6];let f=Kh(d),p;t[7]!==s||t[8]!==o||t[9]!==r?(p=()=>{s(),r&&o(r.offset)},t[7]=s,t[8]=o,t[9]=r,t[10]=p):p=t[10];let m=Kh(p),h;return t[11]!==m||t[12]!==u||t[13]!==f?(h={selectItem:f,close:m,registerSelectItemOverride:u},t[11]=m,t[12]=u,t[13]=f,t[14]=h):h=t[14],h}),Pfe=tg(e=>{let t=R(46),{adapter:n,text:r,triggerChar:i,behavior:a,aui:o,popoverId:s,isLoading:c}=e,l;t[0]!==r||t[1]!==i?(l=kfe({text:r,triggerChar:i}),t[0]=r,t[1]=i,t[2]=l):l=t[2];let u=_g(l),d=u.trigger!==null&&n!==void 0&&a!==void 0,f;t[3]!==n||t[4]!==u.query||t[5]!==d?(f=Mfe({adapter:n,query:u.query,open:d}),t[3]=n,t[4]=u.query,t[5]=d,t[6]=f):f=t[6];let p=_g(f),m;t[7]===p?m=t[8]:(m=()=>{p.goBack()},t[7]=p,t[8]=m);let h=Kh(m),g;t[9]!==o||t[10]!==a||t[11]!==u.setCursorPosition||t[12]!==u.trigger||t[13]!==h||t[14]!==i?(g=Nfe({behavior:a,trigger:u.trigger,aui:o,triggerChar:i,setCursorPosition:u.setCursorPosition,onSelected:h}),t[9]=o,t[10]=a,t[11]=u.setCursorPosition,t[12]=u.trigger,t[13]=h,t[14]=i,t[15]=g):g=t[15];let _=_g(g),v;t[16]!==u.query||t[17]!==p.activeCategoryId||t[18]!==p.goBack||t[19]!==p.isSearchMode||t[20]!==p.navigableList||t[21]!==p.selectCategory||t[22]!==d||t[23]!==s||t[24]!==_.close||t[25]!==_.selectItem?(v=jfe({navigableList:p.navigableList,isSearchMode:p.isSearchMode,activeCategoryId:p.activeCategoryId,query:u.query,popoverId:s,open:d,selectItem:_.selectItem,selectCategory:p.selectCategory,goBack:p.goBack,close:_.close}),t[16]=u.query,t[17]=p.activeCategoryId,t[18]=p.goBack,t[19]=p.isSearchMode,t[20]=p.navigableList,t[21]=p.selectCategory,t[22]=d,t[23]=s,t[24]=_.close,t[25]=_.selectItem,t[26]=v):v=t[26];let y=_g(v),b;return t[27]!==u.query||t[28]!==u.setCursorPosition||t[29]!==c||t[30]!==y.handleKeyDown||t[31]!==y.highlightIndex||t[32]!==y.highlightedIndex||t[33]!==y.highlightedItemId||t[34]!==p.activeCategoryId||t[35]!==p.categories||t[36]!==p.goBack||t[37]!==p.isSearchMode||t[38]!==p.items||t[39]!==p.selectCategory||t[40]!==d||t[41]!==s||t[42]!==_.close||t[43]!==_.registerSelectItemOverride||t[44]!==_.selectItem?(b={open:d,query:u.query,activeCategoryId:p.activeCategoryId,categories:p.categories,items:p.items,highlightedIndex:y.highlightedIndex,isSearchMode:p.isSearchMode,isLoading:c,popoverId:s,highlightedItemId:y.highlightedItemId,selectCategory:p.selectCategory,goBack:p.goBack,selectItem:_.selectItem,close:_.close,highlightIndex:y.highlightIndex,handleKeyDown:y.handleKeyDown,setCursorPosition:u.setCursorPosition,registerSelectItemOverride:_.registerSelectItemOverride},t[27]=u.query,t[28]=u.setCursorPosition,t[29]=c,t[30]=y.handleKeyDown,t[31]=y.highlightIndex,t[32]=y.highlightedIndex,t[33]=y.highlightedItemId,t[34]=p.activeCategoryId,t[35]=p.categories,t[36]=p.goBack,t[37]=p.isSearchMode,t[38]=p.items,t[39]=p.selectCategory,t[40]=d,t[41]=s,t[42]=_.close,t[43]=_.registerSelectItemOverride,t[44]=_.selectItem,t[45]=b):b=t[45],b}),ND=Yh(null),PD=()=>{let e=Zh(ND);if(!e)throw Error(`useTriggerPopoverScopeContext must be used within ComposerPrimitive.TriggerPopover`);return e},Ffe=()=>Zh(ND),FD=Yh(null),ID=()=>{let e=Zh(FD);if(!e)throw Error(`TriggerPopover.Directive / TriggerPopover.Action must be rendered inside ComposerPrimitive.TriggerPopover`);return e},LD=(0,Ih.forwardRef)((e,t)=>{let n=R(61),r,i,a,o,s,c;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4],s=n[5],c=n[6]):({char:a,adapter:r,isLoading:c,"aria-label":i,children:o,...s}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o,n[5]=s,n[6]=c);let l=c===void 0?!1:c,u=e_(),d=z(Ife),f=(0,Ih.useId)(),p=Vh(null),[m,h]=zh(null),g=Vh(0),_;n[7]===a?_=n[8]:(_=e=>(g.current+=1,p.current=e,h(e),()=>{g.current=Math.max(0,g.current-1),p.current===e&&(p.current=null,h(null))}),n[7]=a,n[8]=_);let v=_,y;n[9]===v?y=n[10]:(y={register:v},n[9]=v,n[10]=y);let b=y,x=m??void 0,S;n[11]!==r||n[12]!==u||n[13]!==a||n[14]!==l||n[15]!==f||n[16]!==x||n[17]!==d?(S=Pfe({adapter:r,text:d,triggerChar:a,behavior:x,aui:u,popoverId:f,isLoading:l}),n[11]=r,n[12]=u,n[13]=a,n[14]=l,n[15]=f,n[16]=x,n[17]=d,n[18]=S):S=n[18];let C=_g(S),w;n[19]===C?w=n[20]:(w=()=>C,n[19]=C,n[20]=w);let T=Kh(w),E=CD(),D;n[21]!==m||n[22]!==a||n[23]!==T||n[24]!==E?(D=()=>E.register({char:a,...m?{behavior:m}:{},resource:T()}),n[21]=m,n[22]=a,n[23]=T,n[24]=E,n[25]=D):D=n[25];let O;n[26]!==m||n[27]!==a||n[28]!==E?(O=[E,a,m],n[26]=m,n[27]=a,n[28]=E,n[29]=O):O=n[29],Wh(D,O);let ee=bD(),te;n[30]!==T||n[31]!==ee?(te=()=>{if(ee)return ee.register(T())},n[30]=T,n[31]=ee,n[32]=te):te=n[32];let k;n[33]===ee?k=n[34]:(k=[ee],n[33]=ee,n[34]=k),Wh(te,k);let A=m!==null&&C.open,ne=Sfe(),re,ie;n[35]!==ne||n[36]!==a||n[37]!==A?(re=()=>{if(A)return()=>{ne.setActiveAria(a,null)}},ie=[ne,a,A],n[35]=ne,n[36]=a,n[37]=A,n[38]=re,n[39]=ie):(re=n[38],ie=n[39]),Wh(re,ie);let j,ae;n[40]!==ne||n[41]!==a||n[42]!==A||n[43]!==f||n[44]!==C.highlightedItemId?(j=()=>{A&&ne.setActiveAria(a,{popoverId:f,highlightedItemId:C.highlightedItemId})},ae=[ne,a,f,A,C.highlightedItemId],n[40]=ne,n[41]=a,n[42]=A,n[43]=f,n[44]=C.highlightedItemId,n[45]=j,n[46]=ae):(j=n[45],ae=n[46]),Wh(j,ae);let oe;n[47]!==i||n[48]!==o||n[49]!==t||n[50]!==A||n[51]!==f||n[52]!==s||n[53]!==C.highlightedItemId?(oe=A?(0,F.jsx)(qy.div,{role:`listbox`,id:f,"aria-label":i??`Suggestions`,"aria-activedescendant":C.highlightedItemId,"data-state":`open`,...s,ref:t,children:o}):o,n[47]=i,n[48]=o,n[49]=t,n[50]=A,n[51]=f,n[52]=s,n[53]=C.highlightedItemId,n[54]=oe):oe=n[54];let se;n[55]!==C||n[56]!==oe?(se=(0,F.jsx)(ND.Provider,{value:C,children:oe}),n[55]=C,n[56]=oe,n[57]=se):se=n[57];let ce;return n[58]!==b||n[59]!==se?(ce=(0,F.jsx)(FD.Provider,{value:b,children:se}),n[58]=b,n[59]=se,n[60]=ce):ce=n[60],ce});LD.displayName=`ComposerPrimitive.TriggerPopover`;function Ife(e){return e.composer.text}var RD=()=>{let e=R(2),{disabled:t,send:n}=_ae(),r;return e[0]===n?r=e[1]:(r=()=>n(),e[0]=n,e[1]=r),t?null:r},Lfe=Xy(`ComposerPrimitive.Send`,RD),zD=(0,Ih.forwardRef)((e,t)=>{let n=R(12),r,i;n[0]===e?(r=n[1],i=n[2]):({onSubmit:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a=RD(),o;n[3]===a?o=n[4]:(o=e=>{e.preventDefault(),a&&a()},n[3]=a,n[4]=o);let s=o,c;n[5]!==s||n[6]!==r?(c=B(r,s),n[5]=s,n[6]=r,n[7]=c):c=n[7];let l;return n[8]!==t||n[9]!==i||n[10]!==c?(l=(0,F.jsx)(qy.form,{...i,ref:t,onSubmit:c}),n[8]=t,n[9]=i,n[10]=c,n[11]=l):l=n[11],l});zD.displayName=`ComposerPrimitive.Root`;var BD=e=>{let t=R(4),n=Zy(e),r=Ty(Rfe),i,a;t[0]!==n||t[1]!==r?(i=()=>r(n),a=[r,n],t[0]=n,t[1]=r,t[2]=i,t[3]=a):(i=t[2],a=t[3]),Wh(i,a)};function Rfe(e){return e.onScrollToBottom}var zfe=()=>!1,Bfe=()=>{},Vfe=e=>{let t=R(4),n;t[0]===e?n=t[1]:(n=t=>{if(typeof window>`u`||e===null)return Bfe;let n=window.matchMedia(e);return n.addEventListener(`change`,t),()=>n.removeEventListener(`change`,t)},t[0]=e,t[1]=n);let r=n,i;return t[2]===e?i=t[3]:(i=()=>typeof window>`u`||e===null?!1:window.matchMedia(e).matches,t[2]=e,t[3]=i),qh(r,i,zfe)};function VD(){return VD=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},VD.apply(null,arguments)}function Hfe(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 Ufe=M.useLayoutEffect,Wfe=function(e){var t=M.useRef(e);return Ufe(function(){t.current=e}),t},HD=function(e,t){if(typeof e==`function`){e(t);return}e.current=t},Gfe=function(e,t){var n=M.useRef();return M.useCallback(function(r){e.current=r,n.current&&HD(n.current,null),n.current=t,t&&HD(t,r)},[t])},UD={"min-height":`0`,"max-height":`none`,height:`0`,visibility:`hidden`,overflow:`hidden`,position:`absolute`,"z-index":`-1000`,top:`0`,right:`0`,display:`block`},WD=function(e){Object.keys(UD).forEach(function(t){e.style.setProperty(t,UD[t],`important`)})},GD=null,KD=function(e,t){var n=e.scrollHeight;return t.sizingStyle.boxSizing===`border-box`?n+t.borderSize:n-t.paddingSize};function Kfe(e,t,n,r){n===void 0&&(n=1),r===void 0&&(r=1/0),GD||(GD=document.createElement(`textarea`),GD.setAttribute(`tabindex`,`-1`),GD.setAttribute(`aria-hidden`,`true`),WD(GD)),GD.parentNode===null&&document.body.appendChild(GD);var i=e.paddingSize,a=e.borderSize,o=e.sizingStyle,s=o.boxSizing;Object.keys(o).forEach(function(e){var t=e;GD.style[t]=o[t]}),WD(GD),GD.value=t;var c=KD(GD,e);GD.value=t,c=KD(GD,e),GD.value=`x`;var l=GD.scrollHeight-i,u=l*n;s===`border-box`&&(u=u+i+a),c=Math.max(u,c);var d=l*r;return s===`border-box`&&(d=d+i+a),c=Math.min(d,c),[c,l]}var qD=function(){},qfe=function(e,t){return e.reduce(function(e,n){return e[n]=t[n],e},{})},Jfe=[`borderBottomWidth`,`borderLeftWidth`,`borderRightWidth`,`borderTopWidth`,`boxSizing`,`fontFamily`,`fontSize`,`fontStyle`,`fontWeight`,`letterSpacing`,`lineHeight`,`paddingBottom`,`paddingLeft`,`paddingRight`,`paddingTop`,`tabSize`,`textIndent`,`textRendering`,`textTransform`,`width`,`wordBreak`,`wordSpacing`,`scrollbarGutter`],Yfe=!!document.documentElement.currentStyle,Xfe=function(e){var t=window.getComputedStyle(e);if(t===null)return null;var n=qfe(Jfe,t),r=n.boxSizing;return r===``?null:(Yfe&&r===`border-box`&&(n.width=parseFloat(n.width)+parseFloat(n.borderRightWidth)+parseFloat(n.borderLeftWidth)+parseFloat(n.paddingRight)+parseFloat(n.paddingLeft)+`px`),{sizingStyle:n,paddingSize:parseFloat(n.paddingBottom)+parseFloat(n.paddingTop),borderSize:parseFloat(n.borderBottomWidth)+parseFloat(n.borderTopWidth)})};function JD(e,t,n){var r=Wfe(n);M.useLayoutEffect(function(){var n=function(e){return r.current(e)};if(e)return e.addEventListener(t,n),function(){return e.removeEventListener(t,n)}},[])}var Zfe=function(e,t){JD(document.body,`reset`,function(n){e.current.form===n.target&&t(n)})},Qfe=function(e){JD(window,`resize`,e)},$fe=function(e){JD(document.fonts,`loadingdone`,e)},epe=[`cacheMeasurements`,`maxRows`,`minRows`,`onChange`,`onHeightChange`],tpe=M.forwardRef(function(e,t){var n=e.cacheMeasurements,r=e.maxRows,i=e.minRows,a=e.onChange,o=a===void 0?qD:a,s=e.onHeightChange,c=s===void 0?qD:s,l=Hfe(e,epe),u=l.value!==void 0,d=M.useRef(null),f=Gfe(d,t),p=M.useRef(0),m=M.useRef(),h=function(){var e=d.current,t=n&&m.current?m.current:Xfe(e);if(t){m.current=t;var a=Kfe(t,e.value||e.placeholder||`x`,i,r),o=a[0],s=a[1];p.current!==o&&(p.current=o,e.style.setProperty(`height`,o+`px`,`important`),c(o,{rowHeight:s}))}};return M.useLayoutEffect(h),Zfe(d,function(){if(!u){var e=d.current.value;requestAnimationFrame(function(){var t=d.current;t&&e!==t.value&&h()})}}),Qfe(h),$fe(h),M.createElement(`textarea`,VD({},l,{onChange:function(e){u||h(),o(e)},ref:f}))}),npe=`(pointer: coarse) and (not (any-pointer: fine))`,YD=(0,Ih.forwardRef)(({autoFocus:e=!1,asChild:t,render:n,disabled:r,onChange:i,onKeyDown:a,onPaste:o,onSelect:s,submitOnEnter:c,submitMode:l,cancelOnEscape:u=!0,unstable_focusOnRunStart:d=!0,unstable_focusOnScrollToBottom:f=!0,unstable_focusOnThreadSwitched:p=!0,unstable_insertNewlineOnTouchEnter:m=!1,addAttachmentOnPaste:h=!0,...g},_)=>{let v=e_(),y=bD(),b=Efe(),x=l??(c===!1?`none`:`enter`),S=Vfe(m?npe:null),C=m&&S&&x===`enter`?`none`:x,w=z(e=>e.composer.isEditing?e.composer.text:``),T=z(e=>e.thread.isDisabled||e.composer.dictation?.inputDisabled)||r,E=Vh(null),D=Iy(_,E),O=Vh(!1);Qy(e=>{if(!E.current?.contains(e.target))return;if(y){for(let t of y.getPlugins())if(t.handleKeyDown(e))return}if(!u)return;let t=v.composer();t.getState().canCancel&&(t.cancel(),e.preventDefault())});let ee=e=>{if(!T&&!e.nativeEvent.isComposing){if(y){for(let t of y.getPlugins())if(t.handleKeyDown(e))return}if(e.key===`Enter`){let t=v.thread().getState(),n=t.capabilities.queue;if(e.shiftKey&&(e.ctrlKey||e.metaKey)&&n&&x!==`none`&&v.composer().getState().canSend){e.preventDefault(),v.composer().send({steer:!0});return}if(e.shiftKey||t.isRunning&&!n)return;let r=!1;C===`ctrlEnter`?r=e.ctrlKey||e.metaKey:C===`enter`&&(r=!0),r&&(e.preventDefault(),E.current?.closest(`form`)?.requestSubmit())}}},te=async e=>{if(!h)return;let t=v.thread().getState().capabilities,n=Array.from(e.clipboardData?.files||[]);if(t.attachments&&n.length>0)try{e.preventDefault(),await Promise.all(n.map(e=>v.composer().addAttachment(e)))}catch(e){console.error(`Error adding attachment:`,e)}},k=e&&!T,A=Uh(()=>{let e=E.current;!e||!k||(e.focus({preventScroll:!0}),e.setSelectionRange(e.value.length,e.value.length))},[k]);Wh(()=>A(),[A]),BD(()=>{v.composer().getState().type===`thread`&&f&&A()}),Wh(()=>{if(!(v.composer().getState().type!==`thread`||!d))return v.on(`thread.runStart`,A)},[d,A,v]),Wh(()=>{if(!(v.composer().getState().type!==`thread`||!p))return v.on(`threadListItem.switchedTo`,A)},[p,A,v]);let ne=b?{"aria-controls":b.popoverId,"aria-expanded":!0,"aria-haspopup":`listbox`,"aria-activedescendant":b.highlightedItemId}:{},re={name:`input`,value:w,...g,...ne,ref:D,disabled:T,onChange:B(i,e=>{if(!v.composer().getState().isEditing)return;let t=e.nativeEvent.isComposing===!0;O.current&&!t&&(O.current=!1);let n=t||O.current;if(ag(()=>{v.composer().setText(e.target.value)}),n)return;let r=e.target.selectionStart??e.target.value.length;if(y)for(let e of y.getPlugins())e.setCursorPosition(r)}),onKeyDown:B(a,ee),onCompositionStart:B(g.onCompositionStart,()=>{O.current=!0}),onCompositionEnd:B(g.onCompositionEnd,e=>{if(O.current=!1,!v.composer().getState().isEditing)return;let t=e.target;ag(()=>{v.composer().setText(t.value)});let n=t.selectionStart??t.value.length;if(y)for(let e of y.getPlugins())e.setCursorPosition(n)}),onSelect:B(s,e=>{if(O.current)return;let t=e.target,n=t.selectionStart??t.value.length;if(y)for(let e of y.getPlugins())e.setCursorPosition(n)}),onPaste:B(o,te)};if(n&&(0,Ih.isValidElement)(n)){let e=g.children===void 0?n.props.children:g.children;return(0,F.jsx)(By,{...re,children:(0,Ih.cloneElement)(n,void 0,e)})}return(0,F.jsx)(t?By:tpe,{...re})});YD.displayName=`ComposerPrimitive.Input`;var rpe=Xy(`ComposerPrimitive.Cancel`,()=>{let{disabled:e,cancel:t}=yae();return e?null:t}),ipe=Xy(`ComposerPrimitive.AddAttachment`,e=>{let t=R(6),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let{multiple:r}=n,i=r===void 0?!0:r,{disabled:a,addAttachment:o}=Cae(),s=e_(),c;return t[2]!==o||t[3]!==s||t[4]!==i?(c=()=>{let e=document.createElement(`input`);e.type=`file`,e.multiple=i,e.hidden=!0;let t=s.composer().getState().attachmentAccept;t!==`*`&&(e.accept=t),document.body.appendChild(e),e.onchange=t=>{let n=t.target.files;if(n){for(let e of n)o(e);document.body.removeChild(e)}},e.oncancel=()=>{(!e.files||e.files.length===0)&&document.body.removeChild(e)},e.click()},t[2]=o,t[3]=s,t[4]=i,t[5]=c):c=t[5],a?null:c},[`multiple`]),XD=(0,Ih.forwardRef)((e,t)=>{let n=R(30),{disabled:r,asChild:i,render:a,children:o,...s}=e,c=i===void 0?!1:i,[l,u]=zh(!1),d=e_(),f;n[0]===r?f=n[1]:(f=e=>{r||(e.preventDefault(),u(!0))},n[0]=r,n[1]=f);let p=f,m;n[2]!==r||n[3]!==l?(m=e=>{r||(e.preventDefault(),l||u(!0))},n[2]=r,n[3]=l,n[4]=m):m=n[4];let h=m,g;n[5]===r?g=n[6]:(g=e=>{if(r)return;e.preventDefault();let t=e.relatedTarget;t&&e.currentTarget.contains(t)||u(!1)},n[5]=r,n[6]=g);let _=g,v;n[7]!==d||n[8]!==r?(v=async e=>{if(r)return;e.preventDefault(),u(!1);let t=Array.from(e.dataTransfer.files);await Promise.all(t.map(async e=>{try{await d.composer().addAttachment(e)}catch(e){console.error(`Failed to add attachment:`,e)}}))},n[7]=d,n[8]=r,n[9]=v):v=n[9];let y=v,b;n[10]===l?b=n[11]:(b=l?{"data-dragging":`true`}:null,n[10]=l,n[11]=b);let x=B(s.onDragEnterCapture,p),S=B(s.onDragOverCapture,h),C=B(s.onDragLeaveCapture,_),w=B(s.onDropCapture,y),T;n[12]!==t||n[13]!==s||n[14]!==w||n[15]!==b||n[16]!==x||n[17]!==S||n[18]!==C?(T={...b,...s,onDragEnterCapture:x,onDragOverCapture:S,onDragLeaveCapture:C,onDropCapture:w,ref:t},n[12]=t,n[13]=s,n[14]=w,n[15]=b,n[16]=x,n[17]=S,n[18]=C,n[19]=T):T=n[19];let E=T;if(a&&(0,Ih.isValidElement)(a)){let e=o===void 0?a.props.children:o,t;n[20]!==a||n[21]!==e?(t=(0,Ih.cloneElement)(a,void 0,e),n[20]=a,n[21]=e,n[22]=t):t=n[22];let r;return n[23]!==E||n[24]!==t?(r=(0,F.jsx)(By,{...E,children:t}),n[23]=E,n[24]=t,n[25]=r):r=n[25],r}let D=c?By:`div`,O;return n[26]!==D||n[27]!==o||n[28]!==E?(O=(0,F.jsx)(D,{...E,children:o}),n[26]=D,n[27]=o,n[28]=E,n[29]=O):O=n[29],O});XD.displayName=`ComposerPrimitive.AttachmentDropzone`;var ape=Xy(`ComposerPrimitive.Dictate`,()=>{let{disabled:e,startDictation:t}=xae();return e?null:t}),ope=Xy(`ComposerPrimitive.StopDictation`,()=>{let e=R(2),t=e_(),n=z(spe),r;return e[0]===t?r=e[1]:(r=()=>{t.composer().stopDictation()},e[0]=t,e[1]=r),n?r:null});function spe(e){return e.composer.dictation!=null}var ZD=(0,Ih.forwardRef)((e,t)=>{let n=R(7),r,i;n[0]===e?(r=n[1],i=n[2]):({children:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a=z(cpe);if(!a)return null;let o=r??a,s;return n[3]!==t||n[4]!==i||n[5]!==o?(s=(0,F.jsx)(qy.span,{...i,ref:t,children:o}),n[3]=t,n[4]=i,n[5]=o,n[6]=s):s=n[6],s});ZD.displayName=`ComposerPrimitive.DictationTranscript`;function cpe(e){return e.composer.dictation?.transcript}var QD=(0,Ih.forwardRef)((e,t)=>{let n=R(3);if(!z(lpe))return null;let r;return n[0]!==t||n[1]!==e?(r=(0,F.jsx)(qy.div,{...e,ref:t}),n[0]=t,n[1]=e,n[2]=r):r=n[2],r});QD.displayName=`ComposerPrimitive.Quote`;var $D=(0,Ih.forwardRef)((e,t)=>{let n=R(7),r,i;n[0]===e?(r=n[1],i=n[2]):({children:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a=z(upe);if(!a)return null;let o=r??a,s;return n[3]!==t||n[4]!==i||n[5]!==o?(s=(0,F.jsx)(qy.span,{...i,ref:t,children:o}),n[3]=t,n[4]=i,n[5]=o,n[6]=s):s=n[6],s});$D.displayName=`ComposerPrimitive.QuoteText`;var eO=(0,Ih.forwardRef)((e,t)=>{let n=R(12),r,i;n[0]===e?(r=n[1],i=n[2]):({onClick:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a=e_(),o;n[3]===a?o=n[4]:(o=()=>{a.composer().setQuote(void 0)},n[3]=a,n[4]=o);let s=o,c;n[5]!==s||n[6]!==r?(c=B(r,s),n[5]=s,n[6]=r,n[7]=c):c=n[7];let l;return n[8]!==t||n[9]!==i||n[10]!==c?(l=(0,F.jsx)(qy.button,{type:`button`,...i,ref:t,onClick:c}),n[8]=t,n[9]=i,n[10]=c,n[11]=l):l=n[11],l});eO.displayName=`ComposerPrimitive.QuoteDismiss`;function lpe(e){return e.composer.quote}function upe(e){return e.composer.quote?.text}var tO=(0,Ih.forwardRef)((e,t)=>{let n=R(12),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({children:i,"aria-label":r,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let{categories:o,activeCategoryId:s,isSearchMode:c,open:l}=PD();if(!l||s||c)return null;let u=r??`Categories`,d;n[4]!==o||n[5]!==i?(d=i(o),n[4]=o,n[5]=i,n[6]=d):d=n[6];let f;return n[7]!==t||n[8]!==a||n[9]!==u||n[10]!==d?(f=(0,F.jsx)(qy.div,{role:`group`,"aria-label":u,...a,ref:t,children:d}),n[7]=t,n[8]=a,n[9]=u,n[10]=d,n[11]=f):f=n[11],f});tO.displayName=`ComposerPrimitive.TriggerPopoverCategories`;var nO=(0,Ih.forwardRef)((e,t)=>{let n=R(30),r,i,a,o;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4]):({categoryId:r,onClick:i,onMouseMove:a,...o}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o);let{selectCategory:s,highlightIndex:c,categories:l,highlightedIndex:u,activeCategoryId:d,isSearchMode:f,popoverId:p}=PD(),m;n[5]!==r||n[6]!==s?(m=()=>{s(r)},n[5]=r,n[6]=s,n[7]=m):m=n[7];let h=m,g;if(n[8]!==l||n[9]!==r){let e;n[11]===r?e=n[12]:(e=e=>e.id===r,n[11]=r,n[12]=e),g=l.findIndex(e),n[8]=l,n[9]=r,n[10]=g}else g=n[10];let _=g,v=!d&&!f&&_===u,y;n[13]!==_||n[14]!==c?(y=()=>{c(_)},n[13]=_,n[14]=c,n[15]=y):y=n[15];let b=y,x=`${p}-option-${r}`,S=v?``:void 0,C;n[16]!==h||n[17]!==i?(C=B(i,h),n[16]=h,n[17]=i,n[18]=C):C=n[18];let w;n[19]!==b||n[20]!==a?(w=B(a,b),n[19]=b,n[20]=a,n[21]=w):w=n[21];let T;return n[22]!==t||n[23]!==v||n[24]!==o||n[25]!==x||n[26]!==S||n[27]!==C||n[28]!==w?(T=(0,F.jsx)(qy.button,{type:`button`,role:`option`,id:x,"aria-selected":v,"data-highlighted":S,...o,ref:t,onClick:C,onMouseMove:w}),n[22]=t,n[23]=v,n[24]=o,n[25]=x,n[26]=S,n[27]=C,n[28]=w,n[29]=T):T=n[29],T});nO.displayName=`ComposerPrimitive.TriggerPopoverCategoryItem`;var rO=(0,Ih.forwardRef)((e,t)=>{let n=R(12),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({children:i,"aria-label":r,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let{items:o,activeCategoryId:s,isSearchMode:c,open:l}=PD();if(!l||!s&&!c)return null;let u=r??`Items`,d;n[4]!==i||n[5]!==o?(d=i(o),n[4]=i,n[5]=o,n[6]=d):d=n[6];let f;return n[7]!==t||n[8]!==a||n[9]!==u||n[10]!==d?(f=(0,F.jsx)(qy.div,{role:`group`,"aria-label":u,...a,ref:t,children:d}),n[7]=t,n[8]=a,n[9]=u,n[10]=d,n[11]=f):f=n[11],f});rO.displayName=`ComposerPrimitive.TriggerPopoverItems`;var iO=(0,Ih.forwardRef)((e,t)=>{let n=R(30),r,i,a,o,s;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4],s=n[5]):({item:i,index:r,onClick:a,onMouseMove:o,...s}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o,n[5]=s);let{selectItem:c,highlightIndex:l,items:u,highlightedIndex:d,activeCategoryId:f,isSearchMode:p,popoverId:m}=PD(),h;n[6]!==i||n[7]!==c?(h=()=>{c(i)},n[6]=i,n[7]=c,n[8]=h):h=n[8];let g=h,_;n[9]!==r||n[10]!==i.id||n[11]!==u?(_=r??u.findIndex(e=>e.id===i.id),n[9]=r,n[10]=i.id,n[11]=u,n[12]=_):_=n[12];let v=_,y=(p||f!==null)&&v===d,b;n[13]!==l||n[14]!==v?(b=()=>{l(v)},n[13]=l,n[14]=v,n[15]=b):b=n[15];let x=b,S=`${m}-option-${i.id}`,C=y?``:void 0,w;n[16]!==g||n[17]!==a?(w=B(a,g),n[16]=g,n[17]=a,n[18]=w):w=n[18];let T;n[19]!==x||n[20]!==o?(T=B(o,x),n[19]=x,n[20]=o,n[21]=T):T=n[21];let E;return n[22]!==t||n[23]!==y||n[24]!==s||n[25]!==S||n[26]!==C||n[27]!==w||n[28]!==T?(E=(0,F.jsx)(qy.button,{type:`button`,role:`option`,id:S,"aria-selected":y,"data-highlighted":C,...s,ref:t,onClick:w,onMouseMove:T}),n[22]=t,n[23]=y,n[24]=s,n[25]=S,n[26]=C,n[27]=w,n[28]=T,n[29]=E):E=n[29],E});iO.displayName=`ComposerPrimitive.TriggerPopoverItem`;var aO=(0,Ih.forwardRef)((e,t)=>{let n=R(10),r,i;n[0]===e?(r=n[1],i=n[2]):({onClick:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let{activeCategoryId:a,isSearchMode:o,goBack:s,open:c}=PD();if(!c||!a||o)return null;let l;n[3]!==s||n[4]!==r?(l=B(r,s),n[3]=s,n[4]=r,n[5]=l):l=n[5];let u;return n[6]!==t||n[7]!==i||n[8]!==l?(u=(0,F.jsx)(qy.button,{type:`button`,...i,ref:t,onClick:l}),n[6]=t,n[7]=i,n[8]=l,n[9]=u):u=n[9],u});aO.displayName=`ComposerPrimitive.TriggerPopoverBack`;var oO=({formatter:e,onExecute:t,removeOnExecute:n})=>{let{register:r}=ID(),i=Vh(t);return i.current=t,Wh(()=>r({kind:`action`,formatter:e??Sy,onExecute:e=>i.current(e),...n===void 0?{}:{removeOnExecute:n}}),[r,e,n]),null};oO.displayName=`ComposerPrimitive.TriggerPopoverAction`;var sO=({formatter:e,onInserted:t})=>{let{register:n}=ID(),r=Vh(t);return r.current=t,Wh(()=>n({kind:`directive`,formatter:e??Sy,onInserted:e=>r.current?.(e)}),[n,e]),null};sO.displayName=`ComposerPrimitive.TriggerPopoverDirective`;var dpe=Object.assign(LD,{Directive:sO,Action:oO}),cO=Ry({AddAttachment:()=>ipe,AttachmentByIndex:()=>fy,AttachmentDropzone:()=>XD,Attachments:()=>my,Cancel:()=>rpe,Dictate:()=>ape,DictationTranscript:()=>ZD,If:()=>xy,Input:()=>YD,Queue:()=>hy,Quote:()=>QD,QuoteDismiss:()=>eO,QuoteText:()=>$D,Root:()=>zD,Send:()=>Lfe,StopDictation:()=>ope,Unstable_TriggerPopover:()=>dpe,Unstable_TriggerPopoverBack:()=>aO,Unstable_TriggerPopoverCategories:()=>tO,Unstable_TriggerPopoverCategoryItem:()=>nO,Unstable_TriggerPopoverItem:()=>iO,Unstable_TriggerPopoverItems:()=>rO,Unstable_TriggerPopoverRoot:()=>AD,unstable_useTriggerPopoverRootContext:()=>CD,unstable_useTriggerPopoverRootContextOptional:()=>wD,unstable_useTriggerPopoverScopeContext:()=>PD,unstable_useTriggerPopoverScopeContextOptional:()=>Ffe,unstable_useTriggerPopoverTriggers:()=>Cfe,unstable_useTriggerPopoverTriggersOptional:()=>Tfe}),lO=()=>z(fpe);function fpe(e){if(e.part.type!==`text`&&e.part.type!==`reasoning`)throw Error(`MessagePartText can only be used inside text or reasoning message parts.`);return e.part}var ppe=Yh(null);function mpe(e){let t=Zh(ppe);if(!e?.optional&&!t)throw Error(`This component must be used within a SmoothContextProvider.`);return t}var{useSmoothStatus:hpe,useSmoothStatusStore:gpe}=Cy(mpe,`useSmoothStatus`),uO=250,dO=5,_pe=class{currentText;setText;animationFrameId=null;lastUpdateTime=Date.now();lastCommitTime=0;targetText=``;drainMs=uO;maxCharIntervalMs=dO;maxCharsPerFrame=1/0;minCommitMs=0;constructor(e,t){this.currentText=e,this.setText=t}start(){this.animationFrameId===null&&(this.lastUpdateTime=Date.now(),this.animate())}stop(){this.animationFrameId!==null&&(cancelAnimationFrame(this.animationFrameId),this.animationFrameId=null)}animate=()=>{let e=Date.now(),t=e-this.lastUpdateTime,n=this.targetText.length-this.currentText.length,r=Math.min(this.maxCharIntervalMs,this.drainMs/n),i=Math.min(n,this.maxCharsPerFrame),a=0;for(;t>=r&&a<i;)a++,t-=r;a===i&&i===this.maxCharsPerFrame&&(t=0),a===n?this.animationFrameId=null:this.animationFrameId=requestAnimationFrame(this.animate),a!==0&&(this.currentText=this.targetText.slice(0,this.currentText.length+a),this.lastUpdateTime=e-t,(a===n||e-this.lastCommitTime>=this.minCommitMs)&&(this.lastCommitTime=e,this.setText(this.currentText)))}},fO=Object.freeze({type:`running`}),pO=(e,t)=>e!==void 0&&e>0?e:t,mO=(e,t=!1)=>{let{text:n}=e,r=typeof t==`object`&&t?t:void 0,i=t!==!1&&t!==null,a=pO(r?.drainMs,uO),o=pO(r?.maxCharIntervalMs,dO),s=pO(r?.maxCharsPerFrame,1/0),c=pO(r?.minCommitMs,0),[l,u]=zh(e.status.type===`running`?``:n),d=e_(),f=z(()=>d.part()),[p,m]=zh(f);(f!==p||!n.startsWith(l))&&(m(f),u(e.status.type===`running`?``:n));let h=gpe({optional:!0}),g=Zy(t=>{if(u(t),h){let n=l!==t||e.status.type===`running`?fO:e.status;Oy(h).setState(n,!0)}});Wh(()=>{if(h){let t=i&&(l!==n||e.status.type===`running`)?fO:e.status;Oy(h).setState(t,!0)}},[h,i,n,l,e.status]);let[_]=zh(new _pe(l,g));Wh(()=>{_.drainMs=a,_.maxCharIntervalMs=o,_.maxCharsPerFrame=s,_.minCommitMs=c},[_,a,o,s,c]);let v=Vh(f);return Wh(()=>{if(!i){_.stop();return}let t=v.current!==f;if(v.current=f,t||!n.startsWith(_.targetText)){e.status.type===`running`?(_.currentText=``,_.targetText=n,_.lastCommitTime=0,_.start()):(_.currentText=n,_.targetText=n,_.stop());return}_.targetText=n,_.start()},[_,i,n,e.status.type,f]),Wh(()=>()=>{_.stop()},[_]),Hh(()=>i?{...e,text:l,status:n===l?e.status:fO}:e,[i,l,e,n])},vpe=()=>z(ype);function ype(e){if(e.part.type!==`image`)throw Error(`MessagePartImage can only be used inside image message parts.`);return e.part}var hO=(0,Ih.forwardRef)((e,t)=>{let n=R(10),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({smooth:i,component:a,...r}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let o=i===void 0?!0:i,s=a===void 0?`span`:a,{text:c,status:l}=mO(lO(),o),u;return n[4]!==s||n[5]!==t||n[6]!==r||n[7]!==l.type||n[8]!==c?(u=(0,F.jsx)(s,{"data-status":l.type,...r,ref:t,children:c}),n[4]=s,n[5]=t,n[6]=r,n[7]=l.type,n[8]=c,n[9]=u):u=n[9],u});hO.displayName=`MessagePartPrimitive.Text`;var gO=(0,Ih.forwardRef)((e,t)=>{let n=R(4),{image:r}=vpe(),i;return n[0]!==t||n[1]!==r||n[2]!==e?(i=(0,F.jsx)(qy.img,{src:r,...e,ref:t}),n[0]=t,n[1]=r,n[2]=e,n[3]=i):i=n[3],i});gO.displayName=`MessagePartPrimitive.Image`;var _O=e=>{let t=R(2),n=Vh(void 0),r;return t[0]===e?r=t[1]:(r=t=>{n.current&&=(n.current(),void 0),t&&(n.current=e(t))},t[0]=e,t[1]=r),r},vO=(e,t)=>{let n=e.trim().match(/^(\d+(?:\.\d+)?|\.\d+)(em|px|rem)$/);if(!n)return 1/0;let r=Number(n[1]),i=n[2];return i===`px`?r:i===`em`?r*(parseFloat(getComputedStyle(t).fontSize)||16):i===`rem`?r*(parseFloat(getComputedStyle(document.documentElement).fontSize)||16):1/0},bpe=e=>e.dataset.messageId,xpe=()=>{let e=document.createElement(`div`);return e.dataset.auiTopAnchorReserve=``,e.style.height=`0px`,e.style.flexShrink=`0`,e.style.pointerEvents=`none`,e.setAttribute(`aria-hidden`,`true`),e},yO=(e,t)=>{let n=`${t}px`;return e.style.height===n?!1:(e.style.height=n,!0)},Spe=e=>{let t=window.devicePixelRatio||1;return Math.round(e*t)/t},bO=()=>{let e=R(4),t=e_(),n;e[0]===t?n=e[1]:(n=()=>t.message(),e[0]=t,e[1]=n);let r=z(n),i;return e[2]===r?i=e[3]:(i=e=>{let t=()=>{r.setIsHovering(!0)},n=()=>{r.setIsHovering(!1)};return e.addEventListener(`mouseenter`,t),e.addEventListener(`mouseleave`,n),e.matches(`:hover`)&&queueMicrotask(()=>r.setIsHovering(!0)),()=>{e.removeEventListener(`mouseenter`,t),e.removeEventListener(`mouseleave`,n),r.setIsHovering(!1)}},e[2]=r,e[3]=i),_O(i)},Cpe=()=>{let e=R(2),t=Ty(kpe),n;return e[0]===t?n=e[1]:(n=e=>e.message.role===`user`&&e.message.index>0&&e.message.index===e.thread.messages.length-2&&e.thread.messages.at(-1)?.role===`assistant`&&(e.message.id===t||e.thread.isRunning),e[0]=t,e[1]=n),z(n)},wpe=()=>{let e=R(2),t=Ty(Ape),n;return e[0]===t?n=e[1]:(n=e=>e.message.isLast&&e.message.role===`assistant`&&e.message.index>=1&&e.thread.messages.at(e.message.index-1)?.role===`user`&&(e.message.id===t||e.thread.isRunning),e[0]=t,e[1]=n),z(n)},Tpe=(e,t)=>{let n=R(3),r;return n[0]!==e||n[1]!==t?(r=n=>{if(e)return t.getState().registerAnchorElement(n)},n[0]=e,n[1]=t,n[2]=r):r=n[2],_O(r)},Epe=e=>{let t=R(3),{active:n,threadViewportStore:r}=e,i;return t[0]!==n||t[1]!==r?(i=e=>{if(!n)return;let t=r.getState(),i=t.topAnchorMessageClamp;return t.registerAnchorTargetElement(e,{tallerThan:vO(i.tallerThan,e),visibleHeight:vO(i.visibleHeight,e)})},t[0]=n,t[1]=r,t[2]=i):i=t[2],_O(i)},Dpe=e=>{let t=R(7),n,r;t[0]===e?(n=t[1],r=t[2]):({forwardedRef:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i=bO(),a=Iy(n,i),o=z(jpe),s;return t[3]!==o||t[4]!==r||t[5]!==a?(s=(0,F.jsx)(qy.div,{...r,ref:a,"data-message-id":o}),t[3]=o,t[4]=r,t[5]=a,t[6]=s):s=t[6],s},Ope=e=>{let t=R(13),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({forwardedRef:n,threadViewportStore:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=bO(),o=Cpe(),s=wpe(),c=Tpe(o,i),l;t[4]!==s||t[5]!==i?(l={active:s,threadViewportStore:i},t[4]=s,t[5]=i,t[6]=l):l=t[6];let u=Epe(l),d=Iy(n,a,c,u),f=z(Mpe),p=o?``:void 0,m=s?``:void 0,h;return t[7]!==f||t[8]!==r||t[9]!==d||t[10]!==p||t[11]!==m?(h=(0,F.jsx)(qy.div,{...r,ref:d,"data-message-id":f,"data-aui-top-anchor-user":p,"data-aui-top-anchor-target":m}),t[7]=f,t[8]=r,t[9]=d,t[10]=p,t[11]=m,t[12]=h):h=t[12],h},xO=(0,Ih.forwardRef)((e,t)=>{let n=R(7),r=Ey();if(r.getState().turnAnchor===`top`){let i;return n[0]!==t||n[1]!==e||n[2]!==r?(i=(0,F.jsx)(Ope,{...e,forwardedRef:t,threadViewportStore:r}),n[0]=t,n[1]=e,n[2]=r,n[3]=i):i=n[3],i}let i;return n[4]!==t||n[5]!==e?(i=(0,F.jsx)(Dpe,{...e,forwardedRef:t}),n[4]=t,n[5]=e,n[6]=i):i=n[6],i});xO.displayName=`MessagePrimitive.Root`;function kpe(e){return e.topAnchorTurn?.anchorId}function Ape(e){return e.topAnchorTurn?.targetId}function jpe(e){return e.message.id}function Mpe(e){return e.message.id}var SO={...qv,Text:()=>(0,F.jsxs)(`p`,{style:{whiteSpace:`pre-line`},children:[(0,F.jsx)(hO,{}),(0,F.jsx)(gy,{children:(0,F.jsx)(`span`,{style:{fontFamily:`revert`},children:` ●`})})]}),Image:()=>(0,F.jsx)(gO,{})},CO=e=>{let t=R(10);if(`children`in e){let n;return t[0]===e.children?n=t[1]:(n=(0,F.jsx)(ey,{children:e.children}),t[0]=e.children,t[1]=n),n}let n,r;t[2]===e?(n=t[3],r=t[4]):({components:n,...r}=e,t[2]=e,t[3]=n,t[4]=r);let i;t[5]===n?i=t[6]:(i=n?{Text:n.Text??SO.Text,Image:n.Image??SO.Image,Reasoning:n.Reasoning??qv.Reasoning,Source:n.Source??qv.Source,File:n.File??qv.File,Unstable_Audio:n.Unstable_Audio??qv.Unstable_Audio,...`ChainOfThought`in n?{ChainOfThought:n.ChainOfThought}:{tools:n.tools,data:n.data,ToolGroup:n.ToolGroup??qv.ToolGroup,ReasoningGroup:n.ReasoningGroup??qv.ReasoningGroup},Empty:n.Empty,Quote:n.Quote,generativeUI:n.generativeUI}:SO,t[5]=n,t[6]=i);let a=i,o;return t[7]!==r||t[8]!==a?(o=(0,F.jsx)(ey,{components:a,...r}),t[7]=r,t[8]=a,t[9]=o):o=t[9],o};CO.displayName=`MessagePrimitive.Parts`;var wO=e=>{let{children:t}=e;return Jae()===void 0?null:t};wO.displayName=`MessagePrimitive.Error`;var Npe=e=>{let t=new Map;for(let n=0;n<e.length;n++){let r=e[n]?.parentId??`__ungrouped_${n}`,i=t.get(r)??[];i.push(n),t.set(r,i)}let n=[];for(let[e,r]of t){let t=e.startsWith(`__ungrouped_`)?void 0:e;n.push({groupKey:t,indices:r})}return n},Ppe=e=>{let t=R(4),n=z(Hpe),r;bb0:{if(n.length===0){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=[],t[0]=e):e=t[0],r=e;break bb0}let i;t[1]!==e||t[2]!==n?(i=e(n),t[1]=e,t[2]=n,t[3]=i):i=t[3],r=i}return r},Fpe=e=>{let t=R(9),n,r;t[0]===e?(n=t[1],r=t[2]):({Fallback:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]!==n||t[4]!==r.toolName?(i=e=>{let t=e.tools.tools[r.toolName]??n;return Array.isArray(t)?t[0]??n:t},t[3]=n,t[4]=r.toolName,t[5]=i):i=t[5];let a=z(i);if(!a)return null;let o;return t[6]!==a||t[7]!==r?(o=(0,F.jsx)(a,{...r}),t[6]=a,t[7]=r,t[8]=o):o=t[8],o},Ipe=e=>{let t=R(9),n,r;t[0]===e?(n=t[1],r=t[2]):({Fallback:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]!==n||t[4]!==r.name?(i=e=>{let t=e.dataRenderers.renderers[r.name]??n;return Array.isArray(t)?t[0]??n:t},t[3]=n,t[4]=r.name,t[5]=i):i=t[5];let a=z(i);if(!a)return null;let o;return t[6]!==a||t[7]!==r?(o=(0,F.jsx)(a,{...r}),t[6]=a,t[7]=r,t[8]=o):o=t[8],o},TO={Text:()=>(0,F.jsxs)(`p`,{style:{whiteSpace:`pre-line`},children:[(0,F.jsx)(hO,{}),(0,F.jsx)(gy,{children:(0,F.jsx)(`span`,{style:{fontFamily:`revert`},children:` ●`})})]}),Reasoning:()=>null,Source:()=>null,Image:()=>(0,F.jsx)(gO,{}),File:()=>null,Unstable_Audio:()=>null,Group:({children:e})=>e},Lpe=e=>{let t=R(43),{components:n}=e,r;t[0]===n?r=t[1]:(r=n===void 0?{}:n,t[0]=n,t[1]=r);let{Text:i,Reasoning:a,Image:o,Source:s,File:c,Unstable_Audio:l,tools:u,data:d}=r,f=i===void 0?TO.Text:i,p=a===void 0?TO.Reasoning:a,m=o===void 0?TO.Image:o,h=s===void 0?TO.Source:s,g=c===void 0?TO.File:c,_=l===void 0?TO.Unstable_Audio:l,v;t[2]===u?v=t[3]:(v=u===void 0?{}:u,t[2]=u,t[3]=v);let y=v,b=e_(),x=z(Upe),S=x.type;if(S===`tool-call`){let e;t[4]===b?e=t[5]:(e=b.part(),t[4]=b,t[5]=e);let n=e.addToolResult,r;t[6]===b?r=t[7]:(r=b.part(),t[6]=b,t[7]=r);let i=r.resumeToolCall,a;t[8]===b?a=t[9]:(a=b.part(),t[8]=b,t[9]=a);let o=a.respondToToolApproval;if(`Override`in y){let e;return t[10]!==n||t[11]!==x||t[12]!==o||t[13]!==i||t[14]!==y.Override?(e=(0,F.jsx)(y.Override,{...x,addResult:n,resume:i,respondToApproval:o}),t[10]=n,t[11]=x,t[12]=o,t[13]=i,t[14]=y.Override,t[15]=e):e=t[15],e}let s=y.by_name?.[x.toolName]??y.Fallback,c;return t[16]!==s||t[17]!==n||t[18]!==x||t[19]!==o||t[20]!==i?(c=(0,F.jsx)(Fpe,{...x,Fallback:s,addResult:n,resume:i,respondToApproval:o}),t[16]=s,t[17]=n,t[18]=x,t[19]=o,t[20]=i,t[21]=c):c=t[21],c}if(x.status?.type===`requires-action`)throw Error(`Encountered unexpected requires-action status`);switch(S){case`text`:{let e;return t[22]!==f||t[23]!==x?(e=(0,F.jsx)(f,{...x}),t[22]=f,t[23]=x,t[24]=e):e=t[24],e}case`reasoning`:{let e;return t[25]!==p||t[26]!==x?(e=(0,F.jsx)(p,{...x}),t[25]=p,t[26]=x,t[27]=e):e=t[27],e}case`source`:{let e;return t[28]!==h||t[29]!==x?(e=(0,F.jsx)(h,{...x}),t[28]=h,t[29]=x,t[30]=e):e=t[30],e}case`image`:{let e;return t[31]!==m||t[32]!==x?(e=(0,F.jsx)(m,{...x}),t[31]=m,t[32]=x,t[33]=e):e=t[33],e}case`file`:{let e;return t[34]!==g||t[35]!==x?(e=(0,F.jsx)(g,{...x}),t[34]=g,t[35]=x,t[36]=e):e=t[36],e}case`audio`:{let e;return t[37]!==_||t[38]!==x?(e=(0,F.jsx)(_,{...x}),t[37]=_,t[38]=x,t[39]=e):e=t[39],e}case`data`:{let e=d?.by_name?.[x.name]??d?.Fallback,n;return t[40]!==e||t[41]!==x?(n=(0,F.jsx)(Ipe,{...x,Fallback:e}),t[40]=e,t[41]=x,t[42]=n):n=t[42],n}default:return console.warn(`Unknown message part type: ${S}`),null}},Rpe=(0,Ih.memo)(e=>{let t=R(5),{partIndex:n,components:r}=e,i;t[0]===r?i=t[1]:(i=(0,F.jsx)(Lpe,{components:r}),t[0]=r,t[1]=i);let a;return t[2]!==n||t[3]!==i?(a=(0,F.jsx)(R_,{index:n,children:i}),t[2]=n,t[3]=i,t[4]=a):a=t[4],a},(e,t)=>e.partIndex===t.partIndex&&e.components?.Text===t.components?.Text&&e.components?.Reasoning===t.components?.Reasoning&&e.components?.Source===t.components?.Source&&e.components?.Image===t.components?.Image&&e.components?.File===t.components?.File&&e.components?.Unstable_Audio===t.components?.Unstable_Audio&&e.components?.tools===t.components?.tools&&e.components?.data===t.components?.data&&e.components?.Group===t.components?.Group),zpe=e=>{let t=R(6),{status:n,component:r}=e,i=n.type===`running`,a;t[0]!==r||t[1]!==n?(a=(0,F.jsx)(r,{type:`text`,text:``,status:n}),t[0]=r,t[1]=n,t[2]=a):a=t[2];let o;return t[3]!==i||t[4]!==a?(o=(0,F.jsx)(z_,{text:``,isRunning:i,children:a}),t[3]=i,t[4]=a,t[5]=o):o=t[5],o},Bpe=Object.freeze({type:`complete`}),Vpe=(0,Ih.memo)(e=>{let t=R(6),{components:n}=e,r=z(Wpe);if(n?.Empty){let e;return t[0]!==n.Empty||t[1]!==r?(e=(0,F.jsx)(n.Empty,{status:r}),t[0]=n.Empty,t[1]=r,t[2]=e):e=t[2],e}let i=n?.Text??TO.Text,a;return t[3]!==r||t[4]!==i?(a=(0,F.jsx)(zpe,{status:r,component:i}),t[3]=r,t[4]=i,t[5]=a):a=t[5],a},(e,t)=>e.components?.Empty===t.components?.Empty&&e.components?.Text===t.components?.Text),EO=e=>{let t=R(9),{groupingFunction:n,components:r}=e,i=z(Gpe),a=Ppe(n),o;bb0:{if(i===0){let e;t[0]===r?e=t[1]:(e=(0,F.jsx)(Vpe,{components:r}),t[0]=r,t[1]=e),o=e;break bb0}let e;if(t[2]!==r||t[3]!==a){let n;t[5]===r?n=t[6]:(n=(e,t)=>(0,F.jsx)(r?.Group??TO.Group,{groupKey:e.groupKey,indices:e.indices,children:e.indices.map(e=>(0,F.jsx)(Rpe,{partIndex:e,components:r},e))},`group-${t}-${e.groupKey??`ungrouped`}`),t[5]=r,t[6]=n),e=a.map(n),t[2]=r,t[3]=a,t[4]=e}else e=t[4];o=e}let s=o,c;return t[7]===s?c=t[8]:(c=(0,F.jsx)(F.Fragment,{children:s}),t[7]=s,t[8]=c),c};EO.displayName=`MessagePrimitive.Unstable_PartsGrouped`;var DO=e=>{let t=R(6),n,r;t[0]===e?(n=t[1],r=t[2]):({components:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=(0,F.jsx)(EO,{...r,components:n,groupingFunction:Npe}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i};DO.displayName=`MessagePrimitive.Unstable_PartsGroupedByParentId`;function Hpe(e){return e.message.parts}function Upe(e){return e.part}function Wpe(e){return e.message.status??Bpe}function Gpe(e){return e.message.parts.length}var OO=Ry({AttachmentByIndex:()=>cy,Attachments:()=>uy,Content:()=>CO,Error:()=>wO,GenerativeUI:()=>Bv,GroupedParts:()=>ay,If:()=>vD,PartByIndex:()=>Jv,Parts:()=>CO,Quote:()=>oy,Root:()=>xO,Unstable_PartsGrouped:()=>EO,Unstable_PartsGroupedByParentId:()=>DO}),Kpe=e=>{let t=R(2),n=Zy(e),r;return t[0]===n?r=t[1]:(r=e=>{let t=new ResizeObserver(()=>{n()}),r=new MutationObserver(e=>{e.some(qpe)&&n()});return t.observe(e),r.observe(e,{childList:!0,subtree:!0,attributes:!0,characterData:!0}),()=>{t.disconnect(),r.disconnect()}},t[0]=n,t[1]=r),_O(r)};function qpe(e){return e.type!==`attributes`||e.attributeName!==`style`}var Jpe=({autoScroll:e,scrollToBottomOnRunStart:t=!0,scrollToBottomOnInitialize:n=!0,scrollToBottomOnThreadSwitch:r=!0})=>{let i=Vh(null),a=z(e=>e.thread.messages.length>0),o=Vh(!1),s=Vh(null),c=Ey();e===void 0&&(e=c.getState().turnAnchor!==`top`);let l=Vh(0),u=Vh(0),d=Vh(0),f=Vh(0),p=Vh(null),m=Uh(e=>{let t=i.current;t&&(p.current=e,t.scrollTo({top:t.scrollHeight,behavior:e}))},[]),h=Uh(e=>{p.current=e,s.current!==null&&cancelAnimationFrame(s.current),s.current=requestAnimationFrame(()=>{s.current=null,m(e)})},[m]);Gh(()=>()=>{s.current!==null&&cancelAnimationFrame(s.current)},[]);let g=Uh(()=>{let e=c.getState();return e.turnAnchor===`top`&&e.element.viewport===i.current&&e.element.anchor!==null},[c]),_=()=>{let e=i.current;if(!e)return;let t=c.getState().isAtBottom,n=Math.abs(e.scrollHeight-e.scrollTop-e.clientHeight)<=1||e.scrollHeight<=e.clientHeight;!n&&l.current<e.scrollTop||(n?e.scrollHeight>e.clientHeight+1&&(p.current=null):l.current>e.scrollTop&&u.current===e.scrollHeight&&(p.current=null),(n||p.current===null)&&n!==t&&Oy(c).setState({isAtBottom:n})),l.current=e.scrollTop,u.current=e.scrollHeight},v=Kpe(()=>{let t=i.current;if(!t)return;let{scrollHeight:n,clientHeight:r}=t;if(n===d.current&&r===f.current)return;d.current=n,f.current=r;let a=p.current;a&&g()?p.current=null:a?m(a):e&&c.getState().isAtBottom&&m(`instant`),_()}),y=_O(e=>{let t=()=>{p.current=null};return e.addEventListener(`scroll`,_),e.addEventListener(`pointerdown`,t),()=>{e.removeEventListener(`scroll`,_),e.removeEventListener(`pointerdown`,t)}});return Gh(()=>{if(n){if(!a){o.current=!1;return}o.current||(o.current=!0,p.current===null&&h(`instant`))}},[a,h,n]),BD(({behavior:e})=>{m(e)}),r_(`thread.runStart`,()=>{t&&c.getState().turnAnchor!==`top`&&h(`auto`)}),r_(`threadListItem.switchedTo`,()=>{r&&h(`instant`)}),Iy(v,y,i)},kO=(0,Ih.forwardRef)((e,t)=>{let n=R(3),r;return n[0]!==e||n[1]!==t?(r=(0,F.jsx)(qy.div,{...e,ref:t}),n[0]=e,n[1]=t,n[2]=r):r=n[2],r});kO.displayName=`ThreadPrimitive.Root`;var AO=e=>{let{children:t}=e;return z(Ype)?t:null};AO.displayName=`ThreadPrimitive.Empty`;function Ype(e){return e.thread.isEmpty}var Xpe=e=>{let t=R(4),n;return t[0]!==e.disabled||t[1]!==e.empty||t[2]!==e.running?(n=t=>!(e.empty===!0&&!t.thread.isEmpty||e.empty===!1&&t.thread.isEmpty||e.running===!0&&!t.thread.isRunning||e.running===!1&&t.thread.isRunning||e.disabled===!0&&!t.thread.isDisabled||e.disabled===!1&&t.thread.isDisabled),t[0]=e.disabled,t[1]=e.empty,t[2]=e.running,t[3]=n):n=t[3],z(n)},jO=e=>{let t=R(3),n,r;return t[0]===e?(n=t[1],r=t[2]):({children:n,...r}=e,t[0]=e,t[1]=n,t[2]=r),Xpe(r)?n:null};jO.displayName=`ThreadPrimitive.If`;var MO=(e,t)=>{let n=R(3),r;return n[0]!==t||n[1]!==e?(r=n=>{if(!e)return;let r=e(),i=()=>{let e=t?t(n):n.offsetHeight;r.setHeight(e)},a=new ResizeObserver(i);return a.observe(n),i(),()=>{a.disconnect(),r.unregister()}},n[0]=t,n[1]=e,n[2]=r):r=n[2],_O(r)},NO=e=>{let t=0,n=e;for(;n;)t+=n.offsetTop,n=n.offsetParent;return t},Zpe=(e,t)=>{let n=0,r=e;for(;r&&r!==t;)n+=r.offsetTop,r=r.offsetParent;return r===t?n:NO(e)-NO(t)},PO=({viewport:e,anchor:t,tallerThan:n,visibleHeight:r})=>{let i=Zpe(t,e),a=t.offsetHeight;return i+Math.max(0,a-(a<=n?a:r))},Qpe=({scrollHeight:e,...t})=>{let{viewport:n}=t,r=PO(t)+n.clientHeight;return Math.max(0,r-e)},$pe=({viewport:e,reserve:t,...n})=>Qpe({viewport:e,...n,scrollHeight:e.scrollHeight-t.offsetHeight}),eme=e=>{let t=new ResizeObserver(e),n=new MutationObserver(e),r=null,i=null,a=null,o=()=>{t.disconnect(),n.disconnect(),r=null,i=null,a=null};return{target:(e,s,c)=>{r===e&&i===s&&a===c||(o(),t.observe(e),t.observe(s),t.observe(c),n.observe(c,{childList:!0,subtree:!0,characterData:!0}),r=e,i=s,a=c)},disconnect:o}},tme=e=>{let t=null;return{schedule:()=>{t===null&&(t=requestAnimationFrame(()=>{t=null,e()}))},cancel:()=>{t!==null&&(cancelAnimationFrame(t),t=null)}}},nme=e=>{let t=null,n;function r(){let r=e.getState(),{viewport:o,anchor:s,target:c}=r.element,l=r.targetConfig;if(r.turnAnchor!==`top`||!o||!s||!c||!l){a.disconnect(),t&&(yO(t,0),t.remove());return}if(t??=xpe(),(t.parentElement!==c.parentElement||t.previousElementSibling!==c)&&c.after(t),a.target(o,s,c),yO(t,$pe({viewport:o,anchor:s,reserve:t,...l}))){i.schedule();return}let u=bpe(s);if(u!==void 0&&n===u)return;let d=Spe(PO({viewport:o,anchor:s,...l}));Math.abs(o.scrollTop-d)>1&&o.scrollTo({top:d,behavior:`smooth`}),u!==void 0&&(n=u)}let i=tme(r),a=eme(i.schedule);i.schedule();let o=e.subscribe(i.schedule);return()=>{i.cancel(),o(),a.disconnect(),t?.remove()}},rme=e=>{let t=R(4),n=Ey(),r,i;t[0]!==e||t[1]!==n?(r=()=>{if(e)return nme(n)},i=[e,n],t[0]=e,t[1]=n,t[2]=r,t[3]=i):(r=t[2],i=t[3]),Gh(r,i)},FO=({isRunning:e,messages:t})=>{if(!e)return null;let n=t.at(-1),r=t.at(-2);return r?.role!==`user`||n?.role!==`assistant`?null:{anchorId:r.id,targetId:n.id}},ime=e=>FO(e)?.anchorId,ame=e=>FO(e)?.targetId,ome=()=>MO(Ty(lme),ume),sme=()=>_O(Ty(dme)),cme=e=>{let t=R(13),n=Ey(),r;t[0]===e?r=t[1]:(r=t=>{if(e)return ime(t.thread)},t[0]=e,t[1]=r);let i=z(r),a;t[2]===e?a=t[3]:(a=t=>{if(e)return ame(t.thread)},t[2]=e,t[3]=a);let o=z(a),s;bb0:{if(!i||!o){s=null;break bb0}let e;t[4]!==i||t[5]!==o?(e={anchorId:i,targetId:o},t[4]=i,t[5]=o,t[6]=e):e=t[6],s=e}let c=s,l,u;t[7]!==c||t[8]!==n?(l=()=>{if(!c)return;let e=n.getState(),t=e.topAnchorTurn;t?.anchorId===c.anchorId&&t.targetId===c.targetId||e.setTopAnchorTurn(c)},u=[c,n],t[7]=c,t[8]=n,t[9]=l,t[10]=u):(l=t[9],u=t[10]),Gh(l,u);let d;t[11]===n?d=t[12]:(d=()=>{n.getState().setTopAnchorTurn(null)},t[11]=n,t[12]=d);let f=d;r_(`thread.initialize`,f),r_(`threadListItem.switchedTo`,f)},IO=(0,Ih.forwardRef)((e,t)=>{let n=R(18),r,i,a,o,s,c;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4],s=n[5],c=n[6]):({autoScroll:r,scrollToBottomOnRunStart:s,scrollToBottomOnInitialize:o,scrollToBottomOnThreadSwitch:c,children:i,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o,n[5]=s,n[6]=c);let l;n[7]!==r||n[8]!==o||n[9]!==s||n[10]!==c?(l={autoScroll:r,scrollToBottomOnRunStart:s,scrollToBottomOnInitialize:o,scrollToBottomOnThreadSwitch:c},n[7]=r,n[8]=o,n[9]=s,n[10]=c,n[11]=l):l=n[11];let u=Jpe(l),d=ome(),f=sme(),p=Ey(),m;n[12]===p?m=n[13]:(m=p.getState(),n[12]=p,n[13]=m);let h=m.turnAnchor===`top`;cme(h),rme(h);let g=Iy(t,u,d,f),_;return n[14]!==i||n[15]!==g||n[16]!==a?(_=(0,F.jsx)(qy.div,{...a,ref:g,children:i}),n[14]=i,n[15]=g,n[16]=a,n[17]=_):_=n[17],_});IO.displayName=`ThreadPrimitive.ViewportScrollable`;var LO=(0,Ih.forwardRef)((e,t)=>{let n=R(13),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({turnAnchor:a,topAnchorMessageClamp:i,...r}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let o;n[4]!==i||n[5]!==a?(o={turnAnchor:a,topAnchorMessageClamp:i},n[4]=i,n[5]=a,n[6]=o):o=n[6];let s;n[7]!==r||n[8]!==t?(s=(0,F.jsx)(IO,{...r,ref:t}),n[7]=r,n[8]=t,n[9]=s):s=n[9];let c;return n[10]!==o||n[11]!==s?(c=(0,F.jsx)(ky,{options:o,children:s}),n[10]=o,n[11]=s,n[12]=c):c=n[12],c});LO.displayName=`ThreadPrimitive.Viewport`;function lme(e){return e.registerViewport}function ume(e){return e.clientHeight}function dme(e){return e.registerViewportElement}var RO=(0,Ih.forwardRef)((e,t)=>{let n=R(3),r=Iy(t,MO(Ty(fme),pme)),i;return n[0]!==e||n[1]!==r?(i=(0,F.jsx)(qy.div,{...e,ref:r}),n[0]=e,n[1]=r,n[2]=i):i=n[2],i});RO.displayName=`ThreadPrimitive.ViewportFooter`;function fme(e){return e.registerContentInset}function pme(e){let t=parseFloat(getComputedStyle(e).marginTop)||0;return e.offsetHeight+t}var mme=Xy(`ThreadPrimitive.ScrollToBottom`,e=>{let t=R(5),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let{behavior:r}=n,i=Ty(hme),a=Ey(),o;return t[2]!==r||t[3]!==a?(o=()=>{a.getState().scrollToBottom({behavior:r})},t[2]=r,t[3]=a,t[4]=o):o=t[4],i?null:o},[`behavior`]);function hme(e){return e.isAtBottom}var gme=Xy(`ThreadPrimitive.Suggestion`,e=>{let t=R(4),{prompt:n,send:r,clearComposer:i,autoSend:a}=e,o=r??a??!1,s;t[0]!==i||t[1]!==n||t[2]!==o?(s={prompt:n,send:o,clearComposer:i},t[0]=i,t[1]=n,t[2]=o,t[3]=s):s=t[3];let{disabled:c,trigger:l}=Kae(s);return c?null:l},[`prompt`,`send`,`clearComposer`,`autoSend`,`method`]),zO=Ry({Empty:()=>AO,If:()=>jO,MessageByIndex:()=>Pv,Messages:()=>xie,Root:()=>kO,ScrollToBottom:()=>mme,Suggestion:()=>gme,SuggestionByIndex:()=>vy,Suggestions:()=>hae,Viewport:()=>LO,ViewportFooter:()=>RO,ViewportProvider:()=>ky}),BO=typeof window<`u`&&window.location?window.location.hostname:``,VO=e=>`oc.brand.${e}`;function _me(e){if(typeof e!=`object`||!e||Array.isArray(e)||!(`tokens`in e))return!1;let t=e.tokens;if(t===null)return!0;if(typeof t!=`object`)return!1;let n=t.colors;return typeof n==`object`&&!!n&&`light`in n&&`dark`in n}function vme(e){try{let t=localStorage.getItem(VO(e));if(!t)return null;let n=JSON.parse(t);return _me(n)?n:null}catch{return null}}function yme(e,t){try{localStorage.setItem(VO(e),JSON.stringify(t))}catch{}}var bme=`background.foreground.card.card-foreground.popover.popover-foreground.primary.primary-foreground.secondary.secondary-foreground.muted.muted-foreground.accent.accent-foreground.destructive.destructive-foreground.border.input.ring.chart-1.chart-2.chart-3.chart-4.chart-5.sidebar.sidebar-foreground.sidebar-primary.sidebar-primary-foreground.sidebar-accent.sidebar-accent-foreground.sidebar-border.sidebar-ring`.split(`.`),HO=[{key:`ocean`,name:`Ocean`,tokens:{colors:{light:{background:`oklch(0.985 0.012 230)`,foreground:`oklch(0.22 0.04 245)`,card:`oklch(0.995 0.008 230)`,"card-foreground":`oklch(0.22 0.04 245)`,popover:`oklch(0.995 0.008 230)`,"popover-foreground":`oklch(0.22 0.04 245)`,primary:`oklch(0.55 0.13 235)`,"primary-foreground":`oklch(0.99 0.01 230)`,secondary:`oklch(0.93 0.03 220)`,"secondary-foreground":`oklch(0.28 0.05 240)`,muted:`oklch(0.94 0.02 225)`,"muted-foreground":`oklch(0.5 0.04 235)`,accent:`oklch(0.9 0.05 200)`,"accent-foreground":`oklch(0.28 0.06 230)`,border:`oklch(0.88 0.03 225)`,input:`oklch(0.88 0.03 225)`,ring:`oklch(0.55 0.13 235)`,"chart-1":`oklch(0.6 0.13 235)`,"chart-2":`oklch(0.65 0.12 200)`,"chart-3":`oklch(0.55 0.1 260)`,"chart-4":`oklch(0.7 0.11 180)`,"chart-5":`oklch(0.5 0.12 215)`,sidebar:`oklch(0.96 0.02 228)`,"sidebar-foreground":`oklch(0.24 0.04 245)`,"sidebar-primary":`oklch(0.55 0.13 235)`,"sidebar-primary-foreground":`oklch(0.99 0.01 230)`,"sidebar-accent":`oklch(0.9 0.05 200)`,"sidebar-accent-foreground":`oklch(0.28 0.06 230)`,"sidebar-border":`oklch(0.87 0.03 225)`,"sidebar-ring":`oklch(0.55 0.13 235)`},dark:{background:`oklch(0.2 0.03 245)`,foreground:`oklch(0.95 0.02 225)`,card:`oklch(0.25 0.04 245)`,"card-foreground":`oklch(0.95 0.02 225)`,popover:`oklch(0.25 0.04 245)`,"popover-foreground":`oklch(0.95 0.02 225)`,primary:`oklch(0.7 0.12 230)`,"primary-foreground":`oklch(0.18 0.04 245)`,secondary:`oklch(0.3 0.04 240)`,"secondary-foreground":`oklch(0.95 0.02 225)`,muted:`oklch(0.3 0.03 242)`,"muted-foreground":`oklch(0.72 0.04 228)`,accent:`oklch(0.4 0.07 210)`,"accent-foreground":`oklch(0.96 0.02 220)`,border:`oklch(0.35 0.03 242)`,input:`oklch(0.35 0.03 242)`,ring:`oklch(0.7 0.12 230)`,"chart-1":`oklch(0.7 0.13 230)`,"chart-2":`oklch(0.72 0.12 195)`,"chart-3":`oklch(0.65 0.11 260)`,"chart-4":`oklch(0.76 0.1 180)`,"chart-5":`oklch(0.62 0.12 215)`,sidebar:`oklch(0.23 0.04 246)`,"sidebar-foreground":`oklch(0.95 0.02 225)`,"sidebar-primary":`oklch(0.7 0.12 230)`,"sidebar-primary-foreground":`oklch(0.18 0.04 245)`,"sidebar-accent":`oklch(0.4 0.07 210)`,"sidebar-accent-foreground":`oklch(0.96 0.02 220)`,"sidebar-border":`oklch(0.34 0.03 242)`,"sidebar-ring":`oklch(0.7 0.12 230)`}},radius:`0.75rem`,fontSans:`ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif`}},{key:`forest`,name:`Forest`,tokens:{colors:{light:{background:`oklch(0.985 0.012 130)`,foreground:`oklch(0.24 0.04 145)`,card:`oklch(0.995 0.008 130)`,"card-foreground":`oklch(0.24 0.04 145)`,popover:`oklch(0.995 0.008 130)`,"popover-foreground":`oklch(0.24 0.04 145)`,primary:`oklch(0.52 0.12 150)`,"primary-foreground":`oklch(0.99 0.01 130)`,secondary:`oklch(0.93 0.04 130)`,"secondary-foreground":`oklch(0.3 0.05 150)`,muted:`oklch(0.94 0.03 135)`,"muted-foreground":`oklch(0.5 0.04 145)`,accent:`oklch(0.9 0.06 115)`,"accent-foreground":`oklch(0.3 0.06 150)`,border:`oklch(0.88 0.03 135)`,input:`oklch(0.88 0.03 135)`,ring:`oklch(0.52 0.12 150)`,"chart-1":`oklch(0.58 0.13 150)`,"chart-2":`oklch(0.68 0.12 120)`,"chart-3":`oklch(0.6 0.11 95)`,"chart-4":`oklch(0.55 0.1 175)`,"chart-5":`oklch(0.5 0.12 140)`,sidebar:`oklch(0.96 0.02 132)`,"sidebar-foreground":`oklch(0.26 0.04 145)`,"sidebar-primary":`oklch(0.52 0.12 150)`,"sidebar-primary-foreground":`oklch(0.99 0.01 130)`,"sidebar-accent":`oklch(0.9 0.06 115)`,"sidebar-accent-foreground":`oklch(0.3 0.06 150)`,"sidebar-border":`oklch(0.87 0.03 135)`,"sidebar-ring":`oklch(0.52 0.12 150)`},dark:{background:`oklch(0.2 0.03 150)`,foreground:`oklch(0.95 0.02 130)`,card:`oklch(0.25 0.04 150)`,"card-foreground":`oklch(0.95 0.02 130)`,popover:`oklch(0.25 0.04 150)`,"popover-foreground":`oklch(0.95 0.02 130)`,primary:`oklch(0.68 0.13 145)`,"primary-foreground":`oklch(0.18 0.04 150)`,secondary:`oklch(0.3 0.04 148)`,"secondary-foreground":`oklch(0.95 0.02 130)`,muted:`oklch(0.3 0.03 150)`,"muted-foreground":`oklch(0.72 0.04 135)`,accent:`oklch(0.4 0.07 120)`,"accent-foreground":`oklch(0.96 0.02 125)`,border:`oklch(0.35 0.03 148)`,input:`oklch(0.35 0.03 148)`,ring:`oklch(0.68 0.13 145)`,"chart-1":`oklch(0.68 0.14 148)`,"chart-2":`oklch(0.74 0.12 120)`,"chart-3":`oklch(0.68 0.11 95)`,"chart-4":`oklch(0.62 0.1 175)`,"chart-5":`oklch(0.6 0.12 140)`,sidebar:`oklch(0.23 0.04 150)`,"sidebar-foreground":`oklch(0.95 0.02 130)`,"sidebar-primary":`oklch(0.68 0.13 145)`,"sidebar-primary-foreground":`oklch(0.18 0.04 150)`,"sidebar-accent":`oklch(0.4 0.07 120)`,"sidebar-accent-foreground":`oklch(0.96 0.02 125)`,"sidebar-border":`oklch(0.34 0.03 148)`,"sidebar-ring":`oklch(0.68 0.13 145)`}},radius:`0.375rem`,fontSans:`Georgia, Cambria, 'Times New Roman', Times, serif`}},{key:`dusk`,name:`Dusk`,tokens:{colors:{light:{background:`oklch(0.985 0.012 300)`,foreground:`oklch(0.24 0.05 300)`,card:`oklch(0.995 0.008 300)`,"card-foreground":`oklch(0.24 0.05 300)`,popover:`oklch(0.995 0.008 300)`,"popover-foreground":`oklch(0.24 0.05 300)`,primary:`oklch(0.55 0.16 300)`,"primary-foreground":`oklch(0.99 0.01 300)`,secondary:`oklch(0.93 0.04 310)`,"secondary-foreground":`oklch(0.3 0.06 300)`,muted:`oklch(0.94 0.03 305)`,"muted-foreground":`oklch(0.5 0.05 300)`,accent:`oklch(0.9 0.07 70)`,"accent-foreground":`oklch(0.32 0.08 60)`,border:`oklch(0.88 0.03 305)`,input:`oklch(0.88 0.03 305)`,ring:`oklch(0.55 0.16 300)`,"chart-1":`oklch(0.58 0.17 300)`,"chart-2":`oklch(0.7 0.15 70)`,"chart-3":`oklch(0.55 0.15 330)`,"chart-4":`oklch(0.65 0.14 35)`,"chart-5":`oklch(0.5 0.16 280)`,sidebar:`oklch(0.96 0.02 303)`,"sidebar-foreground":`oklch(0.26 0.05 300)`,"sidebar-primary":`oklch(0.55 0.16 300)`,"sidebar-primary-foreground":`oklch(0.99 0.01 300)`,"sidebar-accent":`oklch(0.9 0.07 70)`,"sidebar-accent-foreground":`oklch(0.32 0.08 60)`,"sidebar-border":`oklch(0.87 0.03 305)`,"sidebar-ring":`oklch(0.55 0.16 300)`},dark:{background:`oklch(0.2 0.04 300)`,foreground:`oklch(0.95 0.02 305)`,card:`oklch(0.25 0.05 300)`,"card-foreground":`oklch(0.95 0.02 305)`,popover:`oklch(0.25 0.05 300)`,"popover-foreground":`oklch(0.95 0.02 305)`,primary:`oklch(0.72 0.15 300)`,"primary-foreground":`oklch(0.18 0.04 300)`,secondary:`oklch(0.3 0.05 305)`,"secondary-foreground":`oklch(0.95 0.02 305)`,muted:`oklch(0.3 0.04 303)`,"muted-foreground":`oklch(0.72 0.05 305)`,accent:`oklch(0.45 0.1 65)`,"accent-foreground":`oklch(0.96 0.02 70)`,border:`oklch(0.35 0.04 303)`,input:`oklch(0.35 0.04 303)`,ring:`oklch(0.72 0.15 300)`,"chart-1":`oklch(0.72 0.16 300)`,"chart-2":`oklch(0.78 0.14 70)`,"chart-3":`oklch(0.68 0.15 330)`,"chart-4":`oklch(0.72 0.13 35)`,"chart-5":`oklch(0.64 0.16 280)`,sidebar:`oklch(0.23 0.05 300)`,"sidebar-foreground":`oklch(0.95 0.02 305)`,"sidebar-primary":`oklch(0.72 0.15 300)`,"sidebar-primary-foreground":`oklch(0.18 0.04 300)`,"sidebar-accent":`oklch(0.45 0.1 65)`,"sidebar-accent-foreground":`oklch(0.96 0.02 70)`,"sidebar-border":`oklch(0.34 0.04 303)`,"sidebar-ring":`oklch(0.72 0.15 300)`}},radius:`1rem`,fontSans:`ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace`}}];new Set(HO.map(e=>e.key));function UO(e){let t=e??localStorage.getItem(`oc.theme`)??`system`,n=()=>t===`system`?window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:t,[r,i]=(0,M.useState)(n);return(0,M.useEffect)(()=>{if(i(n()),t!==`system`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`),r=()=>i(e.matches?`dark`:`light`);return e.addEventListener(`change`,r),()=>e.removeEventListener(`change`,r)},[t]),r}function xme(e,t){let n=document.documentElement.style,r=e?.colors?.[t];for(let e of bme){let t=r?.[e];t===void 0?n.removeProperty(`--`+e):n.setProperty(`--`+e,t)}e?.radius===void 0?n.removeProperty(`--radius`):n.setProperty(`--radius`,e.radius),e?.fontSans===void 0?n.removeProperty(`--ui-font-sans`):n.setProperty(`--ui-font-sans`,e.fontSans),e?.fontMono===void 0?n.removeProperty(`--ui-font-mono`):n.setProperty(`--ui-font-mono`,e.fontMono)}function WO(e,t){(0,M.useEffect)(()=>{xme(e??null,t)},[e,t])}var GO=new Map,KO={active:!1,percent:0,count:0},qO=new Set;function JO(){let e=0,t=0;for(let n of GO.values())e+=n.loaded,t+=n.total;let n=GO.size;KO={active:n>0,percent:t>0?Math.min(100,Math.round(e/t*100)):0,count:n};for(let e of qO)e()}var YO={subscribe(e){return qO.add(e),()=>qO.delete(e)},getSnapshot(){return KO},report(e,t,n){GO.set(e,{loaded:t,total:n}),JO()},clear(e){GO.delete(e)&&JO()}};function Sme(e,t){if(!e)return null;let n=e.logoLightHasAlpha&&e.logoLightUrl||e.logoDarkHasAlpha&&e.logoDarkUrl||null;if(n)return{url:n,masked:!0};let r=XO(e,t);return r?{url:r,masked:!1}:null}function XO(e,t){return(t===`dark`?e?.logoDarkUrl:e?.logoLightUrl)??(t===`dark`?e?.logoLightUrl:e?.logoDarkUrl)??null}function ZO(e){if(!e)return null;let t=/oklch\(\s*([0-9]*\.?[0-9]+)(%?)/i.exec(e);if(!t)return null;let n=parseFloat(t[1]);return Number.isFinite(n)?t[2]===`%`?n/100:n:null}function Cme(e,t,n){let r=ZO(e),i=ZO(t);return r===null||i===null?n:i>r?`dark`:`light`}function wme(e){let t=e.trim().split(/\s+/).filter(Boolean);return t.length===0?`?`:t.length===1?t[0].slice(0,2).toUpperCase():(t[0][0]+t[1][0]).toUpperCase()}function QO({className:e}){return(0,F.jsxs)(`svg`,{className:e,viewBox:`0 0 64 64`,fill:`none`,"aria-hidden":`true`,children:[(0,F.jsx)(`path`,{d:`M25 15H15V49H25`,stroke:`currentColor`,strokeWidth:`6.5`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,F.jsx)(`path`,{d:`M39 15H49V49H39`,stroke:`currentColor`,strokeWidth:`6.5`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,F.jsx)(`polyline`,{points:`20 33 26 33 29 25 33 41 37 29 41 33 44 33`,stroke:`currentColor`,strokeWidth:`3.4`,strokeLinecap:`round`,strokeLinejoin:`round`})]})}var Tme={},$O=[`fr`,`en`],Eme=`PARAGLIDE_LOCALE`,ek=[`localStorage`,`baseLocale`],tk=[],nk,rk;function Dme(e){if(tk.length===0)return;let t=typeof e==`string`?e:e.href;if(nk===t)return rk;let n=new URL(t,`http://dummy.com`),r;for(let e of tk)if(new Tme(e.match,n.href).exec(n.href)){r=e;break}return nk=t,rk=r,r}function ik(e){let t=Dme(e);return t&&t.exclude!==!0&&Array.isArray(t.strategy)?t.strategy:ek}var ak=void 0;globalThis.__paraglide=globalThis.__paraglide??{},globalThis.__paraglide.ssr=globalThis.__paraglide.ssr??{};var ok=!1,V=()=>{if(ak){let e=ak?.getStore()?.locale;if(e)return e}let e=ek;typeof window<`u`&&window.location?.href&&(e=ik(window.location.href));let t=Ome(e,typeof window<`u`?window.location?.href:void 0);if(t)return ok||(ok=!0,sk(t,{reload:!1})),t;throw Error(`No locale found. Read the docs https://inlang.com/m/gerre34r/library-inlang-paraglideJs/errors#no-locale-found`)};function Ome(e,t){let n;for(let t of e){if(t===`baseLocale`)n=`fr`;else if(t===`localStorage`)n=localStorage.getItem(`PARAGLIDE_LOCALE`)??void 0;else if(uk(t)&&lk.has(t)){let e=lk.get(t);if(e){let t=e.getLocale();if(t instanceof Promise)continue;if(t!==void 0)return Ame(t)}}let e=ck(n);if(e)return e}}var kme=e=>{e?window.location.href=e:window.location.reload()},sk=(e,t)=>{let n={reload:!0,...t},r;try{r=V()}catch{}let i=[],a=ek;typeof window<`u`&&window.location?.href&&(a=ik(window.location.href));for(let t of a)if(t===`baseLocale`)continue;else if(t===`localStorage`&&typeof window<`u`)localStorage.setItem(Eme,e);else if(uk(t)&&lk.has(t)){let n=lk.get(t);if(n){let r=n.setLocale(e);r instanceof Promise&&(r=r.catch(e=>{throw Error(`Custom strategy "${t}" setLocale failed.`,{cause:e})}),i.push(r))}}let o=()=>{n.reload&&window.location&&e!==r&&kme(void 0)};if(i.length)return Promise.all(i).then(()=>{o()});o()};function ck(e){if(typeof e!=`string`)return;let t=e.toLowerCase();for(let e of $O)if(e.toLowerCase()===t)return e}function Ame(e){let t=ck(e);if(t)return t;throw Error(`Invalid locale: ${e}. Expected one of: ${$O.join(`, `)}`)}var lk=new Map;function uk(e){return typeof e==`string`&&/^custom-[A-Za-z0-9_-]+$/.test(e)}var jme=e=>`Fichier trop volumineux (${e?.size} Mo, max ${e?.max} Mo). Réduisez-le (p. ex. compressez les images) et réessayez.`,Mme=e=>`File too large (${e?.size} MB, max ${e?.max} MB). Reduce it (e.g. compress images) and try again.`,Nme=((e,t={})=>(t.locale??V())===`fr`?jme(e):Mme(e)),Pme=()=>`Chargement…`,Fme=()=>`Loading…`,dk=((e={},t={})=>(t.locale??V())===`fr`?Pme(e):Fme(e)),Ime=()=>`Thème`,Lme=()=>`Theme`,Rme=((e={},t={})=>(t.locale??V())===`fr`?Ime(e):Lme(e)),zme=()=>`Clair`,Bme=()=>`Light`,fk=((e={},t={})=>(t.locale??V())===`fr`?zme(e):Bme(e)),Vme=()=>`Sombre`,Hme=()=>`Dark`,pk=((e={},t={})=>(t.locale??V())===`fr`?Vme(e):Hme(e)),Ume=()=>`Système`,Wme=()=>`System`,mk=((e={},t={})=>(t.locale??V())===`fr`?Ume(e):Wme(e)),Gme=()=>`Défaut de l’app`,Kme=()=>`App default`,hk=((e={},t={})=>(t.locale??V())===`fr`?Gme(e):Kme(e)),qme=()=>`Se déconnecter`,Jme=()=>`Sign out`,gk=((e={},t={})=>(t.locale??V())===`fr`?qme(e):Jme(e)),Yme=()=>`Préférences`,Xme=()=>`Preferences`,Zme=((e={},t={})=>(t.locale??V())===`fr`?Yme(e):Xme(e)),Qme=()=>`Nom affiché`,$me=()=>`Display name`,ehe=((e={},t={})=>(t.locale??V())===`fr`?Qme(e):$me(e)),the=()=>`Le nom et prénom affichés dans la liste des utilisateurs et le menu de compte. Vous pouvez le modifier à tout moment.`,nhe=()=>`The name shown in the user list and the account menu. You can change it at any time.`,rhe=((e={},t={})=>(t.locale??V())===`fr`?the(e):nhe(e)),ihe=()=>`Votre nom et prénom`,ahe=()=>`Your name`,ohe=((e={},t={})=>(t.locale??V())===`fr`?ihe(e):ahe(e)),she=()=>`Laissez vide pour n’afficher que votre email.`,che=()=>`Leave empty to show only your email.`,lhe=((e={},t={})=>(t.locale??V())===`fr`?she(e):che(e)),uhe=()=>`Nom affiché mis à jour.`,dhe=()=>`Display name updated.`,fhe=((e={},t={})=>(t.locale??V())===`fr`?uhe(e):dhe(e)),phe=()=>`Échec de la mise à jour du nom`,mhe=()=>`Failed to update the name`,hhe=((e={},t={})=>(t.locale??V())===`fr`?phe(e):mhe(e)),ghe=()=>`Langue`,_he=()=>`Language`,vhe=((e={},t={})=>(t.locale??V())===`fr`?ghe(e):_he(e)),yhe=()=>`Choisissez la langue de l’interface. « Défaut de l’app » suit le réglage de l’administrateur.`,bhe=()=>`Choose the interface language. “App default” follows the administrator setting.`,xhe=((e={},t={})=>(t.locale??V())===`fr`?yhe(e):bhe(e)),She=()=>`Le changement de langue recharge la page une fois.`,Che=()=>`Changing the language reloads the page once.`,whe=((e={},t={})=>(t.locale??V())===`fr`?She(e):Che(e)),The=()=>`Interface`,Ehe=()=>`Interface`,Dhe=((e={},t={})=>(t.locale??V())===`fr`?The(e):Ehe(e)),Ohe=()=>`Activez ou masquez des éléments d’interface. Les options grisées sont verrouillées par l’administrateur.`,khe=()=>`Enable or hide interface elements. Greyed options are locked by the administrator.`,Ahe=((e={},t={})=>(t.locale??V())===`fr`?Ohe(e):khe(e)),jhe=()=>`Français`,Mhe=()=>`French`,_k=((e={},t={})=>(t.locale??V())===`fr`?jhe(e):Mhe(e)),Nhe=()=>`Anglais`,Phe=()=>`English`,vk=((e={},t={})=>(t.locale??V())===`fr`?Nhe(e):Phe(e)),Fhe=()=>`Fichiers`,Ihe=()=>`Files`,Lhe=((e={},t={})=>(t.locale??V())===`fr`?Fhe(e):Ihe(e)),Rhe=()=>`Tous les fichiers échangés dans vos conversations (envoyés et reçus).`,zhe=()=>`Every file exchanged across your conversations (sent and received).`,Bhe=((e={},t={})=>(t.locale??V())===`fr`?Rhe(e):zhe(e)),Vhe=()=>`Sens`,Hhe=()=>`Direction`,Uhe=((e={},t={})=>(t.locale??V())===`fr`?Vhe(e):Hhe(e)),Whe=()=>`Tous les sens`,Ghe=()=>`All directions`,Khe=((e={},t={})=>(t.locale??V())===`fr`?Whe(e):Ghe(e)),qhe=()=>`Envoyé`,Jhe=()=>`Sent`,yk=((e={},t={})=>(t.locale??V())===`fr`?qhe(e):Jhe(e)),Yhe=()=>`Reçu`,Xhe=()=>`Received`,bk=((e={},t={})=>(t.locale??V())===`fr`?Yhe(e):Xhe(e)),Zhe=()=>`Conversation`,Qhe=()=>`Conversation`,$he=((e={},t={})=>(t.locale??V())===`fr`?Zhe(e):Qhe(e)),ege=()=>`Toutes les conversations`,tge=()=>`All conversations`,nge=((e={},t={})=>(t.locale??V())===`fr`?ege(e):tge(e)),rge=()=>`Bridge`,ige=()=>`Bridge`,age=((e={},t={})=>(t.locale??V())===`fr`?rge(e):ige(e)),oge=()=>`Tous les bridges`,sge=()=>`All bridges`,cge=((e={},t={})=>(t.locale??V())===`fr`?oge(e):sge(e)),lge=()=>`Type`,uge=()=>`Type`,dge=((e={},t={})=>(t.locale??V())===`fr`?lge(e):uge(e)),fge=()=>`Tous les types`,pge=()=>`All types`,mge=((e={},t={})=>(t.locale??V())===`fr`?fge(e):pge(e)),hge=()=>`Image`,gge=()=>`Image`,_ge=((e={},t={})=>(t.locale??V())===`fr`?hge(e):gge(e)),vge=()=>`Audio`,yge=()=>`Audio`,bge=((e={},t={})=>(t.locale??V())===`fr`?vge(e):yge(e)),xge=()=>`Vidéo`,Sge=()=>`Video`,Cge=((e={},t={})=>(t.locale??V())===`fr`?xge(e):Sge(e)),wge=()=>`PDF`,Tge=()=>`PDF`,Ege=((e={},t={})=>(t.locale??V())===`fr`?wge(e):Tge(e)),Dge=()=>`Document`,Oge=()=>`Document`,kge=((e={},t={})=>(t.locale??V())===`fr`?Dge(e):Oge(e)),Age=()=>`Archive`,jge=()=>`Archive`,Mge=((e={},t={})=>(t.locale??V())===`fr`?Age(e):jge(e)),Nge=()=>`Autre`,Pge=()=>`Other`,Fge=((e={},t={})=>(t.locale??V())===`fr`?Nge(e):Pge(e)),Ige=()=>`Nom`,Lge=()=>`Name`,Rge=((e={},t={})=>(t.locale??V())===`fr`?Ige(e):Lge(e)),zge=()=>`Type`,Bge=()=>`Type`,Vge=((e={},t={})=>(t.locale??V())===`fr`?zge(e):Bge(e)),Hge=()=>`Sens`,Uge=()=>`Direction`,Wge=((e={},t={})=>(t.locale??V())===`fr`?Hge(e):Uge(e)),Gge=()=>`Conversation`,Kge=()=>`Conversation`,qge=((e={},t={})=>(t.locale??V())===`fr`?Gge(e):Kge(e)),Jge=()=>`Date`,Yge=()=>`Date`,Xge=((e={},t={})=>(t.locale??V())===`fr`?Jge(e):Yge(e)),Zge=()=>`Action`,Qge=()=>`Action`,$ge=((e={},t={})=>(t.locale??V())===`fr`?Zge(e):Qge(e)),e_e=()=>`Télécharger`,t_e=()=>`Download`,n_e=((e={},t={})=>(t.locale??V())===`fr`?e_e(e):t_e(e)),r_e=()=>`Réinitialiser`,i_e=()=>`Reset`,a_e=((e={},t={})=>(t.locale??V())===`fr`?r_e(e):i_e(e)),o_e=()=>`Actions`,s_e=()=>`Actions`,c_e=((e={},t={})=>(t.locale??V())===`fr`?o_e(e):s_e(e)),l_e=()=>`Supprimer`,u_e=()=>`Delete`,xk=((e={},t={})=>(t.locale??V())===`fr`?l_e(e):u_e(e)),d_e=()=>`Fichier supprimé`,f_e=()=>`File removed`,p_e=((e={},t={})=>(t.locale??V())===`fr`?d_e(e):f_e(e)),m_e=()=>`Échec de la suppression du fichier`,h_e=()=>`Could not remove the file`,g_e=((e={},t={})=>(t.locale??V())===`fr`?m_e(e):h_e(e)),__e=()=>`Supprimer ce fichier ?`,v_e=()=>`Remove this file?`,y_e=((e={},t={})=>(t.locale??V())===`fr`?__e(e):v_e(e)),b_e=()=>`Il sera retiré de vos fichiers. La conversation où il a été échangé n'est pas modifiée.`,x_e=()=>`It will be removed from your files. The conversation where it was exchanged is unchanged.`,S_e=((e={},t={})=>(t.locale??V())===`fr`?b_e(e):x_e(e)),C_e=()=>`Indisponible`,w_e=()=>`Unavailable`,T_e=((e={},t={})=>(t.locale??V())===`fr`?C_e(e):w_e(e)),E_e=()=>`Aucun fichier pour le moment.`,D_e=()=>`No files yet.`,O_e=((e={},t={})=>(t.locale??V())===`fr`?E_e(e):D_e(e)),k_e=()=>`Aucun fichier ne correspond aux filtres.`,A_e=()=>`No files match the filters.`,j_e=((e={},t={})=>(t.locale??V())===`fr`?k_e(e):A_e(e)),M_e=e=>`Affichage des ${e?.cap} fichiers les plus récents.`,N_e=e=>`Showing the ${e?.cap} most recent files.`,P_e=((e,t={})=>(t.locale??V())===`fr`?M_e(e):N_e(e)),F_e=()=>`Apparence`,I_e=()=>`Appearance`,L_e=((e={},t={})=>(t.locale??V())===`fr`?F_e(e):I_e(e)),R_e=()=>`Thème par défaut de l’application`,z_e=()=>`Default app theme`,B_e=((e={},t={})=>(t.locale??V())===`fr`?R_e(e):z_e(e)),V_e=()=>`Appliqué aux utilisateurs sans préférence personnelle.`,H_e=()=>`Applied to users without a personal preference.`,U_e=((e={},t={})=>(t.locale??V())===`fr`?V_e(e):H_e(e)),W_e=()=>`Langue par défaut de l’application`,G_e=()=>`Default app language`,K_e=((e={},t={})=>(t.locale??V())===`fr`?W_e(e):G_e(e)),Sk=()=>`Langue des nouveaux utilisateurs qui n’ont pas encore choisi la leur.`,Ck=()=>`Language for new users who haven’t picked their own yet.`,wk=((e={},t={})=>(t.locale??V())===`fr`?Sk(e):Ck(e)),Tk=()=>`Si vous n’avez pas défini votre propre langue, changer ce défaut rechargera votre vue.`,Ek=()=>`If you haven’t set your own language, changing this default will reload your view.`,Dk=((e={},t={})=>(t.locale??V())===`fr`?Tk(e):Ek(e)),Ok=()=>`Référence des composants (design)`,kk=()=>`Component reference (design)`,Ak=((e={},t={})=>(t.locale??V())===`fr`?Ok(e):kk(e)),jk=()=>`Administration de l’apparence`,Mk=()=>`Appearance administration`,Nk=((e={},t={})=>(t.locale??V())===`fr`?jk(e):Mk(e)),Pk=()=>`Réservé aux administrateurs. S’applique à toute l’organisation.`,Fk=()=>`Admins only. Applies to the whole organization.`,Ik=((e={},t={})=>(t.locale??V())===`fr`?Pk(e):Fk(e)),Lk=()=>`Ma charte graphique`,Rk=()=>`My graphic chart`,zk=((e={},t={})=>(t.locale??V())===`fr`?Lk(e):Rk(e)),Bk=()=>`Choisissez la palette appliquée à votre interface, en clair comme en sombre.`,Vk=()=>`Pick the palette applied to your interface, in light and dark.`,Hk=((e={},t={})=>(t.locale??V())===`fr`?Bk(e):Vk(e)),Uk=()=>`Défaut de l’application`,Wk=()=>`Application default`,Gk=((e={},t={})=>(t.locale??V())===`fr`?Uk(e):Wk(e)),Kk=()=>`Suit le défaut de l’application.`,qk=()=>`Follows the application default.`,Jk=((e={},t={})=>(t.locale??V())===`fr`?Kk(e):qk(e)),Yk=()=>`Commune`,Xk=()=>`Common`,Zk=((e={},t={})=>(t.locale??V())===`fr`?Yk(e):Xk(e)),Qk=()=>`La vôtre`,$k=()=>`Yours`,eA=((e={},t={})=>(t.locale??V())===`fr`?Qk(e):$k(e)),tA=e=>`Via le groupe ${e?.group}`,nA=e=>`Via group ${e?.group}`,rA=((e,t={})=>(t.locale??V())===`fr`?tA(e):nA(e)),iA=()=>`Aucune charte disponible pour le moment.`,aA=()=>`No chart available yet.`,oA=((e={},t={})=>(t.locale??V())===`fr`?iA(e):aA(e)),sA=()=>`Charte par défaut de l’application`,cA=()=>`Application default chart`,lA=((e={},t={})=>(t.locale??V())===`fr`?sA(e):cA(e)),uA=()=>`Appliquée aux utilisateurs sans charte personnelle.`,dA=()=>`Applied to users without a personal chart.`,fA=((e={},t={})=>(t.locale??V())===`fr`?uA(e):dA(e)),pA=()=>`Pools de chartes par groupe`,mA=()=>`Group chart pools`,hA=((e={},t={})=>(t.locale??V())===`fr`?pA(e):mA(e)),gA=()=>`Définissez le pool de chaque charte : les groupes qui PEUVENT la proposer. Un gestionnaire de groupe choisit ensuite dans son pool (onglet Groupes). Une charte reste commune tant qu’aucun groupe ne l’a sélectionnée.`,_A=()=>`Define each chart's pool: the groups that MAY offer it. A group manager then selects from its pool (Groups tab). A chart stays common until a group actually selects it.`,vA=((e={},t={})=>(t.locale??V())===`fr`?gA(e):_A(e)),yA=()=>`Charte par domaine`,bA=()=>`Chart by domain`,xA=((e={},t={})=>(t.locale??V())===`fr`?yA(e):bA(e)),SA=()=>`Associez un domaine à une charte publique (intégrée ou commune) : elle devient la charte par défaut sur cet hôte, page de connexion comprise.`,CA=()=>`Map a domain to a public chart (builtin or common): it becomes the default chart on that host, including the login page.`,wA=((e={},t={})=>(t.locale??V())===`fr`?SA(e):CA(e)),TA=()=>`Commune`,EA=()=>`Common`,DA=((e={},t={})=>(t.locale??V())===`fr`?TA(e):EA(e)),OA=()=>`Restreinte`,kA=()=>`Restricted`,AA=((e={},t={})=>(t.locale??V())===`fr`?OA(e):kA(e)),jA=()=>`Défaut`,MA=()=>`Default`,NA=((e={},t={})=>(t.locale??V())===`fr`?jA(e):MA(e)),PA=()=>`Aucun groupe à associer.`,FA=()=>`No group to attach.`,IA=((e={},t={})=>(t.locale??V())===`fr`?PA(e):FA(e)),LA=()=>`Disponible aux groupes (pool)`,RA=()=>`Available to groups (pool)`,zA=((e={},t={})=>(t.locale??V())===`fr`?LA(e):RA(e)),BA=()=>`Ajouter au pool d'un groupe…`,VA=()=>`Add to a group's pool…`,HA=((e={},t={})=>(t.locale??V())===`fr`?BA(e):VA(e)),UA=e=>`Retirer ${e?.group} du pool`,WA=e=>`Remove ${e?.group} from the pool`,GA=((e,t={})=>(t.locale??V())===`fr`?UA(e):WA(e)),KA=()=>`Importer une charte`,qA=()=>`Import a chart`,JA=((e={},t={})=>(t.locale??V())===`fr`?KA(e):qA(e)),YA=()=>`Collez le JSON d’une charte (ou choisissez un fichier .json) pour créer votre charte personnelle. Les couleurs doivent être au format oklch ; les valeurs sont validées et nettoyées côté serveur.`,XA=()=>`Paste a chart's JSON (or pick a .json file) to create your personal chart. Colors must be in oklch format; values are validated and sanitized server-side.`,ZA=((e={},t={})=>(t.locale??V())===`fr`?YA(e):XA(e)),QA=()=>`Nom de la charte`,$A=()=>`Chart name`,ej=((e={},t={})=>(t.locale??V())===`fr`?QA(e):$A(e)),tj=()=>`Ma charte`,nj=()=>`My chart`,rj=((e={},t={})=>(t.locale??V())===`fr`?tj(e):nj(e)),ij=()=>`JSON des tokens`,aj=()=>`Tokens JSON`,oj=((e={},t={})=>(t.locale??V())===`fr`?ij(e):aj(e)),sj=()=>`Collez ici le JSON des tokens (colors.light / colors.dark en oklch, radius, fontSans, fontMono)…`,cj=()=>`Paste the tokens JSON here (colors.light / colors.dark in oklch, radius, fontSans, fontMono)…`,lj=((e={},t={})=>(t.locale??V())===`fr`?sj(e):cj(e)),uj=()=>`Charger un fichier .json`,dj=()=>`Load a .json file`,fj=((e={},t={})=>(t.locale??V())===`fr`?uj(e):dj(e)),pj=()=>`Importer`,mj=()=>`Import`,hj=((e={},t={})=>(t.locale??V())===`fr`?pj(e):mj(e)),gj=()=>`JSON invalide : impossible d’analyser le contenu.`,_j=()=>`Invalid JSON: could not parse the content.`,vj=((e={},t={})=>(t.locale??V())===`fr`?gj(e):_j(e)),yj=()=>`Charte importée.`,bj=()=>`Chart imported.`,xj=((e={},t={})=>(t.locale??V())===`fr`?yj(e):bj(e)),Sj=()=>`Indiquez un nom de charte.`,Cj=()=>`Please provide a chart name.`,wj=((e={},t={})=>(t.locale??V())===`fr`?Sj(e):Cj(e)),Tj=()=>`Mes chartes`,Ej=()=>`My charts`,Dj=((e={},t={})=>(t.locale??V())===`fr`?Tj(e):Ej(e)),Oj=()=>`Les chartes que vous avez importées. Vous pouvez les renommer, modifier leurs tokens, les associer à vos groupes ou les supprimer.`,kj=()=>`The charts you have imported. You can rename them, edit their tokens, associate them with your groups, or delete them.`,Aj=((e={},t={})=>(t.locale??V())===`fr`?Oj(e):kj(e)),jj=()=>`Vous n’avez pas encore importé de charte.`,Mj=()=>`You haven't imported any chart yet.`,Nj=((e={},t={})=>(t.locale??V())===`fr`?jj(e):Mj(e)),Pj=()=>`Modifier`,Fj=()=>`Edit`,Ij=((e={},t={})=>(t.locale??V())===`fr`?Pj(e):Fj(e)),Lj=()=>`Supprimer`,Rj=()=>`Delete`,zj=((e={},t={})=>(t.locale??V())===`fr`?Lj(e):Rj(e)),Bj=()=>`Logo de marque`,Vj=()=>`Brand logo`,Hj=((e={},t={})=>(t.locale??V())===`fr`?Bj(e):Vj(e)),Uj=()=>`Mode clair`,Wj=()=>`Light mode`,Gj=((e={},t={})=>(t.locale??V())===`fr`?Uj(e):Wj(e)),Kj=()=>`Mode sombre`,qj=()=>`Dark mode`,Jj=((e={},t={})=>(t.locale??V())===`fr`?Kj(e):qj(e)),Yj=()=>`Téléverser`,Xj=()=>`Upload`,Zj=((e={},t={})=>(t.locale??V())===`fr`?Yj(e):Xj(e)),Qj=()=>`Remplacer`,$j=()=>`Replace`,eM=((e={},t={})=>(t.locale??V())===`fr`?Qj(e):$j(e)),tM=()=>`Retirer`,nM=()=>`Remove`,rM=((e={},t={})=>(t.locale??V())===`fr`?tM(e):nM(e)),iM=()=>`Générer depuis l’autre mode`,aM=()=>`Generate from the other mode`,oM=((e={},t={})=>(t.locale??V())===`fr`?iM(e):aM(e)),sM=()=>`Traitement…`,cM=()=>`Processing…`,lM=((e={},t={})=>(t.locale??V())===`fr`?sM(e):cM(e)),uM=()=>`Le fichier doit être une image.`,dM=()=>`The file must be an image.`,fM=((e={},t={})=>(t.locale??V())===`fr`?uM(e):dM(e)),pM=()=>`Image trop volumineuse (max 12 Mo).`,mM=()=>`Image too large (max 12 MB).`,hM=((e={},t={})=>(t.locale??V())===`fr`?pM(e):mM(e)),gM=()=>`Format d’image non pris en charge.`,_M=()=>`Unsupported image format.`,vM=((e={},t={})=>(t.locale??V())===`fr`?gM(e):_M(e)),yM=()=>`Traitement de l’image impossible.`,bM=()=>`Could not process the image.`,xM=((e={},t={})=>(t.locale??V())===`fr`?yM(e):bM(e)),SM=()=>`Encodage de l’image impossible.`,CM=()=>`Could not encode the image.`,wM=((e={},t={})=>(t.locale??V())===`fr`?SM(e):CM(e)),TM=()=>`Domaines (admin)`,EM=()=>`Domains (admin)`,DM=((e={},t={})=>(t.locale??V())===`fr`?TM(e):EM(e)),OM=()=>`Quand Atrium est ouvert sur ce domaine, cette charte s’applique par défaut (page de connexion incluse). Ex. chat.acme.com ou *.acme.com.`,kM=()=>`When Atrium is opened on this domain, this chart applies by default (including the login page). E.g. chat.acme.com or *.acme.com.`,AM=((e={},t={})=>(t.locale??V())===`fr`?OM(e):kM(e)),jM=()=>`chat.acme.com ou *.acme.com`,MM=()=>`chat.acme.com or *.acme.com`,NM=((e={},t={})=>(t.locale??V())===`fr`?jM(e):MM(e)),PM=()=>`Ajouter`,FM=()=>`Add`,IM=((e={},t={})=>(t.locale??V())===`fr`?PM(e):FM(e)),LM=()=>`Aucun domaine.`,RM=()=>`No domain.`,zM=((e={},t={})=>(t.locale??V())===`fr`?LM(e):RM(e)),BM=e=>`Retirer ${e?.domain}`,VM=e=>`Remove ${e?.domain}`,HM=((e,t={})=>(t.locale??V())===`fr`?BM(e):VM(e)),UM=()=>`Enregistrer`,WM=()=>`Save`,GM=((e={},t={})=>(t.locale??V())===`fr`?UM(e):WM(e)),KM=()=>`Annuler`,qM=()=>`Cancel`,JM=((e={},t={})=>(t.locale??V())===`fr`?KM(e):qM(e)),YM=()=>`Nom`,XM=()=>`Name`,ZM=((e={},t={})=>(t.locale??V())===`fr`?YM(e):XM(e)),QM=()=>`Tokens (JSON)`,$M=()=>`Tokens (JSON)`,eN=((e={},t={})=>(t.locale??V())===`fr`?QM(e):$M(e)),tN=()=>`Supprimer définitivement cette charte ?`,nN=()=>`Permanently delete this chart?`,rN=((e={},t={})=>(t.locale??V())===`fr`?tN(e):nN(e)),iN=()=>`Chartes personnalisées`,aN=()=>`Custom charts`,oN=((e={},t={})=>(t.locale??V())===`fr`?iN(e):aN(e)),sN=()=>`Gérez les chartes importées par les utilisateurs : promouvoir en commune (offerte à tous) ou supprimer.`,cN=()=>`Manage charts imported by users: promote to common (offered to everyone) or delete.`,lN=((e={},t={})=>(t.locale??V())===`fr`?sN(e):cN(e)),uN=e=>`Propriétaire : ${e?.owner}`,dN=e=>`Owner: ${e?.owner}`,fN=((e,t={})=>(t.locale??V())===`fr`?uN(e):dN(e)),pN=()=>`Personnelle`,mN=()=>`Personal`,hN=((e={},t={})=>(t.locale??V())===`fr`?pN(e):mN(e)),gN=()=>`Commune`,_N=()=>`Common`,vN=((e={},t={})=>(t.locale??V())===`fr`?gN(e):_N(e)),yN=()=>`Promouvoir en commune`,bN=()=>`Promote to common`,xN=((e={},t={})=>(t.locale??V())===`fr`?yN(e):bN(e)),SN=()=>`Supprimer`,CN=()=>`Delete`,wN=((e={},t={})=>(t.locale??V())===`fr`?SN(e):CN(e)),TN=()=>`Aucune charte personnalisée pour le moment.`,EN=()=>`No custom chart yet.`,DN=((e={},t={})=>(t.locale??V())===`fr`?TN(e):EN(e)),ON=()=>`Messages`,kN=()=>`Messages`,AN=((e={},t={})=>(t.locale??V())===`fr`?ON(e):kN(e)),jN=()=>`Composeur`,MN=()=>`Composer`,NN=((e={},t={})=>(t.locale??V())===`fr`?jN(e):MN(e)),PN=()=>`Barre latérale`,FN=()=>`Sidebar`,IN=((e={},t={})=>(t.locale??V())===`fr`?PN(e):FN(e)),LN=()=>`Autre`,RN=()=>`Other`,zN=((e={},t={})=>(t.locale??V())===`fr`?LN(e):RN(e)),BN=()=>`Vue source des messages`,VN=()=>`Message source view`,HN=((e={},t={})=>(t.locale??V())===`fr`?BN(e):VN(e)),UN=()=>`Le bouton </> qui montre le texte brut exact d’un message.`,WN=()=>`The </> button that shows a message’s exact raw text.`,GN=((e={},t={})=>(t.locale??V())===`fr`?UN(e):WN(e)),KN=()=>`Signaler un problème`,qN=()=>`Report a problem`,JN=((e={},t={})=>(t.locale??V())===`fr`?KN(e):qN(e)),YN=()=>`Le drapeau qui envoie un signalement (feedback) sur un message.`,XN=()=>`The flag that sends feedback about a message.`,ZN=((e={},t={})=>(t.locale??V())===`fr`?YN(e):XN(e)),QN=()=>`Copier les réponses de l’IA`,$N=()=>`Copy AI replies`,eP=((e={},t={})=>(t.locale??V())===`fr`?QN(e):$N(e)),tP=()=>`Copier vos messages`,nP=()=>`Copy your messages`,rP=((e={},t={})=>(t.locale??V())===`fr`?tP(e):nP(e)),iP=()=>`Supprimer un message`,aP=()=>`Delete a message`,oP=((e={},t={})=>(t.locale??V())===`fr`?iP(e):aP(e)),sP=()=>`Activité des outils`,cP=()=>`Tool activity`,lP=((e={},t={})=>(t.locale??V())===`fr`?sP(e):cP(e)),uP=()=>`Affiche l’activité des outils et les sources dans la conversation (vue d’analyse, avec détail dépliable). Désactivé : vue épurée centrée sur le contenu — le signal « traitement en cours » reste visible.`,dP=()=>`Shows tool activity and sources in the conversation (analysis view, with expandable detail). Off: a clean, content-focused view — the “processing in progress” signal stays visible.`,fP=((e={},t={})=>(t.locale??V())===`fr`?uP(e):dP(e)),pP=()=>`Saisie vocale (micro)`,mP=()=>`Voice input (mic)`,hP=((e={},t={})=>(t.locale??V())===`fr`?pP(e):mP(e)),gP=()=>`Le bouton micro dans le composeur.`,_P=()=>`The mic button in the composer.`,vP=((e={},t={})=>(t.locale??V())===`fr`?gP(e):_P(e)),yP=()=>`Âge des conversations`,bP=()=>`Conversation age`,xP=((e={},t={})=>(t.locale??V())===`fr`?yP(e):bP(e)),SP=()=>`Afficher l’ancienneté de chaque conversation (ex. « 3j », « 2sem ») dans la liste à gauche.`,CP=()=>`Show each conversation’s age (e.g. “3d”, “2w”) in the left list.`,wP=((e={},t={})=>(t.locale??V())===`fr`?SP(e):CP(e)),TP=()=>`Bridge des conversations`,EP=()=>`Conversation bridge`,DP=((e={},t={})=>(t.locale??V())===`fr`?TP(e):EP(e)),OP=()=>`Marquer le bridge (OpenClaw / Hermes) de chaque conversation dans la liste à gauche. Apparaît uniquement si vos conversations utilisent plusieurs bridges.`,kP=()=>`Tag each conversation’s bridge (OpenClaw / Hermes) in the left list. Shown only if your conversations use more than one bridge.`,AP=((e={},t={})=>(t.locale??V())===`fr`?OP(e):kP(e)),jP=()=>`Filtrer les préférences…`,MP=()=>`Filter preferences…`,NP=((e={},t={})=>(t.locale??V())===`fr`?jP(e):MP(e)),PP=()=>`Aucune préférence ne correspond.`,FP=()=>`No preference matches.`,IP=((e={},t={})=>(t.locale??V())===`fr`?PP(e):FP(e)),LP=()=>`Non activé`,RP=()=>`Not enabled`,zP=((e={},t={})=>(t.locale??V())===`fr`?LP(e):RP(e)),BP=()=>`défaut`,VP=()=>`default`,HP=((e={},t={})=>(t.locale??V())===`fr`?BP(e):VP(e)),UP=()=>`Réinitialiser`,WP=()=>`Reset`,GP=((e={},t={})=>(t.locale??V())===`fr`?UP(e):WP(e)),KP=()=>`Gérer les défauts et verrous`,qP=()=>`Manage defaults and locks`,JP=((e={},t={})=>(t.locale??V())===`fr`?KP(e):qP(e)),YP=()=>`Défaut admin`,XP=()=>`Admin default`,ZP=((e={},t={})=>(t.locale??V())===`fr`?YP(e):XP(e)),QP=()=>`Fonctionnalité activée (système)`,$P=()=>`Feature enabled (system)`,eF=((e={},t={})=>(t.locale??V())===`fr`?QP(e):$P(e)),tF=()=>`Configurez l’interface : activez les fonctionnalités système et définissez les valeurs par défaut héritées par les utilisateurs (chacun peut ensuite les redéfinir dans ses propres préférences).`,nF=()=>`Configure the interface: enable system features and set the defaults users inherit (each can then override them in their own preferences).`,rF=((e={},t={})=>(t.locale??V())===`fr`?tF(e):nF(e)),iF=()=>`Une fonctionnalité non activée ici ne peut pas être activée par les utilisateurs (option grisée).`,aF=()=>`A feature not enabled here cannot be turned on by users (greyed out).`,oF=((e={},t={})=>(t.locale??V())===`fr`?iF(e):aF(e)),sF=()=>`Active le pipeline vocal. Tant que c’est désactivé, l’option reste grisée et non activable par les utilisateurs.`,cF=()=>`Enables the voice pipeline. While off, the option stays greyed and users can’t turn it on.`,lF=((e={},t={})=>(t.locale??V())===`fr`?sF(e):cF(e)),uF=()=>`« Hérité » = la valeur intégrée par défaut de l’application.`,dF=()=>`“Inherited” = the app’s built-in default value.`,fF=((e={},t={})=>(t.locale??V())===`fr`?uF(e):dF(e)),pF=()=>`Activé`,mF=()=>`On`,hF=((e={},t={})=>(t.locale??V())===`fr`?pF(e):mF(e)),gF=()=>`Désactivé`,_F=()=>`Off`,vF=((e={},t={})=>(t.locale??V())===`fr`?gF(e):_F(e)),yF=()=>`Hérité`,bF=()=>`Inherited`,xF=((e={},t={})=>(t.locale??V())===`fr`?yF(e):bF(e)),SF=()=>`Comptes de service pour les agents OpenClaw (auth par clé API). Le texte en clair d’une clé n’est affiché qu’une seule fois à sa création — il n’est jamais stocké ni récupérable ensuite.`,CF=()=>`Service accounts for OpenClaw agents (API key auth). A key's plaintext is shown only once at creation — it is never stored nor retrievable afterwards.`,wF=((e={},t={})=>(t.locale??V())===`fr`?SF(e):CF(e)),TF=()=>`Rechercher un compte`,EF=()=>`Search an account`,DF=((e={},t={})=>(t.locale??V())===`fr`?TF(e):EF(e)),OF=()=>`Rôle`,kF=()=>`Role`,AF=((e={},t={})=>(t.locale??V())===`fr`?OF(e):kF(e)),jF=()=>`Tous les rôles`,MF=()=>`All roles`,NF=((e={},t={})=>(t.locale??V())===`fr`?jF(e):MF(e)),PF=()=>`Tous les statuts`,FF=()=>`All statuses`,IF=((e={},t={})=>(t.locale??V())===`fr`?PF(e):FF(e)),LF=()=>`actif`,RF=()=>`active`,zF=((e={},t={})=>(t.locale??V())===`fr`?LF(e):RF(e)),BF=()=>`désactivé`,VF=()=>`disabled`,HF=((e={},t={})=>(t.locale??V())===`fr`?BF(e):VF(e)),UF=()=>`Comptes de service`,WF=()=>`Service accounts`,GF=((e={},t={})=>(t.locale??V())===`fr`?UF(e):WF(e)),KF=()=>`Ajouter un compte`,qF=()=>`Add an account`,JF=((e={},t={})=>(t.locale??V())===`fr`?KF(e):qF(e)),YF=()=>`Aucun compte de service.`,XF=()=>`No service account.`,ZF=((e={},t={})=>(t.locale??V())===`fr`?YF(e):XF(e)),QF=()=>`Générer une clé API`,$F=()=>`Generate an API key`,eI=((e={},t={})=>(t.locale??V())===`fr`?QF(e):$F(e)),tI=()=>`Masquer les clés`,nI=()=>`Hide keys`,rI=((e={},t={})=>(t.locale??V())===`fr`?tI(e):nI(e)),iI=()=>`Afficher les clés`,aI=()=>`Show keys`,oI=((e={},t={})=>(t.locale??V())===`fr`?iI(e):aI(e)),sI=()=>`Modifier`,cI=()=>`Edit`,lI=((e={},t={})=>(t.locale??V())===`fr`?sI(e):cI(e)),uI=()=>`Supprimer le compte`,dI=()=>`Delete account`,fI=((e={},t={})=>(t.locale??V())===`fr`?uI(e):dI(e)),pI=()=>`Replier`,mI=()=>`Collapse`,hI=((e={},t={})=>(t.locale??V())===`fr`?pI(e):mI(e)),gI=()=>`Déplier`,_I=()=>`Expand`,vI=((e={},t={})=>(t.locale??V())===`fr`?gI(e):_I(e)),yI=()=>`Nom`,bI=()=>`Name`,xI=((e={},t={})=>(t.locale??V())===`fr`?yI(e):bI(e)),SI=()=>`Rôle`,CI=()=>`Role`,wI=((e={},t={})=>(t.locale??V())===`fr`?SI(e):CI(e)),TI=()=>`Statut`,EI=()=>`Status`,DI=((e={},t={})=>(t.locale??V())===`fr`?TI(e):EI(e)),OI=()=>`Expiration de la prochaine clé`,kI=()=>`Next key expiry`,AI=((e={},t={})=>(t.locale??V())===`fr`?OI(e):kI(e)),jI=()=>`Clés`,MI=()=>`Keys`,NI=((e={},t={})=>(t.locale??V())===`fr`?jI(e):MI(e)),PI=()=>`génération…`,FI=()=>`generating…`,II=((e={},t={})=>(t.locale??V())===`fr`?PI(e):FI(e)),LI=e=>`${e?.count} active(s)`,RI=e=>`${e?.count} active`,zI=((e,t={})=>(t.locale??V())===`fr`?LI(e):RI(e)),BI=()=>`Modifier le compte de service`,VI=()=>`Edit service account`,HI=((e={},t={})=>(t.locale??V())===`fr`?BI(e):VI(e)),UI=()=>`Modifier le nom, le rôle et la description.`,WI=()=>`Update the name, role and description.`,GI=((e={},t={})=>(t.locale??V())===`fr`?UI(e):WI(e)),KI=()=>`Enregistrer`,qI=()=>`Save`,JI=((e={},t={})=>(t.locale??V())===`fr`?KI(e):qI(e)),YI=()=>`Nouveau compte de service`,XI=()=>`New service account`,ZI=((e={},t={})=>(t.locale??V())===`fr`?YI(e):XI(e)),QI=()=>`Principal authentifié par clé API (jamais un humain).`,$I=()=>`Principal authenticated by API key (never a human).`,eL=((e={},t={})=>(t.locale??V())===`fr`?QI(e):$I(e)),tL=()=>`Ajouter`,nL=()=>`Add`,rL=((e={},t={})=>(t.locale??V())===`fr`?tL(e):nL(e)),iL=()=>`Nom`,aL=()=>`Name`,oL=((e={},t={})=>(t.locale??V())===`fr`?iL(e):aL(e)),sL=()=>`Rôle`,cL=()=>`Role`,lL=((e={},t={})=>(t.locale??V())===`fr`?sL(e):cL(e)),uL=()=>`Choisir un rôle`,dL=()=>`Choose a role`,fL=((e={},t={})=>(t.locale??V())===`fr`?uL(e):dL(e)),pL=()=>`Description (optionnel)`,mL=()=>`Description (optional)`,hL=((e={},t={})=>(t.locale??V())===`fr`?pL(e):mL(e)),gL=()=>`Échec de la création du compte`,_L=()=>`Failed to create the account`,vL=((e={},t={})=>(t.locale??V())===`fr`?gL(e):_L(e)),yL=()=>`Échec de la modification du compte`,bL=()=>`Failed to update the account`,xL=((e={},t={})=>(t.locale??V())===`fr`?yL(e):bL(e)),SL=()=>`Compte de service mis à jour.`,CL=()=>`Service account updated.`,wL=((e={},t={})=>(t.locale??V())===`fr`?SL(e):CL(e)),TL=()=>`Échec de la génération de la clé`,EL=()=>`Failed to generate the key`,DL=((e={},t={})=>(t.locale??V())===`fr`?TL(e):EL(e)),OL=()=>`Supprimer ce compte de service ?`,kL=()=>`Delete this service account?`,AL=((e={},t={})=>(t.locale??V())===`fr`?OL(e):kL(e)),jL=()=>`Le compte`,ML=()=>`The account`,NL=((e={},t={})=>(t.locale??V())===`fr`?jL(e):ML(e)),PL=()=>`et`,FL=()=>`and`,IL=((e={},t={})=>(t.locale??V())===`fr`?PL(e):FL(e)),LL=()=>`toutes ses clés API`,RL=()=>`all its API keys`,zL=((e={},t={})=>(t.locale??V())===`fr`?LL(e):RL(e)),BL=()=>`seront supprimés définitivement. Cette action est irréversible. Tapez le nom du compte pour confirmer.`,VL=()=>`will be permanently deleted. This action is irreversible. Type the account name to confirm.`,HL=((e={},t={})=>(t.locale??V())===`fr`?BL(e):VL(e)),UL=()=>`Supprimer`,WL=()=>`Delete`,GL=((e={},t={})=>(t.locale??V())===`fr`?UL(e):WL(e)),KL=()=>`Compte de service supprimé`,qL=()=>`Service account deleted`,JL=((e={},t={})=>(t.locale??V())===`fr`?KL(e):qL(e)),YL=()=>`Échec de la suppression du compte`,XL=()=>`Failed to delete the account`,ZL=((e={},t={})=>(t.locale??V())===`fr`?YL(e):XL(e)),QL=()=>`Révoquer cette clé API ?`,$L=()=>`Revoke this API key?`,eR=((e={},t={})=>(t.locale??V())===`fr`?QL(e):$L(e)),tR=()=>`La clé`,nR=()=>`The key`,rR=((e={},t={})=>(t.locale??V())===`fr`?tR(e):nR(e)),iR=()=>`sera désactivée immédiatement et ne pourra plus authentifier de requêtes. Cette action est irréversible.`,aR=()=>`will be disabled immediately and will no longer be able to authenticate requests. This action is irreversible.`,oR=((e={},t={})=>(t.locale??V())===`fr`?iR(e):aR(e)),sR=()=>`Révoquer`,cR=()=>`Revoke`,lR=((e={},t={})=>(t.locale??V())===`fr`?sR(e):cR(e)),uR=()=>`Échec de la révocation`,dR=()=>`Failed to revoke`,fR=((e={},t={})=>(t.locale??V())===`fr`?uR(e):dR(e)),pR=()=>`Clés de`,mR=()=>`Keys of`,hR=((e={},t={})=>(t.locale??V())===`fr`?pR(e):mR(e)),gR=()=>`Aucune clé pour ce compte.`,_R=()=>`No key for this account.`,vR=((e={},t={})=>(t.locale??V())===`fr`?gR(e):_R(e)),yR=()=>`Clé`,bR=()=>`Key`,xR=((e={},t={})=>(t.locale??V())===`fr`?yR(e):bR(e)),SR=()=>`Rôle`,CR=()=>`Role`,wR=((e={},t={})=>(t.locale??V())===`fr`?SR(e):CR(e)),TR=()=>`Créée`,ER=()=>`Created`,DR=((e={},t={})=>(t.locale??V())===`fr`?TR(e):ER(e)),OR=()=>`Dernier usage`,kR=()=>`Last used`,AR=((e={},t={})=>(t.locale??V())===`fr`?OR(e):kR(e)),jR=()=>`Expiration`,MR=()=>`Expiry`,NR=((e={},t={})=>(t.locale??V())===`fr`?jR(e):MR(e)),PR=()=>`Statut`,FR=()=>`Status`,IR=((e={},t={})=>(t.locale??V())===`fr`?PR(e):FR(e)),LR=()=>`Révocation…`,RR=()=>`Revoking…`,zR=((e={},t={})=>(t.locale??V())===`fr`?LR(e):RR(e)),BR=()=>`Révoquer`,VR=()=>`Revoke`,HR=((e={},t={})=>(t.locale??V())===`fr`?BR(e):VR(e)),UR=()=>`Clé API créée`,WR=()=>`API key created`,GR=((e={},t={})=>(t.locale??V())===`fr`?UR(e):WR(e)),KR=e=>`Pour le compte « ${e?.name} ». Copiez-la maintenant.`,qR=e=>`For the account « ${e?.name} ». Copy it now.`,JR=((e,t={})=>(t.locale??V())===`fr`?KR(e):qR(e)),YR=()=>`Stockez cette clé en lieu sûr. Vous ne la reverrez plus jamais. Pour la remplacer, il faudra la révoquer et en générer une nouvelle.`,XR=()=>`Store this key in a safe place. You will never see it again. To replace it, you will have to revoke it and generate a new one.`,ZR=((e={},t={})=>(t.locale??V())===`fr`?YR(e):XR(e)),QR=()=>`Copier la clé`,$R=()=>`Copy the key`,ez=((e={},t={})=>(t.locale??V())===`fr`?QR(e):$R(e)),tz=()=>`Copié`,nz=()=>`Copied`,rz=((e={},t={})=>(t.locale??V())===`fr`?tz(e):nz(e)),iz=()=>`Copier`,az=()=>`Copy`,oz=((e={},t={})=>(t.locale??V())===`fr`?iz(e):az(e)),sz=()=>`J’ai copié la clé`,cz=()=>`I have copied the key`,lz=((e={},t={})=>(t.locale??V())===`fr`?sz(e):cz(e)),uz=()=>`Jamais`,dz=()=>`Never`,fz=((e={},t={})=>(t.locale??V())===`fr`?uz(e):dz(e)),pz=()=>`30 jours`,mz=()=>`30 days`,hz=((e={},t={})=>(t.locale??V())===`fr`?pz(e):mz(e)),gz=()=>`90 jours`,_z=()=>`90 days`,vz=((e={},t={})=>(t.locale??V())===`fr`?gz(e):_z(e)),yz=()=>`Jamais`,bz=()=>`Never`,xz=((e={},t={})=>(t.locale??V())===`fr`?yz(e):bz(e)),Sz=()=>`révoquée`,Cz=()=>`revoked`,wz=((e={},t={})=>(t.locale??V())===`fr`?Sz(e):Cz(e)),Tz=()=>`expirée`,Ez=()=>`expired`,Dz=((e={},t={})=>(t.locale??V())===`fr`?Tz(e):Ez(e)),Oz=()=>`active`,kz=()=>`active`,Az=((e={},t={})=>(t.locale??V())===`fr`?Oz(e):kz(e)),jz=()=>`Sélectionnez ou créez une conversation pour commencer.`,Mz=()=>`Select or create a chat to begin.`,Nz=((e={},t={})=>(t.locale??V())===`fr`?jz(e):Mz(e)),Pz=()=>`Conversation introuvable`,Fz=()=>`Conversation not found`,Iz=((e={},t={})=>(t.locale??V())===`fr`?Pz(e):Fz(e)),Lz=()=>`Ce lien ne correspond à aucune conversation. Elle a peut-être été supprimée, ou l’adresse est incomplète.`,Rz=()=>`This link does not match any conversation. It may have been deleted, or the address is incomplete.`,zz=((e={},t={})=>(t.locale??V())===`fr`?Lz(e):Rz(e)),Bz=()=>`Nouvelle conversation`,Vz=()=>`New conversation`,Hz=((e={},t={})=>(t.locale??V())===`fr`?Bz(e):Vz(e)),Uz=()=>`Derniers messages`,Wz=()=>`Latest messages`,Gz=((e={},t={})=>(t.locale??V())===`fr`?Uz(e):Wz(e)),Kz=()=>`Le service de chat est momentanément indisponible. L’envoi de message est suspendu — réessayez dans un instant. Si cela persiste, contactez votre administrateur.`,qz=()=>`The chat service is temporarily unavailable. Sending messages is suspended — try again in a moment. If this persists, contact your administrator.`,Jz=((e={},t={})=>(t.locale??V())===`fr`?Kz(e):qz(e)),Yz=()=>`Ce chat est en lecture seule : l’agent associé ne t’est plus disponible (ton accès aux agents a été modifié). Démarre un nouveau chat avec un agent disponible.`,Xz=()=>`This chat is read-only: its agent is no longer available to you (your agent access was changed). Start a new chat with an available agent.`,Zz=((e={},t={})=>(t.locale??V())===`fr`?Yz(e):Xz(e)),Qz=()=>`Réponse reçue.`,$z=()=>`Reply received.`,eB=((e={},t={})=>(t.locale??V())===`fr`?Qz(e):$z(e)),tB=()=>`Comment puis-je aider ?`,nB=()=>`How can I help?`,rB=((e={},t={})=>(t.locale??V())===`fr`?tB(e):nB(e)),iB=()=>`Conversation`,aB=()=>`Conversation`,oB=((e={},t={})=>(t.locale??V())===`fr`?iB(e):aB(e)),sB=e=>`Agent de cette conversation : ${e?.name}`,cB=e=>`Agent for this conversation: ${e?.name}`,lB=((e,t={})=>(t.locale??V())===`fr`?sB(e):cB(e)),uB=()=>` (agent par défaut)`,dB=()=>` (default agent)`,fB=((e={},t={})=>(t.locale??V())===`fr`?uB(e):dB(e)),pB=()=>` — cet agent n’existe plus sur la gateway`,mB=()=>` — this agent no longer exists on the gateway`,hB=((e={},t={})=>(t.locale??V())===`fr`?pB(e):mB(e)),gB=()=>` — état non confirmé (gateway injoignable)`,_B=()=>` — state not confirmed (gateway unreachable)`,vB=((e={},t={})=>(t.locale??V())===`fr`?gB(e):_B(e)),yB=e=>`Instance : ${e?.instance}`,bB=e=>`Instance: ${e?.instance}`,xB=((e,t={})=>(t.locale??V())===`fr`?yB(e):bB(e)),SB=()=>`Modèle`,CB=()=>`Model`,wB=((e={},t={})=>(t.locale??V())===`fr`?SB(e):CB(e)),TB=e=>`Modèle · ${e?.provider}`,EB=e=>`Model · ${e?.provider}`,DB=((e,t={})=>(t.locale??V())===`fr`?TB(e):EB(e)),OB=()=>`Niveau de réflexion hérité de l’agent`,kB=()=>`Thinking level inherited from the agent`,AB=((e={},t={})=>(t.locale??V())===`fr`?OB(e):kB(e)),jB=()=>`Niveau de réflexion (spécifique à ce chat)`,MB=()=>`Thinking level (specific to this chat)`,NB=((e={},t={})=>(t.locale??V())===`fr`?jB(e):MB(e)),PB=()=>`Réflexion`,FB=()=>`Thinking`,IB=((e={},t={})=>(t.locale??V())===`fr`?PB(e):FB(e)),LB=()=>`héritée`,RB=()=>`inherited`,zB=((e={},t={})=>(t.locale??V())===`fr`?LB(e):RB(e)),BB=e=>`Contexte utilisé : ${e?.pct}% (${e?.used} / ${e?.total} tokens)`,VB=e=>`Context used: ${e?.pct}% (${e?.used} / ${e?.total} tokens)`,HB=((e,t={})=>(t.locale??V())===`fr`?BB(e):VB(e)),UB=()=>`Contexte`,WB=()=>`Context`,GB=((e={},t={})=>(t.locale??V())===`fr`?UB(e):WB(e)),KB=()=>`Exporter la conversation`,qB=()=>`Export the conversation`,JB=((e={},t={})=>(t.locale??V())===`fr`?KB(e):qB(e)),YB=()=>`Exporter`,XB=()=>`Export`,ZB=((e={},t={})=>(t.locale??V())===`fr`?YB(e):XB(e)),QB=()=>`Markdown (.md)`,$B=()=>`Markdown (.md)`,eV=((e={},t={})=>(t.locale??V())===`fr`?QB(e):$B(e)),tV=()=>`JSON (.json)`,nV=()=>`JSON (.json)`,rV=((e={},t={})=>(t.locale??V())===`fr`?tV(e):nV(e)),iV=()=>`Réglages avancés (réflexion, modèle)`,aV=()=>`Advanced settings (thinking, model)`,oV=((e={},t={})=>(t.locale??V())===`fr`?iV(e):aV(e)),sV=()=>`Avancé`,cV=()=>`Advanced`,lV=((e={},t={})=>(t.locale??V())===`fr`?sV(e):cV(e)),uV=()=>`Supprimer et régénérer cette réponse ?`,dV=()=>`Delete and regenerate this reply?`,fV=((e={},t={})=>(t.locale??V())===`fr`?uV(e):dV(e)),pV=()=>`Cette réponse sera supprimée, puis régénérée à partir de votre dernier message.`,mV=()=>`This reply will be deleted, then regenerated from your last message.`,hV=((e={},t={})=>(t.locale??V())===`fr`?pV(e):mV(e)),gV=()=>`Régénérer`,_V=()=>`Regenerate`,vV=((e={},t={})=>(t.locale??V())===`fr`?gV(e):_V(e)),yV=()=>`Annuler`,bV=()=>`Cancel`,xV=((e={},t={})=>(t.locale??V())===`fr`?yV(e):bV(e)),SV=()=>`Supprimer ce message et les suivants ?`,CV=()=>`Delete this message and the following ones?`,wV=((e={},t={})=>(t.locale??V())===`fr`?SV(e):CV(e)),TV=()=>`Ce message et tous les messages qui le suivent seront supprimés de la conversation. Cette action est irréversible.`,EV=()=>`This message and all messages following it will be deleted from the conversation. This action is irreversible.`,DV=((e={},t={})=>(t.locale??V())===`fr`?TV(e):EV(e)),OV=()=>`Supprimer`,kV=()=>`Delete`,AV=((e={},t={})=>(t.locale??V())===`fr`?OV(e):kV(e)),jV=()=>`Supprimer et régénérer la réponse`,MV=()=>`Delete and regenerate the reply`,NV=((e={},t={})=>(t.locale??V())===`fr`?jV(e):MV(e)),PV=()=>`Supprimer ce message et les suivants`,FV=()=>`Delete this message and the following ones`,IV=((e={},t={})=>(t.locale??V())===`fr`?PV(e):FV(e)),LV=()=>`Supprimer le message`,RV=()=>`Delete the message`,zV=((e={},t={})=>(t.locale??V())===`fr`?LV(e):RV(e)),BV=()=>`La suppression a échoué`,VV=()=>`Delete failed`,HV=((e={},t={})=>(t.locale??V())===`fr`?BV(e):VV(e)),UV=()=>`Sources`,WV=()=>`Sources`,GV=((e={},t={})=>(t.locale??V())===`fr`?UV(e):WV(e)),KV=()=>`1 souvenir`,qV=()=>`1 memory`,JV=((e={},t={})=>(t.locale??V())===`fr`?KV(e):qV(e)),YV=e=>`${e?.count} souvenirs`,XV=e=>`${e?.count} memories`,ZV=((e,t={})=>(t.locale??V())===`fr`?YV(e):XV(e)),QV=()=>`1 document`,$V=()=>`1 document`,eH=((e={},t={})=>(t.locale??V())===`fr`?QV(e):$V(e)),tH=e=>`${e?.count} documents`,nH=e=>`${e?.count} documents`,rH=((e,t={})=>(t.locale??V())===`fr`?tH(e):nH(e)),iH=()=>`Mémoire conversationnelle`,aH=()=>`Conversational memory`,oH=((e={},t={})=>(t.locale??V())===`fr`?iH(e):aH(e)),sH=()=>`Documents`,cH=()=>`Documents`,lH=((e={},t={})=>(t.locale??V())===`fr`?sH(e):cH(e)),uH=()=>`Contexte`,dH=()=>`Context`,fH=((e={},t={})=>(t.locale??V())===`fr`?uH(e):dH(e)),pH=()=>`1 contexte`,mH=()=>`1 context`,hH=((e={},t={})=>(t.locale??V())===`fr`?pH(e):mH(e)),gH=e=>`${e?.count} contextes`,_H=e=>`${e?.count} contexts`,vH=((e,t={})=>(t.locale??V())===`fr`?gH(e):_H(e)),yH=()=>`Contexte du graphe de connaissances`,bH=()=>`Knowledge-graph context`,xH=((e={},t={})=>(t.locale??V())===`fr`?yH(e):bH(e)),SH=e=>`score ${e?.score}`,CH=e=>`score ${e?.score}`,wH=((e,t={})=>(t.locale??V())===`fr`?SH(e):CH(e)),TH=()=>`(sans titre)`,EH=()=>`(untitled)`,DH=((e={},t={})=>(t.locale??V())===`fr`?TH(e):EH(e)),OH=()=>`Sources de la réponse`,kH=()=>`Sources of the reply`,AH=((e={},t={})=>(t.locale??V())===`fr`?OH(e):kH(e)),jH=()=>`Voir les sources de la réponse`,MH=()=>`View the sources of the reply`,NH=((e={},t={})=>(t.locale??V())===`fr`?jH(e):MH(e)),PH=()=>`Rechercher dans les sources…`,FH=()=>`Search the sources…`,IH=((e={},t={})=>(t.locale??V())===`fr`?PH(e):FH(e)),LH=()=>`Aucune source ne correspond à votre recherche.`,RH=()=>`No source matches your search.`,zH=((e={},t={})=>(t.locale??V())===`fr`?LH(e):RH(e)),BH=()=>`Tout sélectionner`,VH=()=>`Select all`,HH=((e={},t={})=>(t.locale??V())===`fr`?BH(e):VH(e)),UH=e=>`${e?.count} document(s) sélectionné(s)`,WH=e=>`${e?.count} document(s) selected`,GH=((e,t={})=>(t.locale??V())===`fr`?UH(e):WH(e)),KH=()=>`Joindre les documents`,qH=()=>`Attach the documents`,JH=((e={},t={})=>(t.locale??V())===`fr`?KH(e):qH(e)),YH=()=>`Récupère les fichiers sources des documents cochés en liens téléchargeables (slot « Source d'origine »).`,XH=()=>`Fetches the checked documents' source files as downloadable links (the "Original source" slot).`,ZH=((e={},t={})=>(t.locale??V())===`fr`?YH(e):XH(e)),QH=e=>`${e?.count} document(s) joint(s) téléchargeable(s) — ouvrir le panneau Sources`,$H=e=>`${e?.count} attached document(s) available for download — open the Sources panel`,eU=((e,t={})=>(t.locale??V())===`fr`?QH(e):$H(e)),tU=()=>`Source d'origine`,nU=()=>`Original source`,rU=((e={},t={})=>(t.locale??V())===`fr`?tU(e):nU(e)),iU=()=>`Aucun agent documentaire configuré`,aU=()=>`No documentary agent configured`,oU=((e={},t={})=>(t.locale??V())===`fr`?iU(e):aU(e)),sU=()=>`Récupération des documents en cours…`,cU=()=>`Fetching the documents…`,lU=((e={},t={})=>(t.locale??V())===`fr`?sU(e):cU(e)),uU=()=>`Récupération des documents lancée — voir le panneau Sources`,dU=()=>`Document fetch started — see the Sources panel`,fU=((e={},t={})=>(t.locale??V())===`fr`?uU(e):dU(e)),pU=()=>`Impossible de lancer la récupération des documents`,mU=()=>`Could not start the document fetch`,hU=((e={},t={})=>(t.locale??V())===`fr`?pU(e):mU(e)),gU=()=>`Récupération…`,_U=()=>`Fetching…`,vU=((e={},t={})=>(t.locale??V())===`fr`?gU(e):_U(e)),yU=()=>`Télécharger la source`,bU=()=>`Download the source`,xU=((e={},t={})=>(t.locale??V())===`fr`?yU(e):bU(e)),SU=()=>`Source introuvable`,CU=()=>`Source not found`,wU=((e={},t={})=>(t.locale??V())===`fr`?SU(e):CU(e)),TU=()=>`Voir plus`,EU=()=>`Show more`,DU=((e={},t={})=>(t.locale??V())===`fr`?TU(e):EU(e)),OU=()=>`Voir moins`,kU=()=>`Show less`,AU=((e={},t={})=>(t.locale??V())===`fr`?OU(e):kU(e)),jU=()=>`Fermer le panneau des sources`,MU=()=>`Close the sources panel`,NU=((e={},t={})=>(t.locale??V())===`fr`?jU(e):MU(e)),PU=()=>`Redimensionner le panneau des sources`,FU=()=>`Resize the sources panel`,IU=((e={},t={})=>(t.locale??V())===`fr`?PU(e):FU(e)),LU=e=>`Source · texte brut exact · ${e?.count} caractère`,RU=e=>`Source · exact raw text · ${e?.count} character`,zU=((e,t={})=>(t.locale??V())===`fr`?LU(e):RU(e)),BU=e=>`Source · texte brut exact · ${e?.count} caractères`,VU=e=>`Source · exact raw text · ${e?.count} characters`,HU=((e,t={})=>(t.locale??V())===`fr`?BU(e):VU(e)),UU=()=>`Copier la source exacte`,WU=()=>`Copy the exact source`,GU=((e={},t={})=>(t.locale??V())===`fr`?UU(e):WU(e)),KU=()=>`(aucun texte)`,qU=()=>`(no text)`,JU=((e={},t={})=>(t.locale??V())===`fr`?KU(e):qU(e)),YU=()=>`Afficher le message rendu`,XU=()=>`Show the rendered message`,ZU=((e={},t={})=>(t.locale??V())===`fr`?YU(e):XU(e)),QU=()=>`Afficher la source (texte brut exact)`,$U=()=>`Show the source (exact raw text)`,eW=((e={},t={})=>(t.locale??V())===`fr`?QU(e):$U(e)),tW=()=>`Afficher la source du message`,nW=()=>`Show the message source`,rW=((e={},t={})=>(t.locale??V())===`fr`?tW(e):nW(e)),iW=()=>`Copier le message`,aW=()=>`Copy the message`,oW=((e={},t={})=>(t.locale??V())===`fr`?iW(e):aW(e)),sW=()=>`Envoi…`,cW=()=>`Sending…`,lW=((e={},t={})=>(t.locale??V())===`fr`?sW(e):cW(e)),uW=e=>`${e?.name} traite votre message…`,dW=e=>`${e?.name} is processing your message…`,fW=((e,t={})=>(t.locale??V())===`fr`?uW(e):dW(e)),pW=e=>`L'agent ${e?.name} traite votre message…`,mW=e=>`The agent ${e?.name} is processing your message…`,hW=((e,t={})=>(t.locale??V())===`fr`?pW(e):mW(e)),gW=()=>`Copier la réponse`,_W=()=>`Copy the reply`,vW=((e={},t={})=>(t.locale??V())===`fr`?gW(e):_W(e)),yW=()=>`Chat indisponible…`,bW=()=>`Chat unavailable…`,xW=((e={},t={})=>(t.locale??V())===`fr`?yW(e):bW(e)),SW=()=>`Message OpenClaw…`,CW=()=>`Message OpenClaw…`,wW=((e={},t={})=>(t.locale??V())===`fr`?SW(e):CW(e)),TW=()=>`Joindre un fichier`,EW=()=>`Attach a file`,DW=((e={},t={})=>(t.locale??V())===`fr`?TW(e):EW(e)),OW=()=>`échec`,kW=()=>`failed`,AW=((e={},t={})=>(t.locale??V())===`fr`?OW(e):kW(e)),jW=e=>`Téléversement du fichier… ${e?.percent}%`,MW=e=>`Uploading file… ${e?.percent}%`,NW=((e,t={})=>(t.locale??V())===`fr`?jW(e):MW(e)),PW=e=>`Téléversement de ${e?.count} fichiers… ${e?.percent}%`,FW=e=>`Uploading ${e?.count} files… ${e?.percent}%`,IW=((e,t={})=>(t.locale??V())===`fr`?PW(e):FW(e)),LW=()=>`Retirer la pièce jointe`,RW=()=>`Remove attachment`,zW=((e={},t={})=>(t.locale??V())===`fr`?LW(e):RW(e)),BW=()=>`Masquer l'activité des outils et revenir à la vue épurée`,VW=()=>`Hide tool activity and return to the clean view`,HW=((e={},t={})=>(t.locale??V())===`fr`?BW(e):VW(e)),UW=()=>`Afficher l'activité des outils (traitements réalisés et en cours)`,WW=()=>`Show tool activity (completed and in-progress processing)`,GW=((e={},t={})=>(t.locale??V())===`fr`?UW(e):WW(e)),KW=()=>`Outils`,qW=()=>`Tools`,JW=((e={},t={})=>(t.locale??V())===`fr`?KW(e):qW(e)),YW=e=>`${e?.count} appel d'outil`,XW=e=>`${e?.count} tool call`,ZW=((e,t={})=>(t.locale??V())===`fr`?YW(e):XW(e)),QW=e=>`${e?.count} appels d'outils`,$W=e=>`${e?.count} tool calls`,eG=((e,t={})=>(t.locale??V())===`fr`?QW(e):$W(e)),tG=()=>`Terminé`,nG=()=>`Done`,rG=((e={},t={})=>(t.locale??V())===`fr`?tG(e):nG(e)),iG=()=>`Échec`,aG=()=>`Failed`,oG=((e={},t={})=>(t.locale??V())===`fr`?iG(e):aG(e)),sG=e=>`exit ${e?.code}`,cG=e=>`exit ${e?.code}`,lG=((e,t={})=>(t.locale??V())===`fr`?sG(e):cG(e)),uG=e=>`${e?.ms} ms`,dG=e=>`${e?.ms} ms`,fG=((e,t={})=>(t.locale??V())===`fr`?uG(e):dG(e)),pG=()=>`Sortie non transmise par la passerelle`,mG=()=>`Output not transmitted by the gateway`,hG=((e={},t={})=>(t.locale??V())===`fr`?pG(e):mG(e)),gG=()=>`en cours`,_G=()=>`running`,vG=((e={},t={})=>(t.locale??V())===`fr`?gG(e):_G(e)),yG=()=>`terminé`,bG=()=>`done`,xG=((e={},t={})=>(t.locale??V())===`fr`?yG(e):bG(e)),SG=()=>`Afficher le détail des appels d'outils`,CG=()=>`Show tool call details`,wG=((e={},t={})=>(t.locale??V())===`fr`?SG(e):CG(e)),TG=()=>`Masquer le détail des appels d'outils`,EG=()=>`Hide tool call details`,DG=((e={},t={})=>(t.locale??V())===`fr`?TG(e):EG(e)),OG=()=>`Dictée vocale — bientôt disponible`,kG=()=>`Voice dictation — coming soon`,AG=((e={},t={})=>(t.locale??V())===`fr`?OG(e):kG(e)),jG=()=>`Dictée vocale (bientôt disponible)`,MG=()=>`Voice dictation (coming soon)`,NG=((e={},t={})=>(t.locale??V())===`fr`?jG(e):MG(e)),PG=()=>`Envoi indisponible (service de chat hors ligne)`,FG=()=>`Sending unavailable (chat service offline)`,IG=((e={},t={})=>(t.locale??V())===`fr`?PG(e):FG(e)),LG=()=>`Envoyer`,RG=()=>`Send`,zG=((e={},t={})=>(t.locale??V())===`fr`?LG(e):RG(e)),BG=()=>`Réponse en cours…`,VG=()=>`Response in progress…`,HG=((e={},t={})=>(t.locale??V())===`fr`?BG(e):VG(e)),UG=()=>`Mettre en file (envoyé après la réponse en cours)`,WG=()=>`Queue (sent after the current reply)`,GG=((e={},t={})=>(t.locale??V())===`fr`?UG(e):WG(e)),KG=()=>`Envoyer après la réponse en cours`,qG=()=>`Send after the current reply`,JG=((e={},t={})=>(t.locale??V())===`fr`?KG(e):qG(e)),YG=()=>`Trop de messages en attente. Patientez la fin de la réponse en cours.`,XG=()=>`Too many messages waiting. Wait for the current reply to finish.`,ZG=((e={},t={})=>(t.locale??V())===`fr`?YG(e):XG(e)),QG=()=>`Impossible de mettre le message en file. Réessayez.`,$G=()=>`Could not queue the message. Try again.`,eK=((e={},t={})=>(t.locale??V())===`fr`?QG(e):$G(e)),tK=()=>`Chargement…`,nK=()=>`Loading…`,rK=((e={},t={})=>(t.locale??V())===`fr`?tK(e):nK(e)),iK=()=>`Configuration des intégrations.`,aK=()=>`Integrations configuration.`,oK=((e={},t={})=>(t.locale??V())===`fr`?iK(e):aK(e)),sK=()=>`Aucune clé API ici`,cK=()=>`No API key here`,lK=((e={},t={})=>(t.locale??V())===`fr`?sK(e):cK(e)),uK=()=>`— elles vivent dans l'environnement du déploiement ; un champ vide retombe sur la variable d'environnement puis le défaut. L'indicateur « configuré » reflète la présence de la clé côté serveur.`,dK=()=>`— they live in the deployment environment; an empty field falls back to the environment variable then the default. The "configured" indicator reflects the presence of the key on the server side.`,fK=((e={},t={})=>(t.locale??V())===`fr`?uK(e):dK(e)),pK=()=>`actif`,mK=()=>`active`,hK=((e={},t={})=>(t.locale??V())===`fr`?pK(e):mK(e)),gK=()=>`en pause`,_K=()=>`paused`,vK=((e={},t={})=>(t.locale??V())===`fr`?gK(e):_K(e)),yK=()=>`clé manquante (env)`,q_e=()=>`key missing (env)`,bK=((e={},t={})=>(t.locale??V())===`fr`?yK(e):q_e(e)),J_e=()=>`appliqué par le bridge (à venir)`,Y_e=()=>`applied by the bridge (coming soon)`,xK=((e={},t={})=>(t.locale??V())===`fr`?J_e(e):Y_e(e)),X_e=()=>`Export des traces. Clés : LANGFUSE_PUBLIC_KEY / LANGFUSE_SECRET_KEY (env).`,Z_e=()=>`Trace export. Keys: LANGFUSE_PUBLIC_KEY / LANGFUSE_SECRET_KEY (env).`,Q_e=((e={},t={})=>(t.locale??V())===`fr`?X_e(e):Z_e(e)),$_e=()=>`Export des traces. Clé : OPIK_API_KEY (env).`,eve=()=>`Trace export. Key: OPIK_API_KEY (env).`,tve=((e={},t={})=>(t.locale??V())===`fr`?$_e(e):eve(e)),nve=()=>`Host`,rve=()=>`Host`,ive=((e={},t={})=>(t.locale??V())===`fr`?nve(e):rve(e)),ave=()=>`Base URL`,ove=()=>`Base URL`,sve=((e={},t={})=>(t.locale??V())===`fr`?ave(e):ove(e)),cve=()=>`Workspace`,lve=()=>`Workspace`,uve=((e={},t={})=>(t.locale??V())===`fr`?cve(e):lve(e)),dve=()=>`(défaut serveur)`,fve=()=>`(server default)`,pve=((e={},t={})=>(t.locale??V())===`fr`?dve(e):fve(e)),mve=()=>`Activé (expédition des traces)`,hve=()=>`Enabled (trace shipping)`,SK=((e={},t={})=>(t.locale??V())===`fr`?mve(e):hve(e)),gve=()=>`Synthèse vocale (TTS)`,_ve=()=>`Text-to-speech (TTS)`,vve=((e={},t={})=>(t.locale??V())===`fr`?gve(e):_ve(e)),yve=()=>`Lecture audio des réponses. Clé du provider via env (ex. OPENAI_API_KEY, ELEVENLABS_API_KEY).`,bve=()=>`Audio playback of replies. Provider key via env (e.g. OPENAI_API_KEY, ELEVENLABS_API_KEY).`,xve=((e={},t={})=>(t.locale??V())===`fr`?yve(e):bve(e)),Sve=()=>`Mode auto`,Cve=()=>`Auto mode`,wve=((e={},t={})=>(t.locale??V())===`fr`?Sve(e):Cve(e)),Tve=()=>`Désactivé`,Eve=()=>`Disabled`,Dve=((e={},t={})=>(t.locale??V())===`fr`?Tve(e):Eve(e)),Ove=()=>`Toujours`,kve=()=>`Always`,Ave=((e={},t={})=>(t.locale??V())===`fr`?Ove(e):kve(e)),jve=()=>`Après un message vocal`,Mve=()=>`After a voice message`,Nve=((e={},t={})=>(t.locale??V())===`fr`?jve(e):Mve(e)),Pve=()=>`Sur directive [[tts:…]]`,Fve=()=>`On [[tts:…]] directive`,Ive=((e={},t={})=>(t.locale??V())===`fr`?Pve(e):Fve(e)),Lve=()=>`Provider`,Rve=()=>`Provider`,zve=((e={},t={})=>(t.locale??V())===`fr`?Lve(e):Rve(e)),Bve=()=>`Microsoft (sans clé)`,Vve=()=>`Microsoft (no key)`,Hve=((e={},t={})=>(t.locale??V())===`fr`?Bve(e):Vve(e)),Uve=()=>`Modèle`,Wve=()=>`Model`,Gve=((e={},t={})=>(t.locale??V())===`fr`?Uve(e):Wve(e)),Kve=()=>`Voix`,qve=()=>`Voice`,CK=((e={},t={})=>(t.locale??V())===`fr`?Kve(e):qve(e)),Jve=()=>`speakerVoiceId / nom de voix`,Yve=()=>`speakerVoiceId / voice name`,Xve=((e={},t={})=>(t.locale??V())===`fr`?Jve(e):Yve(e)),Zve=()=>`Mode conversation (Talk / STS)`,Qve=()=>`Conversation mode (Talk / STS)`,$ve=((e={},t={})=>(t.locale??V())===`fr`?Zve(e):Qve(e)),eye=()=>`OpenAI realtime : OPENAI_API_KEY présent (env). Le navigateur recevra un jeton éphémère minté côté serveur — jamais la clé brute.`,tye=()=>`OpenAI realtime: OPENAI_API_KEY present (env). The browser will receive an ephemeral token minted server-side — never the raw key.`,nye=((e={},t={})=>(t.locale??V())===`fr`?eye(e):tye(e)),rye=()=>`OpenAI realtime : OPENAI_API_KEY ABSENT (env). À définir côté déploiement pour activer gpt-realtime.`,iye=()=>`OpenAI realtime: OPENAI_API_KEY ABSENT (env). To be set on the deployment side to enable gpt-realtime.`,aye=((e={},t={})=>(t.locale??V())===`fr`?rye(e):iye(e)),oye=()=>`Activer le mode conversation`,sye=()=>`Enable conversation mode`,cye=((e={},t={})=>(t.locale??V())===`fr`?oye(e):sye(e)),lye=()=>`Provider realtime`,uye=()=>`Realtime provider`,dye=((e={},t={})=>(t.locale??V())===`fr`?lye(e):uye(e)),fye=()=>`Modèle realtime`,pye=()=>`Realtime model`,mye=((e={},t={})=>(t.locale??V())===`fr`?fye(e):pye(e)),hye=()=>`Transport`,gye=()=>`Transport`,_ye=((e={},t={})=>(t.locale??V())===`fr`?hye(e):gye(e)),vye=()=>`WebRTC (navigateur)`,yye=()=>`WebRTC (browser)`,bye=((e={},t={})=>(t.locale??V())===`fr`?vye(e):yye(e)),xye=()=>`Locale`,Sye=()=>`Locale`,Cye=((e={},t={})=>(t.locale??V())===`fr`?xye(e):Sye(e)),wye=()=>`Interrompre la lecture quand l'utilisateur parle`,Tye=()=>`Interrupt playback when the user speaks`,Eye=((e={},t={})=>(t.locale??V())===`fr`?wye(e):Tye(e)),Dye=()=>`Voice wake (mot d'activation)`,Oye=()=>`Voice wake (wake word)`,kye=((e={},t={})=>(t.locale??V())===`fr`?Dye(e):Oye(e)),Aye=()=>`non câblable dans le navigateur`,jye=()=>`not wireable in the browser`,Mye=((e={},t={})=>(t.locale??V())===`fr`?Aye(e):jye(e)),Nye=()=>`OpenClaw gère le voice-wake côté Gateway avec détection native macOS/iOS (Android = micro manuel) ; le navigateur n'est pas une plateforme supportée. Le câbler dans ce webchat nécessiterait un moteur wake-word côté client (type Porcupine) que nous bâtirions — hors de OpenClaw. Configuration des déclencheurs : RPC gateway`,Pye=()=>`OpenClaw handles voice-wake on the Gateway side with native macOS/iOS detection (Android = manual mic); the browser is not a supported platform. Wiring it into this webchat would require a client-side wake-word engine (Porcupine-style) that we would build — outside OpenClaw. Trigger configuration: gateway RPC`,Fye=((e={},t={})=>(t.locale??V())===`fr`?Nye(e):Pye(e)),Iye=()=>`Curseurs d'expédition`,Lye=()=>`Shipping cursors`,Rye=((e={},t={})=>(t.locale??V())===`fr`?Iye(e):Lye(e)),zye=()=>`Aucun curseur — aucune trace n'a encore été expédiée.`,Bye=()=>`No cursor — no trace has been shipped yet.`,Vye=((e={},t={})=>(t.locale??V())===`fr`?zye(e):Bye(e)),Hye=()=>`Vendeur`,Uye=()=>`Vendor`,Wye=((e={},t={})=>(t.locale??V())===`fr`?Hye(e):Uye(e)),Gye=()=>`Dernier envoi`,Kye=()=>`Last send`,qye=((e={},t={})=>(t.locale??V())===`fr`?Gye(e):Kye(e)),Jye=()=>`Échecs consécutifs`,Yye=()=>`Consecutive failures`,Xye=((e={},t={})=>(t.locale??V())===`fr`?Jye(e):Yye(e)),Zye=()=>`Dernier statut HTTP`,Qye=()=>`Last HTTP status`,$ye=((e={},t={})=>(t.locale??V())===`fr`?Zye(e):Qye(e)),ebe=()=>`Dernière erreur`,tbe=()=>`Last error`,nbe=((e={},t={})=>(t.locale??V())===`fr`?ebe(e):tbe(e)),rbe=()=>`Mots modifiés / altérés`,ibe=()=>`Modified / altered words`,abe=((e={},t={})=>(t.locale??V())===`fr`?rbe(e):ibe(e)),obe=()=>`Réponse incorrecte`,sbe=()=>`Incorrect answer`,cbe=((e={},t={})=>(t.locale??V())===`fr`?obe(e):sbe(e)),lbe=()=>`Incohérence`,ube=()=>`Inconsistency`,dbe=((e={},t={})=>(t.locale??V())===`fr`?lbe(e):ube(e)),fbe=()=>`Formatage`,pbe=()=>`Formatting`,mbe=((e={},t={})=>(t.locale??V())===`fr`?fbe(e):pbe(e)),hbe=()=>`Latence`,gbe=()=>`Latency`,_be=((e={},t={})=>(t.locale??V())===`fr`?hbe(e):gbe(e)),vbe=()=>`Erreur API`,ybe=()=>`API error`,bbe=((e={},t={})=>(t.locale??V())===`fr`?vbe(e):ybe(e)),xbe=()=>`Autre`,Sbe=()=>`Other`,Cbe=((e={},t={})=>(t.locale??V())===`fr`?xbe(e):Sbe(e)),wbe=()=>`reçu = stocké`,Tbe=()=>`received = stored`,Ebe=((e={},t={})=>(t.locale??V())===`fr`?wbe(e):Tbe(e)),Dbe=()=>`affichage fidèle ✓`,Obe=()=>`faithful display ✓`,kbe=((e={},t={})=>(t.locale??V())===`fr`?Dbe(e):Obe(e)),Abe=()=>`écart ⚠`,jbe=()=>`mismatch ⚠`,Mbe=((e={},t={})=>(t.locale??V())===`fr`?Abe(e):jbe(e)),Nbe=()=>`régénération`,Pbe=()=>`regeneration`,Fbe=((e={},t={})=>(t.locale??V())===`fr`?Nbe(e):Pbe(e)),Ibe=()=>`Commentaire du rapporteur`,Lbe=()=>`Reporter's comment`,Rbe=((e={},t={})=>(t.locale??V())===`fr`?Ibe(e):Lbe(e)),zbe=()=>`Échange avec l'utilisateur`,Bbe=()=>`Exchange with the user`,Vbe=((e={},t={})=>(t.locale??V())===`fr`?zbe(e):Bbe(e)),Hbe=()=>`Administrateur`,Ube=()=>`Administrator`,Wbe=((e={},t={})=>(t.locale??V())===`fr`?Hbe(e):Ube(e)),Gbe=()=>`Utilisateur`,Kbe=()=>`User`,qbe=((e={},t={})=>(t.locale??V())===`fr`?Gbe(e):Kbe(e)),Jbe=()=>`Aucune réponse envoyée.`,Ybe=()=>`No reply sent.`,Xbe=((e={},t={})=>(t.locale??V())===`fr`?Jbe(e):Ybe(e)),Zbe=()=>`Répondre à l'utilisateur (visible dans sa zone de notification)…`,Qbe=()=>`Reply to the user (visible in their notification area)…`,$be=((e={},t={})=>(t.locale??V())===`fr`?Zbe(e):Qbe(e)),exe=()=>`Envoi…`,txe=()=>`Sending…`,nxe=((e={},t={})=>(t.locale??V())===`fr`?exe(e):txe(e)),rxe=()=>`Répondre`,ixe=()=>`Reply`,axe=((e={},t={})=>(t.locale??V())===`fr`?rxe(e):ixe(e)),oxe=()=>`Texte stocké (serveur, autoritatif)`,sxe=()=>`Stored text (server, authoritative)`,cxe=((e={},t={})=>(t.locale??V())===`fr`?oxe(e):sxe(e)),lxe=()=>`(vide)`,uxe=()=>`(empty)`,wK=((e={},t={})=>(t.locale??V())===`fr`?lxe(e):uxe(e)),dxe=()=>`Texte affiché (navigateur, au signalement)`,fxe=()=>`Displayed text (browser, at report time)`,pxe=((e={},t={})=>(t.locale??V())===`fr`?dxe(e):fxe(e)),mxe=()=>`Prompt générateur`,hxe=()=>`Generator prompt`,gxe=((e={},t={})=>(t.locale??V())===`fr`?mxe(e):hxe(e)),_xe=e=>`Contexte figé (${e?.count} tours${e?.truncated})`,vxe=e=>`Frozen context (${e?.count} turns${e?.truncated})`,yxe=((e,t={})=>(t.locale??V())===`fr`?_xe(e):vxe(e)),bxe=()=>`, tronqué`,xxe=()=>`, truncated`,Sxe=((e={},t={})=>(t.locale??V())===`fr`?bxe(e):xxe(e)),Cxe=()=>`Payload dispatché (outbox)`,wxe=()=>`Dispatched payload (outbox)`,Txe=((e={},t={})=>(t.locale??V())===`fr`?Cxe(e):wxe(e)),Exe=()=>`Extensions de correction détectées (peuvent altérer le texte)`,Dxe=()=>`Correction extensions detected (may alter the text)`,Oxe=((e={},t={})=>(t.locale??V())===`fr`?Exe(e):Dxe(e)),kxe=()=>`Environnement client`,Axe=()=>`Client environment`,jxe=((e={},t={})=>(t.locale??V())===`fr`?kxe(e):Axe(e)),Mxe=e=>`thème ${e?.theme}`,Nxe=e=>`theme ${e?.theme}`,Pxe=((e,t={})=>(t.locale??V())===`fr`?Mxe(e):Nxe(e)),Fxe=()=>`Plugins :`,Ixe=()=>`Plugins:`,Lxe=((e={},t={})=>(t.locale??V())===`fr`?Fxe(e):Ixe(e)),Rxe=()=>`(navigator.plugins — neutralisé/partiel dans les navigateurs modernes)`,zxe=()=>`(navigator.plugins — neutralized/partial in modern browsers)`,Bxe=((e={},t={})=>(t.locale??V())===`fr`?Rxe(e):zxe(e)),Vxe=()=>`Signalements « Report Feedback » enregistrés. La liste est en métadonnées ; ouvrir le détail lit le contenu figé et`,Hxe=()=>`Recorded "Report Feedback" reports. The list shows metadata; opening the detail reads the frozen content and`,Uxe=((e={},t={})=>(t.locale??V())===`fr`?Vxe(e):Hxe(e)),Wxe=()=>`trace cet accès dans l'Audit`,Gxe=()=>`traces this access in the Audit`,Kxe=((e={},t={})=>(t.locale??V())===`fr`?Wxe(e):Gxe(e)),qxe=()=>`(lecture de contenu d'un autre utilisateur). Fenêtre récente bornée.`,Jxe=()=>`(reading another user's content). Bounded recent window.`,Yxe=((e={},t={})=>(t.locale??V())===`fr`?qxe(e):Jxe(e)),Xxe=()=>`Signalements`,Zxe=()=>`Reports`,Qxe=((e={},t={})=>(t.locale??V())===`fr`?Xxe(e):Zxe(e)),$xe=()=>`Aucun signalement pour l'instant.`,eSe=()=>`No reports yet.`,tSe=((e={},t={})=>(t.locale??V())===`fr`?$xe(e):eSe(e)),nSe=()=>`Quand`,rSe=()=>`When`,iSe=((e={},t={})=>(t.locale??V())===`fr`?nSe(e):rSe(e)),aSe=()=>`Catégorie`,oSe=()=>`Category`,sSe=((e={},t={})=>(t.locale??V())===`fr`?aSe(e):oSe(e)),cSe=()=>`Type`,lSe=()=>`Type`,uSe=((e={},t={})=>(t.locale??V())===`fr`?cSe(e):lSe(e)),dSe=()=>`user`,fSe=()=>`user`,pSe=((e={},t={})=>(t.locale??V())===`fr`?dSe(e):fSe(e)),mSe=()=>`AI`,hSe=()=>`AI`,gSe=((e={},t={})=>(t.locale??V())===`fr`?mSe(e):hSe(e)),_Se=()=>`Rapporteur`,vSe=()=>`Reporter`,ySe=((e={},t={})=>(t.locale??V())===`fr`?_Se(e):vSe(e)),bSe=e=>`(via ${e?.operator})`,xSe=e=>`(via ${e?.operator})`,SSe=((e,t={})=>(t.locale??V())===`fr`?bSe(e):xSe(e)),CSe=()=>`Fidélité`,wSe=()=>`Fidelity`,TSe=((e={},t={})=>(t.locale??V())===`fr`?CSe(e):wSe(e)),ESe=()=>`Note`,DSe=()=>`Note`,OSe=((e={},t={})=>(t.locale??V())===`fr`?ESe(e):DSe(e)),kSe=()=>`Statut`,ASe=()=>`Status`,jSe=((e={},t={})=>(t.locale??V())===`fr`?kSe(e):ASe(e)),MSe=()=>`Répondu`,NSe=()=>`Answered`,PSe=((e={},t={})=>(t.locale??V())===`fr`?MSe(e):NSe(e)),FSe=()=>`En attente`,ISe=()=>`Pending`,LSe=((e={},t={})=>(t.locale??V())===`fr`?FSe(e):ISe(e)),RSe=()=>`Clos par l'utilisateur`,zSe=()=>`Closed by user`,BSe=((e={},t={})=>(t.locale??V())===`fr`?RSe(e):zSe(e)),VSe=()=>`Raison de clôture`,HSe=()=>`Close reason`,USe=((e={},t={})=>(t.locale??V())===`fr`?VSe(e):HSe(e)),WSe=()=>`Masquer`,GSe=()=>`Hide`,KSe=((e={},t={})=>(t.locale??V())===`fr`?WSe(e):GSe(e)),qSe=()=>`Voir le détail`,JSe=()=>`View detail`,YSe=((e={},t={})=>(t.locale??V())===`fr`?qSe(e):JSe(e)),XSe=()=>`Supprimer`,ZSe=()=>`Delete`,QSe=((e={},t={})=>(t.locale??V())===`fr`?XSe(e):ZSe(e)),$Se=()=>`Supprimer ce signalement ?`,eCe=()=>`Delete this report?`,tCe=((e={},t={})=>(t.locale??V())===`fr`?$Se(e):eCe(e)),nCe=()=>`L'instantané forensique figé sera définitivement supprimé. Cette action est irréversible.`,rCe=()=>`The frozen forensic snapshot will be permanently deleted. This action is irreversible.`,iCe=((e={},t={})=>(t.locale??V())===`fr`?nCe(e):rCe(e)),aCe=()=>`Supprimer`,oCe=()=>`Delete`,sCe=((e={},t={})=>(t.locale??V())===`fr`?aCe(e):oCe(e)),cCe=()=>`Aucun onglet`,lCe=()=>`No tabs`,uCe=((e={},t={})=>(t.locale??V())===`fr`?cCe(e):lCe(e)),dCe=e=>`${e?.count} onglets`,fCe=e=>`${e?.count} tabs`,pCe=((e,t={})=>(t.locale??V())===`fr`?dCe(e):fCe(e)),mCe=()=>`Onglets Settings autorisés`,hCe=()=>`Allowed Settings tabs`,gCe=((e={},t={})=>(t.locale??V())===`fr`?mCe(e):hCe(e)),_Ce=()=>`Changement de rôle refusé`,vCe=()=>`Role change refused`,yCe=((e={},t={})=>(t.locale??V())===`fr`?_Ce(e):vCe(e)),bCe=()=>`Mise à jour des permissions refusée`,xCe=()=>`Permission update refused`,SCe=((e={},t={})=>(t.locale??V())===`fr`?bCe(e):xCe(e)),CCe=()=>`Rechercher (email, nom)`,wCe=()=>`Search (email, name)`,TCe=((e={},t={})=>(t.locale??V())===`fr`?CCe(e):wCe(e)),ECe=()=>`Tous les rôles`,DCe=()=>`All roles`,OCe=((e={},t={})=>(t.locale??V())===`fr`?ECe(e):DCe(e)),kCe=()=>`Utilisateurs`,ACe=()=>`Users`,jCe=((e={},t={})=>(t.locale??V())===`fr`?kCe(e):ACe(e)),MCe=()=>`Aucun utilisateur.`,NCe=()=>`No users.`,PCe=((e={},t={})=>(t.locale??V())===`fr`?MCe(e):NCe(e)),FCe=()=>`Voir comme cet utilisateur`,ICe=()=>`View as this user`,LCe=((e={},t={})=>(t.locale??V())===`fr`?FCe(e):ICe(e)),RCe=()=>`Supprimer l’utilisateur`,zCe=()=>`Delete user`,BCe=((e={},t={})=>(t.locale??V())===`fr`?RCe(e):zCe(e)),VCe=()=>`Supprimer cet utilisateur ?`,HCe=()=>`Delete this user?`,UCe=((e={},t={})=>(t.locale??V())===`fr`?VCe(e):HCe(e)),WCe=e=>`« ${e?.user} » et toutes ses données (conversations, fichiers, accès) seront définitivement supprimés. Cette action est irréversible.`,GCe=e=>`“${e?.user}” and all their data (conversations, files, access) will be permanently deleted. This action cannot be undone.`,KCe=((e,t={})=>(t.locale??V())===`fr`?WCe(e):GCe(e)),qCe=()=>`SUPPRIMER`,JCe=()=>`DELETE`,YCe=((e={},t={})=>(t.locale??V())===`fr`?qCe(e):JCe(e)),XCe=()=>`Supprimer définitivement`,ZCe=()=>`Delete permanently`,QCe=((e={},t={})=>(t.locale??V())===`fr`?XCe(e):ZCe(e)),$Ce=()=>`Suppression de l’utilisateur refusée`,ewe=()=>`User deletion refused`,twe=((e={},t={})=>(t.locale??V())===`fr`?$Ce(e):ewe(e)),nwe=e=>`Utilisateur « ${e?.user} » supprimé.`,rwe=e=>`User “${e?.user}” deleted.`,iwe=((e,t={})=>(t.locale??V())===`fr`?nwe(e):rwe(e)),awe=()=>`Renommer`,owe=()=>`Rename`,swe=((e={},t={})=>(t.locale??V())===`fr`?awe(e):owe(e)),cwe=()=>`Renommer l’utilisateur`,lwe=()=>`Rename user`,uwe=((e={},t={})=>(t.locale??V())===`fr`?cwe(e):lwe(e)),dwe=e=>`Nom affiché pour « ${e?.user} »`,fwe=e=>`Display name for “${e?.user}”`,pwe=((e,t={})=>(t.locale??V())===`fr`?dwe(e):fwe(e)),mwe=()=>`Nom et prénom`,hwe=()=>`Name`,gwe=((e={},t={})=>(t.locale??V())===`fr`?mwe(e):hwe(e)),_we=()=>`Nom mis à jour.`,vwe=()=>`Name updated.`,ywe=((e={},t={})=>(t.locale??V())===`fr`?_we(e):vwe(e)),bwe=()=>`Renommage refusé`,xwe=()=>`Rename refused`,Swe=((e={},t={})=>(t.locale??V())===`fr`?bwe(e):xwe(e)),Cwe=()=>`Utilisateur`,wwe=()=>`User`,Twe=((e={},t={})=>(t.locale??V())===`fr`?Cwe(e):wwe(e)),Ewe=()=>`Rôle`,Dwe=()=>`Role`,Owe=((e={},t={})=>(t.locale??V())===`fr`?Ewe(e):Dwe(e)),kwe=()=>`Accès Settings`,Awe=()=>`Settings access`,jwe=((e={},t={})=>(t.locale??V())===`fr`?kwe(e):Awe(e)),Mwe=()=>`Tous (admin)`,Nwe=()=>`All (admin)`,Pwe=((e={},t={})=>(t.locale??V())===`fr`?Mwe(e):Nwe(e)),Fwe=()=>`Agents`,Iwe=()=>`Agents`,TK=((e={},t={})=>(t.locale??V())===`fr`?Fwe(e):Iwe(e)),Lwe=()=>`Gérer les agents`,Rwe=()=>`Manage agents`,EK=((e={},t={})=>(t.locale??V())===`fr`?Lwe(e):Rwe(e)),zwe=()=>`Échec de l’enregistrement de l’instance`,Bwe=()=>`Failed to save instance`,Vwe=((e={},t={})=>(t.locale??V())===`fr`?zwe(e):Bwe(e)),Hwe=()=>`Les agents sont `,Uwe=()=>`Agents are `,Wwe=((e={},t={})=>(t.locale??V())===`fr`?Hwe(e):Uwe(e)),Gwe=()=>`découverts par le bridge`,Kwe=()=>`discovered by the bridge`,qwe=((e={},t={})=>(t.locale??V())===`fr`?Gwe(e):Kwe(e)),Jwe=()=>` (jamais saisis à la main). Les identifiants gateway (token, device, clé API) se configurent par instance via « Identifiants » — chiffrés au repos.`,Ywe=()=>` (never entered by hand). Gateway credentials (token, device identity, API key) are set per instance via “Credentials” — encrypted at rest.`,Xwe=((e={},t={})=>(t.locale??V())===`fr`?Jwe(e):Ywe(e)),Zwe=()=>`Instances`,Qwe=()=>`Instances`,$we=((e={},t={})=>(t.locale??V())===`fr`?Zwe(e):Qwe(e)),eTe=()=>`Ajouter une instance`,tTe=()=>`Add instance`,nTe=((e={},t={})=>(t.locale??V())===`fr`?eTe(e):tTe(e)),rTe=()=>`Aucune instance.`,iTe=()=>`No instances.`,aTe=((e={},t={})=>(t.locale??V())===`fr`?rTe(e):iTe(e)),oTe=()=>`Nom`,sTe=()=>`Name`,cTe=((e={},t={})=>(t.locale??V())===`fr`?oTe(e):sTe(e)),lTe=()=>`Bridge`,uTe=()=>`Bridge`,dTe=((e={},t={})=>(t.locale??V())===`fr`?lTe(e):uTe(e)),fTe=()=>`Gateway URL`,pTe=()=>`Gateway URL`,mTe=((e={},t={})=>(t.locale??V())===`fr`?fTe(e):pTe(e)),hTe=()=>`Affichage`,gTe=()=>`Display`,_Te=((e={},t={})=>(t.locale??V())===`fr`?hTe(e):gTe(e)),vTe=()=>`Configurer le bridge`,yTe=()=>`Configure bridge`,bTe=((e={},t={})=>(t.locale??V())===`fr`?vTe(e):yTe(e)),xTe=()=>`Supprimer`,STe=()=>`Delete`,DK=((e={},t={})=>(t.locale??V())===`fr`?xTe(e):STe(e)),CTe=()=>`Nouvelle instance`,wTe=()=>`New instance`,TTe=((e={},t={})=>(t.locale??V())===`fr`?CTe(e):wTe(e)),ETe=()=>`Modifier`,DTe=()=>`Edit`,OTe=((e={},t={})=>(t.locale??V())===`fr`?ETe(e):DTe(e)),kTe=()=>`Modifier l'instance`,ATe=()=>`Edit instance`,jTe=((e={},t={})=>(t.locale??V())===`fr`?kTe(e):ATe(e)),MTe=()=>`Le nom est la clé de routage et ne peut pas être modifié après création.`,NTe=()=>`The name is the routing key and can't be changed after creation.`,PTe=((e={},t={})=>(t.locale??V())===`fr`?MTe(e):NTe(e)),FTe=()=>`Métadonnées non-secrètes.`,ITe=()=>`Non-secret metadata.`,LTe=((e={},t={})=>(t.locale??V())===`fr`?FTe(e):ITe(e)),RTe=()=>`Enregistrer`,zTe=()=>`Save`,OK=((e={},t={})=>(t.locale??V())===`fr`?RTe(e):zTe(e)),BTe=()=>`Nom de l’instance (ex. main)`,VTe=()=>`Instance name (e.g. main)`,HTe=((e={},t={})=>(t.locale??V())===`fr`?BTe(e):VTe(e)),UTe=()=>`Technologie (bridge)`,WTe=()=>`Technology (bridge)`,GTe=((e={},t={})=>(t.locale??V())===`fr`?UTe(e):WTe(e)),KTe=()=>`Gateway URL (ws(s)://)`,qTe=()=>`Gateway URL (ws(s)://)`,JTe=((e={},t={})=>(t.locale??V())===`fr`?KTe(e):qTe(e)),YTe=()=>`URL du bridge`,XTe=()=>`Bridge URL`,ZTe=((e={},t={})=>(t.locale??V())===`fr`?YTe(e):XTe(e)),QTe=()=>`http://bridge-host:8787 — sinon le BRIDGE_URL du déploiement`,$Te=()=>`http://bridge-host:8787 — else the deployment BRIDGE_URL`,eEe=((e={},t={})=>(t.locale??V())===`fr`?QTe(e):$Te(e)),tEe=()=>`Nom affiché (optionnel)`,nEe=()=>`Display name (optional)`,rEe=((e={},t={})=>(t.locale??V())===`fr`?tEe(e):nEe(e)),iEe=()=>`Version de la gateway (optionnel)`,aEe=()=>`Gateway version (optional)`,oEe=((e={},t={})=>(t.locale??V())===`fr`?iEe(e):aEe(e)),sEe=()=>`ex. 2026.6.5 — repli de compatibilité`,cEe=()=>`e.g. 2026.6.5 — compat fallback`,lEe=((e={},t={})=>(t.locale??V())===`fr`?sEe(e):cEe(e)),uEe=()=>`URL HTTP média (optionnel)`,dEe=()=>`Media HTTP URL (optional)`,fEe=((e={},t={})=>(t.locale??V())===`fr`?uEe(e):dEe(e)),pEe=()=>`Seulement si le média est servi sur un autre hôte/port`,mEe=()=>`Only if media is served on another host/port`,hEe=((e={},t={})=>(t.locale??V())===`fr`?pEe(e):mEe(e)),gEe=()=>`Identifiants`,_Ee=()=>`Credentials`,vEe=((e={},t={})=>(t.locale??V())===`fr`?gEe(e):_Ee(e)),yEe=e=>`Identifiants de la gateway — instance « ${e?.instance} »`,bEe=e=>`Gateway credentials — instance « ${e?.instance} »`,xEe=((e,t={})=>(t.locale??V())===`fr`?yEe(e):bEe(e)),SEe=()=>`Stockés chiffrés au repos. En écriture seule : une valeur n'est jamais réaffichée — définissez-la, remplacez-la ou effacez-la.`,CEe=()=>`Stored encrypted at rest. Write-only: a value is never shown again — set or replace it, or clear it.`,wEe=((e={},t={})=>(t.locale??V())===`fr`?SEe(e):CEe(e)),TEe=()=>`Jeton opérateur`,EEe=()=>`Operator token`,DEe=((e={},t={})=>(t.locale??V())===`fr`?TEe(e):EEe(e)),OEe=()=>`Identité d'appareil (JSON Ed25519)`,kEe=()=>`Device identity (Ed25519 JSON)`,AEe=((e={},t={})=>(t.locale??V())===`fr`?OEe(e):kEe(e)),jEe=()=>`Clé API`,MEe=()=>`API key`,NEe=((e={},t={})=>(t.locale??V())===`fr`?jEe(e):MEe(e)),PEe=()=>`Configuré`,FEe=()=>`Configured`,kK=((e={},t={})=>(t.locale??V())===`fr`?PEe(e):FEe(e)),IEe=()=>`Non défini`,LEe=()=>`Not set`,AK=((e={},t={})=>(t.locale??V())===`fr`?IEe(e):LEe(e)),REe=()=>`Saisir la valeur…`,zEe=()=>`Enter value…`,BEe=((e={},t={})=>(t.locale??V())===`fr`?REe(e):zEe(e)),VEe=()=>`Remplacer la valeur…`,HEe=()=>`Replace value…`,UEe=((e={},t={})=>(t.locale??V())===`fr`?VEe(e):HEe(e)),WEe=()=>`Définir`,GEe=()=>`Set`,KEe=((e={},t={})=>(t.locale??V())===`fr`?WEe(e):GEe(e)),qEe=()=>`Effacer`,JEe=()=>`Clear`,YEe=((e={},t={})=>(t.locale??V())===`fr`?qEe(e):JEe(e)),XEe=()=>`Identifiant enregistré`,ZEe=()=>`Credential saved`,QEe=((e={},t={})=>(t.locale??V())===`fr`?XEe(e):ZEe(e)),$Ee=()=>`Impossible d'enregistrer l'identifiant`,eDe=()=>`Could not save the credential`,jK=((e={},t={})=>(t.locale??V())===`fr`?$Ee(e):eDe(e)),tDe=()=>`Identifiant effacé`,nDe=()=>`Credential cleared`,rDe=((e={},t={})=>(t.locale??V())===`fr`?tDe(e):nDe(e)),iDe=()=>`Générer`,aDe=()=>`Generate`,oDe=((e={},t={})=>(t.locale??V())===`fr`?iDe(e):aDe(e)),sDe=()=>`Crée une identité Ed25519 côté serveur (la clé privée ne touche jamais le navigateur) et l'enregistre. Vous l'appairerez ensuite sur la gateway.`,cDe=()=>`Mints an Ed25519 identity server-side (the private key never reaches the browser) and saves it. You'll then pair it on the gateway.`,lDe=((e={},t={})=>(t.locale??V())===`fr`?sDe(e):cDe(e)),uDe=()=>`Identité générée et enregistrée`,dDe=()=>`Device identity generated and saved`,MK=((e={},t={})=>(t.locale??V())===`fr`?uDe(e):dDe(e)),fDe=()=>`Appairez cet appareil sur votre gateway avec :`,pDe=()=>`Pair this device on your gateway with:`,mDe=((e={},t={})=>(t.locale??V())===`fr`?fDe(e):pDe(e)),hDe=()=>`Impossible de générer l'identité d'appareil`,gDe=()=>`Could not generate the device identity`,_De=((e={},t={})=>(t.locale??V())===`fr`?hDe(e):gDe(e)),vDe=()=>`Synchroniser maintenant`,yDe=()=>`Sync now`,bDe=((e={},t={})=>(t.locale??V())===`fr`?vDe(e):yDe(e)),xDe=()=>`Synchronisation…`,SDe=()=>`Syncing…`,CDe=((e={},t={})=>(t.locale??V())===`fr`?xDe(e):SDe(e)),wDe=()=>`Synchronisation effectuée`,TDe=()=>`Synced`,EDe=((e={},t={})=>(t.locale??V())===`fr`?wDe(e):TDe(e)),DDe=()=>`Échec de la synchronisation`,ODe=()=>`Sync failed`,kDe=((e={},t={})=>(t.locale??V())===`fr`?DDe(e):ODe(e)),ADe=()=>`Aucun agent récupéré — appairez l'appareil sur la gateway (ou vérifiez la configuration de l'instance), puis re-synchronisez`,jDe=()=>`No agents retrieved — pair the device on the gateway (or check the instance configuration), then sync again`,MDe=((e={},t={})=>(t.locale??V())===`fr`?ADe(e):jDe(e)),NDe=()=>`Aucun bridge ne sert cette instance — définissez son « Bridge URL » dans Settings → Agents → Instances.`,PDe=()=>`No bridge serves this instance — set its “Bridge URL” in Settings → Agents → Instances.`,FDe=((e={},t={})=>(t.locale??V())===`fr`?NDe(e):PDe(e)),IDe=()=>`Configuration Convex incomplète : BRIDGE_SHARED_SECRET manquant sur le déploiement.`,LDe=()=>`Convex deployment is misconfigured: BRIDGE_SHARED_SECRET is missing.`,RDe=((e={},t={})=>(t.locale??V())===`fr`?IDe(e):LDe(e)),zDe=()=>`Bridge injoignable — vérifiez qu'il tourne et que son URL est correcte.`,BDe=()=>`Bridge unreachable — check it is running and its URL is correct.`,VDe=((e={},t={})=>(t.locale??V())===`fr`?zDe(e):BDe(e)),HDe=()=>`Le bridge a rejeté l'authentification — BRIDGE_SHARED_SECRET désynchronisé entre Convex et le bridge.`,UDe=()=>`The bridge rejected authentication — BRIDGE_SHARED_SECRET is out of sync between Convex and the bridge.`,WDe=((e={},t={})=>(t.locale??V())===`fr`?HDe(e):UDe(e)),GDe=()=>`Le bridge ne sert pas cette instance — son secret doit figurer dans BRIDGE_INSTANCE_SECRETS et ses identifiants doivent être valides.`,KDe=()=>`The bridge does not serve this instance — its secret must be in BRIDGE_INSTANCE_SECRETS and its credentials must be valid.`,qDe=((e={},t={})=>(t.locale??V())===`fr`?GDe(e):KDe(e)),JDe=()=>`Force le bridge à prendre en compte les identifiants et à récupérer les agents depuis la gateway maintenant (sinon ~2 min via le cron). Déclenche aussi l'appairage si l'appareil n'est pas encore appairé.`,YDe=()=>`Forces the bridge to take the credentials into account and fetch the agents from the gateway now (otherwise ~2 min via the cron). Also triggers pairing if the device is not yet paired.`,XDe=((e={},t={})=>(t.locale??V())===`fr`?JDe(e):YDe(e)),ZDe=()=>`Secret du bridge (bridge → Convex)`,QDe=()=>`Bridge secret (bridge → Convex)`,$De=((e={},t={})=>(t.locale??V())===`fr`?ZDe(e):QDe(e)),eOe=()=>`Authentifie CE bridge auprès de Convex et le lie à cette instance, afin que le bridge ne puisse lire que les secrets de cette gateway. À définir dans l'environnement du bridge. Affiché une seule fois à la génération.`,tOe=()=>`Authenticates THIS bridge to Convex and ties it to this instance, so the bridge can only ever read this gateway's secrets. Set it in the bridge's environment. Shown once at generation.`,nOe=((e={},t={})=>(t.locale??V())===`fr`?eOe(e):tOe(e)),rOe=()=>`Générer`,iOe=()=>`Generate`,aOe=((e={},t={})=>(t.locale??V())===`fr`?rOe(e):iOe(e)),oOe=()=>`Régénérer`,sOe=()=>`Regenerate`,cOe=((e={},t={})=>(t.locale??V())===`fr`?oOe(e):sOe(e)),lOe=()=>`Révoquer`,uOe=()=>`Revoke`,dOe=((e={},t={})=>(t.locale??V())===`fr`?lOe(e):uOe(e)),fOe=()=>`Secret du bridge révoqué`,pOe=()=>`Bridge secret revoked`,mOe=((e={},t={})=>(t.locale??V())===`fr`?fOe(e):pOe(e)),hOe=()=>`Impossible de générer le secret du bridge`,gOe=()=>`Could not generate the bridge secret`,NK=((e={},t={})=>(t.locale??V())===`fr`?hOe(e):gOe(e)),_Oe=()=>`Copiez ce secret maintenant — il ne sera plus jamais affiché. Placez-le dans la variable d'environnement du bridge.`,vOe=()=>`Copy this secret now — it is never shown again. Put it in the bridge's environment variable.`,yOe=((e={},t={})=>(t.locale??V())===`fr`?_Oe(e):vOe(e)),bOe=()=>`J'ai copié le secret`,xOe=()=>`I've copied the secret`,PK=((e={},t={})=>(t.locale??V())===`fr`?bOe(e):xOe(e)),SOe=e=>`Agents — instance « ${e?.name} »`,COe=e=>`Agents — instance « ${e?.name} »`,wOe=((e,t={})=>(t.locale??V())===`fr`?SOe(e):COe(e)),TOe=()=>`Les agents sont découverts par le bridge. Coche ceux à rendre disponibles en aval (assignables aux groupes/users), et choisis un défaut. Un agent désactivé reste listé mais grisé.`,EOe=()=>`Agents are discovered by the bridge. Tick the ones to make available downstream (assignable to groups/users), and pick one default. A disabled agent stays listed but greyed.`,DOe=((e={},t={})=>(t.locale??V())===`fr`?TOe(e):EOe(e)),OOe=()=>`Impossible de mettre à jour l’agent`,kOe=()=>`Could not update the agent`,FK=((e={},t={})=>(t.locale??V())===`fr`?OOe(e):kOe(e)),AOe=()=>`Types`,jOe=()=>`Types`,MOe=((e={},t={})=>(t.locale??V())===`fr`?AOe(e):jOe(e)),NOe=()=>`Gérer`,POe=()=>`Manage`,FOe=((e={},t={})=>(t.locale??V())===`fr`?NOe(e):POe(e)),IOe=()=>`Types de l'agent`,LOe=()=>`Agent types`,ROe=((e={},t={})=>(t.locale??V())===`fr`?IOe(e):LOe(e)),zOe=()=>`Un agent peut avoir plusieurs types. Chaque type indique à Atrium comment l'agent peut être utilisé.`,BOe=()=>`An agent may hold several types. Each type tells Atrium how the agent can be used.`,VOe=((e={},t={})=>(t.locale??V())===`fr`?zOe(e):BOe(e)),HOe=()=>`Conversationnel`,UOe=()=>`Conversational`,WOe=((e={},t={})=>(t.locale??V())===`fr`?HOe(e):UOe(e)),GOe=()=>`Agent de chat standard — répond aux messages des utilisateurs dans une conversation.`,KOe=()=>`Standard chat agent — answers users' messages in a conversation.`,qOe=((e={},t={})=>(t.locale??V())===`fr`?GOe(e):KOe(e)),JOe=()=>`Source documentaire`,YOe=()=>`Documentary source`,XOe=((e={},t={})=>(t.locale??V())===`fr`?JOe(e):YOe(e)),ZOe=()=>`Agent spécialisé appelé par une action Atrium dédiée pour exploiter une source documentaire — pas de chat direct.`,QOe=()=>`Specialised agent invoked by a dedicated Atrium action to exploit a documentary source — not used for direct chat.`,$Oe=((e={},t={})=>(t.locale??V())===`fr`?ZOe(e):QOe(e)),eke=()=>`Définir par défaut`,tke=()=>`Set as default`,nke=((e={},t={})=>(t.locale??V())===`fr`?eke(e):tke(e)),rke=()=>`Retirer`,ike=()=>`Remove`,ake=((e={},t={})=>(t.locale??V())===`fr`?rke(e):ike(e)),oke=e=>`Retirer ${e?.name} ?`,ske=e=>`Remove ${e?.name}?`,cke=((e,t={})=>(t.locale??V())===`fr`?oke(e):ske(e)),lke=()=>`Cet agent n’existe plus sur le gateway. Le retirer le supprime aussi de la liste d’agents de chaque groupe et utilisateur. Action irréversible.`,uke=()=>`This agent no longer exists on the gateway. Removing it also removes it from every group's and user's agent list. This cannot be undone.`,dke=((e={},t={})=>(t.locale??V())===`fr`?lke(e):uke(e)),fke=()=>`Retirer`,pke=()=>`Remove`,mke=((e={},t={})=>(t.locale??V())===`fr`?fke(e):pke(e)),hke=()=>`Agent retiré`,gke=()=>`Agent removed`,_ke=((e={},t={})=>(t.locale??V())===`fr`?hke(e):gke(e)),vke=()=>`Chargement…`,yke=()=>`Loading…`,bke=((e={},t={})=>(t.locale??V())===`fr`?vke(e):yke(e)),xke=()=>`Jamais sondé.`,Ske=()=>`Never polled.`,Cke=((e={},t={})=>(t.locale??V())===`fr`?xke(e):Ske(e)),wke=()=>`Découverte OK.`,Tke=()=>`Discovery OK.`,Eke=((e={},t={})=>(t.locale??V())===`fr`?wke(e):Tke(e)),Dke=e=>`Hors-ligne (${e?.error}) — dernier bon résultat servi.`,Oke=e=>`Offline (${e?.error}) — last good result served.`,kke=((e,t={})=>(t.locale??V())===`fr`?Dke(e):Oke(e)),Ake=()=>`Aucun agent découvert.`,jke=()=>`No agent discovered.`,Mke=((e={},t={})=>(t.locale??V())===`fr`?Ake(e):jke(e)),Nke=()=>`défaut`,Pke=()=>`default`,IK=((e={},t={})=>(t.locale??V())===`fr`?Nke(e):Pke(e)),Fke=()=>`supprimé`,Ike=()=>`removed`,Lke=((e={},t={})=>(t.locale??V())===`fr`?Fke(e):Ike(e)),Rke=()=>`Trace des actions effectuées sous usurpation d’identité : qui a réellement agi (acteur réel) et au nom de quel utilisateur. Le contenu des messages n’est jamais enregistré.`,zke=()=>`Trace of actions performed under impersonation: who really acted (real actor) and on behalf of which user. Message content is never recorded.`,Bke=((e={},t={})=>(t.locale??V())===`fr`?Rke(e):zke(e)),Vke=()=>`Fenêtre récente bornée — une plage antérieure peut être partielle.`,Hke=()=>`Bounded recent window — an earlier range may be partial.`,Uke=((e={},t={})=>(t.locale??V())===`fr`?Vke(e):Hke(e)),Wke=()=>`Rechercher (action, acteur, ressource)`,Gke=()=>`Search (action, actor, resource)`,Kke=((e={},t={})=>(t.locale??V())===`fr`?Wke(e):Gke(e)),qke=()=>`Action`,Jke=()=>`Action`,LK=((e={},t={})=>(t.locale??V())===`fr`?qke(e):Jke(e)),Yke=()=>`Toutes les actions`,Xke=()=>`All actions`,Zke=((e={},t={})=>(t.locale??V())===`fr`?Yke(e):Xke(e)),Qke=()=>`Usurpation : toutes`,$ke=()=>`Impersonation: all`,eAe=((e={},t={})=>(t.locale??V())===`fr`?Qke(e):$ke(e)),tAe=()=>`Sous usurpation`,nAe=()=>`Under impersonation`,rAe=((e={},t={})=>(t.locale??V())===`fr`?tAe(e):nAe(e)),iAe=()=>`Sans usurpation`,aAe=()=>`Without impersonation`,oAe=((e={},t={})=>(t.locale??V())===`fr`?iAe(e):aAe(e)),sAe=()=>`Ressource`,cAe=()=>`Resource`,RK=((e={},t={})=>(t.locale??V())===`fr`?sAe(e):cAe(e)),lAe=()=>`Toutes les ressources`,uAe=()=>`All resources`,dAe=((e={},t={})=>(t.locale??V())===`fr`?lAe(e):uAe(e)),fAe=()=>`Audit`,pAe=()=>`Audit`,mAe=((e={},t={})=>(t.locale??V())===`fr`?fAe(e):pAe(e)),hAe=()=>`Aucune action tracée pour l’instant.`,gAe=()=>`No action traced yet.`,_Ae=((e={},t={})=>(t.locale??V())===`fr`?hAe(e):gAe(e)),vAe=()=>`Quand`,yAe=()=>`When`,bAe=((e={},t={})=>(t.locale??V())===`fr`?vAe(e):yAe(e)),xAe=()=>`Acteur réel`,SAe=()=>`Real actor`,CAe=((e={},t={})=>(t.locale??V())===`fr`?xAe(e):SAe(e)),wAe=()=>`Au nom de`,TAe=()=>`On behalf of`,EAe=((e={},t={})=>(t.locale??V())===`fr`?wAe(e):TAe(e)),DAe=()=>`Traces`,OAe=()=>`Traces`,kAe=((e={},t={})=>(t.locale??V())===`fr`?DAe(e):OAe(e)),AAe=()=>`KPI`,jAe=()=>`KPI`,MAe=((e={},t={})=>(t.locale??V())===`fr`?AAe(e):jAe(e)),NAe=()=>`OpenClaw / Anomalies`,PAe=()=>`OpenClaw / Anomalies`,FAe=((e={},t={})=>(t.locale??V())===`fr`?NAe(e):PAe(e)),IAe=()=>`Chats`,LAe=()=>`Chats`,RAe=((e={},t={})=>(t.locale??V())===`fr`?IAe(e):LAe(e)),zAe=()=>`Admin`,BAe=()=>`Admin`,VAe=((e={},t={})=>(t.locale??V())===`fr`?zAe(e):BAe(e)),HAe=()=>`Lire`,UAe=()=>`Read`,zK=((e={},t={})=>(t.locale??V())===`fr`?HAe(e):UAe(e)),WAe=()=>`Contenu`,GAe=()=>`Content`,KAe=((e={},t={})=>(t.locale??V())===`fr`?WAe(e):GAe(e)),qAe=()=>`Écrire`,JAe=()=>`Write`,BK=((e={},t={})=>(t.locale??V())===`fr`?qAe(e):JAe(e)),YAe=()=>`Requête`,XAe=()=>`Query`,ZAe=((e={},t={})=>(t.locale??V())===`fr`?YAe(e):XAe(e)),QAe=()=>`Anomalies`,$Ae=()=>`Anomalies`,eje=((e={},t={})=>(t.locale??V())===`fr`?QAe(e):$Ae(e)),tje=()=>`Signaler`,nje=()=>`Report`,rje=((e={},t={})=>(t.locale??V())===`fr`?tje(e):nje(e)),ije=()=>`Gérer`,aje=()=>`Manage`,oje=((e={},t={})=>(t.locale??V())===`fr`?ije(e):aje(e)),sje=()=>`Auto-correction`,cje=()=>`Self-heal`,lje=((e={},t={})=>(t.locale??V())===`fr`?sje(e):cje(e)),uje=e=>`${e?.key} — accès au contenu brut (PHI), à accorder avec prudence`,dje=e=>`${e?.key} — access to raw content (PHI), grant with caution`,fje=((e,t={})=>(t.locale??V())===`fr`?uje(e):dje(e)),pje=()=>`Échec de l’initialisation des rôles`,mje=()=>`Failed to initialize roles`,hje=((e={},t={})=>(t.locale??V())===`fr`?pje(e):mje(e)),gje=e=>`Modifier le rôle intégré « ${e?.name} » ?`,_je=e=>`Edit the built-in role “${e?.name}”?`,vje=((e,t={})=>(t.locale??V())===`fr`?gje(e):_je(e)),yje=()=>`Les rôles intégrés sont la base du modèle de permissions. Les modifier peut affecter les comptes existants. Continuer ?`,bje=()=>`Built-in roles are the foundation of the permission model. Editing them may affect existing accounts. Continue?`,xje=((e={},t={})=>(t.locale??V())===`fr`?yje(e):bje(e)),Sje=()=>`Modifier`,Cje=()=>`Edit`,wje=((e={},t={})=>(t.locale??V())===`fr`?Sje(e):Cje(e)),Tje=()=>`Échec de la mise à jour des permissions`,Eje=()=>`Failed to update permissions`,Dje=((e={},t={})=>(t.locale??V())===`fr`?Tje(e):Eje(e)),Oje=()=>`Échec de la création du rôle`,kje=()=>`Failed to create role`,Aje=((e={},t={})=>(t.locale??V())===`fr`?Oje(e):kje(e)),jje=()=>`Matrice de permissions. Lignes = rôles (intégrés + personnalisés), colonnes = clés de permission. Le rôle`,Mje=()=>`Permission matrix. Rows = roles (built-in + custom), columns = permission keys. The`,Nje=((e={},t={})=>(t.locale??V())===`fr`?jje(e):Mje(e)),Pje=()=>`détient le joker « * » (toutes les permissions) et est verrouillé. La colonne`,Fje=()=>`role holds the “*” wildcard (all permissions) and is locked. The`,Ije=((e={},t={})=>(t.locale??V())===`fr`?Pje(e):Fje(e)),Lje=()=>`donne accès au contenu brut (PHI) — à n’accorder qu’à bon escient.`,Rje=()=>`column grants access to raw content (PHI) — grant only when justified.`,zje=((e={},t={})=>(t.locale??V())===`fr`?Lje(e):Rje(e)),Bje=()=>`Rôles`,Vje=()=>`Roles`,Hje=((e={},t={})=>(t.locale??V())===`fr`?Bje(e):Vje(e)),Uje=()=>`Ajouter un rôle`,Wje=()=>`Add a role`,Gje=((e={},t={})=>(t.locale??V())===`fr`?Uje(e):Wje(e)),Kje=()=>`Chargement…`,qje=()=>`Loading…`,Jje=((e={},t={})=>(t.locale??V())===`fr`?Kje(e):qje(e)),Yje=()=>`Initialisation des rôles…`,Xje=()=>`Initializing roles…`,Zje=((e={},t={})=>(t.locale??V())===`fr`?Yje(e):Xje(e)),Qje=()=>`Rôle`,$je=()=>`Role`,eMe=((e={},t={})=>(t.locale??V())===`fr`?Qje(e):$je(e)),tMe=()=>`intégré`,nMe=()=>`built-in`,rMe=((e={},t={})=>(t.locale??V())===`fr`?tMe(e):nMe(e)),iMe=()=>`personnalisé`,aMe=()=>`custom`,oMe=((e={},t={})=>(t.locale??V())===`fr`?iMe(e):aMe(e)),sMe=()=>`Authentifié mais pas encore approuvé — l’accès est bloqué tant qu’un administrateur n’a pas validé le compte.`,cMe=()=>`Authenticated but not yet approved — access is blocked until an admin approves the account.`,lMe=((e={},t={})=>(t.locale??V())===`fr`?sMe(e):cMe(e)),uMe=()=>`Personne approuvée, avec accès au chat.`,dMe=()=>`Approved person with chat access.`,fMe=((e={},t={})=>(t.locale??V())===`fr`?uMe(e):dMe(e)),pMe=()=>`Accès total (superset) : gère les utilisateurs, rôles, agents, instances et l’observabilité.`,mMe=()=>`Full access (superset): manages users, roles, agents, instances and observability.`,hMe=((e={},t={})=>(t.locale??V())===`fr`?pMe(e):mMe(e)),gMe=()=>`Compte de service en LECTURE SEULE pour superviser : voit les traces, KPI, anomalies et l’état du bridge/version via l’API. Ne peut rien écrire ni déclencher.`,_Me=()=>`READ-ONLY service account for monitoring: views traces, KPIs, anomalies and bridge/version status through the API. Cannot write or trigger anything.`,vMe=((e={},t={})=>(t.locale??V())===`fr`?gMe(e):_Me(e)),yMe=()=>`Compte de service pour un agent OpenClaw lui-même : tout ce que voit l’observateur, PLUS interroger OpenClaw et SIGNALER des anomalies (écriture — ex. heartbeat / auto-réparation). À utiliser pour un agent automatisé, pas pour un humain qui consulte les tableaux de bord.`,bMe=()=>`Service account for an OpenClaw agent itself: the observer's read access PLUS querying OpenClaw and REPORTING anomalies (write — e.g. heartbeat / self-repair). Use it for an automated agent, not a human watching dashboards.`,xMe=((e={},t={})=>(t.locale??V())===`fr`?yMe(e):bMe(e)),SMe=()=>`Accordé via « * » (toutes les permissions)`,CMe=()=>`Granted via “*” (all permissions)`,wMe=((e={},t={})=>(t.locale??V())===`fr`?SMe(e):CMe(e)),TMe=()=>`Écriture en cours…`,EMe=()=>`Writing…`,DMe=((e={},t={})=>(t.locale??V())===`fr`?TMe(e):EMe(e)),OMe=()=>`Nouveau rôle`,kMe=()=>`New role`,AMe=((e={},t={})=>(t.locale??V())===`fr`?OMe(e):kMe(e)),jMe=()=>`Rôle personnalisé. Ajustez les permissions dans la matrice après création.`,MMe=()=>`Custom role. Adjust the permissions in the matrix after creation.`,NMe=((e={},t={})=>(t.locale??V())===`fr`?jMe(e):MMe(e)),PMe=()=>`Créer`,FMe=()=>`Create`,IMe=((e={},t={})=>(t.locale??V())===`fr`?PMe(e):FMe(e)),LMe=()=>`Clé (identifiant stable)`,RMe=()=>`Key (stable identifier)`,zMe=((e={},t={})=>(t.locale??V())===`fr`?LMe(e):RMe(e)),BMe=()=>`ex. analyst`,VMe=()=>`e.g. analyst`,HMe=((e={},t={})=>(t.locale??V())===`fr`?BMe(e):VMe(e)),UMe=()=>`Nom affiché`,WMe=()=>`Display name`,GMe=((e={},t={})=>(t.locale??V())===`fr`?UMe(e):WMe(e)),KMe=()=>`Description (optionnel)`,qMe=()=>`Description (optional)`,JMe=((e={},t={})=>(t.locale??V())===`fr`?KMe(e):qMe(e)),YMe=()=>`Ouvertes`,XMe=()=>`Open`,ZMe=((e={},t={})=>(t.locale??V())===`fr`?YMe(e):XMe(e)),QMe=()=>`En sourdine`,$Me=()=>`Muted`,eNe=((e={},t={})=>(t.locale??V())===`fr`?QMe(e):$Me(e)),tNe=()=>`Résolues`,nNe=()=>`Resolved`,rNe=((e={},t={})=>(t.locale??V())===`fr`?tNe(e):nNe(e)),iNe=()=>`Résoudre cette anomalie ?`,aNe=()=>`Resolve this anomaly?`,oNe=((e={},t={})=>(t.locale??V())===`fr`?iNe(e):aNe(e)),sNe=()=>`L’anomalie`,cNe=()=>`The anomaly`,lNe=((e={},t={})=>(t.locale??V())===`fr`?sNe(e):cNe(e)),uNe=()=>`sera marquée comme`,dNe=()=>`will be marked as`,fNe=((e={},t={})=>(t.locale??V())===`fr`?uNe(e):dNe(e)),pNe=()=>`résolue`,mNe=()=>`resolved`,hNe=((e={},t={})=>(t.locale??V())===`fr`?pNe(e):mNe(e)),gNe=()=>`Elle sortira du décompte des anomalies ouvertes (signal de self-repair OpenClaw).`,_Ne=()=>`It will be removed from the open anomalies count (OpenClaw self-repair signal).`,vNe=((e={},t={})=>(t.locale??V())===`fr`?gNe(e):_Ne(e)),yNe=()=>`Résoudre`,bNe=()=>`Resolve`,xNe=((e={},t={})=>(t.locale??V())===`fr`?yNe(e):bNe(e)),SNe=()=>`Anomalie résolue`,CNe=()=>`Anomaly resolved`,wNe=((e={},t={})=>(t.locale??V())===`fr`?SNe(e):CNe(e)),TNe=()=>`Échec de la résolution`,ENe=()=>`Resolution failed`,DNe=((e={},t={})=>(t.locale??V())===`fr`?TNe(e):ENe(e)),ONe=()=>`Anomalie acquittée`,kNe=()=>`Anomaly acknowledged`,ANe=((e={},t={})=>(t.locale??V())===`fr`?ONe(e):kNe(e)),jNe=()=>`Échec de l’acquittement`,MNe=()=>`Acknowledgement failed`,NNe=((e={},t={})=>(t.locale??V())===`fr`?jNe(e):MNe(e)),PNe=()=>`Anomalies détectées (cron) ou signalées par les agents OpenClaw. Données non-PHI uniquement (type, sévérité, message, corrélation).`,FNe=()=>`Anomalies detected (cron) or reported by OpenClaw agents. Non-PHI data only (type, severity, message, correlation).`,INe=((e={},t={})=>(t.locale??V())===`fr`?PNe(e):FNe(e)),LNe=()=>`Ouverte`,RNe=()=>`Open`,zNe=((e={},t={})=>(t.locale??V())===`fr`?LNe(e):RNe(e)),BNe=()=>`= active, elle alerte et compte dans le heartbeat.`,VNe=()=>`= active, it alerts and counts in the heartbeat.`,HNe=((e={},t={})=>(t.locale??V())===`fr`?BNe(e):VNe(e)),UNe=()=>`En sourdine`,WNe=()=>`Muted`,GNe=((e={},t={})=>(t.locale??V())===`fr`?UNe(e):WNe(e)),KNe=()=>`= vue, plus d'alerte, mais pas forcément corrigée (les admins sont notifiés des nouvelles anomalies).`,qNe=()=>`= seen, no more alerts, but not necessarily fixed (admins are notified of new anomalies).`,JNe=((e={},t={})=>(t.locale??V())===`fr`?KNe(e):qNe(e)),YNe=()=>`Résolue`,XNe=()=>`Resolved`,ZNe=((e={},t={})=>(t.locale??V())===`fr`?YNe(e):XNe(e)),QNe=()=>`= le problème est réglé (le détecteur résout automatiquement quand la condition cesse). Les deux la sortent du décompte heartbeat.`,$Ne=()=>`= the problem is fixed (the detector resolves automatically when the condition clears). Both remove it from the heartbeat count.`,ePe=((e={},t={})=>(t.locale??V())===`fr`?QNe(e):$Ne(e)),tPe=()=>`La plage temporelle filtre la fenêtre récente — une plage antérieure peut être partielle.`,nPe=()=>`The time range filters the recent window — an earlier range may be partial.`,rPe=((e={},t={})=>(t.locale??V())===`fr`?tPe(e):nPe(e)),iPe=()=>`Rechercher (message, type, corrélation)`,aPe=()=>`Search (message, type, correlation)`,oPe=((e={},t={})=>(t.locale??V())===`fr`?iPe(e):aPe(e)),sPe=()=>`Tous les statuts`,cPe=()=>`All statuses`,lPe=((e={},t={})=>(t.locale??V())===`fr`?sPe(e):cPe(e)),uPe=()=>`Sévérité`,dPe=()=>`Severity`,VK=((e={},t={})=>(t.locale??V())===`fr`?uPe(e):dPe(e)),fPe=()=>`Toutes sévérités`,pPe=()=>`All severities`,mPe=((e={},t={})=>(t.locale??V())===`fr`?fPe(e):pPe(e)),hPe=()=>`Source`,gPe=()=>`Source`,HK=((e={},t={})=>(t.locale??V())===`fr`?hPe(e):gPe(e)),_Pe=()=>`Toutes sources`,vPe=()=>`All sources`,yPe=((e={},t={})=>(t.locale??V())===`fr`?_Pe(e):vPe(e)),bPe=()=>`Type`,xPe=()=>`Type`,UK=((e={},t={})=>(t.locale??V())===`fr`?bPe(e):xPe(e)),SPe=()=>`Tous les types`,CPe=()=>`All types`,wPe=((e={},t={})=>(t.locale??V())===`fr`?SPe(e):CPe(e)),TPe=()=>`Anomalies`,EPe=()=>`Anomalies`,DPe=((e={},t={})=>(t.locale??V())===`fr`?TPe(e):EPe(e)),OPe=()=>`Aucune anomalie ouverte. 🎉`,kPe=()=>`No open anomalies. 🎉`,APe=((e={},t={})=>(t.locale??V())===`fr`?OPe(e):kPe(e)),jPe=()=>`Aucune anomalie enregistrée.`,MPe=()=>`No anomalies recorded.`,NPe=((e={},t={})=>(t.locale??V())===`fr`?jPe(e):MPe(e)),PPe=()=>`Résoudre (corrigé)`,FPe=()=>`Resolve (fixed)`,IPe=((e={},t={})=>(t.locale??V())===`fr`?PPe(e):FPe(e)),LPe=()=>`Marquer comme vue (sourdine)`,RPe=()=>`Mark as seen (mute)`,zPe=((e={},t={})=>(t.locale??V())===`fr`?LPe(e):RPe(e)),BPe=()=>`Quand`,VPe=()=>`When`,HPe=((e={},t={})=>(t.locale??V())===`fr`?BPe(e):VPe(e)),UPe=()=>`Statut`,WPe=()=>`Status`,GPe=((e={},t={})=>(t.locale??V())===`fr`?UPe(e):WPe(e)),KPe=()=>`Message`,qPe=()=>`Message`,JPe=((e={},t={})=>(t.locale??V())===`fr`?KPe(e):qPe(e)),YPe=()=>`Cause & correctif`,XPe=()=>`Cause & fix`,ZPe=((e={},t={})=>(t.locale??V())===`fr`?YPe(e):XPe(e)),QPe=()=>`Corrélation`,$Pe=()=>`Correlation`,eFe=((e={},t={})=>(t.locale??V())===`fr`?QPe(e):$Pe(e)),tFe=()=>`Voir la trace`,nFe=()=>`View trace`,rFe=((e={},t={})=>(t.locale??V())===`fr`?tFe(e):nFe(e)),iFe=()=>`ouverte`,aFe=()=>`open`,oFe=((e={},t={})=>(t.locale??V())===`fr`?iFe(e):aFe(e)),sFe=()=>`en sourdine`,cFe=()=>`muted`,lFe=((e={},t={})=>(t.locale??V())===`fr`?sFe(e):cFe(e)),uFe=()=>`résolue`,dFe=()=>`resolved`,fFe=((e={},t={})=>(t.locale??V())===`fr`?uFe(e):dFe(e)),pFe=()=>`Réponse incorrecte`,mFe=()=>`Incorrect response`,hFe=((e={},t={})=>(t.locale??V())===`fr`?pFe(e):mFe(e)),gFe=()=>`Incohérence`,_Fe=()=>`Inconsistency`,vFe=((e={},t={})=>(t.locale??V())===`fr`?gFe(e):_Fe(e)),yFe=()=>`Mots / orthographe erronés`,bFe=()=>`Wrong words / spelling`,xFe=((e={},t={})=>(t.locale??V())===`fr`?yFe(e):bFe(e)),SFe=()=>`Formatage`,CFe=()=>`Formatting`,wFe=((e={},t={})=>(t.locale??V())===`fr`?SFe(e):CFe(e)),TFe=()=>`Latence`,EFe=()=>`Latency`,DFe=((e={},t={})=>(t.locale??V())===`fr`?TFe(e):EFe(e)),OFe=()=>`Erreur API`,kFe=()=>`API error`,AFe=((e={},t={})=>(t.locale??V())===`fr`?OFe(e):kFe(e)),jFe=()=>`Autre`,MFe=()=>`Other`,WK=((e={},t={})=>(t.locale??V())===`fr`?jFe(e):MFe(e)),NFe=()=>`Mots modifiés à l'envoi`,PFe=()=>`Words altered on send`,FFe=((e={},t={})=>(t.locale??V())===`fr`?NFe(e):PFe(e)),IFe=()=>`Caractères / mise en forme altérés`,LFe=()=>`Characters / formatting altered`,RFe=((e={},t={})=>(t.locale??V())===`fr`?IFe(e):LFe(e)),zFe=()=>`Signaler un problème`,BFe=()=>`Report an issue`,VFe=((e={},t={})=>(t.locale??V())===`fr`?zFe(e):BFe(e)),HFe=()=>`Merci. Un instantané complet de ce message a été figé pour analyse.`,UFe=()=>`Thank you. A complete snapshot of this message has been frozen for analysis.`,WFe=((e={},t={})=>(t.locale??V())===`fr`?HFe(e):UFe(e)),GFe=()=>`Signalez un problème avec votre message tel qu'il a été envoyé. Un instantané forensique exact est enregistré.`,KFe=()=>`Report an issue with your message as it was sent. An exact forensic snapshot is recorded.`,qFe=((e={},t={})=>(t.locale??V())===`fr`?GFe(e):KFe(e)),JFe=()=>`Signalez un problème avec cette réponse. Un instantané forensique exact est enregistré au moment de l'envoi.`,YFe=()=>`Report an issue with this response. An exact forensic snapshot is recorded at send time.`,XFe=((e={},t={})=>(t.locale??V())===`fr`?JFe(e):YFe(e)),ZFe=()=>`✓ Le texte affiché (vue source) correspond exactement, caractère pour caractère, au texte stocké côté serveur. La comparaison est figée comme preuve.`,QFe=()=>`✓ The displayed text (source view) matches exactly, character for character, the text stored on the server. The comparison is frozen as evidence.`,$Fe=((e={},t={})=>(t.locale??V())===`fr`?ZFe(e):QFe(e)),eIe=()=>`⚠ Écart détecté entre le texte affiché (vue source) et le texte stocké. L'instantané a figé les deux versions.`,tIe=()=>`⚠ Discrepancy detected between the displayed text (source view) and the stored text. The snapshot has frozen both versions.`,nIe=((e={},t={})=>(t.locale??V())===`fr`?eIe(e):tIe(e)),rIe=()=>`Instantané enregistré. Pour vérifier que l'affichage n'altère aucun caractère, ouvrez la vue source (</>) sur ce message puis signalez à nouveau : la comparaison portera alors sur le texte réellement affiché par le navigateur.`,iIe=()=>`Snapshot recorded. To verify that the display does not alter any character, open the source view (</>) on this message then report again: the comparison will then be on the text actually rendered by the browser.`,aIe=((e={},t={})=>(t.locale??V())===`fr`?rIe(e):iIe(e)),oIe=()=>`Catégorie`,sIe=()=>`Category`,cIe=((e={},t={})=>(t.locale??V())===`fr`?oIe(e):sIe(e)),lIe=()=>`Choisir une catégorie`,uIe=()=>`Choose a category`,dIe=((e={},t={})=>(t.locale??V())===`fr`?lIe(e):uIe(e)),fIe=()=>`Commentaire`,pIe=()=>`Comment`,mIe=((e={},t={})=>(t.locale??V())===`fr`?fIe(e):pIe(e)),hIe=()=>`Décrivez le problème…`,gIe=()=>`Describe the issue…`,_Ie=((e={},t={})=>(t.locale??V())===`fr`?hIe(e):gIe(e)),vIe=()=>`Fermer`,yIe=()=>`Close`,bIe=((e={},t={})=>(t.locale??V())===`fr`?vIe(e):yIe(e)),xIe=()=>`Annuler`,SIe=()=>`Cancel`,CIe=((e={},t={})=>(t.locale??V())===`fr`?xIe(e):SIe(e)),wIe=()=>`Envoi…`,TIe=()=>`Sending…`,EIe=((e={},t={})=>(t.locale??V())===`fr`?wIe(e):TIe(e)),DIe=()=>`Envoyer`,OIe=()=>`Send`,kIe=((e={},t={})=>(t.locale??V())===`fr`?DIe(e):OIe(e)),AIe=()=>`Problème signalé`,jIe=()=>`Issue reported`,MIe=((e={},t={})=>(t.locale??V())===`fr`?AIe(e):jIe(e)),NIe=()=>`Signaler un problème`,PIe=()=>`Report an issue`,FIe=((e={},t={})=>(t.locale??V())===`fr`?NIe(e):PIe(e)),IIe=()=>`Signaler un problème avec ce message`,LIe=()=>`Report an issue with this message`,RIe=((e={},t={})=>(t.locale??V())===`fr`?IIe(e):LIe(e)),zIe=()=>`Événements récents (fenêtre bornée, plus récents d’abord). Toutes les traces sont des métadonnées `,BIe=()=>`Recent events (bounded window, newest first). All traces are redacted metadata `,VIe=((e={},t={})=>(t.locale??V())===`fr`?zIe(e):BIe(e)),HIe=()=>`expurgées`,UIe=()=>`redacted`,WIe=((e={},t={})=>(t.locale??V())===`fr`?HIe(e):UIe(e)),GIe=()=>` : aucun contenu de message, pièce jointe ou jeton n’est stocké — uniquement des longueurs, codes et indicateurs.`,KIe=()=>`: no message content, attachment or token is stored — only lengths, codes and flags.`,qIe=((e={},t={})=>(t.locale??V())===`fr`?GIe(e):KIe(e)),JIe=()=>`La plage temporelle filtre la fenêtre récente — une plage antérieure peut être partielle.`,YIe=()=>`The time range filters the recent window — an older range may be partial.`,XIe=((e={},t={})=>(t.locale??V())===`fr`?JIe(e):YIe(e)),ZIe=()=>`Rechercher (kind, principal, rôle, route, correlationId)`,QIe=()=>`Search (kind, principal, role, route, correlationId)`,$Ie=((e={},t={})=>(t.locale??V())===`fr`?ZIe(e):QIe(e)),eLe=()=>`Statut`,tLe=()=>`Status`,nLe=((e={},t={})=>(t.locale??V())===`fr`?eLe(e):tLe(e)),rLe=()=>`Tous statuts`,iLe=()=>`All statuses`,aLe=((e={},t={})=>(t.locale??V())===`fr`?rLe(e):iLe(e)),oLe=()=>`Principal`,sLe=()=>`Principal`,cLe=((e={},t={})=>(t.locale??V())===`fr`?oLe(e):sLe(e)),lLe=()=>`Tous principaux`,uLe=()=>`All principals`,dLe=((e={},t={})=>(t.locale??V())===`fr`?lLe(e):uLe(e)),fLe=()=>`Direction`,pLe=()=>`Direction`,mLe=((e={},t={})=>(t.locale??V())===`fr`?fLe(e):pLe(e)),hLe=()=>`Toutes directions`,gLe=()=>`All directions`,_Le=((e={},t={})=>(t.locale??V())===`fr`?hLe(e):gLe(e)),vLe=()=>`Rôle`,yLe=()=>`Role`,bLe=((e={},t={})=>(t.locale??V())===`fr`?vLe(e):yLe(e)),xLe=()=>`Tous les rôles`,SLe=()=>`All roles`,CLe=((e={},t={})=>(t.locale??V())===`fr`?xLe(e):SLe(e)),wLe=()=>`Tous les kinds`,TLe=()=>`All kinds`,ELe=((e={},t={})=>(t.locale??V())===`fr`?wLe(e):TLe(e)),DLe=()=>`tous les kinds`,OLe=()=>`all kinds`,kLe=((e={},t={})=>(t.locale??V())===`fr`?DLe(e):OLe(e)),ALe=e=>`${e?.count} lignes`,jLe=e=>`${e?.count} rows`,MLe=((e,t={})=>(t.locale??V())===`fr`?ALe(e):jLe(e)),NLe=()=>`Effacer le filtre de corrélation`,PLe=()=>`Clear correlation filter`,FLe=((e={},t={})=>(t.locale??V())===`fr`?NLe(e):PLe(e)),ILe=()=>`filtre: correlationId=`,LLe=()=>`filter: correlationId=`,RLe=((e={},t={})=>(t.locale??V())===`fr`?ILe(e):LLe(e)),zLe=()=>`Effacer`,BLe=()=>`Clear`,VLe=((e={},t={})=>(t.locale??V())===`fr`?zLe(e):BLe(e)),HLe=()=>`Traces`,ULe=()=>`Traces`,WLe=((e={},t={})=>(t.locale??V())===`fr`?HLe(e):ULe(e)),GLe=()=>`Aucun événement pour cette corrélation dans la fenêtre.`,KLe=()=>`No event for this correlation in the window.`,qLe=((e={},t={})=>(t.locale??V())===`fr`?GLe(e):KLe(e)),JLe=()=>`Aucun événement tracé pour l’instant.`,YLe=()=>`No traced event yet.`,XLe=((e={},t={})=>(t.locale??V())===`fr`?JLe(e):YLe(e)),ZLe=()=>`Quand`,QLe=()=>`When`,$Le=((e={},t={})=>(t.locale??V())===`fr`?ZLe(e):QLe(e)),eRe=()=>`Kind`,tRe=()=>`Kind`,nRe=((e={},t={})=>(t.locale??V())===`fr`?eRe(e):tRe(e)),rRe=()=>`Résultat`,iRe=()=>`Result`,aRe=((e={},t={})=>(t.locale??V())===`fr`?rRe(e):iRe(e)),oRe=()=>`ok`,sRe=()=>`ok`,cRe=((e={},t={})=>(t.locale??V())===`fr`?oRe(e):sRe(e)),lRe=()=>`Direction`,uRe=()=>`Direction`,dRe=((e={},t={})=>(t.locale??V())===`fr`?lRe(e):uRe(e)),fRe=()=>`Principal`,pRe=()=>`Principal`,mRe=((e={},t={})=>(t.locale??V())===`fr`?fRe(e):pRe(e)),hRe=()=>`Rôle`,gRe=()=>`Role`,_Re=((e={},t={})=>(t.locale??V())===`fr`?hRe(e):gRe(e)),vRe=()=>`Route`,yRe=()=>`Route`,bRe=((e={},t={})=>(t.locale??V())===`fr`?vRe(e):yRe(e)),xRe=()=>`Statut`,SRe=()=>`Status`,CRe=((e={},t={})=>(t.locale??V())===`fr`?xRe(e):SRe(e)),wRe=()=>`Latence`,TRe=()=>`Latency`,ERe=((e={},t={})=>(t.locale??V())===`fr`?wRe(e):TRe(e)),DRe=()=>`Corrélation`,ORe=()=>`Correlation`,kRe=((e={},t={})=>(t.locale??V())===`fr`?DRe(e):ORe(e)),ARe=()=>`Suivre ce tour (filtrer par correlationId)`,jRe=()=>`Follow this turn (filter by correlationId)`,MRe=((e={},t={})=>(t.locale??V())===`fr`?ARe(e):jRe(e)),NRe=()=>`Meta`,PRe=()=>`Meta`,FRe=((e={},t={})=>(t.locale??V())===`fr`?NRe(e):PRe(e)),IRe=()=>`Voir`,LRe=()=>`View`,RRe=((e={},t={})=>(t.locale??V())===`fr`?IRe(e):LRe(e)),zRe=()=>`Meta ·`,BRe=()=>`Meta ·`,VRe=((e={},t={})=>(t.locale??V())===`fr`?zRe(e):BRe(e)),HRe=()=>`expurgé`,URe=()=>`redacted`,WRe=((e={},t={})=>(t.locale??V())===`fr`?HRe(e):URe(e)),GRe=()=>`Métadonnées non-PHI uniquement (longueurs, codes, indicateurs). Aucun contenu de message n’est stocké.`,KRe=()=>`Non-PHI metadata only (lengths, codes, flags). No message content is stored.`,qRe=((e={},t={})=>(t.locale??V())===`fr`?GRe(e):KRe(e)),JRe=()=>`Chargement…`,YRe=()=>`Loading…`,GK=((e={},t={})=>(t.locale??V())===`fr`?JRe(e):YRe(e)),XRe=()=>`Connexion refusée. Le domaine de ce compte n’est pas autorisé.`,ZRe=()=>`Sign-in refused. This account’s email domain is not allowed.`,QRe=((e={},t={})=>(t.locale??V())===`fr`?XRe(e):ZRe(e)),$Re=()=>`Bon retour`,eze=()=>`Welcome back`,tze=((e={},t={})=>(t.locale??V())===`fr`?$Re(e):eze(e)),nze=()=>`Connectez-vous pour continuer`,rze=()=>`Sign in to continue`,ize=((e={},t={})=>(t.locale??V())===`fr`?nze(e):rze(e)),aze=()=>`Se connecter avec Google`,oze=()=>`Sign in with Google`,sze=((e={},t={})=>(t.locale??V())===`fr`?aze(e):oze(e)),cze=()=>`Aucun mode de connexion configuré.`,lze=()=>`No sign-in method configured.`,uze=((e={},t={})=>(t.locale??V())===`fr`?cze(e):lze(e)),dze=()=>`Continuer (dev, sans compte)`,fze=()=>`Continue (dev, no account)`,pze=((e={},t={})=>(t.locale??V())===`fr`?dze(e):fze(e)),mze=()=>`Compte`,hze=()=>`Account`,gze=((e={},t={})=>(t.locale??V())===`fr`?mze(e):hze(e)),_ze=()=>`En attente d’approbation`,vze=()=>`Awaiting approval`,yze=((e={},t={})=>(t.locale??V())===`fr`?_ze(e):vze(e)),bze=()=>`Ton compte est créé mais doit être approuvé par un administrateur avant d’accéder au chat.`,xze=()=>`Your account has been created but must be approved by an administrator before you can access the chat.`,Sze=((e={},t={})=>(t.locale??V())===`fr`?bze(e):xze(e)),Cze=()=>`Vous explorez l’application en tant que`,wze=()=>`You are exploring the application as`,Tze=((e={},t={})=>(t.locale??V())===`fr`?Cze(e):wze(e)),Eze=()=>`. Toute action est exécutée et tracée en votre nom (`,Dze=()=>`. Every action is executed and traced in your name (`,Oze=((e={},t={})=>(t.locale??V())===`fr`?Eze(e):Dze(e)),kze=()=>`).`,Aze=()=>`).`,jze=((e={},t={})=>(t.locale??V())===`fr`?kze(e):Aze(e)),Mze=()=>`Quitter`,Nze=()=>`Exit`,Pze=((e={},t={})=>(t.locale??V())===`fr`?Mze(e):Nze(e)),Fze=()=>`Afficher la barre latérale`,Ize=()=>`Show sidebar`,Lze=((e={},t={})=>(t.locale??V())===`fr`?Fze(e):Ize(e)),Rze=()=>`Réduire la barre latérale`,zze=()=>`Collapse sidebar`,Bze=((e={},t={})=>(t.locale??V())===`fr`?Rze(e):zze(e)),Vze=()=>`Paramètres`,Hze=()=>`Settings`,Uze=((e={},t={})=>(t.locale??V())===`fr`?Vze(e):Hze(e)),Wze=()=>`Redimensionner la barre latérale`,Gze=()=>`Resize sidebar`,Kze=((e={},t={})=>(t.locale??V())===`fr`?Wze(e):Gze(e)),qze=()=>`Accès non autorisé`,Jze=()=>`Access denied`,Yze=((e={},t={})=>(t.locale??V())===`fr`?qze(e):Jze(e)),Xze=()=>`Vous n’avez pas la permission de consulter cet onglet. Choisissez un onglet disponible dans le menu, ou contactez votre administrateur.`,Zze=()=>`You do not have permission to view this tab. Choose an available tab from the menu, or contact your administrator.`,Qze=((e={},t={})=>(t.locale??V())===`fr`?Xze(e):Zze(e)),$ze=()=>`Une erreur est survenue`,eBe=()=>`Something went wrong`,tBe=((e={},t={})=>(t.locale??V())===`fr`?$ze(e):eBe(e)),nBe=()=>`Cette page n’a pas pu être affichée. Réessayez, ou revenez à l’accueil. Si le problème persiste, contactez votre administrateur.`,rBe=()=>`This page could not be displayed. Try again, or return home. If the problem persists, contact your administrator.`,iBe=((e={},t={})=>(t.locale??V())===`fr`?nBe(e):rBe(e)),aBe=()=>`Réessayer`,oBe=()=>`Retry`,sBe=((e={},t={})=>(t.locale??V())===`fr`?aBe(e):oBe(e)),cBe=()=>`Accueil`,lBe=()=>`Home`,KK=((e={},t={})=>(t.locale??V())===`fr`?cBe(e):lBe(e)),uBe=()=>`Page introuvable`,dBe=()=>`Page not found`,fBe=((e={},t={})=>(t.locale??V())===`fr`?uBe(e):dBe(e)),pBe=()=>`Cette adresse ne correspond à aucune page de l’application.`,mBe=()=>`This address does not match any page in the application.`,hBe=((e={},t={})=>(t.locale??V())===`fr`?pBe(e):mBe(e)),gBe=e=>`Agents de ${e?.user}`,_Be=e=>`${e?.user}'s agents`,vBe=((e,t={})=>(t.locale??V())===`fr`?gBe(e):_Be(e)),yBe=()=>`Associez les agents découverts (par instance) et désignez l'agent par défaut. Au moins un agent est requis pour créer des conversations.`,bBe=()=>`Assign the discovered agents (per instance) and designate the default agent. At least one agent is required to create conversations.`,xBe=((e={},t={})=>(t.locale??V())===`fr`?yBe(e):bBe(e)),SBe=()=>`Agents des groupes du membre. Cochez pour restreindre à une sélection ; sans coche, le membre voit tous ces agents.`,CBe=()=>`The member's group agents. Check to restrict to a selection; with none checked, the member sees all of them.`,wBe=((e={},t={})=>(t.locale??V())===`fr`?SBe(e):CBe(e)),TBe=()=>`Le membre n'appartient à aucun groupe : il voit tous les agents. Cochez pour restreindre à une sélection.`,EBe=()=>`The member belongs to no group, so they see every agent. Check to restrict to a selection.`,DBe=((e={},t={})=>(t.locale??V())===`fr`?TBe(e):EBe(e)),OBe=()=>`Chargement…`,kBe=()=>`Loading…`,ABe=((e={},t={})=>(t.locale??V())===`fr`?OBe(e):kBe(e)),jBe=()=>`Mise à jour de l'accès refusée`,MBe=()=>`Access update denied`,NBe=((e={},t={})=>(t.locale??V())===`fr`?jBe(e):MBe(e)),PBe=()=>`Définition de l'agent par défaut refusée`,FBe=()=>`Setting the default agent was denied`,IBe=((e={},t={})=>(t.locale??V())===`fr`?PBe(e):FBe(e)),LBe=()=>`Aucun agent découvert.`,RBe=()=>`No agent discovered.`,zBe=((e={},t={})=>(t.locale??V())===`fr`?LBe(e):RBe(e)),BBe=e=>`Assigner ${e?.name}`,VBe=e=>`Assign ${e?.name}`,HBe=((e,t={})=>(t.locale??V())===`fr`?BBe(e):VBe(e)),UBe=()=>`supprimé`,WBe=()=>`removed`,GBe=((e={},t={})=>(t.locale??V())===`fr`?UBe(e):WBe(e)),KBe=()=>`hors groupe`,qBe=()=>`outside group`,JBe=((e={},t={})=>(t.locale??V())===`fr`?KBe(e):qBe(e)),YBe=()=>`Agent par défaut`,XBe=()=>`Default agent`,qK=((e={},t={})=>(t.locale??V())===`fr`?YBe(e):XBe(e)),ZBe=()=>`Définir comme agent par défaut`,QBe=()=>`Set as default agent`,JK=((e={},t={})=>(t.locale??V())===`fr`?ZBe(e):QBe(e)),$Be=e=>`Configurer l'instance « ${e?.instance} »`,eVe=e=>`Configure instance « ${e?.instance} »`,tVe=((e,t={})=>(t.locale??V())===`fr`?$Be(e):eVe(e)),nVe=()=>`Configurer`,rVe=()=>`Configure`,YK=((e={},t={})=>(t.locale??V())===`fr`?nVe(e):rVe(e)),iVe=()=>`Config non-secrète du bridge, appliquée à chaud au message suivant (sans redémarrage). Les secrets (tokens, device identity) vivent dans l’environnement du bridge, jamais ici.`,aVe=()=>`Non-secret bridge config, applied hot on the next message (no restart). Secrets (tokens, device identity) live in the bridge environment, never here.`,oVe=((e={},t={})=>(t.locale??V())===`fr`?iVe(e):aVe(e)),sVe=()=>`Aucune instance — ajoutez-en une dans Agents › Instances d’abord.`,cVe=()=>`No instances yet — add one under Agents › Instances first.`,lVe=((e={},t={})=>(t.locale??V())===`fr`?sVe(e):cVe(e)),uVe=()=>`Mode média sortant`,dVe=()=>`Outbound media mode`,fVe=((e={},t={})=>(t.locale??V())===`fr`?uVe(e):dVe(e)),pVe=()=>`Mode média entrant`,mVe=()=>`Inbound media mode`,hVe=((e={},t={})=>(t.locale??V())===`fr`?pVe(e):mVe(e)),gVe=()=>`Taille média max (Mo)`,_Ve=()=>`Max media size (MB)`,vVe=((e={},t={})=>(t.locale??V())===`fr`?gVe(e):_Ve(e)),yVe=()=>`Ré-hydratation de session`,bVe=()=>`Session re-hydration`,xVe=((e={},t={})=>(t.locale??V())===`fr`?yVe(e):bVe(e)),SVe=()=>`Enregistrer`,CVe=()=>`Save`,wVe=((e={},t={})=>(t.locale??V())===`fr`?SVe(e):CVe(e)),TVe=()=>`Impossible d’enregistrer la configuration`,EVe=()=>`Could not save the configuration`,DVe=((e={},t={})=>(t.locale??V())===`fr`?TVe(e):EVe(e)),OVe=()=>`Comment le bridge récupère les fichiers SORTANTS (générés par l’agent) pour les héberger : gateway-http (via HTTP depuis la gateway — aucun système de fichiers partagé requis, défaut portable), shared-fs (lit un volume partagé monté), ou off (aucune pièce jointe sortante).`,kVe=()=>`How the bridge fetches OUTBOUND (agent-generated) files to host them: gateway-http (over HTTP from the gateway — no shared filesystem needed, the portable default), shared-fs (read a mounted shared volume), or off (no outbound attachments).`,AVe=((e={},t={})=>(t.locale??V())===`fr`?OVe(e):kVe(e)),jVe=()=>`Comment les fichiers téléversés atteignent l’agent : inline (base64 dans la trame du chat — plafonné par la taille de trame de la gateway), ou shared-fs (streamé vers un volume partagé et référencé par chemin — toute taille, pour les grosses vidéos/audio/docs).`,MVe=()=>`How user-uploaded files reach the agent: inline (base64 in the chat frame — capped by the gateway frame size), or shared-fs (streamed to a shared volume and referenced by path — any size, for large videos/audio/docs).`,NVe=((e={},t={})=>(t.locale??V())===`fr`?jVe(e):MVe(e)),PVe=()=>`Plafond de taille par fichier (Mo). En mode shared-fs il peut être élevé (les fichiers sont streamés sur disque) ; pour l’inline, la vraie limite est la taille de trame de la gateway.`,FVe=()=>`Per-file size cap (MB). In shared-fs mode this can be large (files stream to disk); for inline files the gateway frame size is the real limit.`,IVe=((e={},t={})=>(t.locale??V())===`fr`?PVe(e):FVe(e)),LVe=()=>`Sur une session gateway fraîche/réinitialisée, renvoie les tours précédents pour que le contexte du modèle corresponde au fil visible. Désactiver pour n’envoyer que le message courant.`,RVe=()=>`On a fresh/rolled gateway session, re-send prior turns so the model's context matches the visible thread. Disable to always send only the current message.`,zVe=((e={},t={})=>(t.locale??V())===`fr`?LVe(e):RVe(e)),BVe=()=>`Chemin entrant (vu par l’agent)`,VVe=()=>`Inbound path (agent view)`,HVe=((e={},t={})=>(t.locale??V())===`fr`?BVe(e):VVe(e)),UVe=()=>`Le chemin DANS le conteneur de la gateway où l’agent LIT les fichiers entrants déposés — le montage du volume partagé côté gateway (ex. /home/node/.openclaw/media/inbound). Doit correspondre à ton montage de volume Docker.`,WVe=()=>`The path INSIDE the gateway container where the agent READS staged inbound files — the gateway's mount of the shared volume (e.g. /home/node/.openclaw/media/inbound). Must match your Docker volume mount.`,GVe=((e={},t={})=>(t.locale??V())===`fr`?UVe(e):WVe(e)),KVe=()=>`Chemin sortant (vu par l’agent)`,qVe=()=>`Outbound path (agent view)`,JVe=((e={},t={})=>(t.locale??V())===`fr`?KVe(e):qVe(e)),YVe=()=>`Le chemin DANS le conteneur de la gateway où l’agent ÉCRIT un fichier généré avant d’émettre MEDIA:<chemin> (ex. /home/node/.openclaw/media/outbound). Doit être accessible en écriture par l’agent dans le conteneur.`,XVe=()=>`The path INSIDE the gateway container where the agent WRITES a generated file before emitting MEDIA:<path> (e.g. /home/node/.openclaw/media/outbound). Must be writable by the agent in the container.`,ZVe=((e={},t={})=>(t.locale??V())===`fr`?YVe(e):XVe(e)),QVe=()=>`Vérifier les chemins`,$Ve=()=>`Check paths`,eHe=((e={},t={})=>(t.locale??V())===`fr`?QVe(e):$Ve(e)),tHe=()=>`Vérification…`,nHe=()=>`Checking…`,rHe=((e={},t={})=>(t.locale??V())===`fr`?tHe(e):nHe(e)),iHe=()=>`Échec de la vérification des chemins`,aHe=()=>`Path check failed`,oHe=((e={},t={})=>(t.locale??V())===`fr`?iHe(e):aHe(e)),sHe=()=>`Vérifie l’accès du BRIDGE aux dossiers partagés. Le montage côté agent (dans le conteneur de la gateway) est à vérifier séparément.`,cHe=()=>`Checks the BRIDGE's access to the shared dirs. The agent-side mount (inside the gateway container) must be verified separately.`,lHe=((e={},t={})=>(t.locale??V())===`fr`?sHe(e):cHe(e)),uHe=()=>`Entrant (écriture bridge)`,dHe=()=>`Inbound (bridge write)`,fHe=((e={},t={})=>(t.locale??V())===`fr`?uHe(e):dHe(e)),pHe=()=>`Sortant (lecture bridge)`,mHe=()=>`Outbound (bridge read)`,hHe=((e={},t={})=>(t.locale??V())===`fr`?pHe(e):mHe(e)),gHe=()=>`Accessible`,_He=()=>`Accessible`,vHe=((e={},t={})=>(t.locale??V())===`fr`?gHe(e):_He(e)),yHe=()=>`Non concerné (pas shared-fs)`,bHe=()=>`Not applicable (not shared-fs)`,xHe=((e={},t={})=>(t.locale??V())===`fr`?yHe(e):bHe(e)),SHe=()=>`Bridge injoignable — vérification impossible`,CHe=()=>`Bridge unreachable — could not check`,wHe=((e={},t={})=>(t.locale??V())===`fr`?SHe(e):CHe(e)),THe=e=>`Bridge joignable mais la vérification a échoué (${e?.reason})`,EHe=e=>`Bridge reachable but the check failed (${e?.reason})`,DHe=((e,t={})=>(t.locale??V())===`fr`?THe(e):EHe(e)),OHe=()=>`Santé du bridge — sondage actif toutes les minutes. Données non-secrètes uniquement : joignabilité, état des connexions, dernière cause d’échec. Les secrets (tokens, device identity) vivent dans l’environnement du bridge, jamais ici.`,kHe=()=>`Bridge health — active poll every minute. Non-secret data only: reachability, connection states, last failure cause. Secrets (tokens, device identity) live in the bridge environment, never here.`,AHe=((e={},t={})=>(t.locale??V())===`fr`?OHe(e):kHe(e)),jHe=()=>`Chargement…`,MHe=()=>`Loading…`,XK=((e={},t={})=>(t.locale??V())===`fr`?jHe(e):MHe(e)),NHe=()=>`Aucun relevé pour l’instant — le sondage tourne chaque minute. Reviens dans un moment.`,PHe=()=>`No reading yet — the poll runs every minute. Check back in a moment.`,FHe=((e={},t={})=>(t.locale??V())===`fr`?NHe(e):PHe(e)),IHe=()=>`Bridge opérationnel`,LHe=()=>`Bridge operational`,RHe=((e={},t={})=>(t.locale??V())===`fr`?IHe(e):LHe(e)),zHe=()=>`Bridge injoignable`,BHe=()=>`Bridge unreachable`,VHe=((e={},t={})=>(t.locale??V())===`fr`?zHe(e):BHe(e)),HHe=e=>`Bridge : ${e?.count} connexion(s) en erreur`,UHe=e=>`Bridge: ${e?.count} connection(s) in error`,WHe=((e,t={})=>(t.locale??V())===`fr`?HHe(e):UHe(e)),GHe=e=>`Vérifié à ${e?.time}`,KHe=e=>`Checked at ${e?.time}`,qHe=((e,t={})=>(t.locale??V())===`fr`?GHe(e):KHe(e)),JHe=e=>`· Bridge démarré le ${e?.time}`,YHe=e=>`· Bridge started on ${e?.time}`,XHe=((e,t={})=>(t.locale??V())===`fr`?JHe(e):YHe(e)),ZHe=()=>`↗ Anomalies`,QHe=()=>`↗ Anomalies`,$He=((e={},t={})=>(t.locale??V())===`fr`?ZHe(e):QHe(e)),eUe=e=>`Connexions (${e?.count})`,tUe=e=>`Connections (${e?.count})`,nUe=((e,t={})=>(t.locale??V())===`fr`?eUe(e):tUe(e)),rUe=()=>`Aucune connexion encore éprouvée. L’état d’une connexion apparaît dès qu’un message la sollicite (le bridge se connecte à la demande).`,iUe=()=>`No connection tested yet. A connection's state appears as soon as a message exercises it (the bridge connects on demand).`,aUe=((e={},t={})=>(t.locale??V())===`fr`?rUe(e):iUe(e)),oUe=e=>`${e?.ok} OK · ${e?.errors} échec(s) · ${e?.attempts} tentative(s)`,sUe=e=>`${e?.ok} OK · ${e?.errors} failure(s) · ${e?.attempts} attempt(s)`,cUe=((e,t={})=>(t.locale??V())===`fr`?oUe(e):sUe(e)),lUe=e=>`Rejeté par la passerelle : ${e?.label} — pas une défaillance du bridge.`,uUe=e=>`Rejected by the gateway: ${e?.label} — not a bridge fault.`,dUe=((e,t={})=>(t.locale??V())===`fr`?lUe(e):uUe(e)),fUe=()=>`Filtrer par cible ou hôte…`,pUe=()=>`Filter by target or host…`,mUe=((e={},t={})=>(t.locale??V())===`fr`?fUe(e):pUe(e)),hUe=()=>`Tous`,gUe=()=>`All`,ZK=((e={},t={})=>(t.locale??V())===`fr`?hUe(e):gUe(e)),_Ue=()=>`État`,vUe=()=>`State`,yUe=((e={},t={})=>(t.locale??V())===`fr`?_Ue(e):vUe(e)),bUe=()=>`Instance`,xUe=()=>`Instance`,SUe=((e={},t={})=>(t.locale??V())===`fr`?bUe(e):xUe(e)),CUe=()=>`Version`,wUe=()=>`Version`,TUe=((e={},t={})=>(t.locale??V())===`fr`?CUe(e):wUe(e)),EUe=()=>`Aucune connexion ne correspond aux filtres.`,DUe=()=>`No connection matches the filters.`,OUe=((e={},t={})=>(t.locale??V())===`fr`?EUe(e):DUe(e)),kUe=()=>`Cible`,AUe=()=>`Target`,jUe=((e={},t={})=>(t.locale??V())===`fr`?kUe(e):AUe(e)),MUe=()=>`État`,NUe=()=>`State`,PUe=((e={},t={})=>(t.locale??V())===`fr`?MUe(e):NUe(e)),FUe=()=>`Instance`,IUe=()=>`Instance`,LUe=((e={},t={})=>(t.locale??V())===`fr`?FUe(e):IUe(e)),RUe=()=>`Hôte passerelle`,zUe=()=>`Gateway host`,BUe=((e={},t={})=>(t.locale??V())===`fr`?RUe(e):zUe(e)),VUe=()=>`Version`,HUe=()=>`Version`,UUe=((e={},t={})=>(t.locale??V())===`fr`?VUe(e):HUe(e)),WUe=()=>`Stats`,GUe=()=>`Stats`,KUe=((e={},t={})=>(t.locale??V())===`fr`?WUe(e):GUe(e)),qUe=()=>`Dernier OK`,JUe=()=>`Last OK`,YUe=((e={},t={})=>(t.locale??V())===`fr`?qUe(e):JUe(e)),XUe=()=>`connectée`,ZUe=()=>`connected`,QK=((e={},t={})=>(t.locale??V())===`fr`?XUe(e):ZUe(e)),QUe=()=>`erreur`,$Ue=()=>`error`,$K=((e={},t={})=>(t.locale??V())===`fr`?QUe(e):$Ue(e)),eWe=()=>`inactive`,tWe=()=>`inactive`,eq=((e={},t={})=>(t.locale??V())===`fr`?eWe(e):tWe(e)),nWe=()=>`5 dernières minutes`,rWe=()=>`Last 5 minutes`,iWe=((e={},t={})=>(t.locale??V())===`fr`?nWe(e):rWe(e)),aWe=()=>`15 dernières minutes`,oWe=()=>`Last 15 minutes`,sWe=((e={},t={})=>(t.locale??V())===`fr`?aWe(e):oWe(e)),cWe=()=>`30 dernières minutes`,lWe=()=>`Last 30 minutes`,uWe=((e={},t={})=>(t.locale??V())===`fr`?cWe(e):lWe(e)),dWe=()=>`Dernière heure`,fWe=()=>`Last hour`,pWe=((e={},t={})=>(t.locale??V())===`fr`?dWe(e):fWe(e)),mWe=()=>`3 dernières heures`,hWe=()=>`Last 3 hours`,gWe=((e={},t={})=>(t.locale??V())===`fr`?mWe(e):hWe(e)),_We=()=>`6 dernières heures`,vWe=()=>`Last 6 hours`,yWe=((e={},t={})=>(t.locale??V())===`fr`?_We(e):vWe(e)),bWe=()=>`12 dernières heures`,xWe=()=>`Last 12 hours`,SWe=((e={},t={})=>(t.locale??V())===`fr`?bWe(e):xWe(e)),CWe=()=>`Dernières 24 heures`,wWe=()=>`Last 24 hours`,TWe=((e={},t={})=>(t.locale??V())===`fr`?CWe(e):wWe(e)),EWe=()=>`2 derniers jours`,DWe=()=>`Last 2 days`,OWe=((e={},t={})=>(t.locale??V())===`fr`?EWe(e):DWe(e)),kWe=()=>`7 derniers jours`,AWe=()=>`Last 7 days`,jWe=((e={},t={})=>(t.locale??V())===`fr`?kWe(e):AWe(e)),MWe=()=>`30 derniers jours`,NWe=()=>`Last 30 days`,PWe=((e={},t={})=>(t.locale??V())===`fr`?MWe(e):NWe(e)),FWe=()=>`90 derniers jours`,IWe=()=>`Last 90 days`,LWe=((e={},t={})=>(t.locale??V())===`fr`?FWe(e):IWe(e)),RWe=()=>`Appels API`,zWe=()=>`API calls`,BWe=((e={},t={})=>(t.locale??V())===`fr`?RWe(e):zWe(e)),VWe=()=>`Erreurs API`,HWe=()=>`API errors`,UWe=((e={},t={})=>(t.locale??V())===`fr`?VWe(e):HWe(e)),WWe=()=>`Latence moyenne`,GWe=()=>`Average latency`,KWe=((e={},t={})=>(t.locale??V())===`fr`?WWe(e):GWe(e)),qWe=()=>`Ingestion OpenClaw`,JWe=()=>`OpenClaw ingest`,YWe=((e={},t={})=>(t.locale??V())===`fr`?qWe(e):JWe(e)),XWe=()=>`Messages envoyés`,ZWe=()=>`Messages sent`,QWe=((e={},t={})=>(t.locale??V())===`fr`?XWe(e):ZWe(e)),$We=()=>`Erreurs de stream`,eGe=()=>`Stream errors`,tGe=((e={},t={})=>(t.locale??V())===`fr`?$We(e):eGe(e)),nGe=()=>`Indicateurs agrégés par heure à partir des traces expurgées (métadonnées non-PHI uniquement). Mise à jour en direct (useQuery) — le rollup tourne chaque heure.`,rGe=()=>`Hourly aggregated indicators from redacted traces (non-PHI metadata only). Live updates (useQuery) — the rollup runs every hour.`,iGe=((e={},t={})=>(t.locale??V())===`fr`?nGe(e):rGe(e)),aGe=()=>`La plage filtre l’historique des rollups — une plage antérieure peut être partielle.`,oGe=()=>`The range filters the rollup history — an earlier range may be partial.`,sGe=((e={},t={})=>(t.locale??V())===`fr`?aGe(e):oGe(e)),cGe=()=>`Chargement des KPI…`,lGe=()=>`Loading KPIs…`,uGe=((e={},t={})=>(t.locale??V())===`fr`?cGe(e):lGe(e)),dGe=()=>`Aucune donnée KPI — le rollup tourne chaque heure ; lance-le ou attends.`,fGe=()=>`No KPI data — the rollup runs every hour; run it or wait.`,pGe=((e={},t={})=>(t.locale??V())===`fr`?dGe(e):fGe(e)),mGe=e=>`dernier : ${e?.value}`,hGe=e=>`latest: ${e?.value}`,gGe=((e,t={})=>(t.locale??V())===`fr`?mGe(e):hGe(e)),_Ge=()=>`aucune donnée`,vGe=()=>`no data`,yGe=((e={},t={})=>(t.locale??V())===`fr`?_Ge(e):vGe(e)),bGe=e=>`${e?.count} h`,xGe=e=>`${e?.count} h`,SGe=((e,t={})=>(t.locale??V())===`fr`?bGe(e):xGe(e)),CGe=e=>`Série horaire (max ${e?.max} ${e?.unit})`,wGe=e=>`Hourly series (max ${e?.max} ${e?.unit})`,TGe=((e,t={})=>(t.locale??V())===`fr`?CGe(e):wGe(e)),EGe=()=>`Mode dev — comptes & rôles`,DGe=()=>`Dev mode — accounts & roles`,OGe=((e={},t={})=>(t.locale??V())===`fr`?EGe(e):DGe(e)),kGe=()=>`Mode dev — comptes & rôles`,AGe=()=>`Dev mode — accounts & roles`,jGe=((e={},t={})=>(t.locale??V())===`fr`?kGe(e):AGe(e)),MGe=()=>`Change de rôle et « agis en tant que » pour tester plusieurs utilisateurs sans CLI. Visible uniquement en dev.`,NGe=()=>`Change roles and “act as” to test multiple users without the CLI. Visible in dev only.`,PGe=((e={},t={})=>(t.locale??V())===`fr`?MGe(e):NGe(e)),FGe=e=>`Moi — ${e?.canonical}`,IGe=e=>`Me — ${e?.canonical}`,LGe=((e,t={})=>(t.locale??V())===`fr`?FGe(e):IGe(e)),RGe=()=>`Devenir admin`,zGe=()=>`Become admin`,BGe=((e={},t={})=>(t.locale??V())===`fr`?RGe(e):zGe(e)),VGe=()=>`Devenir user`,HGe=()=>`Become user`,UGe=((e={},t={})=>(t.locale??V())===`fr`?VGe(e):HGe(e)),WGe=()=>`Devenir pending`,GGe=()=>`Become pending`,KGe=((e={},t={})=>(t.locale??V())===`fr`?WGe(e):GGe(e)),qGe=()=>`Tu agis en tant que`,JGe=()=>`You are acting as`,YGe=((e={},t={})=>(t.locale??V())===`fr`?qGe(e):JGe(e)),XGe=()=>`Arrêter`,ZGe=()=>`Stop`,QGe=((e={},t={})=>(t.locale??V())===`fr`?XGe(e):ZGe(e)),$Ge=()=>`Aucun autre compte. Déconnecte-toi puis reconnecte-toi (nouvelle identité anonyme) — elle sera active immédiatement.`,eKe=()=>`No other account. Sign out then sign back in (new anonymous identity) — it will be active immediately.`,tKe=((e={},t={})=>(t.locale??V())===`fr`?$Ge(e):eKe(e)),nKe=()=>`Deviens admin d'abord`,rKe=()=>`Become admin first`,iKe=((e={},t={})=>(t.locale??V())===`fr`?nKe(e):rKe(e)),aKe=()=>`Un compte pending ne peut pas être impersonné`,oKe=()=>`A pending account cannot be impersonated`,sKe=((e={},t={})=>(t.locale??V())===`fr`?aKe(e):oKe(e)),cKe=()=>`Agir en tant que cet utilisateur`,lKe=()=>`Act as this user`,uKe=((e={},t={})=>(t.locale??V())===`fr`?cKe(e):lKe(e)),dKe=()=>`Agir en tant que`,fKe=()=>`Act as`,pKe=((e={},t={})=>(t.locale??V())===`fr`?dKe(e):fKe(e)),mKe=()=>`Nouveau chat`,hKe=()=>`New chat`,gKe=((e={},t={})=>(t.locale??V())===`fr`?mKe(e):hKe(e)),_Ke=()=>`Nouveau projet`,vKe=()=>`New project`,tq=((e={},t={})=>(t.locale??V())===`fr`?_Ke(e):vKe(e)),yKe=()=>`Nom du projet`,bKe=()=>`Project name`,xKe=((e={},t={})=>(t.locale??V())===`fr`?yKe(e):bKe(e)),SKe=()=>`ex. Travail`,CKe=()=>`e.g. Work`,wKe=((e={},t={})=>(t.locale??V())===`fr`?SKe(e):CKe(e)),TKe=()=>`Créer`,EKe=()=>`Create`,DKe=((e={},t={})=>(t.locale??V())===`fr`?TKe(e):EKe(e)),OKe=()=>`Épinglés`,kKe=()=>`Pinned`,AKe=((e={},t={})=>(t.locale??V())===`fr`?OKe(e):kKe(e)),jKe=()=>`Glissez un chat ici`,MKe=()=>`Drop a chat here`,NKe=((e={},t={})=>(t.locale??V())===`fr`?jKe(e):MKe(e)),PKe=()=>`Chats`,FKe=()=>`Chats`,IKe=((e={},t={})=>(t.locale??V())===`fr`?PKe(e):FKe(e)),LKe=()=>`Sans titre`,RKe=()=>`Untitled`,nq=((e={},t={})=>(t.locale??V())===`fr`?LKe(e):RKe(e)),zKe=()=>`Lecture seule — l'agent associé ne t'est plus disponible`,BKe=()=>`Read-only — its agent is no longer available to you`,rq=((e={},t={})=>(t.locale??V())===`fr`?zKe(e):BKe(e)),VKe=()=>`Supprimer le projet`,HKe=()=>`Delete project`,iq=((e={},t={})=>(t.locale??V())===`fr`?VKe(e):HKe(e)),UKe=e=>`Supprimer le projet « ${e?.name} » ?`,WKe=e=>`Delete project "${e?.name}"?`,GKe=((e,t={})=>(t.locale??V())===`fr`?UKe(e):WKe(e)),KKe=e=>`Cette action est irréversible : elle supprimera aussi définitivement ${e?.count} conversation(s) et tous leurs messages.`,qKe=e=>`This action is irreversible: it will also permanently delete ${e?.count} conversation(s) and all their messages.`,JKe=((e,t={})=>(t.locale??V())===`fr`?KKe(e):qKe(e)),YKe=()=>`Cette action est irréversible.`,XKe=()=>`This action is irreversible.`,ZKe=((e={},t={})=>(t.locale??V())===`fr`?YKe(e):XKe(e)),QKe=()=>`Supprimer`,$Ke=()=>`Delete`,aq=((e={},t={})=>(t.locale??V())===`fr`?QKe(e):$Ke(e)),eqe=()=>`Déplacer / réordonner`,tqe=()=>`Move / reorder`,nqe=((e={},t={})=>(t.locale??V())===`fr`?eqe(e):tqe(e)),rqe=()=>`Actions`,iqe=()=>`Actions`,aqe=((e={},t={})=>(t.locale??V())===`fr`?rqe(e):iqe(e)),oqe=()=>`Renommer`,sqe=()=>`Rename`,cqe=((e={},t={})=>(t.locale??V())===`fr`?oqe(e):sqe(e)),lqe=()=>`Désépingler`,uqe=()=>`Unpin`,dqe=((e={},t={})=>(t.locale??V())===`fr`?lqe(e):uqe(e)),fqe=()=>`Épingler`,pqe=()=>`Pin`,mqe=((e={},t={})=>(t.locale??V())===`fr`?fqe(e):pqe(e)),hqe=()=>`Couleur`,gqe=()=>`Color`,_qe=((e={},t={})=>(t.locale??V())===`fr`?hqe(e):gqe(e)),vqe=()=>`Aucune couleur`,yqe=()=>`No color`,bqe=((e={},t={})=>(t.locale??V())===`fr`?vqe(e):yqe(e)),xqe=()=>`Supprimer ce chat ?`,Sqe=()=>`Delete this chat?`,Cqe=((e={},t={})=>(t.locale??V())===`fr`?xqe(e):Sqe(e)),wqe=()=>`Cette action est irréversible et supprimera ses messages.`,Tqe=()=>`This action is irreversible and will delete its messages.`,Eqe=((e={},t={})=>(t.locale??V())===`fr`?wqe(e):Tqe(e)),Dqe=e=>`Bridge : ${e?.provider}`,Oqe=e=>`Bridge: ${e?.provider}`,kqe=((e,t={})=>(t.locale??V())===`fr`?Dqe(e):Oqe(e)),Aqe=()=>`Renommer le chat`,jqe=()=>`Rename chat`,Mqe=((e={},t={})=>(t.locale??V())===`fr`?Aqe(e):jqe(e)),Nqe=()=>`Titre`,Pqe=()=>`Title`,Fqe=((e={},t={})=>(t.locale??V())===`fr`?Nqe(e):Pqe(e)),Iqe=()=>`Réflexion…`,Lqe=()=>`Thinking…`,Rqe=((e={},t={})=>(t.locale??V())===`fr`?Iqe(e):Lqe(e)),zqe=()=>`Génération…`,Bqe=()=>`Generating…`,Vqe=((e={},t={})=>(t.locale??V())===`fr`?zqe(e):Bqe(e)),Hqe=()=>`Erreur`,Uqe=()=>`Error`,Wqe=((e={},t={})=>(t.locale??V())===`fr`?Hqe(e):Uqe(e)),Gqe=()=>`La réponse a été générée côté agent mais n’a pas pu être finalisée (connexion au bridge interrompue en cours de route). Vous pouvez supprimer ou régénérer ce message.`,Kqe=()=>`The reply was generated on the agent side but could not be finalized (the bridge connection dropped mid-stream). You can delete or regenerate this message.`,qqe=((e={},t={})=>(t.locale??V())===`fr`?Gqe(e):Kqe(e)),Jqe=()=>`Interrompu`,Yqe=()=>`Stopped`,Xqe=((e={},t={})=>(t.locale??V())===`fr`?Jqe(e):Yqe(e)),Zqe=()=>`contient`,Qqe=()=>`contains`,$qe=((e={},t={})=>(t.locale??V())===`fr`?Zqe(e):Qqe(e)),eJe=()=>`Filtre avancé`,tJe=()=>`Advanced filter`,nJe=((e={},t={})=>(t.locale??V())===`fr`?eJe(e):tJe(e)),rJe=()=>`Aucun critère. Ajoutez une condition (toutes les conditions sont cumulées avec ET).`,iJe=()=>`No criteria. Add a condition (all conditions are combined with AND).`,aJe=((e={},t={})=>(t.locale??V())===`fr`?rJe(e):iJe(e)),oJe=()=>`Champ`,sJe=()=>`Field`,cJe=((e={},t={})=>(t.locale??V())===`fr`?oJe(e):sJe(e)),lJe=()=>`Valeur`,uJe=()=>`Value`,dJe=((e={},t={})=>(t.locale??V())===`fr`?lJe(e):uJe(e)),fJe=()=>`Supprimer la condition`,pJe=()=>`Remove condition`,mJe=((e={},t={})=>(t.locale??V())===`fr`?fJe(e):pJe(e)),hJe=()=>`Ajouter une condition`,gJe=()=>`Add condition`,_Je=((e={},t={})=>(t.locale??V())===`fr`?hJe(e):gJe(e)),vJe=()=>`Bridge : pas encore de relevé (sondage chaque minute)`,yJe=()=>`Bridge: no reading yet (polled every minute)`,bJe=((e={},t={})=>(t.locale??V())===`fr`?vJe(e):yJe(e)),xJe=()=>`Bridge opérationnel`,SJe=()=>`Bridge operational`,CJe=((e={},t={})=>(t.locale??V())===`fr`?xJe(e):SJe(e)),wJe=e=>` · vérifié à ${e?.time}`,TJe=e=>` · verified at ${e?.time}`,EJe=((e,t={})=>(t.locale??V())===`fr`?wJe(e):TJe(e)),DJe=e=>`Bridge indisponible (${e?.reason}) — ouvre l’onglet Bridge pour le détail`,OJe=e=>`Bridge unavailable (${e?.reason}) — open the Bridge tab for details`,kJe=((e,t={})=>(t.locale??V())===`fr`?DJe(e):OJe(e)),AJe=()=>`Utilisateur`,jJe=()=>`User`,MJe=((e={},t={})=>(t.locale??V())===`fr`?AJe(e):jJe(e)),NJe=()=>`Système`,PJe=()=>`System`,FJe=((e={},t={})=>(t.locale??V())===`fr`?NJe(e):PJe(e)),IJe=()=>`[Export limité aux 200 messages les plus récents de cette conversation]`,LJe=()=>`[Export limited to the 200 most recent messages of this conversation]`,RJe=((e={},t={})=>(t.locale??V())===`fr`?IJe(e):LJe(e)),zJe=()=>`Conversation`,BJe=()=>`Conversation`,oq=((e={},t={})=>(t.locale??V())===`fr`?zJe(e):BJe(e)),VJe=e=>`Exporté le ${e?.date}`,HJe=e=>`Exported on ${e?.date}`,UJe=((e,t={})=>(t.locale??V())===`fr`?VJe(e):HJe(e)),WJe=e=>`[fichier : ${e?.name}]`,GJe=e=>`[file: ${e?.name}]`,KJe=((e,t={})=>(t.locale??V())===`fr`?WJe(e):GJe(e)),qJe=()=>`Rechercher dans les conversations`,JJe=()=>`Search conversations`,YJe=((e={},t={})=>(t.locale??V())===`fr`?qJe(e):JJe(e)),XJe=()=>`Rechercher…`,ZJe=()=>`Search…`,QJe=((e={},t={})=>(t.locale??V())===`fr`?XJe(e):ZJe(e)),$Je=()=>`Rechercher dans les conversations`,eYe=()=>`Search conversations`,tYe=((e={},t={})=>(t.locale??V())===`fr`?$Je(e):eYe(e)),nYe=()=>`Rechercher dans toutes les conversations…`,rYe=()=>`Search across all conversations…`,iYe=((e={},t={})=>(t.locale??V())===`fr`?nYe(e):rYe(e)),aYe=()=>`Recherche`,oYe=()=>`Search`,sYe=((e={},t={})=>(t.locale??V())===`fr`?aYe(e):oYe(e)),cYe=e=>`Tapez au moins ${e?.count} caractères pour rechercher.`,lYe=e=>`Type at least ${e?.count} characters to search.`,uYe=((e,t={})=>(t.locale??V())===`fr`?cYe(e):lYe(e)),dYe=()=>`Recherche…`,fYe=()=>`Searching…`,pYe=((e={},t={})=>(t.locale??V())===`fr`?dYe(e):fYe(e)),mYe=e=>`Aucune conversation ne correspond à « ${e?.term} ».`,hYe=e=>`No conversation matches “${e?.term}”.`,gYe=((e,t={})=>(t.locale??V())===`fr`?mYe(e):hYe(e)),_Ye=()=>`Nouveau chat`,vYe=()=>`New chat`,yYe=((e={},t={})=>(t.locale??V())===`fr`?_Ye(e):vYe(e)),bYe=()=>`Titre`,xYe=()=>`Title`,SYe=((e={},t={})=>(t.locale??V())===`fr`?bYe(e):xYe(e)),CYe=()=>`Message`,wYe=()=>`Message`,TYe=((e={},t={})=>(t.locale??V())===`fr`?CYe(e):wYe(e)),EYe=()=>`naviguer`,DYe=()=>`navigate`,OYe=((e={},t={})=>(t.locale??V())===`fr`?EYe(e):DYe(e)),kYe=()=>`ouvrir`,AYe=()=>`open`,jYe=((e={},t={})=>(t.locale??V())===`fr`?kYe(e):AYe(e)),MYe=()=>`Échap`,NYe=()=>`Esc`,PYe=((e={},t={})=>(t.locale??V())===`fr`?MYe(e):NYe(e)),FYe=()=>`fermer`,IYe=()=>`close`,LYe=((e={},t={})=>(t.locale??V())===`fr`?FYe(e):IYe(e)),RYe=()=>`Choisir un agent`,zYe=()=>`Choose an agent`,BYe=((e={},t={})=>(t.locale??V())===`fr`?RYe(e):zYe(e)),VYe=()=>`Sélectionnez l’agent (et l’instance) pour cette conversation.`,HYe=()=>`Select the agent (and instance) for this conversation.`,UYe=((e={},t={})=>(t.locale??V())===`fr`?VYe(e):HYe(e)),WYe=()=>`Chargement…`,GYe=()=>`Loading…`,KYe=((e={},t={})=>(t.locale??V())===`fr`?WYe(e):GYe(e)),qYe=()=>`Aucun agent ne vous est assigné. Contactez votre administrateur pour qu’il vous en attribue un.`,JYe=()=>`No agent is assigned to you. Contact your administrator to have one assigned.`,YYe=((e={},t={})=>(t.locale??V())===`fr`?qYe(e):JYe(e)),XYe=()=>`Rechercher un agent…`,ZYe=()=>`Search for an agent…`,QYe=((e={},t={})=>(t.locale??V())===`fr`?XYe(e):ZYe(e)),$Ye=()=>`Rechercher un agent`,eXe=()=>`Search for an agent`,tXe=((e={},t={})=>(t.locale??V())===`fr`?$Ye(e):eXe(e)),nXe=()=>`Cet agent n’existe plus sur la gateway`,rXe=()=>`This agent no longer exists on the gateway`,iXe=((e={},t={})=>(t.locale??V())===`fr`?nXe(e):rXe(e)),aXe=()=>`Agent par défaut`,oXe=()=>`Default agent`,sXe=((e={},t={})=>(t.locale??V())===`fr`?aXe(e):oXe(e)),cXe=()=>`Rechercher`,lXe=()=>`Search`,uXe=((e={},t={})=>(t.locale??V())===`fr`?cXe(e):lXe(e)),dXe=()=>`Réinitialiser`,fXe=()=>`Reset`,pXe=((e={},t={})=>(t.locale??V())===`fr`?dXe(e):fXe(e)),mXe=()=>`Ajouter`,hXe=()=>`Add`,gXe=((e={},t={})=>(t.locale??V())===`fr`?mXe(e):hXe(e)),_Xe=()=>`Aucun élément.`,vXe=()=>`No items.`,yXe=((e={},t={})=>(t.locale??V())===`fr`?_Xe(e):vXe(e)),bXe=()=>`Chargement…`,xXe=()=>`Loading…`,SXe=((e={},t={})=>(t.locale??V())===`fr`?bXe(e):xXe(e)),CXe=()=>`Tout sélectionner`,wXe=()=>`Select all`,TXe=((e={},t={})=>(t.locale??V())===`fr`?CXe(e):wXe(e)),EXe=()=>`Sélectionner la ligne`,DXe=()=>`Select row`,OXe=((e={},t={})=>(t.locale??V())===`fr`?EXe(e):DXe(e)),kXe=()=>`Actions`,AXe=()=>`Actions`,jXe=((e={},t={})=>(t.locale??V())===`fr`?kXe(e):AXe(e)),MXe=e=>`Trier par ${e?.column}`,NXe=e=>`Sort by ${e?.column}`,PXe=((e,t={})=>(t.locale??V())===`fr`?MXe(e):NXe(e)),FXe=()=>`Agent introuvable`,IXe=()=>`Agent not found`,LXe=((e={},t={})=>(t.locale??V())===`fr`?FXe(e):IXe(e)),RXe=()=>`L’agent configuré n’existe plus sur la passerelle. Vérifiez OPENCLAW_AGENT_ID dans le .env du bridge (il doit correspondre à un agent réel de la passerelle).`,zXe=()=>`The configured agent no longer exists on the gateway. Check OPENCLAW_AGENT_ID in the bridge .env (it must match a real gateway agent).`,BXe=((e={},t={})=>(t.locale??V())===`fr`?RXe(e):zXe(e)),VXe=()=>`Authentification refusée`,HXe=()=>`Authentication refused`,UXe=((e={},t={})=>(t.locale??V())===`fr`?VXe(e):HXe(e)),WXe=()=>`Le token opérateur ne correspond pas au device pairé. Re-pairez un device dédié au bridge sur la passerelle et reportez son token + device identity.`,GXe=()=>`The operator token does not match the paired device. Re-pair a dedicated bridge device on the gateway and report its token + device identity.`,KXe=((e={},t={})=>(t.locale??V())===`fr`?WXe(e):GXe(e)),qXe=()=>`Signature device impossible`,JXe=()=>`Device signing failed`,YXe=((e={},t={})=>(t.locale??V())===`fr`?qXe(e):JXe(e)),XXe=()=>`La clé privée du device identity ne se décode pas. Vérifiez OPENCLAW_DEVICE_IDENTITY (format JSON, \\n simples) — voir fix-devid.mjs.`,ZXe=()=>`The device identity private key won’t decode. Check OPENCLAW_DEVICE_IDENTITY (JSON format, single \\n) — see fix-devid.mjs.`,QXe=((e={},t={})=>(t.locale??V())===`fr`?XXe(e):ZXe(e)),$Xe=()=>`Portée insuffisante`,eZe=()=>`Insufficient scope`,tZe=((e={},t={})=>(t.locale??V())===`fr`?$Xe(e):eZe(e)),nZe=()=>`Le pairing du device n’a pas la portée requise (operator.admin). Approuvez/élevez la portée du device sur la passerelle.`,rZe=()=>`The device pairing lacks the required scope (operator.admin). Approve/elevate the device scope on the gateway.`,iZe=((e={},t={})=>(t.locale??V())===`fr`?nZe(e):rZe(e)),aZe=()=>`Délai dépassé`,oZe=()=>`Timed out`,sZe=((e={},t={})=>(t.locale??V())===`fr`?aZe(e):oZe(e)),cZe=()=>`La passerelle n’a pas répondu à temps. Vérifiez qu’elle est démarrée et joignable (OPENCLAW_GATEWAY_URL).`,lZe=()=>`The gateway did not respond in time. Check it’s started and reachable (OPENCLAW_GATEWAY_URL).`,uZe=((e={},t={})=>(t.locale??V())===`fr`?cZe(e):lZe(e)),sq=()=>`Passerelle déconnectée`,dZe=()=>`Gateway disconnected`,fZe=((e={},t={})=>(t.locale??V())===`fr`?sq(e):dZe(e)),pZe=()=>`La connexion à la passerelle a été coupée. Vérifiez l’état du conteneur OpenClaw et l’URL/port de la passerelle.`,mZe=()=>`The connection to the gateway dropped. Check the OpenClaw container state and the gateway URL/port.`,hZe=((e={},t={})=>(t.locale??V())===`fr`?pZe(e):mZe(e)),gZe=()=>`Bridge injoignable`,_Ze=()=>`Bridge unreachable`,vZe=((e={},t={})=>(t.locale??V())===`fr`?gZe(e):_Ze(e)),yZe=()=>`Convex n’a pas pu joindre le bridge. Vérifiez que le conteneur bridge tourne et BRIDGE_URL (http://<ip-hôte>:8787).`,bZe=()=>`Convex could not reach the bridge. Check the bridge container is running and BRIDGE_URL (http://<host-ip>:8787).`,xZe=((e={},t={})=>(t.locale??V())===`fr`?yZe(e):bZe(e)),SZe=()=>`Pièce jointe trop volumineuse`,CZe=()=>`Attachment too large`,wZe=((e={},t={})=>(t.locale??V())===`fr`?SZe(e):CZe(e)),TZe=()=>`La passerelle a refusé la pièce jointe car elle dépasse la taille qu’elle accepte (limite de mise en sandbox de l’agent). Réduisez la taille du fichier, ou retirez la pièce jointe et envoyez le texte seul.`,EZe=()=>`The gateway refused the attachment because it exceeds the size it accepts (the agent's sandbox staging limit). Use a smaller file, or remove the attachment and send the text alone.`,DZe=((e={},t={})=>(t.locale??V())===`fr`?TZe(e):EZe(e)),OZe=()=>`Pièce jointe non traitée`,kZe=()=>`Attachment could not be processed`,AZe=((e={},t={})=>(t.locale??V())===`fr`?OZe(e):kZe(e)),jZe=()=>`La passerelle n’a pas pu analyser/préparer la pièce jointe. Bug connu de la passerelle (le validateur base64 déborde sur les gros fichiers, RangeError) — à corriger côté passerelle (isValidBase64). En attendant : un fichier plus petit passe, ou envoyez le texte sans pièce jointe.`,MZe=()=>`The gateway could not parse/stage the attachment. Known gateway bug (its base64 validator overflows on large files — RangeError); fix it gateway-side (isValidBase64). Meanwhile: a smaller file works, or send the text without the attachment.`,NZe=((e={},t={})=>(t.locale??V())===`fr`?jZe(e):MZe(e)),PZe=()=>`Requête invalide`,FZe=()=>`Invalid request`,IZe=((e={},t={})=>(t.locale??V())===`fr`?PZe(e):FZe(e)),LZe=()=>`La passerelle a rejeté la requête. Consultez les logs du bridge pour le détail brut.`,RZe=()=>`The gateway rejected the request. Check the bridge logs for the raw detail.`,zZe=((e={},t={})=>(t.locale??V())===`fr`?LZe(e):RZe(e)),BZe=()=>`Bridge non configuré`,VZe=()=>`Bridge not configured`,HZe=((e={},t={})=>(t.locale??V())===`fr`?BZe(e):VZe(e)),UZe=()=>`BRIDGE_URL / BRIDGE_SHARED_SECRET ne sont pas définis côté Convex (npx convex env set).`,WZe=()=>`BRIDGE_URL / BRIDGE_SHARED_SECRET are not set on the Convex side (npx convex env set).`,GZe=((e={},t={})=>(t.locale??V())===`fr`?UZe(e):WZe(e)),KZe=()=>`Utilisateur non routé`,qZe=()=>`User not routed`,JZe=((e={},t={})=>(t.locale??V())===`fr`?KZe(e):qZe(e)),YZe=()=>`Ce compte n’est rattaché à aucune instance. Settings → Users → Override instance, ou affectez un groupe.`,XZe=()=>`This account is not attached to any instance. Settings → Users → Override instance, or assign a group.`,ZZe=((e={},t={})=>(t.locale??V())===`fr`?YZe(e):XZe(e)),QZe=()=>`Erreur passerelle`,$Ze=()=>`Gateway error`,eQe=((e={},t={})=>(t.locale??V())===`fr`?QZe(e):$Ze(e)),tQe=()=>`Cause non catégorisée. Consultez les logs du bridge pour le message brut.`,nQe=()=>`Uncategorized cause. Check the bridge logs for the raw message.`,rQe=((e={},t={})=>(t.locale??V())===`fr`?tQe(e):nQe(e)),iQe=()=>`Cause inconnue`,aQe=()=>`Unknown cause`,oQe=((e={},t={})=>(t.locale??V())===`fr`?iQe(e):aQe(e)),sQe=()=>`Aucun code de cause n’a été remonté (bridge antérieur à cette version ?). Consultez les logs du bridge.`,cQe=()=>`No cause code was reported (bridge older than this version?). Check the bridge logs.`,lQe=((e={},t={})=>(t.locale??V())===`fr`?sQe(e):cQe(e)),uQe=()=>`Cause non répertoriée — voir les logs du bridge.`,dQe=()=>`Cause not catalogued — see the bridge logs.`,fQe=((e={},t={})=>(t.locale??V())===`fr`?uQe(e):dQe(e)),pQe=e=>`Notifications (${e?.count} non lues)`,mQe=e=>`Notifications (${e?.count} unread)`,hQe=((e,t={})=>(t.locale??V())===`fr`?pQe(e):mQe(e)),gQe=()=>`Notifications`,_Qe=()=>`Notifications`,vQe=((e={},t={})=>(t.locale??V())===`fr`?gQe(e):_Qe(e)),yQe=()=>`Notifications`,bQe=()=>`Notifications`,xQe=((e={},t={})=>(t.locale??V())===`fr`?yQe(e):bQe(e)),SQe=()=>`Tout lu`,CQe=()=>`Mark all read`,wQe=((e={},t={})=>(t.locale??V())===`fr`?SQe(e):CQe(e)),TQe=()=>`Tout effacer`,EQe=()=>`Clear all`,DQe=((e={},t={})=>(t.locale??V())===`fr`?TQe(e):EQe(e)),OQe=()=>`Aucune notification.`,kQe=()=>`No notifications.`,AQe=((e={},t={})=>(t.locale??V())===`fr`?OQe(e):kQe(e)),jQe=()=>`Marquer comme lue`,MQe=()=>`Mark as read`,cq=((e={},t={})=>(t.locale??V())===`fr`?jQe(e):MQe(e)),NQe=()=>`Effacer la notification`,PQe=()=>`Clear notification`,lq=((e={},t={})=>(t.locale??V())===`fr`?NQe(e):PQe(e)),FQe=()=>`Mes signalements`,IQe=()=>`My reports`,LQe=((e={},t={})=>(t.locale??V())===`fr`?FQe(e):IQe(e)),RQe=()=>`Répondu`,zQe=()=>`Answered`,BQe=((e={},t={})=>(t.locale??V())===`fr`?RQe(e):zQe(e)),VQe=()=>`En attente`,HQe=()=>`Pending`,UQe=((e={},t={})=>(t.locale??V())===`fr`?VQe(e):HQe(e)),WQe=()=>`Administrateur`,GQe=()=>`Administrator`,KQe=((e={},t={})=>(t.locale??V())===`fr`?WQe(e):GQe(e)),qQe=()=>`Vous`,JQe=()=>`You`,YQe=((e={},t={})=>(t.locale??V())===`fr`?qQe(e):JQe(e)),XQe=()=>`Voir la conversation`,ZQe=()=>`View the conversation`,QQe=((e={},t={})=>(t.locale??V())===`fr`?XQe(e):ZQe(e)),$Qe=()=>`Message signalé`,e$e=()=>`Reported message`,t$e=((e={},t={})=>(t.locale??V())===`fr`?$Qe(e):e$e(e)),n$e=()=>`Clore le signalement`,r$e=()=>`Close report`,uq=((e={},t={})=>(t.locale??V())===`fr`?n$e(e):r$e(e)),i$e=()=>`Pourquoi clore ce signalement ? (facultatif)`,a$e=()=>`Why close this report? (optional)`,o$e=((e={},t={})=>(t.locale??V())===`fr`?i$e(e):a$e(e)),s$e=()=>`Clore`,c$e=()=>`Close`,l$e=((e={},t={})=>(t.locale??V())===`fr`?s$e(e):c$e(e)),u$e=()=>`Annuler`,d$e=()=>`Cancel`,f$e=((e={},t={})=>(t.locale??V())===`fr`?u$e(e):d$e(e)),p$e=()=>`Réponse à votre signalement`,m$e=()=>`Reply to your report`,h$e=((e={},t={})=>(t.locale??V())===`fr`?p$e(e):m$e(e)),g$e=()=>`Un administrateur a répondu à un signalement que vous avez envoyé.`,_$e=()=>`An administrator replied to a report you sent.`,v$e=((e={},t={})=>(t.locale??V())===`fr`?g$e(e):_$e(e)),y$e=()=>`Mots modifiés / altérés`,b$e=()=>`Modified / altered words`,x$e=((e={},t={})=>(t.locale??V())===`fr`?y$e(e):b$e(e)),S$e=()=>`Réponse incorrecte`,C$e=()=>`Incorrect answer`,w$e=((e={},t={})=>(t.locale??V())===`fr`?S$e(e):C$e(e)),T$e=()=>`Incohérence`,E$e=()=>`Incoherence`,D$e=((e={},t={})=>(t.locale??V())===`fr`?T$e(e):E$e(e)),O$e=()=>`Formatage`,k$e=()=>`Formatting`,A$e=((e={},t={})=>(t.locale??V())===`fr`?O$e(e):k$e(e)),j$e=()=>`Latence`,M$e=()=>`Latency`,N$e=((e={},t={})=>(t.locale??V())===`fr`?j$e(e):M$e(e)),P$e=()=>`Erreur API`,F$e=()=>`API error`,I$e=((e={},t={})=>(t.locale??V())===`fr`?P$e(e):F$e(e)),L$e=()=>`Autre`,R$e=()=>`Other`,z$e=((e={},t={})=>(t.locale??V())===`fr`?L$e(e):R$e(e)),B$e=()=>`Utilisateurs`,V$e=()=>`Users`,H$e=((e={},t={})=>(t.locale??V())===`fr`?B$e(e):V$e(e)),U$e=()=>`Instances`,W$e=()=>`Instances`,G$e=((e={},t={})=>(t.locale??V())===`fr`?U$e(e):W$e(e)),K$e=()=>`Bridge`,q$e=()=>`Bridge`,J$e=((e={},t={})=>(t.locale??V())===`fr`?K$e(e):q$e(e)),Y$e=()=>`Comptes de service`,X$e=()=>`Service accounts`,Z$e=((e={},t={})=>(t.locale??V())===`fr`?Y$e(e):X$e(e)),Q$e=()=>`Rôles`,$$e=()=>`Roles`,e1e=((e={},t={})=>(t.locale??V())===`fr`?Q$e(e):$$e(e)),t1e=()=>`Traces`,n1e=()=>`Traces`,r1e=((e={},t={})=>(t.locale??V())===`fr`?t1e(e):n1e(e)),i1e=()=>`KPI`,a1e=()=>`KPI`,o1e=((e={},t={})=>(t.locale??V())===`fr`?i1e(e):a1e(e)),s1e=()=>`Anomalies`,c1e=()=>`Anomalies`,l1e=((e={},t={})=>(t.locale??V())===`fr`?s1e(e):c1e(e)),u1e=()=>`Intégrations`,d1e=()=>`Integrations`,f1e=((e={},t={})=>(t.locale??V())===`fr`?u1e(e):d1e(e)),p1e=()=>`Audit`,m1e=()=>`Audit`,h1e=((e={},t={})=>(t.locale??V())===`fr`?p1e(e):m1e(e)),g1e=()=>`Feedbacks`,_1e=()=>`Feedbacks`,v1e=((e={},t={})=>(t.locale??V())===`fr`?g1e(e):_1e(e)),y1e=()=>`Groupes`,b1e=()=>`Groups`,x1e=((e={},t={})=>(t.locale??V())===`fr`?y1e(e):b1e(e)),S1e=()=>`Accès`,C1e=()=>`Access`,w1e=((e={},t={})=>(t.locale??V())===`fr`?S1e(e):C1e(e)),T1e=()=>`Inspectez les accès d’un utilisateur : ses groupes, les agents et chartes qui lui sont disponibles (avec leur provenance) et ses permissions effectives. Lecture seule.`,E1e=()=>`Inspect a user’s access: their groups, the agents and charts available to them (with provenance), and their effective permissions. Read-only.`,D1e=((e={},t={})=>(t.locale??V())===`fr`?T1e(e):E1e(e)),O1e=()=>`Choisir un utilisateur`,k1e=()=>`Pick a user`,dq=((e={},t={})=>(t.locale??V())===`fr`?O1e(e):k1e(e)),A1e=()=>`Sélectionnez un utilisateur pour voir ses accès.`,j1e=()=>`Select a user to see their access.`,M1e=((e={},t={})=>(t.locale??V())===`fr`?A1e(e):j1e(e)),N1e=()=>`Identité`,P1e=()=>`Identity`,F1e=((e={},t={})=>(t.locale??V())===`fr`?N1e(e):P1e(e)),I1e=()=>`Groupes`,L1e=()=>`Groups`,R1e=((e={},t={})=>(t.locale??V())===`fr`?I1e(e):L1e(e)),z1e=()=>`Agents disponibles`,B1e=()=>`Available agents`,V1e=((e={},t={})=>(t.locale??V())===`fr`?z1e(e):B1e(e)),H1e=()=>`Chartes disponibles`,U1e=()=>`Available charts`,W1e=((e={},t={})=>(t.locale??V())===`fr`?H1e(e):U1e(e)),G1e=()=>`Permissions effectives`,K1e=()=>`Effective permissions`,q1e=((e={},t={})=>(t.locale??V())===`fr`?G1e(e):K1e(e)),J1e=()=>`Aucun`,Y1e=()=>`None`,fq=((e={},t={})=>(t.locale??V())===`fr`?J1e(e):Y1e(e)),X1e=()=>`Défaut`,Z1e=()=>`Default`,Q1e=((e={},t={})=>(t.locale??V())===`fr`?X1e(e):Z1e(e)),$1e=()=>`Direct`,e0e=()=>`Direct`,t0e=((e={},t={})=>(t.locale??V())===`fr`?$1e(e):e0e(e)),n0e=()=>`Tous les agents (aucun groupe)`,r0e=()=>`All agents (no group)`,i0e=((e={},t={})=>(t.locale??V())===`fr`?n0e(e):r0e(e)),a0e=e=>`Groupe : ${e?.group}`,o0e=e=>`Group: ${e?.group}`,pq=((e,t={})=>(t.locale??V())===`fr`?a0e(e):o0e(e)),s0e=()=>`Commune`,c0e=()=>`Common`,l0e=((e={},t={})=>(t.locale??V())===`fr`?s0e(e):c0e(e)),u0e=()=>`Perso`,d0e=()=>`Personal`,f0e=((e={},t={})=>(t.locale??V())===`fr`?u0e(e):d0e(e)),p0e=()=>`Groupes`,m0e=()=>`Groups`,h0e=((e={},t={})=>(t.locale??V())===`fr`?p0e(e):m0e(e)),g0e=()=>`Regroupez des utilisateurs et partagez des agents par groupe. Chaque membre hérite des agents du groupe en plus de ses agents directs.`,_0e=()=>`Group users and share agents by group. Each member inherits the group's agents on top of their direct agents.`,v0e=((e={},t={})=>(t.locale??V())===`fr`?g0e(e):_0e(e)),y0e=()=>`Nouveau groupe`,b0e=()=>`New group`,x0e=((e={},t={})=>(t.locale??V())===`fr`?y0e(e):b0e(e)),S0e=()=>`Aucun groupe pour le moment.`,C0e=()=>`No groups yet.`,w0e=((e={},t={})=>(t.locale??V())===`fr`?S0e(e):C0e(e)),T0e=()=>`Nom`,E0e=()=>`Name`,D0e=((e={},t={})=>(t.locale??V())===`fr`?T0e(e):E0e(e)),O0e=()=>`Membres`,k0e=()=>`Members`,A0e=((e={},t={})=>(t.locale??V())===`fr`?O0e(e):k0e(e)),j0e=()=>`Agents`,M0e=()=>`Agents`,N0e=((e={},t={})=>(t.locale??V())===`fr`?j0e(e):M0e(e)),P0e=()=>`Chartes`,F0e=()=>`Charts`,I0e=((e={},t={})=>(t.locale??V())===`fr`?P0e(e):F0e(e)),L0e=()=>`Filtrer les groupes (nom, membre, agent, charte)…`,R0e=()=>`Filter groups (name, member, agent, chart)…`,z0e=((e={},t={})=>(t.locale??V())===`fr`?L0e(e):R0e(e)),B0e=()=>`Gérer`,V0e=()=>`Manage`,H0e=((e={},t={})=>(t.locale??V())===`fr`?B0e(e):V0e(e)),U0e=()=>`Renommer`,W0e=()=>`Rename`,G0e=((e={},t={})=>(t.locale??V())===`fr`?U0e(e):W0e(e)),K0e=()=>`Supprimer`,q0e=()=>`Delete`,J0e=((e={},t={})=>(t.locale??V())===`fr`?K0e(e):q0e(e)),Y0e=()=>`Enregistrer`,X0e=()=>`Save`,Z0e=((e={},t={})=>(t.locale??V())===`fr`?Y0e(e):X0e(e)),Q0e=()=>`Annuler`,$0e=()=>`Cancel`,e2e=((e={},t={})=>(t.locale??V())===`fr`?Q0e(e):$0e(e)),t2e=()=>`Nouveau groupe`,n2e=()=>`New group`,r2e=((e={},t={})=>(t.locale??V())===`fr`?t2e(e):n2e(e)),i2e=()=>`Renommer le groupe`,a2e=()=>`Rename group`,o2e=((e={},t={})=>(t.locale??V())===`fr`?i2e(e):a2e(e)),s2e=()=>`Le nom est libre ; un identifiant stable est généré automatiquement.`,c2e=()=>`The name is free-form; a stable identifier is generated automatically.`,l2e=((e={},t={})=>(t.locale??V())===`fr`?s2e(e):c2e(e)),u2e=()=>`Nom`,d2e=()=>`Name`,f2e=((e={},t={})=>(t.locale??V())===`fr`?u2e(e):d2e(e)),p2e=()=>`Description`,m2e=()=>`Description`,h2e=((e={},t={})=>(t.locale??V())===`fr`?p2e(e):m2e(e)),g2e=e=>`Supprimer le groupe « ${e?.name} » ?`,_2e=e=>`Delete group "${e?.name}"?`,v2e=((e,t={})=>(t.locale??V())===`fr`?g2e(e):_2e(e)),y2e=()=>`Cette action supprime le groupe, ses adhésions et les agents partagés. Elle est irréversible.`,b2e=()=>`This deletes the group, its memberships and shared agents. It cannot be undone.`,x2e=((e={},t={})=>(t.locale??V())===`fr`?y2e(e):b2e(e)),S2e=()=>`Supprimer le groupe`,C2e=()=>`Delete group`,w2e=((e={},t={})=>(t.locale??V())===`fr`?S2e(e):C2e(e)),T2e=e=>`Gérer « ${e?.name} »`,E2e=e=>`Manage "${e?.name}"`,D2e=((e,t={})=>(t.locale??V())===`fr`?T2e(e):E2e(e)),O2e=()=>`Ajoutez ou retirez des membres et partagez des agents découverts avec ce groupe.`,k2e=()=>`Add or remove members and share discovered agents with this group.`,A2e=((e={},t={})=>(t.locale??V())===`fr`?O2e(e):k2e(e)),j2e=()=>`Membres`,M2e=()=>`Members`,N2e=((e={},t={})=>(t.locale??V())===`fr`?j2e(e):M2e(e)),P2e=()=>`Rechercher un utilisateur…`,F2e=()=>`Search a user…`,I2e=((e={},t={})=>(t.locale??V())===`fr`?P2e(e):F2e(e)),L2e=()=>`Agents partagés`,R2e=()=>`Shared agents`,z2e=((e={},t={})=>(t.locale??V())===`fr`?L2e(e):R2e(e)),B2e=()=>`Rechercher un agent…`,V2e=()=>`Search an agent…`,H2e=((e={},t={})=>(t.locale??V())===`fr`?B2e(e):V2e(e)),U2e=()=>`Aucun résultat.`,W2e=()=>`No results.`,G2e=((e={},t={})=>(t.locale??V())===`fr`?U2e(e):W2e(e)),K2e=()=>`Tout sélectionner`,q2e=()=>`Select all`,mq=((e={},t={})=>(t.locale??V())===`fr`?K2e(e):q2e(e)),J2e=()=>`Précédent`,Y2e=()=>`Previous`,X2e=((e={},t={})=>(t.locale??V())===`fr`?J2e(e):Y2e(e)),Z2e=()=>`Suivant`,Q2e=()=>`Next`,$2e=((e={},t={})=>(t.locale??V())===`fr`?Z2e(e):Q2e(e)),e4e=e=>`Page ${e?.page} sur ${e?.pages}`,t4e=e=>`Page ${e?.page} of ${e?.pages}`,n4e=((e,t={})=>(t.locale??V())===`fr`?e4e(e):t4e(e)),r4e=()=>`Administrateur`,i4e=()=>`Admin`,a4e=((e={},t={})=>(t.locale??V())===`fr`?r4e(e):i4e(e)),o4e=()=>`Utilisateur`,s4e=()=>`User`,c4e=((e={},t={})=>(t.locale??V())===`fr`?o4e(e):s4e(e)),l4e=()=>`En attente`,u4e=()=>`Pending`,d4e=((e={},t={})=>(t.locale??V())===`fr`?l4e(e):u4e(e)),f4e=e=>`Basculer l'adhésion de ${e?.user}`,p4e=e=>`Toggle membership of ${e?.user}`,m4e=((e,t={})=>(t.locale??V())===`fr`?f4e(e):p4e(e)),h4e=e=>`Partager l'agent ${e?.name}`,g4e=e=>`Share agent ${e?.name}`,_4e=((e,t={})=>(t.locale??V())===`fr`?h4e(e):g4e(e)),v4e=()=>`Chargement…`,y4e=()=>`Loading…`,hq=((e={},t={})=>(t.locale??V())===`fr`?v4e(e):y4e(e)),b4e=()=>`Chargement des agents…`,x4e=()=>`Loading agents…`,S4e=((e={},t={})=>(t.locale??V())===`fr`?b4e(e):x4e(e)),C4e=()=>`Aucun utilisateur.`,w4e=()=>`No users.`,T4e=((e={},t={})=>(t.locale??V())===`fr`?C4e(e):w4e(e)),E4e=()=>`Aucune instance configurée.`,D4e=()=>`No instances configured.`,O4e=((e={},t={})=>(t.locale??V())===`fr`?E4e(e):D4e(e)),k4e=()=>`Aucun agent découvert.`,A4e=()=>`No discovered agents.`,j4e=((e={},t={})=>(t.locale??V())===`fr`?k4e(e):A4e(e)),M4e=()=>`Instance hors ligne ; agents indisponibles.`,N4e=()=>`Instance offline; agents unavailable.`,P4e=((e={},t={})=>(t.locale??V())===`fr`?M4e(e):N4e(e)),F4e=()=>`hors ligne`,I4e=()=>`offline`,L4e=((e={},t={})=>(t.locale??V())===`fr`?F4e(e):I4e(e)),R4e=()=>`retiré`,z4e=()=>`removed`,B4e=((e={},t={})=>(t.locale??V())===`fr`?R4e(e):z4e(e)),V4e=()=>`Agent par défaut de l'instance`,H4e=()=>`Instance default agent`,gq=((e={},t={})=>(t.locale??V())===`fr`?V4e(e):H4e(e)),U4e=()=>`Chartes`,W4e=()=>`Charts`,G4e=((e={},t={})=>(t.locale??V())===`fr`?U4e(e):W4e(e)),K4e=()=>`Aucune charte disponible pour ce groupe pour l'instant. Demandez à un administrateur d'ajouter des chartes au pool de ce groupe.`,q4e=()=>`No charts available for this group yet. Ask an admin to add charts to this group's pool.`,J4e=((e={},t={})=>(t.locale??V())===`fr`?K4e(e):q4e(e)),Y4e=()=>`Ajoutez des chartes au pool de ce groupe ci-dessous, puis sélectionnez celles que le groupe propose.`,X4e=()=>`Add charts to this group's pool below, then select which ones the group offers.`,Z4e=((e={},t={})=>(t.locale??V())===`fr`?Y4e(e):X4e(e)),Q4e=()=>`Ajouter une charte au pool…`,$4e=()=>`Add a chart to the pool…`,e3e=((e={},t={})=>(t.locale??V())===`fr`?Q4e(e):$4e(e)),t3e=e=>`Retirer ${e?.name} du pool`,n3e=e=>`Remove ${e?.name} from the pool`,_q=((e,t={})=>(t.locale??V())===`fr`?t3e(e):n3e(e)),r3e=e=>`Proposer la charte ${e?.name} à ce groupe`,i3e=e=>`Offer chart ${e?.name} to this group`,a3e=((e,t={})=>(t.locale??V())===`fr`?r3e(e):i3e(e)),o3e=()=>`Charte par défaut du groupe`,s3e=()=>`Group default chart`,vq=((e={},t={})=>(t.locale??V())===`fr`?o3e(e):s3e(e)),c3e=()=>`Définir par défaut`,l3e=()=>`Set as default`,u3e=((e={},t={})=>(t.locale??V())===`fr`?c3e(e):l3e(e)),d3e=()=>`Gestionnaire`,f3e=()=>`Manager`,yq=((e={},t={})=>(t.locale??V())===`fr`?d3e(e):f3e(e)),p3e=()=>`Promouvoir gestionnaire`,m3e=()=>`Promote to manager`,bq=((e={},t={})=>(t.locale??V())===`fr`?p3e(e):m3e(e)),h3e=()=>`Retirer gestionnaire`,g3e=()=>`Remove manager`,xq=((e={},t={})=>(t.locale??V())===`fr`?h3e(e):g3e(e)),_3e=()=>`Changement de gestionnaire refusé`,v3e=()=>`Manager change rejected`,y3e=((e={},t={})=>(t.locale??V())===`fr`?_3e(e):v3e(e)),b3e=()=>`Mise à jour de la charte refusée`,x3e=()=>`Chart update rejected`,Sq=((e={},t={})=>(t.locale??V())===`fr`?b3e(e):x3e(e)),S3e=()=>`Enregistrement du groupe refusé`,C3e=()=>`Group save rejected`,w3e=((e={},t={})=>(t.locale??V())===`fr`?S3e(e):C3e(e)),T3e=()=>`Suppression du groupe refusée`,E3e=()=>`Group deletion rejected`,D3e=((e={},t={})=>(t.locale??V())===`fr`?T3e(e):E3e(e)),O3e=()=>`Mise à jour de l'adhésion refusée`,k3e=()=>`Membership update rejected`,Cq=((e={},t={})=>(t.locale??V())===`fr`?O3e(e):k3e(e)),A3e=()=>`Partage de l'agent refusé`,j3e=()=>`Agent sharing rejected`,wq=((e={},t={})=>(t.locale??V())===`fr`?A3e(e):j3e(e)),M3e=()=>`Réordonner cet onglet`,N3e=()=>`Reorder this tab`,P3e=((e={},t={})=>(t.locale??V())===`fr`?M3e(e):N3e(e)),F3e=()=>`Réglages`,I3e=()=>`Settings`,L3e=((e={},t={})=>(t.locale??V())===`fr`?F3e(e):I3e(e)),R3e=()=>`← Retour au chat`,z3e=()=>`← Back to chat`,B3e=((e={},t={})=>(t.locale??V())===`fr`?R3e(e):z3e(e)),V3e=()=>`Réglages`,H3e=()=>`Settings`,U3e=((e={},t={})=>(t.locale??V())===`fr`?V3e(e):H3e(e)),W3e=()=>`Personnel`,G3e=()=>`Personal`,K3e=((e={},t={})=>(t.locale??V())===`fr`?W3e(e):G3e(e)),q3e=()=>`Agents`,J3e=()=>`Agents`,Y3e=((e={},t={})=>(t.locale??V())===`fr`?q3e(e):J3e(e)),X3e=()=>`Accès & utilisateurs`,Z3e=()=>`Access & users`,Q3e=((e={},t={})=>(t.locale??V())===`fr`?X3e(e):Z3e(e)),$3e=()=>`Observabilité`,e6e=()=>`Observability`,t6e=((e={},t={})=>(t.locale??V())===`fr`?$3e(e):e6e(e)),n6e=()=>`Fermer`,r6e=()=>`Close`,Tq=((e={},t={})=>(t.locale??V())===`fr`?n6e(e):r6e(e)),i6e=()=>`héritée`,a6e=()=>`inherited`,o6e=((e={},t={})=>(t.locale??V())===`fr`?i6e(e):a6e(e)),s6e=()=>`Revenir à la valeur héritée`,c6e=()=>`Back to the inherited value`,Eq=((e={},t={})=>(t.locale??V())===`fr`?s6e(e):c6e(e)),l6e=()=>`Application…`,u6e=()=>`Applying…`,Dq=((e={},t={})=>(t.locale??V())===`fr`?l6e(e):u6e(e)),d6e=()=>`Échec de l’application.`,f6e=()=>`Failed to apply.`,p6e=((e={},t={})=>(t.locale??V())===`fr`?d6e(e):f6e(e)),m6e=()=>`Réessayer`,h6e=()=>`Retry`,Oq=((e={},t={})=>(t.locale??V())===`fr`?m6e(e):h6e(e)),g6e=()=>`Réflexion`,_6e=()=>`Reasoning`,v6e=((e={},t={})=>(t.locale??V())===`fr`?g6e(e):_6e(e)),y6e=()=>`Vitesse`,b6e=()=>`Speed`,x6e=((e={},t={})=>(t.locale??V())===`fr`?y6e(e):b6e(e)),S6e=()=>`Hérité`,C6e=()=>`Inherited`,w6e=((e={},t={})=>(t.locale??V())===`fr`?S6e(e):C6e(e)),T6e=()=>`Rapide`,E6e=()=>`Fast`,kq=((e={},t={})=>(t.locale??V())===`fr`?T6e(e):E6e(e)),D6e=()=>`Standard`,O6e=()=>`Standard`,Aq=((e={},t={})=>(t.locale??V())===`fr`?D6e(e):O6e(e)),k6e=()=>`Tous les réglages de session`,A6e=()=>`All session settings`,j6e=((e={},t={})=>(t.locale??V())===`fr`?k6e(e):A6e(e)),M6e=()=>`Réglages de session`,N6e=()=>`Session settings`,P6e=((e={},t={})=>(t.locale??V())===`fr`?M6e(e):N6e(e)),F6e=()=>`Réglages appliqués à cette conversation.`,I6e=()=>`Settings applied to this conversation.`,L6e=((e={},t={})=>(t.locale??V())===`fr`?F6e(e):I6e(e)),R6e=()=>`Génération`,z6e=()=>`Generation`,B6e=((e={},t={})=>(t.locale??V())===`fr`?R6e(e):z6e(e)),V6e=()=>`Session`,H6e=()=>`Session`,U6e=((e={},t={})=>(t.locale??V())===`fr`?V6e(e):H6e(e)),W6e=()=>`Agent`,G6e=()=>`Agent`,K6e=((e={},t={})=>(t.locale??V())===`fr`?W6e(e):G6e(e)),q6e=()=>`Actions`,J6e=()=>`Actions`,Y6e=((e={},t={})=>(t.locale??V())===`fr`?q6e(e):J6e(e)),X6e=()=>`Contexte`,Z6e=()=>`Context`,Q6e=((e={},t={})=>(t.locale??V())===`fr`?X6e(e):Z6e(e)),$6e=e=>`${e?.pct} % · ${e?.used} / ${e?.total} jetons`,e8e=e=>`${e?.pct}% · ${e?.used} / ${e?.total} tokens`,t8e=((e,t={})=>(t.locale??V())===`fr`?$6e(e):e8e(e)),n8e=()=>`Verbosité`,r8e=()=>`Verbosity`,i8e=((e={},t={})=>(t.locale??V())===`fr`?n8e(e):r8e(e)),a8e=e=>`${e?.level} · fixée`,o8e=e=>`${e?.level} · pinned`,s8e=((e,t={})=>(t.locale??V())===`fr`?a8e(e):o8e(e)),c8e=()=>`Fixée par la passerelle pour un streaming complet.`,l8e=()=>`Pinned by the bridge for complete streaming.`,u8e=((e={},t={})=>(t.locale??V())===`fr`?c8e(e):l8e(e)),d8e=()=>`Coût / jetons`,f8e=()=>`Cost / tokens`,p8e=((e={},t={})=>(t.locale??V())===`fr`?d8e(e):f8e(e)),m8e=e=>`~${e?.cost} $ · ${e?.tokens} jetons`,h8e=e=>`~$${e?.cost} · ${e?.tokens} tokens`,g8e=((e,t={})=>(t.locale??V())===`fr`?m8e(e):h8e(e)),_8e=e=>`~${e?.cost} $`,v8e=e=>`~$${e?.cost}`,y8e=((e,t={})=>(t.locale??V())===`fr`?_8e(e):v8e(e)),b8e=e=>`${e?.tokens} jetons`,x8e=e=>`${e?.tokens} tokens`,S8e=((e,t={})=>(t.locale??V())===`fr`?b8e(e):x8e(e)),C8e=()=>`Compacter le contexte`,w8e=()=>`Compact the context`,T8e=((e={},t={})=>(t.locale??V())===`fr`?C8e(e):w8e(e)),E8e=()=>`Compacter le contexte ?`,D8e=()=>`Compact the context?`,O8e=((e={},t={})=>(t.locale??V())===`fr`?E8e(e):D8e(e)),k8e=()=>`L’agent résume la conversation pour libérer de l’espace dans la fenêtre de contexte. Les messages restent visibles ici.`,A8e=()=>`The agent summarizes the conversation to free space in the context window. Messages stay visible here.`,j8e=((e={},t={})=>(t.locale??V())===`fr`?k8e(e):A8e(e)),M8e=()=>`Compacter`,N8e=()=>`Compact`,P8e=((e={},t={})=>(t.locale??V())===`fr`?M8e(e):N8e(e)),F8e=()=>`Réinitialiser la session`,I8e=()=>`Reset the session`,L8e=((e={},t={})=>(t.locale??V())===`fr`?F8e(e):I8e(e)),R8e=()=>`Réinitialiser la session ?`,z8e=()=>`Reset the session?`,B8e=((e={},t={})=>(t.locale??V())===`fr`?R8e(e):z8e(e)),V8e=()=>`La session de l’agent repart à zéro et se réhydrate depuis la conversation au prochain message. Aucun message n’est supprimé.`,H8e=()=>`The agent session starts fresh and re-hydrates from the conversation on the next message. No message is deleted.`,U8e=((e={},t={})=>(t.locale??V())===`fr`?V8e(e):H8e(e)),W8e=()=>`Réinitialiser`,G8e=()=>`Reset`,K8e=((e={},t={})=>(t.locale??V())===`fr`?W8e(e):G8e(e)),q8e=()=>`Demande envoyée à l’agent.`,J8e=()=>`Request sent to the agent.`,Y8e=((e={},t={})=>(t.locale??V())===`fr`?q8e(e):J8e(e)),X8e=()=>`Échec de l’action.`,Z8e=()=>`Action failed.`,Q8e=((e={},t={})=>(t.locale??V())===`fr`?X8e(e):Z8e(e)),$8e=()=>`Fichiers d’agent`,e5e=()=>`Agent files`,t5e=((e={},t={})=>(t.locale??V())===`fr`?$8e(e):e5e(e)),n5e=()=>`Fichiers de l’espace de travail de l’agent (règles, identité, outils). La jauge mesure l’usage du budget bootstrap par fichier ; l’écriture est réservée aux administrateurs et chaque écriture est auditée.`,r5e=()=>`The agent’s workspace files (rules, identity, tools). The gauge tracks each file’s bootstrap budget usage; writing is admin-only and every write is audited.`,i5e=((e={},t={})=>(t.locale??V())===`fr`?n5e(e):r5e(e)),a5e=()=>`Instance`,o5e=()=>`Instance`,jq=((e={},t={})=>(t.locale??V())===`fr`?a5e(e):o5e(e)),s5e=()=>`Agent`,c5e=()=>`Agent`,l5e=((e={},t={})=>(t.locale??V())===`fr`?s5e(e):c5e(e)),u5e=()=>`Aucun agent disponible.`,d5e=()=>`No agent available.`,f5e=((e={},t={})=>(t.locale??V())===`fr`?u5e(e):d5e(e)),p5e=()=>`Aucun fichier.`,m5e=()=>`No files.`,h5e=((e={},t={})=>(t.locale??V())===`fr`?p5e(e):m5e(e)),g5e=()=>`Bridge injoignable — impossible de lister les fichiers.`,_5e=()=>`Bridge unreachable — cannot list the files.`,v5e=((e={},t={})=>(t.locale??V())===`fr`?g5e(e):_5e(e)),y5e=()=>`absent`,b5e=()=>`missing`,x5e=((e={},t={})=>(t.locale??V())===`fr`?y5e(e):b5e(e)),S5e=e=>`${e?.size} ko`,C5e=e=>`${e?.size} kB`,w5e=((e,t={})=>(t.locale??V())===`fr`?S5e(e):C5e(e)),T5e=e=>`${e?.pct} %`,E5e=e=>`${e?.pct}%`,D5e=((e,t={})=>(t.locale??V())===`fr`?T5e(e):E5e(e)),O5e=()=>`Proche de la limite bootstrap`,k5e=()=>`Near the bootstrap limit`,A5e=((e={},t={})=>(t.locale??V())===`fr`?O5e(e):k5e(e)),j5e=e=>`Budget total : ${e?.used} ko / ${e?.total} ko (${e?.pct} %)`,M5e=e=>`Total budget: ${e?.used} kB / ${e?.total} kB (${e?.pct}%)`,N5e=((e,t={})=>(t.locale??V())===`fr`?j5e(e):M5e(e)),P5e=()=>`Éditer`,F5e=()=>`Edit`,I5e=((e={},t={})=>(t.locale??V())===`fr`?P5e(e):F5e(e)),L5e=()=>`Consulter`,R5e=()=>`View`,z5e=((e={},t={})=>(t.locale??V())===`fr`?L5e(e):R5e(e)),B5e=e=>`${e?.name}`,V5e=e=>`${e?.name}`,Mq=((e,t={})=>(t.locale??V())===`fr`?B5e(e):V5e(e)),H5e=e=>`Agent ${e?.agent} · instance ${e?.instance}`,U5e=e=>`Agent ${e?.agent} · instance ${e?.instance}`,W5e=((e,t={})=>(t.locale??V())===`fr`?H5e(e):U5e(e)),G5e=()=>`lecture seule`,K5e=()=>`read-only`,q5e=((e={},t={})=>(t.locale??V())===`fr`?G5e(e):K5e(e)),J5e=()=>`Source markdown brute — l’aperçu rendu n’est pas disponible ici.`,Y5e=()=>`Raw markdown source — a rendered preview is not available here.`,X5e=((e={},t={})=>(t.locale??V())===`fr`?J5e(e):Y5e(e)),Z5e=e=>`${e?.count} / ${e?.max} caractères`,Q5e=e=>`${e?.count} / ${e?.max} characters`,$5e=((e,t={})=>(t.locale??V())===`fr`?Z5e(e):Q5e(e)),e7e=()=>`Enregistrer`,t7e=()=>`Save`,n7e=((e={},t={})=>(t.locale??V())===`fr`?e7e(e):t7e(e)),r7e=e=>`${e?.name} enregistré.`,i7e=e=>`${e?.name} saved.`,a7e=((e,t={})=>(t.locale??V())===`fr`?r7e(e):i7e(e)),o7e=()=>`Échec de l’enregistrement.`,s7e=()=>`Save failed.`,c7e=((e={},t={})=>(t.locale??V())===`fr`?o7e(e):s7e(e)),l7e=()=>`Impossible de charger le fichier.`,u7e=()=>`Could not load the file.`,d7e=((e={},t={})=>(t.locale??V())===`fr`?l7e(e):u7e(e)),f7e=()=>`Le fichier a changé depuis le chargement. Rechargez avant d’enregistrer (vos modifications sont conservées).`,p7e=()=>`The file changed since it was loaded. Reload before saving (your edits are kept).`,m7e=((e={},t={})=>(t.locale??V())===`fr`?f7e(e):p7e(e)),h7e=()=>`Recharger`,g7e=()=>`Reload`,_7e=((e={},t={})=>(t.locale??V())===`fr`?h7e(e):g7e(e)),v7e=e=>`Écrire ${e?.name} ?`,y7e=e=>`Write ${e?.name}?`,b7e=((e,t={})=>(t.locale??V())===`fr`?v7e(e):y7e(e)),x7e=e=>`Le fichier sera écrit sur l’agent ${e?.agent}. Une révision complète avant/après est conservée.`,S7e=e=>`The file will be written to agent ${e?.agent}. A full before/after revision is kept.`,C7e=((e,t={})=>(t.locale??V())===`fr`?x7e(e):S7e(e)),w7e=e=>`${e?.added} ligne(s) ajoutée(s) · ${e?.removed} ligne(s) retirée(s)`,T7e=e=>`${e?.added} line(s) added · ${e?.removed} line(s) removed`,E7e=((e,t={})=>(t.locale??V())===`fr`?w7e(e):T7e(e)),D7e=()=>`Ajoutées (extrait) :`,O7e=()=>`Added (sample):`,k7e=((e={},t={})=>(t.locale??V())===`fr`?D7e(e):O7e(e)),A7e=()=>`Retirées (extrait) :`,j7e=()=>`Removed (sample):`,M7e=((e={},t={})=>(t.locale??V())===`fr`?A7e(e):j7e(e)),N7e=()=>`Écrire le fichier`,P7e=()=>`Write the file`,F7e=((e={},t={})=>(t.locale??V())===`fr`?N7e(e):P7e(e)),I7e=()=>`Défauts de chat`,L7e=()=>`Chat defaults`,R7e=((e={},t={})=>(t.locale??V())===`fr`?I7e(e):L7e(e)),z7e=()=>`Réglages par défaut des nouvelles sessions de chat, lus depuis la configuration globale du gateway. Les réglages par chat et par agent restent prioritaires.`,B7e=()=>`Default settings for new chat sessions, read from the gateway’s global configuration. Per-chat and per-agent settings keep precedence.`,V7e=((e={},t={})=>(t.locale??V())===`fr`?z7e(e):B7e(e)),H7e=()=>`Réflexion par défaut`,U7e=()=>`Default thinking`,W7e=((e={},t={})=>(t.locale??V())===`fr`?H7e(e):U7e(e)),G7e=()=>`Niveau de raisonnement appliqué quand un chat ne définit pas le sien.`,K7e=()=>`Reasoning level applied when a chat does not set its own.`,q7e=((e={},t={})=>(t.locale??V())===`fr`?G7e(e):K7e(e)),J7e=()=>`Vitesse par défaut`,Y7e=()=>`Default speed`,X7e=((e={},t={})=>(t.locale??V())===`fr`?J7e(e):Y7e(e)),Z7e=()=>`Mode rapide ou standard appliqué quand un chat ne définit pas le sien.`,Q7e=()=>`Fast or standard mode applied when a chat does not set its own.`,$7e=((e={},t={})=>(t.locale??V())===`fr`?Z7e(e):Q7e(e)),e9e=()=>`Bridge injoignable — impossible de lire les défauts globaux.`,t9e=()=>`Bridge unreachable — cannot read the global defaults.`,n9e=((e={},t={})=>(t.locale??V())===`fr`?e9e(e):t9e(e)),r9e=()=>`Enregistrer`,i9e=()=>`Save`,a9e=((e={},t={})=>(t.locale??V())===`fr`?r9e(e):i9e(e)),o9e=()=>`Défauts globaux enregistrés.`,s9e=()=>`Global defaults saved.`,c9e=((e={},t={})=>(t.locale??V())===`fr`?o9e(e):s9e(e)),l9e=()=>`Échec de l’écriture des défauts globaux.`,u9e=()=>`Failed to write the global defaults.`,d9e=((e={},t={})=>(t.locale??V())===`fr`?l9e(e):u9e(e)),f9e=()=>`Ces valeurs sont écrites dans openclaw.json, la configuration globale de l’instance — elles s’appliquent à tous les utilisateurs.`,p9e=()=>`These values are written to openclaw.json, the instance’s global configuration — they apply to every user.`,m9e=((e={},t={})=>(t.locale??V())===`fr`?f9e(e):p9e(e)),h9e=()=>`Modifier les défauts globaux ?`,g9e=()=>`Change the global defaults?`,_9e=((e={},t={})=>(t.locale??V())===`fr`?h9e(e):g9e(e)),v9e=()=>`Cette écriture modifie openclaw.json pour toute l’instance : tous les chats qui héritent du défaut changeront de comportement.`,y9e=()=>`This write changes openclaw.json for the whole instance: every chat inheriting the default will change behavior.`,b9e=((e={},t={})=>(t.locale??V())===`fr`?v9e(e):y9e(e)),x9e=()=>`Modifier`,S9e=()=>`Change`,C9e=((e={},t={})=>(t.locale??V())===`fr`?x9e(e):S9e(e)),w9e=()=>`Compatibilité`,T9e=()=>`Compatibility`,E9e=((e={},t={})=>(t.locale??V())===`fr`?w9e(e):T9e(e)),D9e=()=>`Aucun relevé de compatibilité pour l’instant — le sondage tourne toutes les 5 minutes.`,O9e=()=>`No compatibility reading yet — the poll runs every 5 minutes.`,k9e=((e={},t={})=>(t.locale??V())===`fr`?D9e(e):O9e(e)),A9e=()=>`Protocole :`,j9e=()=>`Protocol:`,M9e=((e={},t={})=>(t.locale??V())===`fr`?A9e(e):j9e(e)),N9e=()=>`inconnue`,P9e=()=>`unknown`,Nq=((e={},t={})=>(t.locale??V())===`fr`?N9e(e):P9e(e)),F9e=()=>`Dernier sondage en échec — affichage du dernier relevé valide.`,I9e=()=>`Last poll failed — showing the last good reading.`,L9e=((e={},t={})=>(t.locale??V())===`fr`?F9e(e):I9e(e)),R9e=()=>`Ce bridge ne publie pas de manifeste de compatibilité (version antérieure) — politique héritée : seuls le modèle et la réflexion sont proposés.`,z9e=()=>`This bridge does not publish a compatibility manifest (older version) — legacy policy: only model and reasoning are offered.`,B9e=((e={},t={})=>(t.locale??V())===`fr`?R9e(e):z9e(e)),V9e=()=>`OpenClaw supporté :`,H9e=()=>`OpenClaw supported:`,U9e=((e={},t={})=>(t.locale??V())===`fr`?V9e(e):H9e(e)),W9e=e=>`de ${e?.min} à ${e?.max} (validé)`,G9e=e=>`from ${e?.min} to ${e?.max} (validated)`,K9e=((e,t={})=>(t.locale??V())===`fr`?W9e(e):G9e(e)),q9e=()=>`1 version validée`,J9e=()=>`1 validated version`,Y9e=((e={},t={})=>(t.locale??V())===`fr`?q9e(e):J9e(e)),X9e=e=>`${e?.count} versions validées`,Z9e=e=>`${e?.count} validated versions`,Q9e=((e,t={})=>(t.locale??V())===`fr`?X9e(e):Z9e(e)),$9e=()=>`Validées au banc`,eet=()=>`Bench-validated`,tet=((e={},t={})=>(t.locale??V())===`fr`?$9e(e):eet(e)),net=()=>`Aucune connexion connue du relevé de compatibilité.`,ret=()=>`No connection known to the compatibility reading.`,iet=((e={},t={})=>(t.locale??V())===`fr`?net(e):ret(e)),aet=()=>`✓ dans le support`,oet=()=>`✓ within support`,set=((e={},t={})=>(t.locale??V())===`fr`?aet(e):oet(e)),cet=()=>`⚠ au-delà du validé`,uet=()=>`⚠ beyond validated`,det=((e={},t={})=>(t.locale??V())===`fr`?cet(e):uet(e)),fet=()=>`? inconnue`,pet=()=>`? unknown`,met=((e={},t={})=>(t.locale??V())===`fr`?fet(e):pet(e)),het=()=>`Hermes : adaptateur à venir.`,get=()=>`Hermes: adapter coming.`,_et=((e={},t={})=>(t.locale??V())===`fr`?het(e):get(e)),vet=e=>`Non supporté par cette instance (version gateway ${e?.version}).`,yet=e=>`Not supported by this instance (gateway version ${e?.version}).`,bet=((e,t={})=>(t.locale??V())===`fr`?vet(e):yet(e)),xet=()=>`Non supporté par cette instance (version gateway inconnue).`,Cet=()=>`Not supported by this instance (unknown gateway version).`,wet=((e={},t={})=>(t.locale??V())===`fr`?xet(e):Cet(e)),Pq=(0,M.createContext)({label:`Atrium`,logoUrl:null,logoMasked:!1,isDefault:!0,initials:`A`,agentName:null,agentEmoji:null});function Fq(){return(0,M.useContext)(Pq)}function Tet(e){return e.agentName??e.label}function Eet(e){return e.agentName?hW({name:e.agentName}):fW({name:e.label})}var Det={user:MJe(),assistant:`OpenClaw`,system:FJe()},Oet=RJe();function Iq(e){return new Date(e).toISOString().slice(0,16).replace(`T`,` `)+` UTC`}function Lq(e){return e?e.filter(e=>e.kind===`file`||e.kind===`media`).map(e=>e.filename).filter(e=>typeof e==`string`&&e.length>0):[]}function ket(e,t={}){let n=[];n.push(`# ${t.title?.trim()||oq()}`),t.exportedAt!=null&&(n.push(``),n.push(`_${UJe({date:Iq(t.exportedAt)})}_`)),t.truncated&&(n.push(``),n.push(Oet));for(let t of e){n.push(``),n.push(`## ${Det[t.role]} · ${Iq(t.createdAt)}`);let e=t.text.trim();e.length>0&&(n.push(``),n.push(e));for(let e of Lq(t.parts))n.push(``),n.push(KJe({name:e}))}return n.join(`
|
|
130
|
+
`)+`
|
|
131
|
+
`}function Aet(e,t={}){let n={title:t.title?.trim()||oq(),exportedAt:t.exportedAt??null,truncated:!!t.truncated,messageCount:e.length,messages:e.map(e=>({role:e.role,createdAt:e.createdAt,text:e.text,attachments:Lq(e.parts)}))};return JSON.stringify(n,null,2)+`
|
|
132
|
+
`}function jet(e){return((e??``).trim()||`conversation`).toLowerCase().normalize(`NFD`).replace(/[̀-ͯ]/g,``).replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``).slice(0,60)||`conversation`}function Rq(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=Rq(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function zq(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Rq(e))&&(r&&(r+=` `),r+=t);return r}var Met=(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},Net=(e,t)=>({classGroupId:e,validator:t}),Bq=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Vq=`-`,Hq=[],Pet=`arbitrary..`,Fet=e=>{let t=Let(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return Iet(e);let n=e.split(Vq);return Uq(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Met(i,t):t:i||Hq}return n[e]||Hq}}},Uq=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=Uq(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(Vq):e.slice(t).join(Vq),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},Iet=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?Pet+r:void 0})(),Let=e=>{let{theme:t,classGroups:n}=e;return Ret(n,t)},Ret=(e,t)=>{let n=Bq();for(let r in e){let i=e[r];Wq(i,n,r,t)}return n},Wq=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];zet(i,t,n,r)}},zet=(e,t,n,r)=>{if(typeof e==`string`){Bet(e,t,n);return}if(typeof e==`function`){Vet(e,t,n,r);return}Het(e,t,n,r)},Bet=(e,t,n)=>{let r=e===``?t:Gq(t,e);r.classGroupId=n},Vet=(e,t,n,r)=>{if(Uet(e)){Wq(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Net(n,e))},Het=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];Wq(o,Gq(t,a),n,r)}},Gq=(e,t)=>{let n=e,r=t.split(Vq),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Bq(),n.nextPart.set(t,i)),n=i}return n},Uet=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,Wet=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)}}},Kq=`!`,qq=`:`,Get=[],Jq=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Ket=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===qq){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(Kq)?(c=s.slice(0,-1),l=!0):s.startsWith(Kq)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return Jq(t,l,c,u)};if(t){let e=t+qq,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):Jq(Get,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},qet=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}},Jet=e=>({cache:Wet(e.cacheSize),parseClassName:Ket(e),sortModifiers:qet(e),postfixLookupClassGroupIds:Yet(e),...Fet(e)}),Yet=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},Xet=/\s+/,Zet=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(Xet),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?_+Kq:_,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},Qet=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=Yq(n))&&(i&&(i+=` `),i+=r);return i},Yq=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=Yq(e[r]))&&(n&&(n+=` `),n+=t);return n},$et=(e,...t)=>{let n,r,i,a,o=o=>(n=Jet(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=Zet(e,n);return i(e,a),a};return a=o,(...e)=>a(Qet(...e))},ett=[],Xq=e=>{let t=t=>t[e]||ett;return t.isThemeGetter=!0,t},Zq=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Qq=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ttt=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,ntt=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,rtt=/\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$/,itt=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,att=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ott=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,$q=e=>ttt.test(e),eJ=e=>!!e&&!Number.isNaN(Number(e)),tJ=e=>!!e&&Number.isInteger(Number(e)),nJ=e=>e.endsWith(`%`)&&eJ(e.slice(0,-1)),rJ=e=>ntt.test(e),iJ=()=>!0,stt=e=>rtt.test(e)&&!itt.test(e),aJ=()=>!1,ctt=e=>att.test(e),ltt=e=>ott.test(e),utt=e=>!oJ(e)&&!dJ(e),dtt=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)),ftt=e=>hJ(e,yJ,aJ),oJ=e=>Zq.test(e),sJ=e=>hJ(e,bJ,stt),cJ=e=>hJ(e,btt,eJ),ptt=e=>hJ(e,SJ,iJ),mtt=e=>hJ(e,xJ,aJ),lJ=e=>hJ(e,_J,aJ),htt=e=>hJ(e,vJ,ltt),uJ=e=>hJ(e,CJ,ctt),dJ=e=>Qq.test(e),fJ=e=>gJ(e,bJ),gtt=e=>gJ(e,xJ),pJ=e=>gJ(e,_J),_tt=e=>gJ(e,yJ),vtt=e=>gJ(e,vJ),mJ=e=>gJ(e,CJ,!0),ytt=e=>gJ(e,SJ,!0),hJ=(e,t,n)=>{let r=Zq.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},gJ=(e,t,n=!1)=>{let r=Qq.exec(e);return r?r[1]?t(r[1]):n:!1},_J=e=>e===`position`||e===`percentage`,vJ=e=>e===`image`||e===`url`,yJ=e=>e===`length`||e===`size`||e===`bg-size`,bJ=e=>e===`length`,btt=e=>e===`number`,xJ=e=>e===`family-name`,SJ=e=>e===`number`||e===`weight`,CJ=e=>e===`shadow`,wJ=$et(()=>{let e=Xq(`color`),t=Xq(`font`),n=Xq(`text`),r=Xq(`font-weight`),i=Xq(`tracking`),a=Xq(`leading`),o=Xq(`breakpoint`),s=Xq(`container`),c=Xq(`spacing`),l=Xq(`radius`),u=Xq(`shadow`),d=Xq(`inset-shadow`),f=Xq(`text-shadow`),p=Xq(`drop-shadow`),m=Xq(`blur`),h=Xq(`perspective`),g=Xq(`aspect`),_=Xq(`ease`),v=Xq(`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(),dJ,oJ],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[dJ,oJ,c],T=()=>[$q,`full`,`auto`,...w()],E=()=>[tJ,`none`,`subgrid`,dJ,oJ],D=()=>[`auto`,{span:[`full`,tJ,dJ,oJ]},tJ,dJ,oJ],O=()=>[tJ,`auto`,dJ,oJ],ee=()=>[`auto`,`min`,`max`,`fr`,dJ,oJ],te=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],k=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],A=()=>[`auto`,...w()],ne=()=>[$q,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],re=()=>[$q,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],ie=()=>[$q,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],j=()=>[e,dJ,oJ],ae=()=>[...b(),pJ,lJ,{position:[dJ,oJ]}],oe=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],se=()=>[`auto`,`cover`,`contain`,_tt,ftt,{size:[dJ,oJ]}],ce=()=>[nJ,fJ,sJ],le=()=>[``,`none`,`full`,l,dJ,oJ],ue=()=>[``,eJ,fJ,sJ],de=()=>[`solid`,`dashed`,`dotted`,`double`],fe=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],pe=()=>[eJ,nJ,pJ,lJ],me=()=>[``,`none`,m,dJ,oJ],he=()=>[`none`,eJ,dJ,oJ],ge=()=>[`none`,eJ,dJ,oJ],_e=()=>[eJ,dJ,oJ],ve=()=>[$q,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[rJ],breakpoint:[rJ],color:[iJ],container:[rJ],"drop-shadow":[rJ],ease:[`in`,`out`,`in-out`],font:[utt],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[rJ],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[rJ],shadow:[rJ],spacing:[`px`,eJ],text:[rJ],"text-shadow":[rJ],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,$q,oJ,dJ,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,dJ,oJ]}],"container-named":[dtt],columns:[{columns:[eJ,oJ,dJ,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:[tJ,`auto`,dJ,oJ]}],basis:[{basis:[$q,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[eJ,$q,`auto`,`initial`,`none`,oJ]}],grow:[{grow:[``,eJ,dJ,oJ]}],shrink:[{shrink:[``,eJ,dJ,oJ]}],order:[{order:[tJ,`first`,`last`,`none`,dJ,oJ]}],"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":ee()}],"auto-rows":[{"auto-rows":ee()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...te(),`normal`]}],"justify-items":[{"justify-items":[...k(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...k()]}],"align-content":[{content:[`normal`,...te()]}],"align-items":[{items:[...k(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...k(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":te()}],"place-items":[{"place-items":[...k(),`baseline`]}],"place-self":[{"place-self":[`auto`,...k()]}],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:A()}],mx:[{mx:A()}],my:[{my:A()}],ms:[{ms:A()}],me:[{me:A()}],mbs:[{mbs:A()}],mbe:[{mbe:A()}],mt:[{mt:A()}],mr:[{mr:A()}],mb:[{mb:A()}],ml:[{ml:A()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:ne()}],"inline-size":[{inline:[`auto`,...re()]}],"min-inline-size":[{"min-inline":[`auto`,...re()]}],"max-inline-size":[{"max-inline":[`none`,...re()]}],"block-size":[{block:[`auto`,...ie()]}],"min-block-size":[{"min-block":[`auto`,...ie()]}],"max-block-size":[{"max-block":[`none`,...ie()]}],w:[{w:[s,`screen`,...ne()]}],"min-w":[{"min-w":[s,`screen`,`none`,...ne()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...ne()]}],h:[{h:[`screen`,`lh`,...ne()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...ne()]}],"max-h":[{"max-h":[`screen`,`lh`,...ne()]}],"font-size":[{text:[`base`,n,fJ,sJ]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,ytt,ptt]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,nJ,oJ]}],"font-family":[{font:[gtt,mtt,t]}],"font-features":[{"font-features":[oJ]}],"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,dJ,oJ]}],"line-clamp":[{"line-clamp":[eJ,`none`,dJ,cJ]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,dJ,oJ]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,dJ,oJ]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:j()}],"text-color":[{text:j()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...de(),`wavy`]}],"text-decoration-thickness":[{decoration:[eJ,`from-font`,`auto`,dJ,sJ]}],"text-decoration-color":[{decoration:j()}],"underline-offset":[{"underline-offset":[eJ,`auto`,dJ,oJ]}],"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:[tJ,dJ,oJ]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,dJ,oJ]}],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`,dJ,oJ]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:ae()}],"bg-repeat":[{bg:oe()}],"bg-size":[{bg:se()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},tJ,dJ,oJ],radial:[``,dJ,oJ],conic:[tJ,dJ,oJ]},vtt,htt]}],"bg-color":[{bg:j()}],"gradient-from-pos":[{from:ce()}],"gradient-via-pos":[{via:ce()}],"gradient-to-pos":[{to:ce()}],"gradient-from":[{from:j()}],"gradient-via":[{via:j()}],"gradient-to":[{to:j()}],rounded:[{rounded:le()}],"rounded-s":[{"rounded-s":le()}],"rounded-e":[{"rounded-e":le()}],"rounded-t":[{"rounded-t":le()}],"rounded-r":[{"rounded-r":le()}],"rounded-b":[{"rounded-b":le()}],"rounded-l":[{"rounded-l":le()}],"rounded-ss":[{"rounded-ss":le()}],"rounded-se":[{"rounded-se":le()}],"rounded-ee":[{"rounded-ee":le()}],"rounded-es":[{"rounded-es":le()}],"rounded-tl":[{"rounded-tl":le()}],"rounded-tr":[{"rounded-tr":le()}],"rounded-br":[{"rounded-br":le()}],"rounded-bl":[{"rounded-bl":le()}],"border-w":[{border:ue()}],"border-w-x":[{"border-x":ue()}],"border-w-y":[{"border-y":ue()}],"border-w-s":[{"border-s":ue()}],"border-w-e":[{"border-e":ue()}],"border-w-bs":[{"border-bs":ue()}],"border-w-be":[{"border-be":ue()}],"border-w-t":[{"border-t":ue()}],"border-w-r":[{"border-r":ue()}],"border-w-b":[{"border-b":ue()}],"border-w-l":[{"border-l":ue()}],"divide-x":[{"divide-x":ue()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":ue()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...de(),`hidden`,`none`]}],"divide-style":[{divide:[...de(),`hidden`,`none`]}],"border-color":[{border:j()}],"border-color-x":[{"border-x":j()}],"border-color-y":[{"border-y":j()}],"border-color-s":[{"border-s":j()}],"border-color-e":[{"border-e":j()}],"border-color-bs":[{"border-bs":j()}],"border-color-be":[{"border-be":j()}],"border-color-t":[{"border-t":j()}],"border-color-r":[{"border-r":j()}],"border-color-b":[{"border-b":j()}],"border-color-l":[{"border-l":j()}],"divide-color":[{divide:j()}],"outline-style":[{outline:[...de(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[eJ,dJ,oJ]}],"outline-w":[{outline:[``,eJ,fJ,sJ]}],"outline-color":[{outline:j()}],shadow:[{shadow:[``,`none`,u,mJ,uJ]}],"shadow-color":[{shadow:j()}],"inset-shadow":[{"inset-shadow":[`none`,d,mJ,uJ]}],"inset-shadow-color":[{"inset-shadow":j()}],"ring-w":[{ring:ue()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:j()}],"ring-offset-w":[{"ring-offset":[eJ,sJ]}],"ring-offset-color":[{"ring-offset":j()}],"inset-ring-w":[{"inset-ring":ue()}],"inset-ring-color":[{"inset-ring":j()}],"text-shadow":[{"text-shadow":[`none`,f,mJ,uJ]}],"text-shadow-color":[{"text-shadow":j()}],opacity:[{opacity:[eJ,dJ,oJ]}],"mix-blend":[{"mix-blend":[...fe(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":fe()}],"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":[eJ]}],"mask-image-linear-from-pos":[{"mask-linear-from":pe()}],"mask-image-linear-to-pos":[{"mask-linear-to":pe()}],"mask-image-linear-from-color":[{"mask-linear-from":j()}],"mask-image-linear-to-color":[{"mask-linear-to":j()}],"mask-image-t-from-pos":[{"mask-t-from":pe()}],"mask-image-t-to-pos":[{"mask-t-to":pe()}],"mask-image-t-from-color":[{"mask-t-from":j()}],"mask-image-t-to-color":[{"mask-t-to":j()}],"mask-image-r-from-pos":[{"mask-r-from":pe()}],"mask-image-r-to-pos":[{"mask-r-to":pe()}],"mask-image-r-from-color":[{"mask-r-from":j()}],"mask-image-r-to-color":[{"mask-r-to":j()}],"mask-image-b-from-pos":[{"mask-b-from":pe()}],"mask-image-b-to-pos":[{"mask-b-to":pe()}],"mask-image-b-from-color":[{"mask-b-from":j()}],"mask-image-b-to-color":[{"mask-b-to":j()}],"mask-image-l-from-pos":[{"mask-l-from":pe()}],"mask-image-l-to-pos":[{"mask-l-to":pe()}],"mask-image-l-from-color":[{"mask-l-from":j()}],"mask-image-l-to-color":[{"mask-l-to":j()}],"mask-image-x-from-pos":[{"mask-x-from":pe()}],"mask-image-x-to-pos":[{"mask-x-to":pe()}],"mask-image-x-from-color":[{"mask-x-from":j()}],"mask-image-x-to-color":[{"mask-x-to":j()}],"mask-image-y-from-pos":[{"mask-y-from":pe()}],"mask-image-y-to-pos":[{"mask-y-to":pe()}],"mask-image-y-from-color":[{"mask-y-from":j()}],"mask-image-y-to-color":[{"mask-y-to":j()}],"mask-image-radial":[{"mask-radial":[dJ,oJ]}],"mask-image-radial-from-pos":[{"mask-radial-from":pe()}],"mask-image-radial-to-pos":[{"mask-radial-to":pe()}],"mask-image-radial-from-color":[{"mask-radial-from":j()}],"mask-image-radial-to-color":[{"mask-radial-to":j()}],"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":[eJ]}],"mask-image-conic-from-pos":[{"mask-conic-from":pe()}],"mask-image-conic-to-pos":[{"mask-conic-to":pe()}],"mask-image-conic-from-color":[{"mask-conic-from":j()}],"mask-image-conic-to-color":[{"mask-conic-to":j()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:ae()}],"mask-repeat":[{mask:oe()}],"mask-size":[{mask:se()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,dJ,oJ]}],filter:[{filter:[``,`none`,dJ,oJ]}],blur:[{blur:me()}],brightness:[{brightness:[eJ,dJ,oJ]}],contrast:[{contrast:[eJ,dJ,oJ]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,mJ,uJ]}],"drop-shadow-color":[{"drop-shadow":j()}],grayscale:[{grayscale:[``,eJ,dJ,oJ]}],"hue-rotate":[{"hue-rotate":[eJ,dJ,oJ]}],invert:[{invert:[``,eJ,dJ,oJ]}],saturate:[{saturate:[eJ,dJ,oJ]}],sepia:[{sepia:[``,eJ,dJ,oJ]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,dJ,oJ]}],"backdrop-blur":[{"backdrop-blur":me()}],"backdrop-brightness":[{"backdrop-brightness":[eJ,dJ,oJ]}],"backdrop-contrast":[{"backdrop-contrast":[eJ,dJ,oJ]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,eJ,dJ,oJ]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[eJ,dJ,oJ]}],"backdrop-invert":[{"backdrop-invert":[``,eJ,dJ,oJ]}],"backdrop-opacity":[{"backdrop-opacity":[eJ,dJ,oJ]}],"backdrop-saturate":[{"backdrop-saturate":[eJ,dJ,oJ]}],"backdrop-sepia":[{"backdrop-sepia":[``,eJ,dJ,oJ]}],"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`,dJ,oJ]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[eJ,`initial`,dJ,oJ]}],ease:[{ease:[`linear`,`initial`,_,dJ,oJ]}],delay:[{delay:[eJ,dJ,oJ]}],animate:[{animate:[`none`,v,dJ,oJ]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,dJ,oJ]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:he()}],"rotate-x":[{"rotate-x":he()}],"rotate-y":[{"rotate-y":he()}],"rotate-z":[{"rotate-z":he()}],scale:[{scale:ge()}],"scale-x":[{"scale-x":ge()}],"scale-y":[{"scale-y":ge()}],"scale-z":[{"scale-z":ge()}],"scale-3d":[`scale-3d`],skew:[{skew:_e()}],"skew-x":[{"skew-x":_e()}],"skew-y":[{"skew-y":_e()}],transform:[{transform:[dJ,oJ,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:ve()}],"translate-x":[{"translate-x":ve()}],"translate-y":[{"translate-y":ve()}],"translate-z":[{"translate-z":ve()}],"translate-none":[`translate-none`],zoom:[{zoom:[tJ,dJ,oJ]}],accent:[{accent:j()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:j()}],"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`,dJ,oJ]}],"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":j()}],"scrollbar-track-color":[{"scrollbar-track":j()}],"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`,dJ,oJ]}],fill:[{fill:[`none`,...j()]}],"stroke-w":[{stroke:[eJ,fJ,sJ,cJ]}],stroke:[{stroke:[`none`,...j()]}],"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 TJ(...e){return wJ(zq(e))}function EJ(e){return(0,F.jsx)(que,{"data-slot":`dropdown-menu`,...e})}function DJ(e){return(0,F.jsx)(Jue,{"data-slot":`dropdown-menu-trigger`,...e})}function OJ({className:e,sideOffset:t=4,...n}){return(0,F.jsx)(Yue,{children:(0,F.jsx)(Xue,{"data-slot":`dropdown-menu-content`,sideOffset:t,className:TJ(`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 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md`,e),...n})})}function kJ({className:e,inset:t,variant:n=`default`,...r}){return(0,F.jsx)(Que,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:TJ(`focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...r})}function AJ({className:e,inset:t,...n}){return(0,F.jsx)(Zue,{"data-slot":`dropdown-menu-label`,"data-inset":t,className:TJ(`px-2 py-1.5 text-sm font-medium data-[inset]:pl-8`,e),...n})}function jJ({className:e,...t}){return(0,F.jsx)(nde,{"data-slot":`dropdown-menu-separator`,className:TJ(`bg-border -mx-1 my-1 h-px`,e),...t})}function xtt(e){return(0,F.jsx)($ue,{"data-slot":`dropdown-menu-radio-group`,...e})}function MJ({className:e,children:t,...n}){return(0,F.jsxs)(ede,{"data-slot":`dropdown-menu-radio-item`,className:TJ(`focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...n,children:[(0,F.jsx)(`span`,{className:`pointer-events-none absolute left-2 flex size-3.5 items-center justify-center`,children:(0,F.jsx)(tde,{children:(0,F.jsx)(See,{className:`size-2 fill-current`})})}),t]})}function NJ({...e}){return(0,F.jsx)(VT,{"data-slot":`popover`,...e})}function PJ({...e}){return(0,F.jsx)(HT,{"data-slot":`popover-trigger`,...e})}function FJ({className:e,align:t=`center`,sideOffset:n=4,...r}){return(0,F.jsx)(UT,{children:(0,F.jsx)(WT,{"data-slot":`popover-content`,align:t,sideOffset:n,className:TJ(`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 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden`,e),...r})})}var IJ=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,LJ=zq,RJ=(e,t)=>n=>{if(t?.variants==null)return LJ(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=IJ(t)||IJ(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 LJ(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)},zJ=RJ(`group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,icon:`size-8`,"icon-xs":`size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function H({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){return(0,F.jsx)(r?By:`button`,{"data-slot":`button`,"data-variant":t,"data-size":n,className:TJ(zJ({variant:t,size:n,className:e})),...i})}function BJ({className:e,type:t,...n}){return(0,F.jsx)(`input`,{type:t,"data-slot":`input`,className:TJ(`h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...n})}function VJ({...e}){return(0,F.jsx)(mce,{"data-slot":`alert-dialog`,...e})}function Stt({...e}){return(0,F.jsx)(hce,{"data-slot":`alert-dialog-portal`,...e})}function Ctt({className:e,...t}){return(0,F.jsx)(gce,{"data-slot":`alert-dialog-overlay`,className:TJ(`fixed inset-0 z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function HJ({className:e,...t}){return(0,F.jsxs)(Stt,{children:[(0,F.jsx)(Ctt,{}),(0,F.jsx)(_ce,{"data-slot":`alert-dialog-content`,className:TJ(`fixed top-1/2 left-1/2 z-50 grid w-[calc(100%-2rem)] max-w-md -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl border border-border bg-popover bg-clip-padding p-5 text-sm text-popover-foreground shadow-lg duration-200 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...t})]})}function UJ({className:e,...t}){return(0,F.jsx)(`div`,{"data-slot":`alert-dialog-header`,className:TJ(`flex flex-col gap-1.5`,e),...t})}function WJ({className:e,...t}){return(0,F.jsx)(`div`,{"data-slot":`alert-dialog-footer`,className:TJ(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...t})}function GJ({className:e,...t}){return(0,F.jsx)(bce,{"data-slot":`alert-dialog-title`,className:TJ(`text-base font-medium text-foreground`,e),...t})}function KJ({className:e,...t}){return(0,F.jsx)(xce,{"data-slot":`alert-dialog-description`,className:TJ(`text-sm text-muted-foreground`,e),...t})}function qJ({className:e,...t}){return(0,F.jsx)(vce,{className:TJ(zJ(),e),...t})}function JJ({className:e,...t}){return(0,F.jsx)(yce,{className:TJ(zJ({variant:`outline`}),e),...t})}function YJ({...e}){return(0,F.jsx)(Gx,{"data-slot":`dialog`,...e})}function wtt({...e}){return(0,F.jsx)(Kx,{"data-slot":`dialog-portal`,...e})}function Ttt({className:e,...t}){return(0,F.jsx)(qx,{"data-slot":`dialog-overlay`,className:TJ(`fixed inset-0 z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function XJ({className:e,children:t,showCloseButton:n=!0,...r}){return(0,F.jsxs)(wtt,{children:[(0,F.jsx)(Ttt,{}),(0,F.jsxs)(Jx,{"data-slot":`dialog-content`,className:TJ(`fixed top-1/2 left-1/2 z-50 grid w-[calc(100%-2rem)] max-w-md -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl border border-border bg-popover bg-clip-padding p-5 text-sm text-popover-foreground shadow-lg duration-200 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r,children:[t,n&&(0,F.jsx)(Zx,{"data-slot":`dialog-close`,asChild:!0,children:(0,F.jsxs)(H,{variant:`ghost`,size:`icon-sm`,className:`absolute top-3 right-3`,children:[(0,F.jsx)(Gm,{}),(0,F.jsx)(`span`,{className:`sr-only`,children:Tq()})]})})]})]})}function ZJ({className:e,...t}){return(0,F.jsx)(`div`,{"data-slot":`dialog-header`,className:TJ(`flex flex-col gap-1.5 pr-6`,e),...t})}function QJ({className:e,...t}){return(0,F.jsx)(`div`,{"data-slot":`dialog-footer`,className:TJ(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...t})}function $J({className:e,...t}){return(0,F.jsx)(Yx,{"data-slot":`dialog-title`,className:TJ(`text-base font-medium text-foreground`,e),...t})}function eY({className:e,...t}){return(0,F.jsx)(Xx,{"data-slot":`dialog-description`,className:TJ(`text-sm text-muted-foreground`,e),...t})}var tY=M.createContext(null);function Ett({children:e}){let[t,n]=M.useState(null),r=M.useRef(null),i=M.useRef(null),[a,o]=M.useState(``),s=M.useCallback(e=>{let t=r.current;r.current=null,n(null),t&&t(e)},[]),c=M.useMemo(()=>({confirm:e=>new Promise(t=>{r.current=t,o(``),n({kind:`confirm`,opts:e})}),prompt:e=>new Promise(t=>{r.current=t,o(e.defaultValue??``),n({kind:`prompt`,opts:e})})}),[]),l=t?.kind===`confirm`,u=t?.kind===`prompt`,d=t?.kind===`confirm`?t.opts.confirmWord:void 0,f=!d||a.trim().toLowerCase()===d.trim().toLowerCase(),p=a.trim().length>0,m=e=>{e.preventDefault(),requestAnimationFrame(()=>i.current?.focus())};return(0,F.jsxs)(tY.Provider,{value:c,children:[e,(0,F.jsx)(VJ,{open:l,onOpenChange:e=>{e||s(!1)},children:l?(0,F.jsxs)(HJ,{onOpenAutoFocus:d?m:void 0,...t.opts.description?{}:{"aria-describedby":void 0},children:[(0,F.jsxs)(UJ,{children:[(0,F.jsx)(GJ,{children:t.opts.title}),t.opts.description?(0,F.jsx)(KJ,{children:t.opts.description}):null]}),d?(0,F.jsxs)(`label`,{className:`flex flex-col gap-1.5`,children:[(0,F.jsxs)(`span`,{className:`text-sm text-muted-foreground`,children:[`Pour confirmer, saisissez`,` `,(0,F.jsxs)(`span`,{className:`font-medium text-foreground`,children:[`« `,d,` »`]}),` `,`ci-dessous.`]}),(0,F.jsx)(BJ,{ref:i,value:a,placeholder:d,autoComplete:`off`,onChange:e=>o(e.target.value),onKeyDown:e=>{e.key===`Enter`&&f&&(e.preventDefault(),s(!0))}})]}):null,(0,F.jsxs)(WJ,{children:[(0,F.jsx)(JJ,{onClick:()=>s(!1),children:t.opts.cancelLabel??`Annuler`}),(0,F.jsx)(H,{variant:t.opts.destructive?`destructive`:`default`,disabled:!f,onClick:()=>s(!0),children:t.opts.confirmLabel??`Supprimer`})]})]}):null}),(0,F.jsx)(YJ,{open:u,onOpenChange:e=>{e||s(null)},children:u?(0,F.jsxs)(XJ,{onOpenAutoFocus:m,...t.opts.description?{}:{"aria-describedby":void 0},children:[(0,F.jsxs)(ZJ,{children:[(0,F.jsx)($J,{children:t.opts.title}),t.opts.description?(0,F.jsx)(eY,{children:t.opts.description}):null]}),(0,F.jsxs)(`label`,{className:`flex flex-col gap-1.5`,children:[t.opts.label?(0,F.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:t.opts.label}):null,(0,F.jsx)(BJ,{ref:i,value:a,placeholder:t.opts.placeholder,autoComplete:`off`,onChange:e=>o(e.target.value),onKeyDown:e=>{e.key===`Enter`&&p&&(e.preventDefault(),s(a.trim()))}})]}),(0,F.jsxs)(QJ,{children:[(0,F.jsx)(H,{variant:`outline`,onClick:()=>s(null),children:t.opts.cancelLabel??`Annuler`}),(0,F.jsx)(H,{disabled:!p,onClick:()=>s(a.trim()),children:t.opts.confirmLabel??`Valider`})]})]}):null})]})}function nY(){let e=M.useContext(tY);if(!e)throw Error(`useConfirm/usePrompt must be used within <DialogsProvider>`);return e}function rY(){return nY().confirm}function iY(){return nY().prompt}var aY=M.createContext(null),Dtt=6e3;function oY(e){if(e instanceof Error)return e.message;if(typeof e==`string`)return e;try{return String(e)}catch{return`Erreur inconnue`}}function Ott({children:e}){let[t,n]=M.useState([]),r=M.useRef(0),i=M.useRef(new Map),a=M.useCallback(e=>{n(t=>t.filter(t=>t.id!==e));let t=i.current.get(e);t!==void 0&&(window.clearTimeout(t),i.current.delete(e))},[]),o=M.useCallback(e=>{let t=r.current++,o={id:t,variant:e.variant??`info`,title:e.title,description:e.description};n(e=>[...e,o]);let s=window.setTimeout(()=>a(t),Dtt);i.current.set(t,s)},[a]);M.useEffect(()=>{let e=i.current;return()=>{for(let t of e.values())window.clearTimeout(t);e.clear()}},[]);let s=M.useMemo(()=>({toast:o,error:(e,t)=>o({variant:`error`,title:e,description:t===void 0?void 0:oY(t)}),success:(e,t)=>o({variant:`success`,title:e,description:t})}),[o]);return(0,F.jsxs)(aY.Provider,{value:s,children:[e,(0,F.jsx)(`div`,{className:`oc-toast__viewport`,role:`region`,"aria-label":`Notifications`,children:t.map(e=>(0,F.jsxs)(`div`,{className:TJ(`oc-toast`,`oc-toast--${e.variant}`),role:e.variant===`error`?`alert`:`status`,children:[(0,F.jsxs)(`div`,{className:`oc-toast__body`,children:[(0,F.jsx)(`div`,{className:`oc-toast__title`,children:e.title}),e.description?(0,F.jsx)(`div`,{className:`oc-toast__desc`,children:e.description}):null]}),(0,F.jsx)(`button`,{type:`button`,className:`oc-toast__close`,"aria-label":`Fermer`,onClick:()=>a(e.id),children:(0,F.jsx)(Gm,{"aria-hidden":!0})})]},e.id))})]})}function sY(){let e=M.useContext(aY);if(!e)throw Error(`useToast must be used within <ToastProvider>`);return e}function ktt(e){return e.kind===`tool`}function Att(e){return e.kind===`media`}function jtt(e){return e.kind===`file`}function Mtt(e){return e.kind===`reasoning`}var Ntt=/---[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}(?=\.[^.]+$|$)/i;function Ptt(e){return e.replace(Ntt,``)}function Ftt(e,t){let n=e.runId??`norun`;return`${e._id}:${n}:${t}`}function Itt(e,t,n){return{toolCallId:Ftt(e,t),toolName:n.name,args:n.input??{},result:n.output,argsText:n.input===void 0?void 0:ztt(n.input),phase:typeof n.phase==`string`?n.phase:void 0}}function Ltt(e){return e&&Ptt(e)}function Rtt(e){return e.url?{type:`file`,mimeType:e.mimeType,data:e.url,filename:Ltt(e.filename)}:null}function ztt(e){try{return typeof e==`string`?e:JSON.stringify(e,null,2)}catch{return String(e)}}function Btt(e){let t=[],n=[],r=[];return e.parts.forEach((i,a)=>{Mtt(i)?t.push({type:`reasoning`,text:i.text}):ktt(i)?n.push(Itt(e,a,i)):i.kind===`provenance`&&r.push(i)}),e.text&&e.text.length>0&&t.push({type:`text`,text:e.text}),e.parts.forEach(e=>{if(Att(e)||jtt(e)){let n=Rtt(e);n&&t.push(n)}}),t.length===0&&t.push({type:`text`,text:``}),{id:e._id,role:e.role,createdAt:new Date(e.updatedAt??e._creationTime),content:t,metadata:{custom:{messageId:e._id,chatId:e.chatId,status:e.status,runId:e.runId??null,error:e.error??null,toolParts:n,provenanceParts:r,attachedDocCount:e.attachedDocCount??0,rawText:e.text}}}}function Vtt(e){return typeof e==`string`&&e.toLowerCase().startsWith(`image/`)}var Htt=128*1024;function Utt(e){let t=e-Htt;return t<=0?0:Math.floor(t/4)*3}function Wtt(){return`att_${Math.random().toString(36).slice(2)}_${Date.now()}`}function Gtt(e){if(!e)return[];let t=[];for(let n of e){let e=n.convex;e?.storageId&&t.push({storageId:e.storageId,filename:e.filename,mimeType:e.mimeType})}return t}function Ktt(e,t,n){return{accept:`*`,async add({file:r}){let i=null;try{i=(await e.query(L.bridgeHealth.getBridgeAvailability,n?{chatId:n}:{}))?.maxInboundBytes??null}catch{}let a=i??Utt(26214400);if(n&&!Vtt(r.type))try{let t=await e.query(L.bridge.getChatInboundPolicy,{chatId:n});t?.inboundMediaMode===`shared-fs`&&(a=t.sharedFsMaxBytes)}catch{}if(r.size>a){let e=e=>Math.floor(e/1024/1024),n=Nme({size:e(r.size),max:e(a)});throw t?.(n),Error(n)}return{id:Wtt(),type:qtt(r.type),name:r.name,contentType:r.type||`application/octet-stream`,file:r,status:{type:`running`,reason:`uploading`,progress:0}}},async send(t){let n=t.file;YO.report(t.id,0,n.size||1);try{let r;try{r=await e.mutation(L.chats.generateUploadUrl,{})}catch(e){throw console.error(`[attach] generateUploadUrl failed:`,e),e}let i=await new Promise((e,i)=>{let a=new XMLHttpRequest;a.open(`POST`,r),a.setRequestHeader(`Content-Type`,n.type||`application/octet-stream`),a.upload.onprogress=e=>{e.lengthComputable&&YO.report(t.id,e.loaded,e.total)},a.onload=()=>{if(a.status>=200&&a.status<300)try{e(JSON.parse(a.responseText).storageId)}catch(e){i(e)}else i(Error(`Upload failed (${a.status})`))},a.onerror=()=>{console.error(`[attach] upload POST failed (network/CORS/CSP)`),i(Error(`Upload failed (network)`))},a.send(n)});return await e.mutation(L.uploads.registerUpload,{storageId:i}),{id:t.id,type:t.type,name:t.name,contentType:t.contentType,status:{type:`complete`},content:[{type:`text`,text:n.name}],convex:{storageId:i,filename:n.name,mimeType:n.type||`application/octet-stream`}}}finally{YO.clear(t.id)}},async remove(){}}}function qtt(e){return e.startsWith(`image/`)?`image`:`document`}function Jtt({chatId:e}){let t=Qn(),n=sY(),r=P(L.send.sendMessage).withOptimisticUpdate((e,t)=>{let n={chatId:t.chatId},r=e.getQuery(L.messages.listByChat,n)??[],i=`optimistic-${t.clientMessageId}`;if(r.some(e=>e._id===i))return;let a=Date.now(),o={_id:i,chatId:t.chatId,_creationTime:a,role:`user`,status:`complete`,runId:void 0,error:void 0,errorCode:void 0,attachedDocCount:void 0,text:t.text,updatedAt:a,parts:[]};e.setQuery(L.messages.listByChat,n,[...r,o])}),i=N(L.messages.listByChat,e?{chatId:e}:`skip`),a=N(L.messages.getStreamingText,e?{chatId:e}:`skip`),o=(0,M.useMemo)(()=>Ktt(t,e=>n.error(e),e),[t,n,e]),s=(0,M.useMemo)(()=>{let e=i??[];if(!a||a.length===0)return e;let t=new Map(a.map(e=>[e.messageId,e.text]));return e.map(e=>e.status===`streaming`&&t.has(e._id)?{...e,text:t.get(e._id)}:e)},[i,a]),c=s.length>0?s[s.length-1].role:null,l=s.some(e=>e.status===`streaming`),[u,d]=(0,M.useState)(null);(0,M.useEffect)(()=>{d(null)},[e]),(0,M.useEffect)(()=>{c===`assistant`&&d(null)},[c,s]),(0,M.useEffect)(()=>{if(u===null)return;let e=window.setTimeout(()=>d(null),12e4);return()=>window.clearTimeout(e)},[u]);let f=u!==null||l,p=(0,M.useMemo)(()=>({messages:s,isRunning:f,convertMessage:Btt,onNew:async t=>{if(!e)throw Error(`No chat selected`);let n=t.content.filter(e=>e.type===`text`).map(e=>e.text).join(``),i=Gtt(t.attachments).map(e=>({storageId:e.storageId,filename:e.filename,mimeType:e.mimeType}));d(Date.now());try{await r({chatId:e,text:n,clientMessageId:crypto.randomUUID(),attachments:i})}catch(e){throw d(null),e}},adapters:{attachments:o}}),[s,f,e,r,o]),m=(0,M.useMemo)(()=>({begin:()=>d(Date.now()),cancel:()=>d(null)}),[]),h=(0,M.useCallback)(async t=>{let i=t.trim();if(!e||i===``)return!1;try{return await r({chatId:e,text:t,clientMessageId:crypto.randomUUID()}),!0}catch(e){return n.error(e?.message?.includes(`QUEUE_FULL`)?ZG():eK()),!1}},[e,r,n]);return{runtime:vie(p),turnGate:m,queueSend:h}}function cY(e,{key:t,value:n}){let r=e.getQuery(L.me.getMe,{host:BO});if(!r?.ui)return;let i={...r.ui.effective},a={...r.ui.userOverrides},o=t,s=t;n===null?delete a[s]:(i[o]=n,a[s]=n),e.setQuery(L.me.getMe,{host:BO},{...r,ui:{...r.ui,effective:i,userOverrides:a}})}function Ytt(e,{messageId:t}){for(let{args:n,value:r}of e.getAllQueries(L.messages.listByChat)){if(r===void 0)continue;let i=r.find(e=>e._id===t);if(i===void 0)continue;let a=i._creationTime;e.setQuery(L.messages.listByChat,n,r.filter(e=>e._creationTime<a))}}function Xtt(e,t){if(e===void 0)return`thinking`;switch(e){case`streaming`:return t?`generating`:`thinking`;case`error`:return`error`;case`aborted`:return`aborted`;default:return null}}function Ztt(e){return e?e.some(e=>e?.type===`text`&&typeof e.text==`string`&&e.text.trim().length>0):!1}var Qtt={thinking:Rqe,generating:Vqe,error:Wqe,aborted:Xqe};function $tt(e,t){let n=Xtt(e,t);return n===null?null:{kind:n,label:Qtt[n]()}}var ent=Ztt;function tnt(e){return e===`stream_orphaned`?qqe():e}function nnt(){let e=Fq(),t=Ny(e=>e.metadata?.custom?.status),n=Ny(e=>e.metadata?.custom?.runId),r=Ny(e=>e.metadata?.custom?.error),i=$tt(t,Ny(e=>ent(e.content))),a=i?.kind===`thinking`,[o,s]=(0,M.useState)(!1);return(0,M.useEffect)(()=>{if(!a){s(!1);return}let e=window.setTimeout(()=>s(!0),6e3);return()=>window.clearTimeout(e)},[a]),i?i.kind===`error`?(0,F.jsxs)(`div`,{className:`oc-error-card`,role:`alert`,title:n?`run ${n}`:void 0,children:[(0,F.jsx)(bm,{size:18,className:`oc-error-card__icon`,"aria-hidden":!0}),(0,F.jsxs)(`div`,{className:`oc-error-card__body`,children:[(0,F.jsx)(`span`,{className:`oc-error-card__title`,children:i.label}),r?(0,F.jsx)(`span`,{className:`oc-error-card__msg`,children:tnt(r)}):null]})]}):(0,F.jsxs)(`div`,{className:`oc-run-status oc-run-status--${i.kind}`,role:`status`,title:n?`run ${n}`:void 0,children:[i.kind===`thinking`?(0,F.jsxs)(`span`,{className:`oc-dots`,"aria-hidden":!0,children:[(0,F.jsx)(`span`,{}),(0,F.jsx)(`span`,{}),(0,F.jsx)(`span`,{})]}):i.kind===`generating`?(0,F.jsx)(`span`,{className:`oc-run-status__pulse`,"aria-hidden":!0}):(0,F.jsx)(Uee,{size:13,"aria-hidden":!0}),(0,F.jsx)(`span`,{className:`oc-run-status__label`,children:i.kind===`thinking`&&o?Eet(e):i.label})]}):null}var rnt=new Set([`status`,`exitCode`,`durationMs`]);function int(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function ant(e){if(typeof e==`string`)return{kind:`text`,text:e};if(typeof e==`object`&&e&&!Array.isArray(e)){let t=e,n=Object.keys(t);if(typeof t.exitCode==`number`&&n.every(e=>rnt.has(e)))return{kind:`outcome`,status:typeof t.status==`string`?t.status:null,exitCode:t.exitCode,durationMs:typeof t.durationMs==`number`?t.durationMs:null}}return{kind:`json`,text:int(e)}}function ont(e){let t=[(e.exitCode===null?e.status===`completed`:e.exitCode===0)?rG():oG()];return e.exitCode!==null&&t.push(lG({code:e.exitCode})),e.durationMs!==null&&t.push(fG({ms:e.durationMs})),t.join(` · `)}var snt=new Set([`complete`,`error`,`aborted`]),cnt=new Set([`completed`,`error`]);function lnt(e,t){if(e.length===0)return!1;if(t===`streaming`)return!0;if(t!==void 0&&snt.has(t))return!1;let n=e[e.length-1];return n.phase!==void 0&&cnt.has(n.phase)?!1:n.result===void 0||n.result===null}var unt=[`command`,`query`,`url`,`path`,`pattern`,`file`,`cmd`,`prompt`];function dnt(e,t){let n=``;if(e&&typeof e==`object`&&!Array.isArray(e)){let t=e;for(let e of unt){let r=t[e];if(typeof r==`string`&&r.trim()){n=r;break}}}return n||=t??(typeof e==`string`?e:``),n.replace(/\s+/g,` `).trim()}function fnt(e,t){let n=e.length,r=n===1?ZW({count:n}):eG({count:n});return{count:n,running:lnt(e,t),label:r}}function lY({text:e}){let[t,n]=(0,M.useState)(!1);return(0,F.jsx)(`button`,{type:`button`,className:`oc-copybtn`,title:`Copier`,"aria-label":`Copier le contenu`,onClick:()=>{navigator.clipboard?.writeText(e).then(()=>{n(!0),window.setTimeout(()=>n(!1),1200)})},children:t?(0,F.jsx)(hm,{size:13,"aria-hidden":!0}):(0,F.jsx)(Sm,{size:13,"aria-hidden":!0})})}function pnt(e,t){let n=typeof e==`string`?e:void 0;return n===`error`?`error`:t||n===`completed`?`completed`:`running`}function mnt(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function hnt({toolName:e,args:t,argsText:n,result:r,status:i}){let a=r!=null,o=pnt(i?.type,a),s=n??mnt(t),c=dnt(t,n),l=a?ant(r):null,u=o===`running`?Om:o===`error`?bm:bee;return(0,F.jsxs)(`details`,{className:`oc-tool oc-tool--${o}`,children:[(0,F.jsxs)(`summary`,{className:`oc-tool__header`,children:[(0,F.jsx)(u,{className:`oc-tool__status${o===`running`?` oc-tool__status--spin`:``}`,size:14,"aria-hidden":!0}),(0,F.jsx)(`span`,{className:`oc-tool__name`,children:e}),c?(0,F.jsx)(`span`,{className:`oc-tool__preview`,title:c,children:c}):null,(0,F.jsx)(`span`,{className:`oc-tool__phase`,children:o}),(0,F.jsx)(_m,{size:15,className:`oc-tool__chevron`,"aria-hidden":!0})]}),(0,F.jsxs)(`div`,{className:`oc-tool__body`,children:[s?(0,F.jsxs)(`details`,{className:`oc-tool__io`,children:[(0,F.jsx)(`summary`,{children:`input`}),(0,F.jsxs)(`div`,{className:`oc-tool__prewrap`,children:[(0,F.jsx)(`pre`,{className:`oc-tool__pre`,children:s}),(0,F.jsx)(lY,{text:s})]})]}):null,l&&l.kind===`outcome`?(0,F.jsxs)(`div`,{className:`oc-tool__outcome`,children:[(0,F.jsx)(`span`,{className:`oc-tool__outcome-label`,children:ont(l)}),(0,F.jsx)(`span`,{className:`oc-tool__outcome-note`,children:hG()})]}):l?(0,F.jsxs)(`details`,{className:`oc-tool__io`,open:!0,children:[(0,F.jsx)(`summary`,{children:`output`}),(0,F.jsxs)(`div`,{className:`oc-tool__prewrap`,children:[(0,F.jsx)(`pre`,{className:`oc-tool__pre`,children:l.text}),(0,F.jsx)(lY,{text:l.text})]})]}):null]})]})}function gnt(){let e=Ny(e=>e.metadata?.custom?.toolParts),t=Ny(e=>e.metadata?.custom?.status),[n,r]=(0,M.useState)(!1);if(!e||e.length===0)return null;let i=n,a=fnt(e,t);return(0,F.jsxs)(`div`,{className:`oc-toolact${i?` is-open`:``}`,children:[(0,F.jsxs)(`button`,{type:`button`,className:`oc-toolact__summary`,"aria-expanded":i,title:i?DG():wG(),onClick:()=>r(!i),children:[(0,F.jsx)(Wm,{size:13,className:`oc-toolact__icon`,"aria-hidden":!0}),(0,F.jsx)(`span`,{className:`oc-toolact__label`,children:a.label}),a.running?(0,F.jsxs)(`span`,{className:`oc-toolact__state`,children:[(0,F.jsx)(Om,{size:12,className:`oc-toolact__spin`,"aria-hidden":!0}),vG()]}):(0,F.jsxs)(`span`,{className:`oc-toolact__state oc-toolact__state--done`,children:[(0,F.jsx)(hm,{size:12,"aria-hidden":!0}),(0,F.jsx)(`span`,{className:`oc-sr-only`,children:xG()})]}),(0,F.jsx)(_m,{size:14,className:`oc-toolact__chevron`,"aria-hidden":!0})]}),i?(0,F.jsx)(`div`,{className:`oc-toolact__detail`,children:e.map(e=>(0,F.jsx)(hnt,{toolName:e.toolName,args:e.args,argsText:e.argsText,result:e.result,status:e.phase?{type:e.phase}:void 0},e.toolCallId))}):null]})}function uY({className:e,...t}){return(0,F.jsx)(vS,{"data-slot":`checkbox`,className:TJ(`peer size-4 shrink-0 rounded-[4px] border border-input bg-background ring-offset-background transition-shadow outline-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=indeterminate]:border-primary data-[state=indeterminate]:bg-primary data-[state=indeterminate]:text-primary-foreground`,e),...t,children:(0,F.jsx)(bS,{"data-slot":`checkbox-indicator`,className:`flex items-center justify-center text-current`,children:t.checked===`indeterminate`?(0,F.jsx)(jee,{className:`size-3.5`}):(0,F.jsx)(hm,{className:`size-3.5`})})})}function dY(e,t){return t===`memory`?`memory`:e.context===!0||!e.file_name?`context`:`document`}function fY(e){let t={memory:0,documents:0,context:0};for(let n of e)for(let e of n.items){let r=dY(e,n.group);r===`memory`?t.memory+=1:r===`document`?t.documents+=1:t.context+=1}return t}function _nt(e){return e.memory+e.documents+e.context>0}function pY(e){let t=[];return e.memory>0&&t.push(e.memory===1?JV():ZV({count:e.memory})),e.documents>0&&t.push(e.documents===1?eH():rH({count:e.documents})),e.context>0&&t.push(e.context===1?hH():vH({count:e.context})),t.join(` · `)}function mY(e){return e.title??e.file_name??e.id??e.type??DH()}function hY(e){return e.title&&e.file_name?e.file_name:void 0}function vnt(e){return e.file_name??mY(e)}function gY(e){let t=[];return e.type&&mY(e)!==e.type&&t.push(e.type),e.date&&t.push(e.date),e.collection&&t.push(e.collection),typeof e.score==`number`&&t.push(wH({score:e.score.toFixed(2)})),t}function _Y(e,t){let n=[];return e.forEach((e,r)=>{e.group===t&&e.items.forEach((t,i)=>{n.push({key:`${e.pluginId}|${e.group}|${t.id??t.file_name??`?`}|${r}.${i}`,group:e.group,pluginId:e.pluginId,source:e.source,item:t})})}),n.sort((e,t)=>(t.item.score??0)-(e.item.score??0))}function vY(e,t){let n=t.trim().toLowerCase();return n===``?!0:[xY(e),e.item.file_name??``,e.item.text??``,...gY(e.item)].join(` `).toLowerCase().includes(n)}function yY(e){return dY(e.item,e.group)===`document`}function bY(e){return dY(e.item,e.group)===`context`}function xY(e){return bY(e)?xH():mY(e.item)}var SY=(0,M.createContext)(null),ynt=[];function bnt(){let e=Ny(e=>e.metadata?.custom?.provenanceParts??ynt),t=Ny(e=>e.metadata?.custom?.messageId),n=Ny(e=>e.metadata?.custom?.attachedDocCount??0),r=(0,M.useContext)(SY),i=fY(e);if(e.length===0||!_nt(i))return null;let a=r?.activeMessageId===t&&t!==void 0;return(0,F.jsxs)(`button`,{type:`button`,className:`oc-sources-trigger${a?` is-active`:``}`,onClick:()=>t&&r?.openFor(t),"aria-haspopup":`dialog`,"aria-expanded":a,"aria-label":NH(),children:[(0,F.jsx)(Tm,{size:13,className:`oc-sources-trigger__icon`,"aria-hidden":!0}),(0,F.jsx)(`span`,{className:`oc-sources-trigger__label`,children:GV()}),(0,F.jsx)(`span`,{className:`oc-sources-trigger__counts`,children:pY(i)}),n>0?(0,F.jsxs)(`span`,{className:`oc-sources-trigger__attached`,title:eU({count:n}),children:[(0,F.jsx)(Cm,{size:12,"aria-hidden":!0}),n]}):null,(0,F.jsx)(_m,{size:14,className:`oc-sources-trigger__chev`,"aria-hidden":!0})]})}function CY({messageId:e,onClose:t}){let n=N(L.messages.getProvenanceParts,{messageId:e}),r=(0,M.useMemo)(()=>n??[],[n]),i=N(L.agents.documentaryAvailable,{}),a=N(L.documentAttachments.getDocumentAttachments,{sourceMessageId:e}),o=P(L.documentAttachments.attachDocuments),s=sY(),c=(0,M.useMemo)(()=>{let e=new Map;for(let t of a??[])e.set(t.entryKey,t);return e},[a]),l=(a??[]).some(e=>e.status===`pending`),[u,d]=(0,M.useState)(``),[f,p]=(0,M.useState)(!1),[m,h]=(0,M.useState)(!1),[g,_]=(0,M.useState)(!1),[v,y]=(0,M.useState)(new Set);(0,M.useEffect)(()=>{d(``),p(!1),h(!1),_(!1),y(new Set)},[e]);let b=(0,M.useMemo)(()=>_Y(r,`documents`).filter(e=>yY(e)&&vY(e,u)),[r,u]),x=(0,M.useMemo)(()=>_Y(r,`documents`).filter(e=>bY(e)&&vY(e,u)),[r,u]),S=(0,M.useMemo)(()=>_Y(r,`memory`).filter(e=>vY(e,u)),[r,u]),C=fY(r),w=e=>y(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),T=(e,t)=>y(n=>{let r=new Set(n);for(let n of e)t?r.add(n):r.delete(n);return r}),E=(0,M.useMemo)(()=>_Y(r,`documents`).filter(e=>yY(e)&&v.has(e.key)),[r,v]),D=i!=null&&E.length>0&&!l;async function O(){if(D)try{await o({sourceMessageId:e,items:E.map(e=>({entryKey:e.key,reference:vnt(e.item)}))}),s.success(fU())}catch(e){let t=oY(e);t.includes(`fetch_in_flight`)?s.error(lU()):t.includes(`no_documentary_agent`)?s.error(oU()):s.error(hU(),e)}}let ee=n===void 0;return(0,F.jsxs)(`div`,{className:`oc-sources-panel`,children:[(0,F.jsxs)(`div`,{className:`oc-sources-panel__head`,children:[(0,F.jsxs)(`div`,{className:`oc-sources-panel__heading`,children:[(0,F.jsx)(`h2`,{className:`oc-sources-panel__title`,children:AH()}),(0,F.jsx)(`p`,{className:`oc-sources-panel__sub`,children:pY(C)})]}),(0,F.jsx)(`button`,{type:`button`,className:`oc-iconbtn`,onClick:t,"aria-label":NU(),title:NU(),children:(0,F.jsx)(Gm,{size:16,"aria-hidden":!0})})]}),(0,F.jsxs)(`div`,{className:`oc-sources-panel__search`,children:[(0,F.jsx)(Fm,{size:15,"aria-hidden":!0}),(0,F.jsx)(BJ,{value:u,onChange:e=>d(e.target.value),placeholder:IH(),"aria-label":IH()})]}),(0,F.jsx)(`div`,{className:`oc-sources-panel__body`,children:ee?(0,F.jsx)(`p`,{className:`oc-sources-panel__empty`,children:(0,F.jsx)(Om,{size:14,className:`oc-iconbtn__spin`,"aria-hidden":!0})}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(wY,{icon:(0,F.jsx)(Tm,{size:14,"aria-hidden":!0}),label:lH(),count:b.length,expanded:f,onToggle:()=>p(e=>!e),entries:b,selectable:!0,selected:v,onToggle1:w,onToggleAll:e=>T(b.map(e=>e.key),e),attachmentByKey:c}),(0,F.jsx)(wY,{icon:(0,F.jsx)(Pee,{size:14,"aria-hidden":!0}),label:fH(),count:x.length,expanded:m,onToggle:()=>h(e=>!e),entries:x,selectable:!1,selected:v,onToggle1:w,onToggleAll:e=>T(x.map(e=>e.key),e),attachmentByKey:c}),(0,F.jsx)(wY,{icon:(0,F.jsx)(vee,{size:14,"aria-hidden":!0}),label:oH(),count:S.length,expanded:g,onToggle:()=>_(e=>!e),entries:S,selectable:!1,selected:v,onToggle1:w,onToggleAll:e=>T(S.map(e=>e.key),e),attachmentByKey:c}),b.length===0&&x.length===0&&S.length===0?(0,F.jsx)(`p`,{className:`oc-sources-panel__empty`,children:zH()}):null]})}),E.length>0?(0,F.jsxs)(`div`,{className:`oc-sources-panel__actions`,children:[(0,F.jsxs)(`div`,{className:`oc-sources-panel__actrow`,children:[(0,F.jsx)(`span`,{className:`oc-sources-panel__selcount`,children:GH({count:E.length})}),(0,F.jsxs)(H,{variant:`outline`,size:`sm`,disabled:!D,onClick:()=>void O(),children:[l?(0,F.jsx)(Om,{size:14,className:`oc-iconbtn__spin`,"aria-hidden":!0}):(0,F.jsx)(Hee,{size:14,"aria-hidden":!0}),JH()]})]}),(0,F.jsx)(`p`,{className:`oc-sources-panel__acthint`,children:i==null?oU():l?lU():ZH()})]}):null]})}function wY({icon:e,label:t,count:n,expanded:r,onToggle:i,entries:a,selectable:o,selected:s,onToggle1:c,onToggleAll:l,attachmentByKey:u}){if(n===0)return null;let d=a.every(e=>s.has(e.key));return(0,F.jsxs)(`section`,{className:`oc-srcsec${r?` is-open`:``}`,children:[(0,F.jsxs)(`button`,{type:`button`,className:`oc-srcsec__head`,"aria-expanded":r,onClick:i,children:[r?(0,F.jsx)(gm,{size:14,"aria-hidden":!0}):(0,F.jsx)(_m,{size:14,"aria-hidden":!0}),e,(0,F.jsx)(`span`,{className:`oc-srcsec__label`,children:t}),(0,F.jsx)(`span`,{className:`oc-srcsec__count`,children:n})]}),r?(0,F.jsxs)(`div`,{className:`oc-srcsec__body`,children:[o?(0,F.jsxs)(`label`,{className:`oc-srcsec__all`,children:[(0,F.jsx)(uY,{checked:d,onCheckedChange:e=>l(e===!0)}),(0,F.jsx)(`span`,{children:HH()})]}):null,a.map(e=>(0,F.jsx)(xnt,{entry:e,selectable:o,selected:s.has(e.key),onToggle:()=>c(e.key),attachment:u.get(e.key)},e.key))]}):null]})}function xnt({entry:e,selectable:t,selected:n,onToggle:r,attachment:i}){let[a,o]=(0,M.useState)(!1),s=(0,M.useRef)(null),[c,l]=(0,M.useState)(!1),{item:u}=e;(0,M.useEffect)(()=>{let e=s.current;if(!e)return;let t=()=>l(e.scrollHeight>e.clientHeight+1);t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[u.text]);let d=gY(u),f=typeof u.score==`number`?Math.max(0,Math.min(1,u.score)):null,p=yY(e);return(0,F.jsxs)(`div`,{className:`oc-srccard${t&&n?` is-selected`:``}`,children:[t?(0,F.jsx)(`label`,{className:`oc-srccard__pick`,children:(0,F.jsx)(uY,{checked:n,onCheckedChange:r})}):null,(0,F.jsxs)(`div`,{className:`oc-srccard__body`,children:[(0,F.jsx)(`div`,{className:`oc-srccard__title`,children:xY(e)}),p&&hY(e.item)?(0,F.jsx)(`div`,{className:`oc-srccard__subid`,title:hY(e.item),children:hY(e.item)}):null,d.length>0||f!==null?(0,F.jsxs)(`div`,{className:`oc-srccard__meta`,children:[d.map(e=>(0,F.jsx)(`span`,{className:`oc-srccard__chip`,children:e},e)),f===null?null:(0,F.jsx)(`span`,{className:`oc-srccard__relev`,title:wH({score:f.toFixed(2)}),children:(0,F.jsx)(`span`,{className:`oc-srccard__relev-track`,"aria-hidden":!0,children:(0,F.jsx)(`span`,{className:`oc-srccard__relev-fill`,style:{width:`${Math.round(f*100)}%`}})})})]}):null,u.text?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`blockquote`,{ref:s,className:`oc-srccard__excerpt${a?` is-full`:``}`,children:u.text}),c||a?(0,F.jsx)(`button`,{type:`button`,className:`oc-srccard__more`,onClick:()=>o(e=>!e),children:a?AU():DU()}):null]}):null,p?(0,F.jsx)(Snt,{attachment:i}):null]})]})}function Snt({attachment:e}){if(e?.status===`ready`&&e.url){let t=e.filename??xU();return(0,F.jsxs)(`a`,{className:`oc-srccard__origin oc-srccard__origin--ready`,href:e.url,download:e.filename??void 0,target:`_blank`,rel:`noreferrer`,title:xU(),children:[(0,F.jsx)(Cm,{size:13,"aria-hidden":!0}),(0,F.jsx)(`span`,{className:`oc-srccard__origin-name`,children:t})]})}return e?.status===`pending`?(0,F.jsxs)(`div`,{className:`oc-srccard__origin oc-srccard__origin--pending`,children:[(0,F.jsx)(Om,{size:13,"aria-hidden":!0}),vU()]}):e?.status===`not_found`||e?.status===`failed`?(0,F.jsxs)(`div`,{className:`oc-srccard__origin oc-srccard__origin--missing`,"aria-disabled":!0,children:[(0,F.jsx)(Gm,{size:13,"aria-hidden":!0}),wU()]}):(0,F.jsxs)(`div`,{className:`oc-srccard__origin`,"aria-disabled":!0,children:[(0,F.jsx)(Cm,{size:13,"aria-hidden":!0}),rU()]})}var Cnt=`oc.sidebar.width`,TY=`oc.sidebar.collapsed`,EY=200,DY=520,wnt=260,OY=`(max-width: 767px)`;function kY(){let[e,t]=(0,M.useState)(()=>typeof window<`u`&&window.matchMedia(OY).matches);return(0,M.useEffect)(()=>{let e=window.matchMedia(OY),n=e=>t(e.matches);return e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),e}function AY(e){let{storageKey:t,defaultWidth:n,min:r,max:i,edge:a}=e,o=(0,M.useCallback)(e=>Math.min(i,Math.max(r,e)),[r,i]),[s,c]=(0,M.useState)(()=>{let e=Number(localStorage.getItem(t));return e?Math.min(i,Math.max(r,e)):n});(0,M.useEffect)(()=>{localStorage.setItem(t,String(s))},[t,s]);let l=(0,M.useRef)(!1);return{width:s,startResize:(0,M.useCallback)(e=>{e.preventDefault(),l.current=!0;let t=e.clientX,n=s,r=a===`left`?1:-1,i=e=>{l.current&&c(o(n+r*(e.clientX-t)))},u=()=>{l.current=!1,window.removeEventListener(`pointermove`,i),window.removeEventListener(`pointerup`,u),document.body.style.cursor=``,document.body.style.userSelect=``};window.addEventListener(`pointermove`,i),window.addEventListener(`pointerup`,u),document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`},[s,a,o]),setWidth:c}}function Tnt(){let{width:e,startResize:t}=AY({storageKey:Cnt,defaultWidth:wnt,min:EY,max:DY,edge:`left`}),[n,r]=(0,M.useState)(()=>localStorage.getItem(TY)===`1`),i=kY();return(0,M.useEffect)(()=>{localStorage.setItem(TY,n?`1`:`0`)},[n]),(0,M.useEffect)(()=>{i&&r(!0)},[i]),{width:e,collapsed:n,toggleCollapsed:(0,M.useCallback)(()=>r(e=>!e),[]),collapse:(0,M.useCallback)(()=>r(!0),[]),startResize:t,isMobile:i,MIN_WIDTH:EY,MAX_WIDTH:DY}}function jY({...e}){return(0,F.jsx)(Gx,{"data-slot":`sheet`,...e})}function Ent({...e}){return(0,F.jsx)(Kx,{"data-slot":`sheet-portal`,...e})}function Dnt({className:e,...t}){return(0,F.jsx)(qx,{"data-slot":`sheet-overlay`,className:TJ(`fixed inset-0 z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function MY({className:e,children:t,side:n=`right`,showCloseButton:r=!0,...i}){return(0,F.jsxs)(Ent,{children:[(0,F.jsx)(Dnt,{}),(0,F.jsxs)(Jx,{"data-slot":`sheet-content`,"data-side":n,className:TJ(`fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-[side=bottom]:data-open:slide-in-from-bottom-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=top]:data-open:slide-in-from-top-10 data-closed:animate-out data-closed:fade-out-0 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=right]:data-closed:slide-out-to-right-10 data-[side=top]:data-closed:slide-out-to-top-10`,e),...i,children:[t,r&&(0,F.jsx)(Zx,{"data-slot":`sheet-close`,asChild:!0,children:(0,F.jsxs)(H,{variant:`ghost`,className:`absolute top-3 right-3`,size:`icon-sm`,children:[(0,F.jsx)(Gm,{}),(0,F.jsx)(`span`,{className:`sr-only`,children:Tq()})]})})]})]})}function NY({className:e,...t}){return(0,F.jsx)(`div`,{"data-slot":`sheet-header`,className:TJ(`flex flex-col gap-0.5 p-4`,e),...t})}function PY({className:e,...t}){return(0,F.jsx)(`div`,{"data-slot":`sheet-footer`,className:TJ(`mt-auto flex flex-col gap-2 p-4`,e),...t})}function FY({className:e,...t}){return(0,F.jsx)(Yx,{"data-slot":`sheet-title`,className:TJ(`font-heading text-base font-medium text-foreground`,e),...t})}function IY({className:e,...t}){return(0,F.jsx)(Xx,{"data-slot":`sheet-description`,className:TJ(`text-sm text-muted-foreground`,e),...t})}function Ont({mimeType:e,data:t,filename:n}){let r=e??``,i=t??``,a=n??`attachment`;return i?r.startsWith(`audio/`)?(0,F.jsxs)(`div`,{className:`oc-media oc-media--audio`,children:[(0,F.jsx)(`audio`,{controls:!0,preload:`metadata`,src:i,className:`oc-media__audio`,children:(0,F.jsx)(`a`,{href:i,download:a,children:`Download audio`})}),(0,F.jsx)(`span`,{className:`oc-media__name`,children:a})]}):r.startsWith(`image/`)?(0,F.jsxs)(`figure`,{className:`oc-media oc-media--image`,children:[(0,F.jsx)(`img`,{src:i,alt:a,className:`oc-media__img`,loading:`lazy`}),(0,F.jsx)(`figcaption`,{className:`oc-media__name`,children:a})]}):r.startsWith(`video/`)?(0,F.jsxs)(`div`,{className:`oc-media oc-media--video`,children:[(0,F.jsx)(`video`,{controls:!0,preload:`metadata`,src:i,className:`oc-media__video`}),(0,F.jsx)(`span`,{className:`oc-media__name`,children:a})]}):(0,F.jsxs)(`a`,{className:`oc-media oc-media--file`,href:i,target:`_blank`,rel:`noopener noreferrer`,children:[(0,F.jsx)(`span`,{className:`oc-media__icon`,"aria-hidden":!0,children:`⬇`}),(0,F.jsx)(`span`,{className:`oc-media__name`,children:a})]}):null}var knt=[`github-light`,`github-dark`],Ant=[`code`,`math`,`cjk`];function jnt(e,t){let n={};for(let r of Ant){let i=e?.[r];if(i===!1)continue;let a=i||t[r];a&&(n[r]=a)}let r=e?.mermaid;return r&&r!==!1&&(n.mermaid=r),n}function LY(e){return typeof e==`object`&&!!e&&`type`in e&&`key`in e}function Mnt(e,t){return e===t?!0:!LY(e)||!LY(t)?!1:e.type===t.type&&e.key===t.key}function Nnt(e,t){let n=Object.keys(e).filter(e=>e!==`children`),r=Object.keys(t).filter(e=>e!==`children`);if(n.length!==r.length)return!1;for(let r of n)if(e[r]!==t[r])return!1;return Mnt(e.children,t.children)}var Pnt=(0,M.createContext)(null),Fnt=(0,M.memo)(function({children:e,node:t,...n}){let r=(0,M.isValidElement)(e)?(0,M.cloneElement)(e,{"data-block":`true`}):e;return(0,F.jsx)(Pnt.Provider,{value:{node:t,...n},children:r})},Nnt),Int=Object.defineProperty,Lnt=Object.defineProperties,Rnt=Object.getOwnPropertyDescriptors,RY=Object.getOwnPropertySymbols,znt=Object.prototype.hasOwnProperty,Bnt=Object.prototype.propertyIsEnumerable,zY=(e,t,n)=>t in e?Int(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,BY=(e,t)=>{for(var n in t||={})znt.call(t,n)&&zY(e,n,t[n]);if(RY)for(var n of RY(t))Bnt.call(t,n)&&zY(e,n,t[n]);return e},VY=(e,t)=>Lnt(e,Rnt(t)),HY=(e,t)=>{let n=!1,r=!1;for(let i=0;i<t;i+=1){if(e[i]===`\\`&&i+1<e.length&&e[i+1]==="`"){i+=1;continue}if(e.substring(i,i+3)==="```"){r=!r,i+=2;continue}!r&&e[i]==="`"&&(n=!n)}return n||r},Vnt=(e,t)=>{let n=e.substring(t,t+3)==="```",r=t>0&&e.substring(t-1,t+2)==="```",i=t>1&&e.substring(t-2,t+1)==="```";return n||r||i},Hnt=e=>{let t=0;for(let n=0;n<e.length;n+=1){if(e[n]===`\\`&&n+1<e.length&&e[n+1]==="`"){n+=1;continue}e[n]==="`"&&!Vnt(e,n)&&(t+=1)}return t},UY=(e,t)=>{let n=!1,r=!1,i=-1;for(let a=0;a<e.length;a+=1){if(e[a]===`\\`&&a+1<e.length&&e[a+1]==="`"){a+=1;continue}if(e.substring(a,a+3)==="```"){r=!r,a+=2;continue}if(!r&&e[a]==="`")if(n){if(i<t&&t<a)return!0;n=!1,i=-1}else n=!0,i=a}return!1},Unt=/^(\s*(?:[-*+]|\d+[.)]) +)>(=?\s*[$]?\d)/gm,Wnt=e=>!e||typeof e!=`string`||!e.includes(`>`)?e:e.replace(Unt,(t,n,r,i)=>HY(e,i)?t:`${n}\\>${r}`),Gnt=/(\*\*)([^*]*\*?)$/,Knt=/(__)([^_]*?)$/,qnt=/(\*\*\*)([^*]*?)$/,Jnt=/(\*)([^*]*?)$/,Ynt=/(_)([^_]*?)$/,Xnt=/(`)([^`]*?)$/,Znt=/(~~)([^~]*?)$/,WY=/^[\s_~*`]*$/,GY=/^[\s]*[-*+][\s]+$/,Qnt=/[\p{L}\p{N}_]/u,$nt=/^```[^`\n]*```?$/,ert=/^\*{4,}$/,trt=/(__)([^_]+)_$/,nrt=/(~~)([^~]+)~$/,KY=/~~/g,qY=e=>{if(!e)return!1;let t=e.charCodeAt(0);return t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122||t===95?!0:Qnt.test(e)},rrt=(e,t)=>{let n=1;for(let r=t-1;r>=0;--r)if(e[r]===`]`)n+=1;else if(e[r]===`[`&&(--n,n===0))return r;return-1},JY=(e,t)=>{let n=1;for(let r=t+1;r<e.length;r+=1)if(e[r]===`[`)n+=1;else if(e[r]===`]`&&(--n,n===0))return r;return-1},YY=(e,t)=>{let n=!1,r=!1;for(let i=0;i<e.length&&i<t;i+=1){if(e[i]===`\\`&&e[i+1]===`$`){i+=1;continue}e[i]===`$`&&(e[i+1]===`$`?(r=!r,i+=1,n=!1):r||(n=!n))}return n||r},irt=(e,t)=>{for(let n=t;n<e.length;n+=1){if(e[n]===`)`)return!0;if(e[n]===`
|
|
133
|
+
`)return!1}return!1},XY=(e,t)=>{for(let n=t-1;n>=0;--n){if(e[n]===`)`)return!1;if(e[n]===`(`)return n>0&&e[n-1]===`]`?irt(e,t):!1;if(e[n]===`
|
|
134
|
+
`)return!1}return!1},art=(e,t)=>{for(let n=t-1;n>=0;--n){if(e[n]===`>`)return!1;if(e[n]===`<`){let t=n+1<e.length?e[n+1]:``;return t>=`a`&&t<=`z`||t>=`A`&&t<=`Z`||t===`/`}if(e[n]===`
|
|
135
|
+
`)return!1}return!1},ZY=(e,t,n)=>{let r=0;for(let n=t-1;n>=0;--n)if(e[n]===`
|
|
136
|
+
`){r=n+1;break}let i=e.length;for(let n=t;n<e.length;n+=1)if(e[n]===`
|
|
137
|
+
`){i=n;break}let a=e.substring(r,i),o=0,s=!1;for(let e of a)if(e===n)o+=1;else if(e!==` `&&e!==` `){s=!0;break}return o>=3&&!s},ort=(e,t,n,r)=>n===`\\`||e.includes(`$`)&&YY(e,t)?!0:n!==`*`&&r===`*`?(t<e.length-2?e[t+2]:``)!==`*`:!!(n===`*`||n&&r&&qY(n)&&qY(r)||(!n||n===` `||n===` `||n===`
|
|
138
|
+
`)&&(!r||r===` `||r===` `||r===`
|
|
139
|
+
`)),QY=e=>{let t=0,n=!1,r=e.length;for(let i=0;i<r;i+=1){if(e[i]==="`"&&i+2<r&&e[i+1]==="`"&&e[i+2]==="`"){n=!n,i+=2;continue}if(n||e[i]!==`*`)continue;let a=i>0?e[i-1]:``,o=i<r-1?e[i+1]:``;ort(e,i,a,o)||(t+=1)}return t},srt=(e,t,n,r)=>!!(n===`\\`||e.includes(`$`)&&YY(e,t)||XY(e,t)||art(e,t)||n===`_`||r===`_`||n&&r&&qY(n)&&qY(r)),crt=e=>{let t=0,n=!1,r=e.length;for(let i=0;i<r;i+=1){if(e[i]==="`"&&i+2<r&&e[i+1]==="`"&&e[i+2]==="`"){n=!n,i+=2;continue}if(n||e[i]!==`_`)continue;let a=i>0?e[i-1]:``,o=i<r-1?e[i+1]:``;srt(e,i,a,o)||(t+=1)}return t},lrt=e=>{let t=0,n=0,r=!1;for(let i=0;i<e.length;i+=1){if(e[i]==="`"&&i+2<e.length&&e[i+1]==="`"&&e[i+2]==="`"){n>=3&&(t+=Math.floor(n/3)),n=0,r=!r,i+=2;continue}r||(e[i]===`*`?n+=1:(n>=3&&(t+=Math.floor(n/3)),n=0))}return n>=3&&(t+=Math.floor(n/3)),t},$Y=e=>{let t=0,n=!1;for(let r=0;r<e.length;r+=1){if(e[r]==="`"&&r+2<e.length&&e[r+1]==="`"&&e[r+2]==="`"){n=!n,r+=2;continue}n||e[r]===`*`&&r+1<e.length&&e[r+1]===`*`&&(t+=1,r+=1)}return t},eX=e=>{let t=0,n=!1;for(let r=0;r<e.length;r+=1){if(e[r]==="`"&&r+2<e.length&&e[r+1]==="`"&&e[r+2]==="`"){n=!n,r+=2;continue}n||e[r]===`_`&&r+1<e.length&&e[r+1]===`_`&&(t+=1,r+=1)}return t},urt=(e,t,n)=>{if(!t||WY.test(t))return!0;let r=e.substring(0,n).lastIndexOf(`
|
|
140
|
+
`),i=r===-1?0:r+1,a=e.substring(i,n);return GY.test(a)&&t.includes(`
|
|
141
|
+
`)?!0:ZY(e,n,`*`)},drt=e=>{let t=e.match(Gnt);if(!t)return e;let n=t[2],r=e.lastIndexOf(t[1]);return HY(e,r)||UY(e,r)||urt(e,n,r)?e:$Y(e)%2==1?n.endsWith(`*`)?`${e}*`:`${e}**`:e},frt=(e,t,n)=>{if(!t||WY.test(t))return!0;let r=e.substring(0,n).lastIndexOf(`
|
|
142
|
+
`),i=r===-1?0:r+1,a=e.substring(i,n);return GY.test(a)&&t.includes(`
|
|
143
|
+
`)?!0:ZY(e,n,`_`)},prt=e=>{let t=e.match(Knt);if(!t){let t=e.match(trt);if(t){let n=e.lastIndexOf(t[1]);if(!(HY(e,n)||UY(e,n))&&eX(e)%2==1)return`${e}_`}return e}let n=t[2],r=e.lastIndexOf(t[1]);return HY(e,r)||UY(e,r)||frt(e,n,r)?e:eX(e)%2==1?`${e}__`:e},mrt=e=>{let t=!1;for(let n=0;n<e.length;n+=1){if(e[n]==="`"&&n+2<e.length&&e[n+1]==="`"&&e[n+2]==="`"){t=!t,n+=2;continue}if(!t&&e[n]===`*`&&e[n-1]!==`*`&&e[n+1]!==`*`&&e[n-1]!==`\\`&&!YY(e,n)){let t=n>0?e[n-1]:``,r=n<e.length-1?e[n+1]:``;if((!t||t===` `||t===` `||t===`
|
|
144
|
+
`)&&(!r||r===` `||r===` `||r===`
|
|
145
|
+
`)||t&&r&&qY(t)&&qY(r))continue;return n}}return-1},hrt=e=>{if(!e.match(Jnt))return e;let t=mrt(e);if(t===-1||HY(e,t)||UY(e,t))return e;let n=e.substring(t+1);return!n||WY.test(n)?e:QY(e)%2==1?`${e}*`:e},tX=e=>{let t=!1;for(let n=0;n<e.length;n+=1){if(e[n]==="`"&&n+2<e.length&&e[n+1]==="`"&&e[n+2]==="`"){t=!t,n+=2;continue}if(!t&&e[n]===`_`&&e[n-1]!==`_`&&e[n+1]!==`_`&&e[n-1]!==`\\`&&!YY(e,n)&&!XY(e,n)){let t=n>0?e[n-1]:``,r=n<e.length-1?e[n+1]:``;if(t&&r&&qY(t)&&qY(r))continue;return n}}return-1},grt=e=>{let t=e.length;for(;t>0&&e[t-1]===`
|
|
146
|
+
`;)--t;return t<e.length?`${e.slice(0,t)}_${e.slice(t)}`:`${e}_`},_rt=e=>{if(!e.endsWith(`**`))return null;let t=e.slice(0,-2);if($Y(t)%2!=1)return null;let n=t.indexOf(`**`),r=tX(t);return n!==-1&&r!==-1&&n<r?`${t}_**`:null},vrt=e=>{if(!e.match(Ynt))return e;let t=tX(e);if(t===-1)return e;let n=e.substring(t+1);if(!n||WY.test(n)||HY(e,t)||UY(e,t))return e;if(crt(e)%2==1){let t=_rt(e);return t===null?grt(e):t}return e},yrt=e=>{let t=$Y(e),n=QY(e);return t%2==0&&n%2==0},brt=(e,t,n)=>!t||WY.test(t)||HY(e,n)||UY(e,n)?!0:ZY(e,n,`*`),xrt=e=>{if(ert.test(e))return e;let t=e.match(qnt);if(!t)return e;let n=t[2];return brt(e,n,e.lastIndexOf(t[1]))?e:lrt(e)%2==1?yrt(e)?e:`${e}***`:e},Srt=/<[a-zA-Z/][^>]*$/,Crt=e=>{let t=e.match(Srt);return!t||t.index===void 0||HY(e,t.index)?e:e.substring(0,t.index).trimEnd()},wrt=e=>!e.match($nt)||e.includes(`
|
|
147
|
+
`)?null:e.endsWith("``")&&!e.endsWith("```")?`${e}\``:e,Trt=e=>(e.match(/```/g)||[]).length%2==1,Ert=e=>{let t=wrt(e);if(t!==null)return t;let n=e.match(Xnt);if(n&&!Trt(e)){let t=n[2];if(!t||WY.test(t))return e;if(Hnt(e)%2==1)return`${e}\``}return e},nX=(e,t)=>t>=2&&e.substring(t-2,t+1)==="```"||t>=1&&e.substring(t-1,t+2)==="```"||t<=e.length-3&&e.substring(t,t+3)==="```",Drt=e=>{let t=0,n=!1;for(let r=0;r<e.length-1;r+=1)e[r]==="`"&&!nX(e,r)&&(n=!n),!n&&e[r]===`$`&&e[r+1]===`$`&&(t+=1,r+=1);return t},Ort=e=>{let t=0,n=!1;for(let r=0;r<e.length;r+=1){if(e[r]===`\\`){r+=1;continue}if(e[r]==="`"&&!nX(e,r)){n=!n;continue}!n&&e[r]===`$`&&(r+1<e.length&&e[r+1]===`$`?r+=1:t+=1)}return t},krt=e=>{if(e.endsWith(`$`)&&!e.endsWith(`$$`))return`${e}$`;let t=e.indexOf(`$$`);return t!==-1&&e.indexOf(`
|
|
148
|
+
`,t)!==-1&&!e.endsWith(`
|
|
149
|
+
`)?`${e}
|
|
150
|
+
$$`:`${e}$$`},Art=e=>Drt(e)%2==0?e:krt(e),jrt=e=>Ort(e)%2==1?`${e}$`:e,Mrt=(e,t,n)=>{if(e.substring(t+2).includes(`)`))return null;let r=rrt(e,t);if(r===-1||HY(e,r))return null;let i=r>0&&e[r-1]===`!`,a=i?r-1:r,o=e.substring(0,a);if(i)return o;let s=e.substring(r+1,t);return n===`text-only`?`${o}${s}`:`${o}[${s}](streamdown:incomplete-link)`},rX=(e,t)=>{for(let n=0;n<t;n++)if(e[n]===`[`&&!HY(e,n)){if(n>0&&e[n-1]===`!`)continue;let t=JY(e,n);if(t===-1)return n;if(t+1<e.length&&e[t+1]===`(`){let r=e.indexOf(`)`,t+2);r!==-1&&(n=r)}}return t},Nrt=(e,t,n)=>{let r=t>0&&e[t-1]===`!`,i=r?t-1:t;if(!e.substring(t+1).includes(`]`)){let a=e.substring(0,i);if(r)return a;if(n===`text-only`){let n=rX(e,t);return e.substring(0,n)+e.substring(n+1)}return`${e}](streamdown:incomplete-link)`}if(JY(e,t)===-1){let a=e.substring(0,i);if(r)return a;if(n===`text-only`){let n=rX(e,t);return e.substring(0,n)+e.substring(n+1)}return`${e}](streamdown:incomplete-link)`}return null},iX=(e,t=`protocol`)=>{let n=e.lastIndexOf(`](`);if(n!==-1&&!HY(e,n)){let r=Mrt(e,n,t);if(r!==null)return r}for(let n=e.length-1;n>=0;--n)if(e[n]===`[`&&!HY(e,n)){let r=Nrt(e,n,t);if(r!==null)return r}return e},Prt=/^-{1,2}$/,Frt=/^[\s]*-{1,2}[\s]+$/,Irt=/^={1,2}$/,Lrt=/^[\s]*={1,2}[\s]+$/,Rrt=e=>{if(!e||typeof e!=`string`)return e;let t=e.lastIndexOf(`
|
|
151
|
+
`);if(t===-1)return e;let n=e.substring(t+1),r=e.substring(0,t),i=n.trim();if(Prt.test(i)&&!n.match(Frt)){let t=r.split(`
|
|
152
|
+
`).at(-1);if(t&&t.trim().length>0)return`${e}\u200B`}if(Irt.test(i)&&!n.match(Lrt)){let t=r.split(`
|
|
153
|
+
`).at(-1);if(t&&t.trim().length>0)return`${e}\u200B`}return e},zrt=RegExp(`(?<=[\\p{L}\\p{N}_])~(?!~)(?=[\\p{L}\\p{N}_])`,`gu`),Brt=e=>!e||typeof e!=`string`||!e.includes(`~`)?e:e.replace(zrt,(t,n)=>HY(e,n)?t:`\\~`),Vrt=e=>{let t=e.match(Znt);if(t){let n=t[2];if(!n||WY.test(n))return e;let r=e.lastIndexOf(t[1]);if(HY(e,r)||UY(e,r))return e;if(e.match(KY)?.length%2==1)return`${e}~~`}else{let t=e.match(nrt);if(t){let n=e.lastIndexOf(t[0].slice(0,2));if(HY(e,n)||UY(e,n))return e;if(e.match(KY)?.length%2==1)return`${e}~`}}return e},aX=e=>e!==!1,Hrt=e=>e===!0,oX={SINGLE_TILDE:0,COMPARISON_OPERATORS:5,HTML_TAGS:10,SETEXT_HEADINGS:15,LINKS:20,BOLD_ITALIC:30,BOLD:35,ITALIC_DOUBLE_UNDERSCORE:40,ITALIC_SINGLE_ASTERISK:41,ITALIC_SINGLE_UNDERSCORE:42,INLINE_CODE:50,STRIKETHROUGH:60,KATEX:70,INLINE_KATEX:75,DEFAULT:100},Urt=[{handler:{name:`singleTilde`,handle:Brt,priority:oX.SINGLE_TILDE},optionKey:`singleTilde`},{handler:{name:`comparisonOperators`,handle:Wnt,priority:oX.COMPARISON_OPERATORS},optionKey:`comparisonOperators`},{handler:{name:`htmlTags`,handle:Crt,priority:oX.HTML_TAGS},optionKey:`htmlTags`},{handler:{name:`setextHeadings`,handle:Rrt,priority:oX.SETEXT_HEADINGS},optionKey:`setextHeadings`},{handler:{name:`links`,handle:iX,priority:oX.LINKS},optionKey:`links`,earlyReturn:e=>e.endsWith(`](streamdown:incomplete-link)`)},{handler:{name:`boldItalic`,handle:xrt,priority:oX.BOLD_ITALIC},optionKey:`boldItalic`},{handler:{name:`bold`,handle:drt,priority:oX.BOLD},optionKey:`bold`},{handler:{name:`italicDoubleUnderscore`,handle:prt,priority:oX.ITALIC_DOUBLE_UNDERSCORE},optionKey:`italic`},{handler:{name:`italicSingleAsterisk`,handle:hrt,priority:oX.ITALIC_SINGLE_ASTERISK},optionKey:`italic`},{handler:{name:`italicSingleUnderscore`,handle:vrt,priority:oX.ITALIC_SINGLE_UNDERSCORE},optionKey:`italic`},{handler:{name:`inlineCode`,handle:Ert,priority:oX.INLINE_CODE},optionKey:`inlineCode`},{handler:{name:`strikethrough`,handle:Vrt,priority:oX.STRIKETHROUGH},optionKey:`strikethrough`},{handler:{name:`katex`,handle:Art,priority:oX.KATEX},optionKey:`katex`},{handler:{name:`inlineKatex`,handle:jrt,priority:oX.INLINE_KATEX},optionKey:`inlineKatex`}],Wrt=e=>{let t=e?.linkMode??`protocol`;return Urt.filter(({handler:t,optionKey:n})=>t.name===`links`?aX(e?.links)||aX(e?.images):t.name===`inlineKatex`?Hrt(e?.inlineKatex):aX(e?.[n])).map(({handler:e,earlyReturn:n})=>e.name===`links`?{handler:VY(BY({},e),{handle:e=>iX(e,t)}),earlyReturn:t===`protocol`?n:void 0}:{handler:e,earlyReturn:n})},sX=(e,t)=>{if(!e||typeof e!=`string`)return e;let n=e.endsWith(` `)&&!e.endsWith(` `)?e.slice(0,-1):e,r=Wrt(t),i=(t?.handlers??[]).map(e=>({handler:VY(BY({},e),{priority:e.priority??oX.DEFAULT}),earlyReturn:void 0})),a=[...r,...i].sort((e,t)=>(e.handler.priority??0)-(t.handler.priority??0));for(let{handler:e,earlyReturn:t}of a)if(n=e.handle(n),t!=null&&t(n))return n;return n},Grt=96,Krt=126,qrt=32,Jrt=9,Yrt=13,Xrt=92,cX=e=>e===qrt||e===Jrt||e===Yrt;function Zrt(e,t,n){for(let r=t;r<n;r+=1)if(!cX(e.charCodeAt(r)))return!1;return!0}function Qrt(e){let t=e.length,n=!1,r=0,i=0,a=!1,o=0,s=-1;for(let c=0;c<=t;){let l=e.indexOf(`
|
|
154
|
+
`,c);l===-1&&(l=t);let u=c;for(;u<l&&cX(e.charCodeAt(u));)u+=1;let d=u<l?e.charCodeAt(u):-1,f=!1;if((d===Grt||d===Krt)&&u-c<=3){let t=u;for(;t<l&&e.charCodeAt(t)===d;)t+=1;t-u>=3&&(f=!0,n?d===r&&t-u>=i&&Zrt(e,t,l)&&(n=!1):(n=!0,r=d,i=t-u))}if(!n&&!f)for(let t=e.indexOf(`$$`,c);t!==-1&&t<l-1;t=e.indexOf(`$$`,t+2))(t===0||e.charCodeAt(t-1)!==Xrt)&&(a=!a);d===-1&&!n&&!a?s=l+1:s!==-1&&(o=s,s=-1),c=l+1}return o}function $rt(e,t){let n=Qrt(e);return n<=0?sX(e,t):e.slice(0,n)+sX(e.slice(n),t)}var eit=/language-([^\s]+)/;function tit(e){if(typeof e==`string`)return e;if(!(0,M.isValidElement)(e))return``;let t=e.props;return t&&typeof t.children==`string`?t.children:``}function lX({node:e,...t}){return(0,F.jsx)(`pre`,{...t})}function nit({node:e,...t}){return(0,F.jsx)(`code`,{...t})}function rit(e){let{SyntaxHighlighter:t,CodeHeader:n,componentsByLanguage:r={}}=e;function i({node:e,className:i,children:a,"data-block":o,...s}){if(!o)return(0,F.jsx)(`code`,{className:`aui-streamdown-inline-code ${i??``}`.trim(),...s,children:a});let c=i?.match(eit)?.[1]??``,l=tit(a),u=r[c]?.SyntaxHighlighter??t,d=r[c]?.CodeHeader??n,f=d?(0,F.jsx)(d,{node:e,language:c,code:l}):null;return u?(0,F.jsxs)(F.Fragment,{children:[f,(0,F.jsx)(u,{node:e,components:{Pre:lX,Code:nit},language:c,code:l})]}):(0,F.jsxs)(F.Fragment,{children:[f,(0,F.jsx)(lX,{node:e,children:(0,F.jsx)(`code`,{className:i,...s,children:a})})]})}let a=(0,M.memo)(i,(e,t)=>e.className===t.className&&e[`data-block`]===t[`data-block`]&&e.children===t.children&&e.node?.position?.start.line===t.node?.position?.start.line&&e.node?.position?.end.line===t.node?.position?.end.line);return a.displayName=`AdaptedCode`,a}function iit(e){return!!(e.SyntaxHighlighter||e.CodeHeader||e.componentsByLanguage&&Object.keys(e.componentsByLanguage).length>0)}function ait({components:e,componentsByLanguage:t}){return(0,M.useMemo)(()=>{let{SyntaxHighlighter:n,CodeHeader:r,...i}=e??{},a={SyntaxHighlighter:n,CodeHeader:r,componentsByLanguage:t},o={pre:Fnt};if(!iit(a))return{...i,...o};let s=rit(a);return{...i,...o,code:s}},[e,t])}var uX=(function(e){if(e==null)return lit;if(typeof e==`function`)return dX(e);if(typeof e==`object`)return Array.isArray(e)?oit(e):sit(e);if(typeof e==`string`)return cit(e);throw Error(`Expected function, string, or object as test`)});function oit(e){let t=[],n=-1;for(;++n<e.length;)t[n]=uX(e[n]);return dX(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function sit(e){let t=e;return dX(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function cit(e){return dX(t);function t(t){return t&&t.type===e}}function dX(e){return t;function t(t,n,r){return!!(uit(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function lit(){return!0}function uit(e){return typeof e==`object`&&!!e&&`type`in e}function dit(e){return e}var fX=[],pX=`skip`;function mX(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=uX(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+dit(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=fX,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=fit(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function fit(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?fX:[e]}function hX(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),mX(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var gX={indicator:`indicator`,textOnly:`text-only`,remove:`remove`};function _X({defaultOrigin:e=``,allowedLinkPrefixes:t=[],allowedImagePrefixes:n=[],allowDataImages:r=!1,allowedProtocols:i=[],blockedImageClass:a=`inline-block bg-gray-200 dark:bg-gray-700 text-gray-600 dark:text-gray-400 px-3 py-1 rounded text-sm`,blockedLinkClass:o=`text-gray-500`,linkBlockPolicy:s=gX.indicator,imageBlockPolicy:c=gX.indicator}){let l=t.length&&!t.every(e=>e===`*`),u=n.length&&!n.every(e=>e===`*`);if(!e&&(l||u))throw Error(`defaultOrigin is required when allowedLinkPrefixes or allowedImagePrefixes are provided`);return l=>{let u=vit(e,t,n,r,i,a,o,s,c);bX(l),hX(l,u)}}function vX(e,t){if(typeof e!=`string`)return null;try{return new URL(e)}catch{if(t)try{return new URL(e,t)}catch{return null}if(e.startsWith(`/`)||e.startsWith(`./`)||e.startsWith(`../`))try{return new URL(e,`http://example.com`)}catch{return null}return null}}function pit(e){return typeof e==`string`?e.startsWith(`/`)||e.startsWith(`./`)||e.startsWith(`../`):!1}var mit=new Set([`https:`,`http:`,`irc:`,`ircs:`,`mailto:`,`xmpp:`,`blob:`]),hit=new Set([`javascript:`,`data:`,`file:`,`vbscript:`]);function yX(e,t,n,r=!1,i=!1,a=[]){if(!e)return null;if(typeof e==`string`&&e.startsWith(`#`)&&!i)try{if(new URL(e,`http://example.com`).hash===e)return e}catch{}if(typeof e==`string`&&e.startsWith(`data:`))return i&&r&&e.startsWith(`data:image/`)?e:null;if(typeof e==`string`&&e.startsWith(`blob:`)){try{if(new URL(e).protocol===`blob:`&&e.length>5){let t=e.substring(5);if(t&&t.length>0&&t!==`invalid`)return e}}catch{return null}return null}let o=vX(e,n);if(!o||hit.has(o.protocol)||!(mit.has(o.protocol)||a.includes(o.protocol)||a.includes(`*`)))return null;if(o.protocol===`mailto:`||!o.protocol.match(/^https?:$/))return o.href;let s=pit(e);return o&&t.some(e=>{let t=vX(e,n);return!t||t.origin!==o.origin?!1:o.href.startsWith(t.href)})?s?o.pathname+o.search+o.hash:o.href:t.includes(`*`)?o.protocol!==`https:`&&o.protocol!==`http:`?null:s?o.pathname+o.search+o.hash:o.href:null}function bX(e){if(`children`in e&&Array.isArray(e.children)){e.children=e.children.filter(e=>e!=null);for(let t of e.children)bX(t)}}var xX=Symbol(`node-seen`);function git(e,t,n){return t===gX.remove?{type:`remove`}:t===gX.textOnly?{type:`replace`,element:{type:`element`,tagName:`span`,properties:{},children:[...e.children]}}:{type:`replace`,element:{type:`element`,tagName:`span`,properties:{title:`Blocked URL: `+String(e.properties.href),class:n},children:[...e.children,{type:`text`,value:` [blocked]`}]}}}function _it(e,t,n){if(t===gX.remove)return{type:`remove`};if(t===gX.textOnly){let t=String(e.properties.alt||``);return t?{type:`replace`,element:{type:`element`,tagName:`span`,properties:{},children:[{type:`text`,value:t}]}}:{type:`remove`}}return{type:`replace`,element:{type:`element`,tagName:`span`,properties:{class:n},children:[{type:`text`,value:`[Image blocked: `+String(e.properties.alt||`No description`)+`]`}]}}}var vit=(e,t,n,r,i,a,o,s,c)=>{let l=(u,d,f)=>{if(u.type!==`element`||u[xX])return!0;if(u.tagName===`a`){let n=yX(u.properties.href,t,e,!1,!1,i);if(n===null){if(u[xX]=!0,hX(u,l),f&&typeof d==`number`){let e=git(u,s,o);if(e.type===`remove`)return f.children.splice(d,1),[pX,d];f.children[d]=e.element}return pX}else return u.properties.href=n,u.properties.target=`_blank`,u.properties.rel=`noopener noreferrer`,!0}if(u.tagName===`img`){let t=yX(u.properties.src,n,e,r,!0,i);if(t===null){if(u[xX]=!0,hX(u,l),f&&typeof d==`number`){let e=_it(u,c,a);if(e.type===`remove`)return f.children.splice(d,1),[pX,d];f.children[d]=e.element}return pX}else return u.properties.src=t,!0}return!0};return l},yit=typeof self==`object`?self:globalThis,SX=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new yit[e](t)},bit=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(SX(e,t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}return n(SX(a,o),i)};return r},CX=e=>bit(new Map,e)(0),wX=``,{toString:xit}={},{keys:Sit}=Object,TX=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=xit.call(e).slice(8,-1);switch(n){case`Array`:return[1,wX];case`Object`:return[2,wX];case`Date`:return[3,wX];case`RegExp`:return[4,wX];case`Map`:return[5,wX];case`Set`:return[6,wX];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:n.includes(`Error`)?[7,n]:[2,n]},EX=([e,t])=>e===0&&(t===`function`||t===`symbol`),Cit=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=TX(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+s);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`Boolean`:case`Number`:case`String`:return i([s,r.valueOf()],r)}if(t&&`toJSON`in r)return a(r.toJSON());let n=[],c=i([o,n],r);for(let t of Sit(r))(e||!EX(TX(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{let t=[],n=i([o,t],r);for(let[n,i]of r)(e||!(EX(TX(n))||EX(TX(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!EX(TX(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a},DX=(e,{json:t,lossy:n}={})=>{let r=[];return Cit(!(t||n),!!t,new Map,r)(e),r},OX=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?CX(DX(e,t)):structuredClone(e):(e,t)=>CX(DX(e,t)),kX=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};kX.prototype.normal={},kX.prototype.property={},kX.prototype.space=void 0;function AX(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new kX(n,r,t)}function jX(e){return e.toLowerCase()}var MX=class{constructor(e,t){this.attribute=t,this.property=e}};MX.prototype.attribute=``,MX.prototype.booleanish=!1,MX.prototype.boolean=!1,MX.prototype.commaOrSpaceSeparated=!1,MX.prototype.commaSeparated=!1,MX.prototype.defined=!1,MX.prototype.mustUseProperty=!1,MX.prototype.number=!1,MX.prototype.overloadedBoolean=!1,MX.prototype.property=``,MX.prototype.spaceSeparated=!1,MX.prototype.space=void 0;var NX=s({boolean:()=>PX,booleanish:()=>FX,commaOrSpaceSeparated:()=>zX,commaSeparated:()=>RX,number:()=>U,overloadedBoolean:()=>IX,spaceSeparated:()=>LX}),wit=0,PX=BX(),FX=BX(),IX=BX(),U=BX(),LX=BX(),RX=BX(),zX=BX();function BX(){return 2**++wit}var VX=Object.keys(NX),HX=class extends MX{constructor(e,t,n,r){let i=-1;if(super(e,t),UX(this,`space`,r),typeof n==`number`)for(;++i<VX.length;){let e=VX[i];UX(this,VX[i],(n&NX[e])===NX[e])}}};HX.prototype.defined=!0;function UX(e,t,n){n&&(e[t]=n)}function WX(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new HX(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[jX(r)]=r,n[jX(a.attribute)]=r}return new kX(t,n,e.space)}var GX=WX({properties:{ariaActiveDescendant:null,ariaAtomic:FX,ariaAutoComplete:null,ariaBusy:FX,ariaChecked:FX,ariaColCount:U,ariaColIndex:U,ariaColSpan:U,ariaControls:LX,ariaCurrent:null,ariaDescribedBy:LX,ariaDetails:null,ariaDisabled:FX,ariaDropEffect:LX,ariaErrorMessage:null,ariaExpanded:FX,ariaFlowTo:LX,ariaGrabbed:FX,ariaHasPopup:null,ariaHidden:FX,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:LX,ariaLevel:U,ariaLive:null,ariaModal:FX,ariaMultiLine:FX,ariaMultiSelectable:FX,ariaOrientation:null,ariaOwns:LX,ariaPlaceholder:null,ariaPosInSet:U,ariaPressed:FX,ariaReadOnly:FX,ariaRelevant:null,ariaRequired:FX,ariaRoleDescription:LX,ariaRowCount:U,ariaRowIndex:U,ariaRowSpan:U,ariaSelected:FX,ariaSetSize:U,ariaSort:null,ariaValueMax:U,ariaValueMin:U,ariaValueNow:U,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function KX(e,t){return t in e?e[t]:t}function qX(e,t){return KX(e,t.toLowerCase())}var Tit=WX({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:RX,acceptCharset:LX,accessKey:LX,action:null,allow:null,allowFullScreen:PX,allowPaymentRequest:PX,allowUserMedia:PX,alpha:PX,alt:null,as:null,async:PX,autoCapitalize:null,autoComplete:LX,autoFocus:PX,autoPlay:PX,blocking:LX,capture:null,charSet:null,checked:PX,cite:null,className:LX,closedBy:null,colorSpace:null,cols:U,colSpan:U,command:null,commandFor:null,content:null,contentEditable:FX,controls:PX,controlsList:LX,coords:U|RX,crossOrigin:null,data:null,dateTime:null,decoding:null,default:PX,defer:PX,dir:null,dirName:null,disabled:PX,download:IX,draggable:FX,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:PX,formTarget:null,headers:LX,height:U,hidden:IX,high:U,href:null,hrefLang:null,htmlFor:LX,httpEquiv:LX,id:null,imageSizes:null,imageSrcSet:null,inert:PX,inputMode:null,integrity:null,is:null,isMap:PX,itemId:null,itemProp:LX,itemRef:LX,itemScope:PX,itemType:LX,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:PX,low:U,manifest:null,max:null,maxLength:U,media:null,method:null,min:null,minLength:U,multiple:PX,muted:PX,name:null,nonce:null,noModule:PX,noValidate:PX,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:PX,optimum:U,pattern:null,ping:LX,placeholder:null,playsInline:PX,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:PX,referrerPolicy:null,rel:LX,required:PX,reversed:PX,rows:U,rowSpan:U,sandbox:LX,scope:null,scoped:PX,seamless:PX,selected:PX,shadowRootClonable:PX,shadowRootCustomElementRegistry:PX,shadowRootDelegatesFocus:PX,shadowRootMode:null,shadowRootSerializable:PX,shape:null,size:U,sizes:null,slot:null,span:U,spellCheck:FX,src:null,srcDoc:null,srcLang:null,srcSet:null,start:U,step:null,style:null,tabIndex:U,target:null,title:null,translate:null,type:null,typeMustMatch:PX,useMap:null,value:FX,width:U,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:LX,axis:null,background:null,bgColor:null,border:U,borderColor:null,bottomMargin:U,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:PX,declare:PX,event:null,face:null,frame:null,frameBorder:null,hSpace:U,leftMargin:U,link:null,longDesc:null,lowSrc:null,marginHeight:U,marginWidth:U,noResize:PX,noHref:PX,noShade:PX,noWrap:PX,object:null,profile:null,prompt:null,rev:null,rightMargin:U,rules:null,scheme:null,scrolling:FX,standby:null,summary:null,text:null,topMargin:U,valueType:null,version:null,vAlign:null,vLink:null,vSpace:U,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:PX,disablePictureInPicture:PX,disableRemotePlayback:PX,exportParts:RX,part:LX,prefix:null,property:null,results:U,security:null,unselectable:null},space:`html`,transform:qX}),Eit=WX({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,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`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,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`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,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`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:zX,accentHeight:U,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:U,amplitude:U,arabicForm:null,ascent:U,attributeName:null,attributeType:null,azimuth:U,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:U,by:null,calcMode:null,capHeight:U,className:LX,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:U,diffuseConstant:U,direction:null,display:null,dur:null,divisor:U,dominantBaseline:null,download:PX,dx:null,dy:null,edgeMode:null,editable:null,elevation:U,enableBackground:null,end:null,event:null,exponent:U,externalResourcesRequired:null,fill:null,fillOpacity:U,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:RX,g2:RX,glyphName:RX,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:U,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:U,horizOriginX:U,horizOriginY:U,id:null,ideographic:U,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:U,k:U,k1:U,k2:U,k3:U,k4:U,kernelMatrix:zX,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:U,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:U,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:U,overlineThickness:U,paintOrder:null,panose1:null,path:null,pathLength:U,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:LX,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:U,pointsAtY:U,pointsAtZ:U,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:zX,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:zX,rev:zX,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:zX,requiredFeatures:zX,requiredFonts:zX,requiredFormats:zX,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:U,specularExponent:U,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:U,strikethroughThickness:U,string:null,stroke:null,strokeDashArray:zX,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:U,strokeOpacity:U,strokeWidth:null,style:null,surfaceScale:U,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:zX,tabIndex:U,tableValues:null,target:null,targetX:U,targetY:U,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:zX,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:U,underlineThickness:U,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:U,values:null,vAlphabetic:U,vMathematical:U,vectorEffect:null,vHanging:U,vIdeographic:U,version:null,vertAdvY:U,vertOriginX:U,vertOriginY:U,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:U,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:KX}),JX=WX({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),YX=WX({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:qX}),XX=WX({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),Dit={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},Oit=/[A-Z]/g,ZX=/-[a-z]/g,kit=/^data[-\w.:]+$/i;function QX(e,t){let n=jX(t),r=t,i=MX;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&kit.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(ZX,jit);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!ZX.test(e)){let n=e.replace(Oit,Ait);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=HX}return new i(r,t)}function Ait(e){return`-`+e.toLowerCase()}function jit(e){return e.charAt(1).toUpperCase()}var $X=AX([GX,Tit,JX,YX,XX],`html`),eZ=AX([GX,Eit,JX,YX,XX],`svg`);function tZ(e){let t=[],n=String(e||``),r=n.indexOf(`,`),i=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);let e=n.slice(i,r).trim();(e||!a)&&t.push(e),i=r+1,r=n.indexOf(`,`,i)}return t}function nZ(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var rZ=/[#.]/g;function Mit(e,t){let n=e||``,r={},i=0,a,o;for(;i<n.length;){rZ.lastIndex=i;let e=rZ.exec(n),t=n.slice(i,e?e.index:n.length);t&&(a?a===`#`?r.id=t:Array.isArray(r.className)?r.className.push(t):r.className=[t]:o=t,i+=t.length),e&&(a=e[0],i++)}return{type:`element`,tagName:o||t||`div`,properties:r,children:[]}}function iZ(e){let t=String(e||``).trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function aZ(e){return e.join(` `).trim()}function oZ(e,t,n){let r=n?Iit(n):void 0;function i(n,i,...a){let o;if(n==null){o={type:`root`,children:[]};let e=i;a.unshift(e)}else{o=Mit(n,t);let s=o.tagName.toLowerCase(),c=r?r.get(s):void 0;if(o.tagName=c||s,Nit(i))a.unshift(i);else for(let[t,n]of Object.entries(i))Pit(e,o.properties,t,n)}for(let e of a)sZ(o.children,e);return o.type===`element`&&o.tagName===`template`&&(o.content={type:`root`,children:o.children},o.children=[]),o}return i}function Nit(e){if(typeof e!=`object`||!e||Array.isArray(e))return!0;if(typeof e.type!=`string`)return!1;let t=e,n=Object.keys(e);for(let e of n){let n=t[e];if(n&&typeof n==`object`){if(!Array.isArray(n))return!0;let e=n;for(let t of e)if(typeof t!=`number`&&typeof t!=`string`)return!0}}return!!(`children`in e&&Array.isArray(e.children))}function Pit(e,t,n,r){let i=QX(e,n),a;if(r!=null){if(typeof r==`number`){if(Number.isNaN(r))return;a=r}else a=typeof r==`boolean`?r:typeof r==`string`?i.spaceSeparated?iZ(r):i.commaSeparated?tZ(r):i.commaOrSpaceSeparated?iZ(tZ(r).join(` `)):cZ(i,i.property,r):Array.isArray(r)?[...r]:i.property===`style`?Fit(r):String(r);if(Array.isArray(a)){let e=[];for(let t of a)e.push(cZ(i,i.property,t));a=e}i.property===`className`&&Array.isArray(t.className)&&(a=t.className.concat(a)),t[i.property]=a}}function sZ(e,t){if(t!=null)if(typeof t==`number`||typeof t==`string`)e.push({type:`text`,value:String(t)});else if(Array.isArray(t))for(let n of t)sZ(e,n);else if(typeof t==`object`&&`type`in t)t.type===`root`?sZ(e,t.children):e.push(t);else throw Error("Expected node, nodes, or string, got `"+t+"`")}function cZ(e,t,n){if(typeof n==`string`){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===``||jX(n)===jX(t)))return!0}return n}function Fit(e){let t=[];for(let[n,r]of Object.entries(e))t.push([n,r].join(`: `));return t.join(`; `)}function Iit(e){let t=new Map;for(let n of e)t.set(n.toLowerCase(),n);return t}var Lit=`altGlyph.altGlyphDef.altGlyphItem.animateColor.animateMotion.animateTransform.clipPath.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.foreignObject.glyphRef.linearGradient.radialGradient.solidColor.textArea.textPath`.split(`.`),Rit=oZ($X,`div`),zit=oZ(eZ,`g`,Lit);function Bit(e){let t=String(e),n=[];return{toOffset:i,toPoint:r};function r(e){if(typeof e==`number`&&e>-1&&e<=t.length){let r=0;for(;;){let i=n[r];if(i===void 0){let e=lZ(t,n[r-1]);i=e===-1?t.length+1:e+1,n[r]=i}if(i>e)return{line:r+1,column:e-(r>0?n[r-1]:0)+1,offset:e};r++}}}function i(e){if(e&&typeof e.line==`number`&&typeof e.column==`number`&&!Number.isNaN(e.line)&&!Number.isNaN(e.column)){for(;n.length<e.line;){let e=n[n.length-1],r=lZ(t,e),i=r===-1?t.length+1:r+1;if(e===i)break;n.push(i)}let r=(e.line>1?n[e.line-2]:0)+e.column-1;if(r<n[e.line-1])return r}}}function lZ(e,t){let n=e.indexOf(`\r`,t),r=e.indexOf(`
|
|
155
|
+
`,t);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}var uZ={html:`http://www.w3.org/1999/xhtml`,mathml:`http://www.w3.org/1998/Math/MathML`,svg:`http://www.w3.org/2000/svg`,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`},dZ={}.hasOwnProperty,Vit=Object.prototype;function Hit(e,t){let n=t||{};return fZ({file:n.file||void 0,location:!1,schema:n.space===`svg`?eZ:$X,verbose:n.verbose||!1},e)}function fZ(e,t){let n;switch(t.nodeName){case`#comment`:{let r=t;return n={type:`comment`,value:r.data},mZ(e,r,n),n}case`#document`:case`#document-fragment`:{let r=t,i=`mode`in r?r.mode===`quirks`||r.mode===`limited-quirks`:!1;if(n={type:`root`,children:pZ(e,t.childNodes),data:{quirksMode:i}},e.file&&e.location){let t=String(e.file),r=Bit(t),i=r.toPoint(0),a=r.toPoint(t.length);n.position={start:i,end:a}}return n}case`#documentType`:{let r=t;return n={type:`doctype`},mZ(e,r,n),n}case`#text`:{let r=t;return n={type:`text`,value:r.value},mZ(e,r,n),n}default:return n=Uit(e,t),n}}function pZ(e,t){let n=-1,r=[];for(;++n<t.length;){let i=fZ(e,t[n]);r.push(i)}return r}function Uit(e,t){let n=e.schema;e.schema=t.namespaceURI===uZ.svg?eZ:$X;let r=-1,i={};for(;++r<t.attrs.length;){let e=t.attrs[r],n=(e.prefix?e.prefix+`:`:``)+e.name;dZ.call(Vit,n)||(i[n]=e.value)}let a=(e.schema.space===`svg`?zit:Rit)(t.tagName,i,pZ(e,t.childNodes));if(mZ(e,t,a),a.tagName===`template`){let n=t,r=n.sourceCodeLocation,i=r&&r.startTag&&hZ(r.startTag),o=r&&r.endTag&&hZ(r.endTag),s=fZ(e,n.content);i&&o&&e.file&&(s.position={start:i.end,end:o.start}),a.content=s}return e.schema=n,a}function mZ(e,t,n){if(`sourceCodeLocation`in t&&t.sourceCodeLocation&&e.file){let r=Wit(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function Wit(e,t,n){let r=hZ(n);if(t.type===`element`){let i=t.children[t.children.length-1];if(r&&!n.endTag&&i&&i.position&&i.position.end&&(r.end=Object.assign({},i.position.end)),e.verbose){let r={},i;if(n.attrs)for(i in n.attrs)dZ.call(n.attrs,i)&&(r[QX(e.schema,i).property]=hZ(n.attrs[i]));n.startTag;let a=hZ(n.startTag),o=n.endTag?hZ(n.endTag):void 0,s={opening:a};o&&(s.closing=o),s.properties=r,t.data={position:s}}}return r}function hZ(e){let t=gZ({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=gZ({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function gZ(e){return e.line&&e.column?e:void 0}var _Z={}.hasOwnProperty;function vZ(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&_Z.call(t,e)){let n=String(t[e]);i=_Z.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var Git={},Kit={}.hasOwnProperty,yZ=vZ(`type`,{handlers:{root:Jit,element:$it,text:Zit,comment:Qit,doctype:Xit}});function qit(e,t){let n=(t||Git).space;return yZ(e,n===`svg`?eZ:$X)}function Jit(e,t){let n={nodeName:`#document`,mode:(e.data||{}).quirksMode?`quirks`:`no-quirks`,childNodes:[]};return n.childNodes=bZ(e.children,n,t),xZ(e,n),n}function Yit(e,t){let n={nodeName:`#document-fragment`,childNodes:[]};return n.childNodes=bZ(e.children,n,t),xZ(e,n),n}function Xit(e){let t={nodeName:`#documentType`,name:`html`,publicId:``,systemId:``,parentNode:null};return xZ(e,t),t}function Zit(e){let t={nodeName:`#text`,value:e.value,parentNode:null};return xZ(e,t),t}function Qit(e){let t={nodeName:`#comment`,data:e.value,parentNode:null};return xZ(e,t),t}function $it(e,t){let n=t,r=n;e.type===`element`&&e.tagName.toLowerCase()===`svg`&&n.space===`html`&&(r=eZ);let i=[],a;if(e.properties){for(a in e.properties)if(a!==`children`&&Kit.call(e.properties,a)){let t=eat(r,a,e.properties[a]);t&&i.push(t)}}let o=r.space,s={nodeName:e.tagName,tagName:e.tagName,attrs:i,namespaceURI:uZ[o],childNodes:[],parentNode:null};return s.childNodes=bZ(e.children,s,r),xZ(e,s),e.tagName===`template`&&e.content&&(s.content=Yit(e.content,r)),s}function eat(e,t,n){let r=QX(e,t);if(n===!1||n==null||typeof n==`number`&&Number.isNaN(n)||!n&&r.boolean)return;Array.isArray(n)&&(n=r.commaSeparated?nZ(n):aZ(n));let i={name:r.attribute,value:n===!0?``:String(n)};if(r.space&&r.space!==`html`&&r.space!==`svg`){let e=i.name.indexOf(`:`);e<0?i.prefix=``:(i.name=i.name.slice(e+1),i.prefix=r.attribute.slice(0,e)),i.namespace=uZ[r.space]}return i}function bZ(e,t,n){let r=-1,i=[];if(e)for(;++r<e.length;){let a=yZ(e[r],n);a.parentNode=t,i.push(a)}return i}function xZ(e,t){let n=e.position;n&&n.start&&n.end&&(n.start.offset,n.end.offset,t.sourceCodeLocation={startLine:n.start.line,startCol:n.start.column,startOffset:n.start.offset,endLine:n.end.line,endCol:n.end.column,endOffset:n.end.offset})}var tat=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`],nat=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),W;(function(e){e[e.EOF=-1]=`EOF`,e[e.NULL=0]=`NULL`,e[e.TABULATION=9]=`TABULATION`,e[e.CARRIAGE_RETURN=13]=`CARRIAGE_RETURN`,e[e.LINE_FEED=10]=`LINE_FEED`,e[e.FORM_FEED=12]=`FORM_FEED`,e[e.SPACE=32]=`SPACE`,e[e.EXCLAMATION_MARK=33]=`EXCLAMATION_MARK`,e[e.QUOTATION_MARK=34]=`QUOTATION_MARK`,e[e.AMPERSAND=38]=`AMPERSAND`,e[e.APOSTROPHE=39]=`APOSTROPHE`,e[e.HYPHEN_MINUS=45]=`HYPHEN_MINUS`,e[e.SOLIDUS=47]=`SOLIDUS`,e[e.DIGIT_0=48]=`DIGIT_0`,e[e.DIGIT_9=57]=`DIGIT_9`,e[e.SEMICOLON=59]=`SEMICOLON`,e[e.LESS_THAN_SIGN=60]=`LESS_THAN_SIGN`,e[e.EQUALS_SIGN=61]=`EQUALS_SIGN`,e[e.GREATER_THAN_SIGN=62]=`GREATER_THAN_SIGN`,e[e.QUESTION_MARK=63]=`QUESTION_MARK`,e[e.LATIN_CAPITAL_A=65]=`LATIN_CAPITAL_A`,e[e.LATIN_CAPITAL_Z=90]=`LATIN_CAPITAL_Z`,e[e.RIGHT_SQUARE_BRACKET=93]=`RIGHT_SQUARE_BRACKET`,e[e.GRAVE_ACCENT=96]=`GRAVE_ACCENT`,e[e.LATIN_SMALL_A=97]=`LATIN_SMALL_A`,e[e.LATIN_SMALL_Z=122]=`LATIN_SMALL_Z`})(W||={});var SZ={DASH_DASH:`--`,CDATA_START:`[CDATA[`,DOCTYPE:`doctype`,SCRIPT:`script`,PUBLIC:`public`,SYSTEM:`system`};function CZ(e){return e>=55296&&e<=57343}function rat(e){return e>=56320&&e<=57343}function iat(e,t){return(e-55296)*1024+9216+t}function wZ(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function TZ(e){return e>=64976&&e<=65007||nat.has(e)}var G;(function(e){e.controlCharacterInInputStream=`control-character-in-input-stream`,e.noncharacterInInputStream=`noncharacter-in-input-stream`,e.surrogateInInputStream=`surrogate-in-input-stream`,e.nonVoidHtmlElementStartTagWithTrailingSolidus=`non-void-html-element-start-tag-with-trailing-solidus`,e.endTagWithAttributes=`end-tag-with-attributes`,e.endTagWithTrailingSolidus=`end-tag-with-trailing-solidus`,e.unexpectedSolidusInTag=`unexpected-solidus-in-tag`,e.unexpectedNullCharacter=`unexpected-null-character`,e.unexpectedQuestionMarkInsteadOfTagName=`unexpected-question-mark-instead-of-tag-name`,e.invalidFirstCharacterOfTagName=`invalid-first-character-of-tag-name`,e.unexpectedEqualsSignBeforeAttributeName=`unexpected-equals-sign-before-attribute-name`,e.missingEndTagName=`missing-end-tag-name`,e.unexpectedCharacterInAttributeName=`unexpected-character-in-attribute-name`,e.unknownNamedCharacterReference=`unknown-named-character-reference`,e.missingSemicolonAfterCharacterReference=`missing-semicolon-after-character-reference`,e.unexpectedCharacterAfterDoctypeSystemIdentifier=`unexpected-character-after-doctype-system-identifier`,e.unexpectedCharacterInUnquotedAttributeValue=`unexpected-character-in-unquoted-attribute-value`,e.eofBeforeTagName=`eof-before-tag-name`,e.eofInTag=`eof-in-tag`,e.missingAttributeValue=`missing-attribute-value`,e.missingWhitespaceBetweenAttributes=`missing-whitespace-between-attributes`,e.missingWhitespaceAfterDoctypePublicKeyword=`missing-whitespace-after-doctype-public-keyword`,e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers=`missing-whitespace-between-doctype-public-and-system-identifiers`,e.missingWhitespaceAfterDoctypeSystemKeyword=`missing-whitespace-after-doctype-system-keyword`,e.missingQuoteBeforeDoctypePublicIdentifier=`missing-quote-before-doctype-public-identifier`,e.missingQuoteBeforeDoctypeSystemIdentifier=`missing-quote-before-doctype-system-identifier`,e.missingDoctypePublicIdentifier=`missing-doctype-public-identifier`,e.missingDoctypeSystemIdentifier=`missing-doctype-system-identifier`,e.abruptDoctypePublicIdentifier=`abrupt-doctype-public-identifier`,e.abruptDoctypeSystemIdentifier=`abrupt-doctype-system-identifier`,e.cdataInHtmlContent=`cdata-in-html-content`,e.incorrectlyOpenedComment=`incorrectly-opened-comment`,e.eofInScriptHtmlCommentLikeText=`eof-in-script-html-comment-like-text`,e.eofInDoctype=`eof-in-doctype`,e.nestedComment=`nested-comment`,e.abruptClosingOfEmptyComment=`abrupt-closing-of-empty-comment`,e.eofInComment=`eof-in-comment`,e.incorrectlyClosedComment=`incorrectly-closed-comment`,e.eofInCdata=`eof-in-cdata`,e.absenceOfDigitsInNumericCharacterReference=`absence-of-digits-in-numeric-character-reference`,e.nullCharacterReference=`null-character-reference`,e.surrogateCharacterReference=`surrogate-character-reference`,e.characterReferenceOutsideUnicodeRange=`character-reference-outside-unicode-range`,e.controlCharacterReference=`control-character-reference`,e.noncharacterCharacterReference=`noncharacter-character-reference`,e.missingWhitespaceBeforeDoctypeName=`missing-whitespace-before-doctype-name`,e.missingDoctypeName=`missing-doctype-name`,e.invalidCharacterSequenceAfterDoctypeName=`invalid-character-sequence-after-doctype-name`,e.duplicateAttribute=`duplicate-attribute`,e.nonConformingDoctype=`non-conforming-doctype`,e.missingDoctype=`missing-doctype`,e.misplacedDoctype=`misplaced-doctype`,e.endTagWithoutMatchingOpenElement=`end-tag-without-matching-open-element`,e.closingOfElementWithOpenChildElements=`closing-of-element-with-open-child-elements`,e.disallowedContentInNoscriptInHead=`disallowed-content-in-noscript-in-head`,e.openElementsLeftAfterEof=`open-elements-left-after-eof`,e.abandonedHeadElementChild=`abandoned-head-element-child`,e.misplacedStartTagForHeadElement=`misplaced-start-tag-for-head-element`,e.nestedNoscriptInHead=`nested-noscript-in-head`,e.eofInElementThatCanContainOnlyText=`eof-in-element-that-can-contain-only-text`})(G||={});var aat=65536,oat=class{constructor(e){this.handler=e,this.html=``,this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=aat,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+Number(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(e,t){let{line:n,col:r,offset:i}=this,a=r+t,o=i+t;return{code:e,startLine:n,endLine:n,startCol:a,endCol:a,startOffset:o,endOffset:o}}_err(e){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(e,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(e){if(this.pos!==this.html.length-1){let t=this.html.charCodeAt(this.pos+1);if(rat(t))return this.pos++,this._addGap(),iat(e,t)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,W.EOF;return this._err(G.surrogateInInputStream),e}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(e,t){this.html.length>0?this.html+=e:this.html=e,this.endOfChunkHit=!1,this.lastChunkWritten=t}insertHtmlAtCurrentPos(e){this.html=this.html.substring(0,this.pos+1)+e+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(e,t){if(this.pos+e.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(t)return this.html.startsWith(e,this.pos);for(let t=0;t<e.length;t++)if((this.html.charCodeAt(this.pos+t)|32)!==e.charCodeAt(t))return!1;return!0}peek(e){let t=this.pos+e;if(t>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,W.EOF;let n=this.html.charCodeAt(t);return n===W.CARRIAGE_RETURN?W.LINE_FEED:n}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,W.EOF;let e=this.html.charCodeAt(this.pos);return e===W.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,W.LINE_FEED):e===W.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,CZ(e)&&(e=this._processSurrogate(e)),this.handler.onParseError===null||e>31&&e<127||e===W.LINE_FEED||e===W.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){wZ(e)?this._err(G.controlCharacterInInputStream):TZ(e)&&this._err(G.noncharacterInInputStream)}retreat(e){for(this.pos-=e;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}},EZ;(function(e){e[e.CHARACTER=0]=`CHARACTER`,e[e.NULL_CHARACTER=1]=`NULL_CHARACTER`,e[e.WHITESPACE_CHARACTER=2]=`WHITESPACE_CHARACTER`,e[e.START_TAG=3]=`START_TAG`,e[e.END_TAG=4]=`END_TAG`,e[e.COMMENT=5]=`COMMENT`,e[e.DOCTYPE=6]=`DOCTYPE`,e[e.EOF=7]=`EOF`,e[e.HIBERNATION=8]=`HIBERNATION`})(EZ||={});function DZ(e,t){for(let n=e.attrs.length-1;n>=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}var sat=new Uint16Array(`ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻\xA0ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌`.split(``).map(e=>e.charCodeAt(0))),cat=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);String.fromCodePoint;function lat(e){return e>=55296&&e<=57343||e>1114111?65533:cat.get(e)??e}var OZ;(function(e){e[e.NUM=35]=`NUM`,e[e.SEMI=59]=`SEMI`,e[e.EQUALS=61]=`EQUALS`,e[e.ZERO=48]=`ZERO`,e[e.NINE=57]=`NINE`,e[e.LOWER_A=97]=`LOWER_A`,e[e.LOWER_F=102]=`LOWER_F`,e[e.LOWER_X=120]=`LOWER_X`,e[e.LOWER_Z=122]=`LOWER_Z`,e[e.UPPER_A=65]=`UPPER_A`,e[e.UPPER_F=70]=`UPPER_F`,e[e.UPPER_Z=90]=`UPPER_Z`})(OZ||={});var uat=32,kZ;(function(e){e[e.VALUE_LENGTH=49152]=`VALUE_LENGTH`,e[e.BRANCH_LENGTH=16256]=`BRANCH_LENGTH`,e[e.JUMP_TABLE=127]=`JUMP_TABLE`})(kZ||={});function AZ(e){return e>=OZ.ZERO&&e<=OZ.NINE}function dat(e){return e>=OZ.UPPER_A&&e<=OZ.UPPER_F||e>=OZ.LOWER_A&&e<=OZ.LOWER_F}function fat(e){return e>=OZ.UPPER_A&&e<=OZ.UPPER_Z||e>=OZ.LOWER_A&&e<=OZ.LOWER_Z||AZ(e)}function pat(e){return e===OZ.EQUALS||fat(e)}var jZ;(function(e){e[e.EntityStart=0]=`EntityStart`,e[e.NumericStart=1]=`NumericStart`,e[e.NumericDecimal=2]=`NumericDecimal`,e[e.NumericHex=3]=`NumericHex`,e[e.NamedEntity=4]=`NamedEntity`})(jZ||={});var MZ;(function(e){e[e.Legacy=0]=`Legacy`,e[e.Strict=1]=`Strict`,e[e.Attribute=2]=`Attribute`})(MZ||={});var mat=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=jZ.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=MZ.Strict}startEntity(e){this.decodeMode=e,this.state=jZ.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case jZ.EntityStart:return e.charCodeAt(t)===OZ.NUM?(this.state=jZ.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=jZ.NamedEntity,this.stateNamedEntity(e,t));case jZ.NumericStart:return this.stateNumericStart(e,t);case jZ.NumericDecimal:return this.stateNumericDecimal(e,t);case jZ.NumericHex:return this.stateNumericHex(e,t);case jZ.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|uat)===OZ.LOWER_X?(this.state=jZ.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=jZ.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,n,r){if(t!==n){let i=n-t;this.result=this.result*r**+i+Number.parseInt(e.substr(t,i),r),this.consumed+=i}}stateNumericHex(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if(AZ(r)||dat(r))t+=1;else return this.addToNumericResult(e,n,t,16),this.emitNumericEntity(r,3)}return this.addToNumericResult(e,n,t,16),-1}stateNumericDecimal(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if(AZ(r))t+=1;else return this.addToNumericResult(e,n,t,10),this.emitNumericEntity(r,2)}return this.addToNumericResult(e,n,t,10),-1}emitNumericEntity(e,t){var n;if(this.consumed<=t)return(n=this.errors)==null||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===OZ.SEMI)this.consumed+=1;else if(this.decodeMode===MZ.Strict)return 0;return this.emitCodePoint(lat(this.result),this.consumed),this.errors&&(e!==OZ.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){let{decodeTree:n}=this,r=n[this.treeIndex],i=(r&kZ.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){let a=e.charCodeAt(t);if(this.treeIndex=hat(n,r,this.treeIndex+Math.max(1,i),a),this.treeIndex<0)return this.result===0||this.decodeMode===MZ.Attribute&&(i===0||pat(a))?0:this.emitNotTerminatedNamedEntity();if(r=n[this.treeIndex],i=(r&kZ.VALUE_LENGTH)>>14,i!==0){if(a===OZ.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==MZ.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;let{result:t,decodeTree:n}=this,r=(n[t]&kZ.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,r,this.consumed),(e=this.errors)==null||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){let{decodeTree:r}=this;return this.emitCodePoint(t===1?r[e]&~kZ.VALUE_LENGTH:r[e+1],n),t===3&&this.emitCodePoint(r[e+2],n),n}end(){var e;switch(this.state){case jZ.NamedEntity:return this.result!==0&&(this.decodeMode!==MZ.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case jZ.NumericDecimal:return this.emitNumericEntity(0,2);case jZ.NumericHex:return this.emitNumericEntity(0,3);case jZ.NumericStart:return(e=this.errors)==null||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case jZ.EntityStart:return 0}}};function hat(e,t,n,r){let i=(t&kZ.BRANCH_LENGTH)>>7,a=t&kZ.JUMP_TABLE;if(i===0)return a!==0&&r===a?n:-1;if(a){let t=r-a;return t<0||t>=i?-1:e[n+t]-1}let o=n,s=o+i-1;for(;o<=s;){let t=o+s>>>1,n=e[t];if(n<r)o=t+1;else if(n>r)s=t-1;else return e[t+i]}return-1}var K;(function(e){e.HTML=`http://www.w3.org/1999/xhtml`,e.MATHML=`http://www.w3.org/1998/Math/MathML`,e.SVG=`http://www.w3.org/2000/svg`,e.XLINK=`http://www.w3.org/1999/xlink`,e.XML=`http://www.w3.org/XML/1998/namespace`,e.XMLNS=`http://www.w3.org/2000/xmlns/`})(K||={});var NZ;(function(e){e.TYPE=`type`,e.ACTION=`action`,e.ENCODING=`encoding`,e.PROMPT=`prompt`,e.NAME=`name`,e.COLOR=`color`,e.FACE=`face`,e.SIZE=`size`})(NZ||={});var PZ;(function(e){e.NO_QUIRKS=`no-quirks`,e.QUIRKS=`quirks`,e.LIMITED_QUIRKS=`limited-quirks`})(PZ||={});var q;(function(e){e.A=`a`,e.ADDRESS=`address`,e.ANNOTATION_XML=`annotation-xml`,e.APPLET=`applet`,e.AREA=`area`,e.ARTICLE=`article`,e.ASIDE=`aside`,e.B=`b`,e.BASE=`base`,e.BASEFONT=`basefont`,e.BGSOUND=`bgsound`,e.BIG=`big`,e.BLOCKQUOTE=`blockquote`,e.BODY=`body`,e.BR=`br`,e.BUTTON=`button`,e.CAPTION=`caption`,e.CENTER=`center`,e.CODE=`code`,e.COL=`col`,e.COLGROUP=`colgroup`,e.DD=`dd`,e.DESC=`desc`,e.DETAILS=`details`,e.DIALOG=`dialog`,e.DIR=`dir`,e.DIV=`div`,e.DL=`dl`,e.DT=`dt`,e.EM=`em`,e.EMBED=`embed`,e.FIELDSET=`fieldset`,e.FIGCAPTION=`figcaption`,e.FIGURE=`figure`,e.FONT=`font`,e.FOOTER=`footer`,e.FOREIGN_OBJECT=`foreignObject`,e.FORM=`form`,e.FRAME=`frame`,e.FRAMESET=`frameset`,e.H1=`h1`,e.H2=`h2`,e.H3=`h3`,e.H4=`h4`,e.H5=`h5`,e.H6=`h6`,e.HEAD=`head`,e.HEADER=`header`,e.HGROUP=`hgroup`,e.HR=`hr`,e.HTML=`html`,e.I=`i`,e.IMG=`img`,e.IMAGE=`image`,e.INPUT=`input`,e.IFRAME=`iframe`,e.KEYGEN=`keygen`,e.LABEL=`label`,e.LI=`li`,e.LINK=`link`,e.LISTING=`listing`,e.MAIN=`main`,e.MALIGNMARK=`malignmark`,e.MARQUEE=`marquee`,e.MATH=`math`,e.MENU=`menu`,e.META=`meta`,e.MGLYPH=`mglyph`,e.MI=`mi`,e.MO=`mo`,e.MN=`mn`,e.MS=`ms`,e.MTEXT=`mtext`,e.NAV=`nav`,e.NOBR=`nobr`,e.NOFRAMES=`noframes`,e.NOEMBED=`noembed`,e.NOSCRIPT=`noscript`,e.OBJECT=`object`,e.OL=`ol`,e.OPTGROUP=`optgroup`,e.OPTION=`option`,e.P=`p`,e.PARAM=`param`,e.PLAINTEXT=`plaintext`,e.PRE=`pre`,e.RB=`rb`,e.RP=`rp`,e.RT=`rt`,e.RTC=`rtc`,e.RUBY=`ruby`,e.S=`s`,e.SCRIPT=`script`,e.SEARCH=`search`,e.SECTION=`section`,e.SELECT=`select`,e.SOURCE=`source`,e.SMALL=`small`,e.SPAN=`span`,e.STRIKE=`strike`,e.STRONG=`strong`,e.STYLE=`style`,e.SUB=`sub`,e.SUMMARY=`summary`,e.SUP=`sup`,e.TABLE=`table`,e.TBODY=`tbody`,e.TEMPLATE=`template`,e.TEXTAREA=`textarea`,e.TFOOT=`tfoot`,e.TD=`td`,e.TH=`th`,e.THEAD=`thead`,e.TITLE=`title`,e.TR=`tr`,e.TRACK=`track`,e.TT=`tt`,e.U=`u`,e.UL=`ul`,e.SVG=`svg`,e.VAR=`var`,e.WBR=`wbr`,e.XMP=`xmp`})(q||={});var J;(function(e){e[e.UNKNOWN=0]=`UNKNOWN`,e[e.A=1]=`A`,e[e.ADDRESS=2]=`ADDRESS`,e[e.ANNOTATION_XML=3]=`ANNOTATION_XML`,e[e.APPLET=4]=`APPLET`,e[e.AREA=5]=`AREA`,e[e.ARTICLE=6]=`ARTICLE`,e[e.ASIDE=7]=`ASIDE`,e[e.B=8]=`B`,e[e.BASE=9]=`BASE`,e[e.BASEFONT=10]=`BASEFONT`,e[e.BGSOUND=11]=`BGSOUND`,e[e.BIG=12]=`BIG`,e[e.BLOCKQUOTE=13]=`BLOCKQUOTE`,e[e.BODY=14]=`BODY`,e[e.BR=15]=`BR`,e[e.BUTTON=16]=`BUTTON`,e[e.CAPTION=17]=`CAPTION`,e[e.CENTER=18]=`CENTER`,e[e.CODE=19]=`CODE`,e[e.COL=20]=`COL`,e[e.COLGROUP=21]=`COLGROUP`,e[e.DD=22]=`DD`,e[e.DESC=23]=`DESC`,e[e.DETAILS=24]=`DETAILS`,e[e.DIALOG=25]=`DIALOG`,e[e.DIR=26]=`DIR`,e[e.DIV=27]=`DIV`,e[e.DL=28]=`DL`,e[e.DT=29]=`DT`,e[e.EM=30]=`EM`,e[e.EMBED=31]=`EMBED`,e[e.FIELDSET=32]=`FIELDSET`,e[e.FIGCAPTION=33]=`FIGCAPTION`,e[e.FIGURE=34]=`FIGURE`,e[e.FONT=35]=`FONT`,e[e.FOOTER=36]=`FOOTER`,e[e.FOREIGN_OBJECT=37]=`FOREIGN_OBJECT`,e[e.FORM=38]=`FORM`,e[e.FRAME=39]=`FRAME`,e[e.FRAMESET=40]=`FRAMESET`,e[e.H1=41]=`H1`,e[e.H2=42]=`H2`,e[e.H3=43]=`H3`,e[e.H4=44]=`H4`,e[e.H5=45]=`H5`,e[e.H6=46]=`H6`,e[e.HEAD=47]=`HEAD`,e[e.HEADER=48]=`HEADER`,e[e.HGROUP=49]=`HGROUP`,e[e.HR=50]=`HR`,e[e.HTML=51]=`HTML`,e[e.I=52]=`I`,e[e.IMG=53]=`IMG`,e[e.IMAGE=54]=`IMAGE`,e[e.INPUT=55]=`INPUT`,e[e.IFRAME=56]=`IFRAME`,e[e.KEYGEN=57]=`KEYGEN`,e[e.LABEL=58]=`LABEL`,e[e.LI=59]=`LI`,e[e.LINK=60]=`LINK`,e[e.LISTING=61]=`LISTING`,e[e.MAIN=62]=`MAIN`,e[e.MALIGNMARK=63]=`MALIGNMARK`,e[e.MARQUEE=64]=`MARQUEE`,e[e.MATH=65]=`MATH`,e[e.MENU=66]=`MENU`,e[e.META=67]=`META`,e[e.MGLYPH=68]=`MGLYPH`,e[e.MI=69]=`MI`,e[e.MO=70]=`MO`,e[e.MN=71]=`MN`,e[e.MS=72]=`MS`,e[e.MTEXT=73]=`MTEXT`,e[e.NAV=74]=`NAV`,e[e.NOBR=75]=`NOBR`,e[e.NOFRAMES=76]=`NOFRAMES`,e[e.NOEMBED=77]=`NOEMBED`,e[e.NOSCRIPT=78]=`NOSCRIPT`,e[e.OBJECT=79]=`OBJECT`,e[e.OL=80]=`OL`,e[e.OPTGROUP=81]=`OPTGROUP`,e[e.OPTION=82]=`OPTION`,e[e.P=83]=`P`,e[e.PARAM=84]=`PARAM`,e[e.PLAINTEXT=85]=`PLAINTEXT`,e[e.PRE=86]=`PRE`,e[e.RB=87]=`RB`,e[e.RP=88]=`RP`,e[e.RT=89]=`RT`,e[e.RTC=90]=`RTC`,e[e.RUBY=91]=`RUBY`,e[e.S=92]=`S`,e[e.SCRIPT=93]=`SCRIPT`,e[e.SEARCH=94]=`SEARCH`,e[e.SECTION=95]=`SECTION`,e[e.SELECT=96]=`SELECT`,e[e.SOURCE=97]=`SOURCE`,e[e.SMALL=98]=`SMALL`,e[e.SPAN=99]=`SPAN`,e[e.STRIKE=100]=`STRIKE`,e[e.STRONG=101]=`STRONG`,e[e.STYLE=102]=`STYLE`,e[e.SUB=103]=`SUB`,e[e.SUMMARY=104]=`SUMMARY`,e[e.SUP=105]=`SUP`,e[e.TABLE=106]=`TABLE`,e[e.TBODY=107]=`TBODY`,e[e.TEMPLATE=108]=`TEMPLATE`,e[e.TEXTAREA=109]=`TEXTAREA`,e[e.TFOOT=110]=`TFOOT`,e[e.TD=111]=`TD`,e[e.TH=112]=`TH`,e[e.THEAD=113]=`THEAD`,e[e.TITLE=114]=`TITLE`,e[e.TR=115]=`TR`,e[e.TRACK=116]=`TRACK`,e[e.TT=117]=`TT`,e[e.U=118]=`U`,e[e.UL=119]=`UL`,e[e.SVG=120]=`SVG`,e[e.VAR=121]=`VAR`,e[e.WBR=122]=`WBR`,e[e.XMP=123]=`XMP`})(J||={});var gat=new Map([[q.A,J.A],[q.ADDRESS,J.ADDRESS],[q.ANNOTATION_XML,J.ANNOTATION_XML],[q.APPLET,J.APPLET],[q.AREA,J.AREA],[q.ARTICLE,J.ARTICLE],[q.ASIDE,J.ASIDE],[q.B,J.B],[q.BASE,J.BASE],[q.BASEFONT,J.BASEFONT],[q.BGSOUND,J.BGSOUND],[q.BIG,J.BIG],[q.BLOCKQUOTE,J.BLOCKQUOTE],[q.BODY,J.BODY],[q.BR,J.BR],[q.BUTTON,J.BUTTON],[q.CAPTION,J.CAPTION],[q.CENTER,J.CENTER],[q.CODE,J.CODE],[q.COL,J.COL],[q.COLGROUP,J.COLGROUP],[q.DD,J.DD],[q.DESC,J.DESC],[q.DETAILS,J.DETAILS],[q.DIALOG,J.DIALOG],[q.DIR,J.DIR],[q.DIV,J.DIV],[q.DL,J.DL],[q.DT,J.DT],[q.EM,J.EM],[q.EMBED,J.EMBED],[q.FIELDSET,J.FIELDSET],[q.FIGCAPTION,J.FIGCAPTION],[q.FIGURE,J.FIGURE],[q.FONT,J.FONT],[q.FOOTER,J.FOOTER],[q.FOREIGN_OBJECT,J.FOREIGN_OBJECT],[q.FORM,J.FORM],[q.FRAME,J.FRAME],[q.FRAMESET,J.FRAMESET],[q.H1,J.H1],[q.H2,J.H2],[q.H3,J.H3],[q.H4,J.H4],[q.H5,J.H5],[q.H6,J.H6],[q.HEAD,J.HEAD],[q.HEADER,J.HEADER],[q.HGROUP,J.HGROUP],[q.HR,J.HR],[q.HTML,J.HTML],[q.I,J.I],[q.IMG,J.IMG],[q.IMAGE,J.IMAGE],[q.INPUT,J.INPUT],[q.IFRAME,J.IFRAME],[q.KEYGEN,J.KEYGEN],[q.LABEL,J.LABEL],[q.LI,J.LI],[q.LINK,J.LINK],[q.LISTING,J.LISTING],[q.MAIN,J.MAIN],[q.MALIGNMARK,J.MALIGNMARK],[q.MARQUEE,J.MARQUEE],[q.MATH,J.MATH],[q.MENU,J.MENU],[q.META,J.META],[q.MGLYPH,J.MGLYPH],[q.MI,J.MI],[q.MO,J.MO],[q.MN,J.MN],[q.MS,J.MS],[q.MTEXT,J.MTEXT],[q.NAV,J.NAV],[q.NOBR,J.NOBR],[q.NOFRAMES,J.NOFRAMES],[q.NOEMBED,J.NOEMBED],[q.NOSCRIPT,J.NOSCRIPT],[q.OBJECT,J.OBJECT],[q.OL,J.OL],[q.OPTGROUP,J.OPTGROUP],[q.OPTION,J.OPTION],[q.P,J.P],[q.PARAM,J.PARAM],[q.PLAINTEXT,J.PLAINTEXT],[q.PRE,J.PRE],[q.RB,J.RB],[q.RP,J.RP],[q.RT,J.RT],[q.RTC,J.RTC],[q.RUBY,J.RUBY],[q.S,J.S],[q.SCRIPT,J.SCRIPT],[q.SEARCH,J.SEARCH],[q.SECTION,J.SECTION],[q.SELECT,J.SELECT],[q.SOURCE,J.SOURCE],[q.SMALL,J.SMALL],[q.SPAN,J.SPAN],[q.STRIKE,J.STRIKE],[q.STRONG,J.STRONG],[q.STYLE,J.STYLE],[q.SUB,J.SUB],[q.SUMMARY,J.SUMMARY],[q.SUP,J.SUP],[q.TABLE,J.TABLE],[q.TBODY,J.TBODY],[q.TEMPLATE,J.TEMPLATE],[q.TEXTAREA,J.TEXTAREA],[q.TFOOT,J.TFOOT],[q.TD,J.TD],[q.TH,J.TH],[q.THEAD,J.THEAD],[q.TITLE,J.TITLE],[q.TR,J.TR],[q.TRACK,J.TRACK],[q.TT,J.TT],[q.U,J.U],[q.UL,J.UL],[q.SVG,J.SVG],[q.VAR,J.VAR],[q.WBR,J.WBR],[q.XMP,J.XMP]]);function FZ(e){return gat.get(e)??J.UNKNOWN}var Y=J,_at={[K.HTML]:new Set([Y.ADDRESS,Y.APPLET,Y.AREA,Y.ARTICLE,Y.ASIDE,Y.BASE,Y.BASEFONT,Y.BGSOUND,Y.BLOCKQUOTE,Y.BODY,Y.BR,Y.BUTTON,Y.CAPTION,Y.CENTER,Y.COL,Y.COLGROUP,Y.DD,Y.DETAILS,Y.DIR,Y.DIV,Y.DL,Y.DT,Y.EMBED,Y.FIELDSET,Y.FIGCAPTION,Y.FIGURE,Y.FOOTER,Y.FORM,Y.FRAME,Y.FRAMESET,Y.H1,Y.H2,Y.H3,Y.H4,Y.H5,Y.H6,Y.HEAD,Y.HEADER,Y.HGROUP,Y.HR,Y.HTML,Y.IFRAME,Y.IMG,Y.INPUT,Y.LI,Y.LINK,Y.LISTING,Y.MAIN,Y.MARQUEE,Y.MENU,Y.META,Y.NAV,Y.NOEMBED,Y.NOFRAMES,Y.NOSCRIPT,Y.OBJECT,Y.OL,Y.P,Y.PARAM,Y.PLAINTEXT,Y.PRE,Y.SCRIPT,Y.SECTION,Y.SELECT,Y.SOURCE,Y.STYLE,Y.SUMMARY,Y.TABLE,Y.TBODY,Y.TD,Y.TEMPLATE,Y.TEXTAREA,Y.TFOOT,Y.TH,Y.THEAD,Y.TITLE,Y.TR,Y.TRACK,Y.UL,Y.WBR,Y.XMP]),[K.MATHML]:new Set([Y.MI,Y.MO,Y.MN,Y.MS,Y.MTEXT,Y.ANNOTATION_XML]),[K.SVG]:new Set([Y.TITLE,Y.FOREIGN_OBJECT,Y.DESC]),[K.XLINK]:new Set,[K.XML]:new Set,[K.XMLNS]:new Set},IZ=new Set([Y.H1,Y.H2,Y.H3,Y.H4,Y.H5,Y.H6]);new Set([q.STYLE,q.SCRIPT,q.XMP,q.IFRAME,q.NOEMBED,q.NOFRAMES,q.PLAINTEXT]);var X;(function(e){e[e.DATA=0]=`DATA`,e[e.RCDATA=1]=`RCDATA`,e[e.RAWTEXT=2]=`RAWTEXT`,e[e.SCRIPT_DATA=3]=`SCRIPT_DATA`,e[e.PLAINTEXT=4]=`PLAINTEXT`,e[e.TAG_OPEN=5]=`TAG_OPEN`,e[e.END_TAG_OPEN=6]=`END_TAG_OPEN`,e[e.TAG_NAME=7]=`TAG_NAME`,e[e.RCDATA_LESS_THAN_SIGN=8]=`RCDATA_LESS_THAN_SIGN`,e[e.RCDATA_END_TAG_OPEN=9]=`RCDATA_END_TAG_OPEN`,e[e.RCDATA_END_TAG_NAME=10]=`RCDATA_END_TAG_NAME`,e[e.RAWTEXT_LESS_THAN_SIGN=11]=`RAWTEXT_LESS_THAN_SIGN`,e[e.RAWTEXT_END_TAG_OPEN=12]=`RAWTEXT_END_TAG_OPEN`,e[e.RAWTEXT_END_TAG_NAME=13]=`RAWTEXT_END_TAG_NAME`,e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]=`SCRIPT_DATA_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_END_TAG_OPEN=15]=`SCRIPT_DATA_END_TAG_OPEN`,e[e.SCRIPT_DATA_END_TAG_NAME=16]=`SCRIPT_DATA_END_TAG_NAME`,e[e.SCRIPT_DATA_ESCAPE_START=17]=`SCRIPT_DATA_ESCAPE_START`,e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]=`SCRIPT_DATA_ESCAPE_START_DASH`,e[e.SCRIPT_DATA_ESCAPED=19]=`SCRIPT_DATA_ESCAPED`,e[e.SCRIPT_DATA_ESCAPED_DASH=20]=`SCRIPT_DATA_ESCAPED_DASH`,e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]=`SCRIPT_DATA_ESCAPED_DASH_DASH`,e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]=`SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]=`SCRIPT_DATA_ESCAPED_END_TAG_OPEN`,e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]=`SCRIPT_DATA_ESCAPED_END_TAG_NAME`,e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]=`SCRIPT_DATA_DOUBLE_ESCAPE_START`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]=`SCRIPT_DATA_DOUBLE_ESCAPED`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]=`SCRIPT_DATA_DOUBLE_ESCAPED_DASH`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]=`SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]=`SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]=`SCRIPT_DATA_DOUBLE_ESCAPE_END`,e[e.BEFORE_ATTRIBUTE_NAME=31]=`BEFORE_ATTRIBUTE_NAME`,e[e.ATTRIBUTE_NAME=32]=`ATTRIBUTE_NAME`,e[e.AFTER_ATTRIBUTE_NAME=33]=`AFTER_ATTRIBUTE_NAME`,e[e.BEFORE_ATTRIBUTE_VALUE=34]=`BEFORE_ATTRIBUTE_VALUE`,e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]=`ATTRIBUTE_VALUE_DOUBLE_QUOTED`,e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]=`ATTRIBUTE_VALUE_SINGLE_QUOTED`,e[e.ATTRIBUTE_VALUE_UNQUOTED=37]=`ATTRIBUTE_VALUE_UNQUOTED`,e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]=`AFTER_ATTRIBUTE_VALUE_QUOTED`,e[e.SELF_CLOSING_START_TAG=39]=`SELF_CLOSING_START_TAG`,e[e.BOGUS_COMMENT=40]=`BOGUS_COMMENT`,e[e.MARKUP_DECLARATION_OPEN=41]=`MARKUP_DECLARATION_OPEN`,e[e.COMMENT_START=42]=`COMMENT_START`,e[e.COMMENT_START_DASH=43]=`COMMENT_START_DASH`,e[e.COMMENT=44]=`COMMENT`,e[e.COMMENT_LESS_THAN_SIGN=45]=`COMMENT_LESS_THAN_SIGN`,e[e.COMMENT_LESS_THAN_SIGN_BANG=46]=`COMMENT_LESS_THAN_SIGN_BANG`,e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]=`COMMENT_LESS_THAN_SIGN_BANG_DASH`,e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]=`COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH`,e[e.COMMENT_END_DASH=49]=`COMMENT_END_DASH`,e[e.COMMENT_END=50]=`COMMENT_END`,e[e.COMMENT_END_BANG=51]=`COMMENT_END_BANG`,e[e.DOCTYPE=52]=`DOCTYPE`,e[e.BEFORE_DOCTYPE_NAME=53]=`BEFORE_DOCTYPE_NAME`,e[e.DOCTYPE_NAME=54]=`DOCTYPE_NAME`,e[e.AFTER_DOCTYPE_NAME=55]=`AFTER_DOCTYPE_NAME`,e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]=`AFTER_DOCTYPE_PUBLIC_KEYWORD`,e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]=`BEFORE_DOCTYPE_PUBLIC_IDENTIFIER`,e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]=`DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED`,e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]=`DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED`,e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]=`AFTER_DOCTYPE_PUBLIC_IDENTIFIER`,e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]=`BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS`,e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]=`AFTER_DOCTYPE_SYSTEM_KEYWORD`,e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]=`BEFORE_DOCTYPE_SYSTEM_IDENTIFIER`,e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]=`DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED`,e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]=`DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED`,e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]=`AFTER_DOCTYPE_SYSTEM_IDENTIFIER`,e[e.BOGUS_DOCTYPE=67]=`BOGUS_DOCTYPE`,e[e.CDATA_SECTION=68]=`CDATA_SECTION`,e[e.CDATA_SECTION_BRACKET=69]=`CDATA_SECTION_BRACKET`,e[e.CDATA_SECTION_END=70]=`CDATA_SECTION_END`,e[e.CHARACTER_REFERENCE=71]=`CHARACTER_REFERENCE`,e[e.AMBIGUOUS_AMPERSAND=72]=`AMBIGUOUS_AMPERSAND`})(X||={});var LZ={DATA:X.DATA,RCDATA:X.RCDATA,RAWTEXT:X.RAWTEXT,SCRIPT_DATA:X.SCRIPT_DATA,PLAINTEXT:X.PLAINTEXT,CDATA_SECTION:X.CDATA_SECTION};function vat(e){return e>=W.DIGIT_0&&e<=W.DIGIT_9}function RZ(e){return e>=W.LATIN_CAPITAL_A&&e<=W.LATIN_CAPITAL_Z}function yat(e){return e>=W.LATIN_SMALL_A&&e<=W.LATIN_SMALL_Z}function zZ(e){return yat(e)||RZ(e)}function BZ(e){return zZ(e)||vat(e)}function VZ(e){return e+32}function HZ(e){return e===W.SPACE||e===W.LINE_FEED||e===W.TABULATION||e===W.FORM_FEED}function UZ(e){return HZ(e)||e===W.SOLIDUS||e===W.GREATER_THAN_SIGN}function bat(e){return e===W.NULL?G.nullCharacterReference:e>1114111?G.characterReferenceOutsideUnicodeRange:CZ(e)?G.surrogateCharacterReference:TZ(e)?G.noncharacterCharacterReference:wZ(e)||e===W.CARRIAGE_RETURN?G.controlCharacterReference:null}var xat=class{constructor(e,t){this.options=e,this.handler=t,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName=``,this.active=!1,this.state=X.DATA,this.returnState=X.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:``,value:``},this.preprocessor=new oat(t),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new mat(sat,(e,t)=>{this.preprocessor.pos=this.entityStartPos+t-1,this._flushCodePointConsumedAsCharacterReference(e)},t.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(G.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:e=>{this._err(G.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+e)},validateNumericCharacterReference:e=>{let t=bat(e);t&&this._err(t,1)}}:void 0)}_err(e,t=0){var n,r;(r=(n=this.handler).onParseError)==null||r.call(n,this.preprocessor.getError(e,t))}getCurrentLocation(e){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-e,startOffset:this.preprocessor.offset-e,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;let e=this._consume();this._ensureHibernation()||this._callState(e)}this.inLoop=!1}}pause(){this.paused=!0}resume(e){if(!this.paused)throw Error(`Parser was already resumed`);this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||e?.())}write(e,t,n){this.active=!0,this.preprocessor.write(e,t),this._runParsingLoop(),this.paused||n?.()}insertHtmlAtCurrentPos(e){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(e),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(e){this.consumedAfterSnapshot+=e;for(let t=0;t<e;t++)this.preprocessor.advance()}_consumeSequenceIfMatch(e,t){return this.preprocessor.startsWith(e,t)?(this._advanceBy(e.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:EZ.START_TAG,tagName:``,tagID:J.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:EZ.END_TAG,tagName:``,tagID:J.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(e){this.currentToken={type:EZ.COMMENT,data:``,location:this.getCurrentLocation(e)}}_createDoctypeToken(e){this.currentToken={type:EZ.DOCTYPE,name:e,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(e,t){this.currentCharacterToken={type:e,chars:t,location:this.currentLocation}}_createAttr(e){this.currentAttr={name:e,value:``},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var e;let t=this.currentToken;if(DZ(t,this.currentAttr.name)===null){if(t.attrs.push(this.currentAttr),t.location&&this.currentLocation){let n=(e=t.location).attrs??(e.attrs=Object.create(null));n[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(G.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(e){this._emitCurrentCharacterToken(e.location),this.currentToken=null,e.location&&(e.location.endLine=this.preprocessor.line,e.location.endCol=this.preprocessor.col+1,e.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){let e=this.currentToken;this.prepareToken(e),e.tagID=FZ(e.tagName),e.type===EZ.START_TAG?(this.lastStartTagName=e.tagName,this.handler.onStartTag(e)):(e.attrs.length>0&&this._err(G.endTagWithAttributes),e.selfClosing&&this._err(G.endTagWithTrailingSolidus),this.handler.onEndTag(e)),this.preprocessor.dropParsedChunk()}emitCurrentComment(e){this.prepareToken(e),this.handler.onComment(e),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(e){this.prepareToken(e),this.handler.onDoctype(e),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(e){if(this.currentCharacterToken){switch(e&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=e.startLine,this.currentCharacterToken.location.endCol=e.startCol,this.currentCharacterToken.location.endOffset=e.startOffset),this.currentCharacterToken.type){case EZ.CHARACTER:this.handler.onCharacter(this.currentCharacterToken);break;case EZ.NULL_CHARACTER:this.handler.onNullCharacter(this.currentCharacterToken);break;case EZ.WHITESPACE_CHARACTER:this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}this.currentCharacterToken=null}}_emitEOFToken(){let e=this.getCurrentLocation(0);e&&(e.endLine=e.startLine,e.endCol=e.startCol,e.endOffset=e.startOffset),this._emitCurrentCharacterToken(e),this.handler.onEof({type:EZ.EOF,location:e}),this.active=!1}_appendCharToCurrentCharacterToken(e,t){if(this.currentCharacterToken)if(this.currentCharacterToken.type===e){this.currentCharacterToken.chars+=t;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(e,t)}_emitCodePoint(e){let t=HZ(e)?EZ.WHITESPACE_CHARACTER:e===W.NULL?EZ.NULL_CHARACTER:EZ.CHARACTER;this._appendCharToCurrentCharacterToken(t,String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(EZ.CHARACTER,e)}_startCharacterReference(){this.returnState=this.state,this.state=X.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?MZ.Attribute:MZ.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===X.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===X.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===X.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case X.DATA:this._stateData(e);break;case X.RCDATA:this._stateRcdata(e);break;case X.RAWTEXT:this._stateRawtext(e);break;case X.SCRIPT_DATA:this._stateScriptData(e);break;case X.PLAINTEXT:this._statePlaintext(e);break;case X.TAG_OPEN:this._stateTagOpen(e);break;case X.END_TAG_OPEN:this._stateEndTagOpen(e);break;case X.TAG_NAME:this._stateTagName(e);break;case X.RCDATA_LESS_THAN_SIGN:this._stateRcdataLessThanSign(e);break;case X.RCDATA_END_TAG_OPEN:this._stateRcdataEndTagOpen(e);break;case X.RCDATA_END_TAG_NAME:this._stateRcdataEndTagName(e);break;case X.RAWTEXT_LESS_THAN_SIGN:this._stateRawtextLessThanSign(e);break;case X.RAWTEXT_END_TAG_OPEN:this._stateRawtextEndTagOpen(e);break;case X.RAWTEXT_END_TAG_NAME:this._stateRawtextEndTagName(e);break;case X.SCRIPT_DATA_LESS_THAN_SIGN:this._stateScriptDataLessThanSign(e);break;case X.SCRIPT_DATA_END_TAG_OPEN:this._stateScriptDataEndTagOpen(e);break;case X.SCRIPT_DATA_END_TAG_NAME:this._stateScriptDataEndTagName(e);break;case X.SCRIPT_DATA_ESCAPE_START:this._stateScriptDataEscapeStart(e);break;case X.SCRIPT_DATA_ESCAPE_START_DASH:this._stateScriptDataEscapeStartDash(e);break;case X.SCRIPT_DATA_ESCAPED:this._stateScriptDataEscaped(e);break;case X.SCRIPT_DATA_ESCAPED_DASH:this._stateScriptDataEscapedDash(e);break;case X.SCRIPT_DATA_ESCAPED_DASH_DASH:this._stateScriptDataEscapedDashDash(e);break;case X.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:this._stateScriptDataEscapedLessThanSign(e);break;case X.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:this._stateScriptDataEscapedEndTagOpen(e);break;case X.SCRIPT_DATA_ESCAPED_END_TAG_NAME:this._stateScriptDataEscapedEndTagName(e);break;case X.SCRIPT_DATA_DOUBLE_ESCAPE_START:this._stateScriptDataDoubleEscapeStart(e);break;case X.SCRIPT_DATA_DOUBLE_ESCAPED:this._stateScriptDataDoubleEscaped(e);break;case X.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:this._stateScriptDataDoubleEscapedDash(e);break;case X.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:this._stateScriptDataDoubleEscapedDashDash(e);break;case X.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:this._stateScriptDataDoubleEscapedLessThanSign(e);break;case X.SCRIPT_DATA_DOUBLE_ESCAPE_END:this._stateScriptDataDoubleEscapeEnd(e);break;case X.BEFORE_ATTRIBUTE_NAME:this._stateBeforeAttributeName(e);break;case X.ATTRIBUTE_NAME:this._stateAttributeName(e);break;case X.AFTER_ATTRIBUTE_NAME:this._stateAfterAttributeName(e);break;case X.BEFORE_ATTRIBUTE_VALUE:this._stateBeforeAttributeValue(e);break;case X.ATTRIBUTE_VALUE_DOUBLE_QUOTED:this._stateAttributeValueDoubleQuoted(e);break;case X.ATTRIBUTE_VALUE_SINGLE_QUOTED:this._stateAttributeValueSingleQuoted(e);break;case X.ATTRIBUTE_VALUE_UNQUOTED:this._stateAttributeValueUnquoted(e);break;case X.AFTER_ATTRIBUTE_VALUE_QUOTED:this._stateAfterAttributeValueQuoted(e);break;case X.SELF_CLOSING_START_TAG:this._stateSelfClosingStartTag(e);break;case X.BOGUS_COMMENT:this._stateBogusComment(e);break;case X.MARKUP_DECLARATION_OPEN:this._stateMarkupDeclarationOpen(e);break;case X.COMMENT_START:this._stateCommentStart(e);break;case X.COMMENT_START_DASH:this._stateCommentStartDash(e);break;case X.COMMENT:this._stateComment(e);break;case X.COMMENT_LESS_THAN_SIGN:this._stateCommentLessThanSign(e);break;case X.COMMENT_LESS_THAN_SIGN_BANG:this._stateCommentLessThanSignBang(e);break;case X.COMMENT_LESS_THAN_SIGN_BANG_DASH:this._stateCommentLessThanSignBangDash(e);break;case X.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:this._stateCommentLessThanSignBangDashDash(e);break;case X.COMMENT_END_DASH:this._stateCommentEndDash(e);break;case X.COMMENT_END:this._stateCommentEnd(e);break;case X.COMMENT_END_BANG:this._stateCommentEndBang(e);break;case X.DOCTYPE:this._stateDoctype(e);break;case X.BEFORE_DOCTYPE_NAME:this._stateBeforeDoctypeName(e);break;case X.DOCTYPE_NAME:this._stateDoctypeName(e);break;case X.AFTER_DOCTYPE_NAME:this._stateAfterDoctypeName(e);break;case X.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._stateAfterDoctypePublicKeyword(e);break;case X.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:this._stateBeforeDoctypePublicIdentifier(e);break;case X.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:this._stateDoctypePublicIdentifierDoubleQuoted(e);break;case X.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:this._stateDoctypePublicIdentifierSingleQuoted(e);break;case X.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:this._stateAfterDoctypePublicIdentifier(e);break;case X.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break;case X.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._stateAfterDoctypeSystemKeyword(e);break;case X.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:this._stateBeforeDoctypeSystemIdentifier(e);break;case X.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:this._stateDoctypeSystemIdentifierDoubleQuoted(e);break;case X.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:this._stateDoctypeSystemIdentifierSingleQuoted(e);break;case X.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:this._stateAfterDoctypeSystemIdentifier(e);break;case X.BOGUS_DOCTYPE:this._stateBogusDoctype(e);break;case X.CDATA_SECTION:this._stateCdataSection(e);break;case X.CDATA_SECTION_BRACKET:this._stateCdataSectionBracket(e);break;case X.CDATA_SECTION_END:this._stateCdataSectionEnd(e);break;case X.CHARACTER_REFERENCE:this._stateCharacterReference();break;case X.AMBIGUOUS_AMPERSAND:this._stateAmbiguousAmpersand(e);break;default:throw Error(`Unknown state`)}}_stateData(e){switch(e){case W.LESS_THAN_SIGN:this.state=X.TAG_OPEN;break;case W.AMPERSAND:this._startCharacterReference();break;case W.NULL:this._err(G.unexpectedNullCharacter),this._emitCodePoint(e);break;case W.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case W.AMPERSAND:this._startCharacterReference();break;case W.LESS_THAN_SIGN:this.state=X.RCDATA_LESS_THAN_SIGN;break;case W.NULL:this._err(G.unexpectedNullCharacter),this._emitChars(`�`);break;case W.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case W.LESS_THAN_SIGN:this.state=X.RAWTEXT_LESS_THAN_SIGN;break;case W.NULL:this._err(G.unexpectedNullCharacter),this._emitChars(`�`);break;case W.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case W.LESS_THAN_SIGN:this.state=X.SCRIPT_DATA_LESS_THAN_SIGN;break;case W.NULL:this._err(G.unexpectedNullCharacter),this._emitChars(`�`);break;case W.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case W.NULL:this._err(G.unexpectedNullCharacter),this._emitChars(`�`);break;case W.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateTagOpen(e){if(zZ(e))this._createStartTagToken(),this.state=X.TAG_NAME,this._stateTagName(e);else switch(e){case W.EXCLAMATION_MARK:this.state=X.MARKUP_DECLARATION_OPEN;break;case W.SOLIDUS:this.state=X.END_TAG_OPEN;break;case W.QUESTION_MARK:this._err(G.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=X.BOGUS_COMMENT,this._stateBogusComment(e);break;case W.EOF:this._err(G.eofBeforeTagName),this._emitChars(`<`),this._emitEOFToken();break;default:this._err(G.invalidFirstCharacterOfTagName),this._emitChars(`<`),this.state=X.DATA,this._stateData(e)}}_stateEndTagOpen(e){if(zZ(e))this._createEndTagToken(),this.state=X.TAG_NAME,this._stateTagName(e);else switch(e){case W.GREATER_THAN_SIGN:this._err(G.missingEndTagName),this.state=X.DATA;break;case W.EOF:this._err(G.eofBeforeTagName),this._emitChars(`</`),this._emitEOFToken();break;default:this._err(G.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=X.BOGUS_COMMENT,this._stateBogusComment(e)}}_stateTagName(e){let t=this.currentToken;switch(e){case W.SPACE:case W.LINE_FEED:case W.TABULATION:case W.FORM_FEED:this.state=X.BEFORE_ATTRIBUTE_NAME;break;case W.SOLIDUS:this.state=X.SELF_CLOSING_START_TAG;break;case W.GREATER_THAN_SIGN:this.state=X.DATA,this.emitCurrentTagToken();break;case W.NULL:this._err(G.unexpectedNullCharacter),t.tagName+=`�`;break;case W.EOF:this._err(G.eofInTag),this._emitEOFToken();break;default:t.tagName+=String.fromCodePoint(RZ(e)?VZ(e):e)}}_stateRcdataLessThanSign(e){e===W.SOLIDUS?this.state=X.RCDATA_END_TAG_OPEN:(this._emitChars(`<`),this.state=X.RCDATA,this._stateRcdata(e))}_stateRcdataEndTagOpen(e){zZ(e)?(this.state=X.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(e)):(this._emitChars(`</`),this.state=X.RCDATA,this._stateRcdata(e))}handleSpecialEndTag(e){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();let t=this.currentToken;switch(t.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case W.SPACE:case W.LINE_FEED:case W.TABULATION:case W.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=X.BEFORE_ATTRIBUTE_NAME,!1;case W.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=X.SELF_CLOSING_START_TAG,!1;case W.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=X.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=X.RCDATA,this._stateRcdata(e))}_stateRawtextLessThanSign(e){e===W.SOLIDUS?this.state=X.RAWTEXT_END_TAG_OPEN:(this._emitChars(`<`),this.state=X.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagOpen(e){zZ(e)?(this.state=X.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(e)):(this._emitChars(`</`),this.state=X.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=X.RAWTEXT,this._stateRawtext(e))}_stateScriptDataLessThanSign(e){switch(e){case W.SOLIDUS:this.state=X.SCRIPT_DATA_END_TAG_OPEN;break;case W.EXCLAMATION_MARK:this.state=X.SCRIPT_DATA_ESCAPE_START,this._emitChars(`<!`);break;default:this._emitChars(`<`),this.state=X.SCRIPT_DATA,this._stateScriptData(e)}}_stateScriptDataEndTagOpen(e){zZ(e)?(this.state=X.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(e)):(this._emitChars(`</`),this.state=X.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=X.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStart(e){e===W.HYPHEN_MINUS?(this.state=X.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars(`-`)):(this.state=X.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStartDash(e){e===W.HYPHEN_MINUS?(this.state=X.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars(`-`)):(this.state=X.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscaped(e){switch(e){case W.HYPHEN_MINUS:this.state=X.SCRIPT_DATA_ESCAPED_DASH,this._emitChars(`-`);break;case W.LESS_THAN_SIGN:this.state=X.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case W.NULL:this._err(G.unexpectedNullCharacter),this._emitChars(`�`);break;case W.EOF:this._err(G.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptDataEscapedDash(e){switch(e){case W.HYPHEN_MINUS:this.state=X.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars(`-`);break;case W.LESS_THAN_SIGN:this.state=X.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case W.NULL:this._err(G.unexpectedNullCharacter),this.state=X.SCRIPT_DATA_ESCAPED,this._emitChars(`�`);break;case W.EOF:this._err(G.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=X.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedDashDash(e){switch(e){case W.HYPHEN_MINUS:this._emitChars(`-`);break;case W.LESS_THAN_SIGN:this.state=X.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case W.GREATER_THAN_SIGN:this.state=X.SCRIPT_DATA,this._emitChars(`>`);break;case W.NULL:this._err(G.unexpectedNullCharacter),this.state=X.SCRIPT_DATA_ESCAPED,this._emitChars(`�`);break;case W.EOF:this._err(G.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=X.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===W.SOLIDUS?this.state=X.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:zZ(e)?(this._emitChars(`<`),this.state=X.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars(`<`),this.state=X.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){zZ(e)?(this.state=X.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars(`</`),this.state=X.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=X.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscapeStart(e){if(this.preprocessor.startsWith(SZ.SCRIPT,!1)&&UZ(this.preprocessor.peek(SZ.SCRIPT.length))){this._emitCodePoint(e);for(let e=0;e<SZ.SCRIPT.length;e++)this._emitCodePoint(this._consume());this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=X.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscaped(e){switch(e){case W.HYPHEN_MINUS:this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars(`-`);break;case W.LESS_THAN_SIGN:this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case W.NULL:this._err(G.unexpectedNullCharacter),this._emitChars(`�`);break;case W.EOF:this._err(G.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDash(e){switch(e){case W.HYPHEN_MINUS:this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars(`-`);break;case W.LESS_THAN_SIGN:this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case W.NULL:this._err(G.unexpectedNullCharacter),this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(`�`);break;case W.EOF:this._err(G.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDashDash(e){switch(e){case W.HYPHEN_MINUS:this._emitChars(`-`);break;case W.LESS_THAN_SIGN:this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case W.GREATER_THAN_SIGN:this.state=X.SCRIPT_DATA,this._emitChars(`>`);break;case W.NULL:this._err(G.unexpectedNullCharacter),this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(`�`);break;case W.EOF:this._err(G.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===W.SOLIDUS?(this.state=X.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars(`/`)):(this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(SZ.SCRIPT,!1)&&UZ(this.preprocessor.peek(SZ.SCRIPT.length))){this._emitCodePoint(e);for(let e=0;e<SZ.SCRIPT.length;e++)this._emitCodePoint(this._consume());this.state=X.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateBeforeAttributeName(e){switch(e){case W.SPACE:case W.LINE_FEED:case W.TABULATION:case W.FORM_FEED:break;case W.SOLIDUS:case W.GREATER_THAN_SIGN:case W.EOF:this.state=X.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break;case W.EQUALS_SIGN:this._err(G.unexpectedEqualsSignBeforeAttributeName),this._createAttr(`=`),this.state=X.ATTRIBUTE_NAME;break;default:this._createAttr(``),this.state=X.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateAttributeName(e){switch(e){case W.SPACE:case W.LINE_FEED:case W.TABULATION:case W.FORM_FEED:case W.SOLIDUS:case W.GREATER_THAN_SIGN:case W.EOF:this._leaveAttrName(),this.state=X.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break;case W.EQUALS_SIGN:this._leaveAttrName(),this.state=X.BEFORE_ATTRIBUTE_VALUE;break;case W.QUOTATION_MARK:case W.APOSTROPHE:case W.LESS_THAN_SIGN:this._err(G.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(e);break;case W.NULL:this._err(G.unexpectedNullCharacter),this.currentAttr.name+=`�`;break;default:this.currentAttr.name+=String.fromCodePoint(RZ(e)?VZ(e):e)}}_stateAfterAttributeName(e){switch(e){case W.SPACE:case W.LINE_FEED:case W.TABULATION:case W.FORM_FEED:break;case W.SOLIDUS:this.state=X.SELF_CLOSING_START_TAG;break;case W.EQUALS_SIGN:this.state=X.BEFORE_ATTRIBUTE_VALUE;break;case W.GREATER_THAN_SIGN:this.state=X.DATA,this.emitCurrentTagToken();break;case W.EOF:this._err(G.eofInTag),this._emitEOFToken();break;default:this._createAttr(``),this.state=X.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateBeforeAttributeValue(e){switch(e){case W.SPACE:case W.LINE_FEED:case W.TABULATION:case W.FORM_FEED:break;case W.QUOTATION_MARK:this.state=X.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break;case W.APOSTROPHE:this.state=X.ATTRIBUTE_VALUE_SINGLE_QUOTED;break;case W.GREATER_THAN_SIGN:this._err(G.missingAttributeValue),this.state=X.DATA,this.emitCurrentTagToken();break;default:this.state=X.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(e)}}_stateAttributeValueDoubleQuoted(e){switch(e){case W.QUOTATION_MARK:this.state=X.AFTER_ATTRIBUTE_VALUE_QUOTED;break;case W.AMPERSAND:this._startCharacterReference();break;case W.NULL:this._err(G.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case W.EOF:this._err(G.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueSingleQuoted(e){switch(e){case W.APOSTROPHE:this.state=X.AFTER_ATTRIBUTE_VALUE_QUOTED;break;case W.AMPERSAND:this._startCharacterReference();break;case W.NULL:this._err(G.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case W.EOF:this._err(G.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueUnquoted(e){switch(e){case W.SPACE:case W.LINE_FEED:case W.TABULATION:case W.FORM_FEED:this._leaveAttrValue(),this.state=X.BEFORE_ATTRIBUTE_NAME;break;case W.AMPERSAND:this._startCharacterReference();break;case W.GREATER_THAN_SIGN:this._leaveAttrValue(),this.state=X.DATA,this.emitCurrentTagToken();break;case W.NULL:this._err(G.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case W.QUOTATION_MARK:case W.APOSTROPHE:case W.LESS_THAN_SIGN:case W.EQUALS_SIGN:case W.GRAVE_ACCENT:this._err(G.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(e);break;case W.EOF:this._err(G.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAfterAttributeValueQuoted(e){switch(e){case W.SPACE:case W.LINE_FEED:case W.TABULATION:case W.FORM_FEED:this._leaveAttrValue(),this.state=X.BEFORE_ATTRIBUTE_NAME;break;case W.SOLIDUS:this._leaveAttrValue(),this.state=X.SELF_CLOSING_START_TAG;break;case W.GREATER_THAN_SIGN:this._leaveAttrValue(),this.state=X.DATA,this.emitCurrentTagToken();break;case W.EOF:this._err(G.eofInTag),this._emitEOFToken();break;default:this._err(G.missingWhitespaceBetweenAttributes),this.state=X.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateSelfClosingStartTag(e){switch(e){case W.GREATER_THAN_SIGN:{let e=this.currentToken;e.selfClosing=!0,this.state=X.DATA,this.emitCurrentTagToken();break}case W.EOF:this._err(G.eofInTag),this._emitEOFToken();break;default:this._err(G.unexpectedSolidusInTag),this.state=X.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateBogusComment(e){let t=this.currentToken;switch(e){case W.GREATER_THAN_SIGN:this.state=X.DATA,this.emitCurrentComment(t);break;case W.EOF:this.emitCurrentComment(t),this._emitEOFToken();break;case W.NULL:this._err(G.unexpectedNullCharacter),t.data+=`�`;break;default:t.data+=String.fromCodePoint(e)}}_stateMarkupDeclarationOpen(e){this._consumeSequenceIfMatch(SZ.DASH_DASH,!0)?(this._createCommentToken(SZ.DASH_DASH.length+1),this.state=X.COMMENT_START):this._consumeSequenceIfMatch(SZ.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(SZ.DOCTYPE.length+1),this.state=X.DOCTYPE):this._consumeSequenceIfMatch(SZ.CDATA_START,!0)?this.inForeignNode?this.state=X.CDATA_SECTION:(this._err(G.cdataInHtmlContent),this._createCommentToken(SZ.CDATA_START.length+1),this.currentToken.data=`[CDATA[`,this.state=X.BOGUS_COMMENT):this._ensureHibernation()||(this._err(G.incorrectlyOpenedComment),this._createCommentToken(2),this.state=X.BOGUS_COMMENT,this._stateBogusComment(e))}_stateCommentStart(e){switch(e){case W.HYPHEN_MINUS:this.state=X.COMMENT_START_DASH;break;case W.GREATER_THAN_SIGN:{this._err(G.abruptClosingOfEmptyComment),this.state=X.DATA;let e=this.currentToken;this.emitCurrentComment(e);break}default:this.state=X.COMMENT,this._stateComment(e)}}_stateCommentStartDash(e){let t=this.currentToken;switch(e){case W.HYPHEN_MINUS:this.state=X.COMMENT_END;break;case W.GREATER_THAN_SIGN:this._err(G.abruptClosingOfEmptyComment),this.state=X.DATA,this.emitCurrentComment(t);break;case W.EOF:this._err(G.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`-`,this.state=X.COMMENT,this._stateComment(e)}}_stateComment(e){let t=this.currentToken;switch(e){case W.HYPHEN_MINUS:this.state=X.COMMENT_END_DASH;break;case W.LESS_THAN_SIGN:t.data+=`<`,this.state=X.COMMENT_LESS_THAN_SIGN;break;case W.NULL:this._err(G.unexpectedNullCharacter),t.data+=`�`;break;case W.EOF:this._err(G.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=String.fromCodePoint(e)}}_stateCommentLessThanSign(e){let t=this.currentToken;switch(e){case W.EXCLAMATION_MARK:t.data+=`!`,this.state=X.COMMENT_LESS_THAN_SIGN_BANG;break;case W.LESS_THAN_SIGN:t.data+=`<`;break;default:this.state=X.COMMENT,this._stateComment(e)}}_stateCommentLessThanSignBang(e){e===W.HYPHEN_MINUS?this.state=X.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=X.COMMENT,this._stateComment(e))}_stateCommentLessThanSignBangDash(e){e===W.HYPHEN_MINUS?this.state=X.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=X.COMMENT_END_DASH,this._stateCommentEndDash(e))}_stateCommentLessThanSignBangDashDash(e){e!==W.GREATER_THAN_SIGN&&e!==W.EOF&&this._err(G.nestedComment),this.state=X.COMMENT_END,this._stateCommentEnd(e)}_stateCommentEndDash(e){let t=this.currentToken;switch(e){case W.HYPHEN_MINUS:this.state=X.COMMENT_END;break;case W.EOF:this._err(G.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`-`,this.state=X.COMMENT,this._stateComment(e)}}_stateCommentEnd(e){let t=this.currentToken;switch(e){case W.GREATER_THAN_SIGN:this.state=X.DATA,this.emitCurrentComment(t);break;case W.EXCLAMATION_MARK:this.state=X.COMMENT_END_BANG;break;case W.HYPHEN_MINUS:t.data+=`-`;break;case W.EOF:this._err(G.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`--`,this.state=X.COMMENT,this._stateComment(e)}}_stateCommentEndBang(e){let t=this.currentToken;switch(e){case W.HYPHEN_MINUS:t.data+=`--!`,this.state=X.COMMENT_END_DASH;break;case W.GREATER_THAN_SIGN:this._err(G.incorrectlyClosedComment),this.state=X.DATA,this.emitCurrentComment(t);break;case W.EOF:this._err(G.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`--!`,this.state=X.COMMENT,this._stateComment(e)}}_stateDoctype(e){switch(e){case W.SPACE:case W.LINE_FEED:case W.TABULATION:case W.FORM_FEED:this.state=X.BEFORE_DOCTYPE_NAME;break;case W.GREATER_THAN_SIGN:this.state=X.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e);break;case W.EOF:{this._err(G.eofInDoctype),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this._emitEOFToken();break}default:this._err(G.missingWhitespaceBeforeDoctypeName),this.state=X.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e)}}_stateBeforeDoctypeName(e){if(RZ(e))this._createDoctypeToken(String.fromCharCode(VZ(e))),this.state=X.DOCTYPE_NAME;else switch(e){case W.SPACE:case W.LINE_FEED:case W.TABULATION:case W.FORM_FEED:break;case W.NULL:this._err(G.unexpectedNullCharacter),this._createDoctypeToken(`�`),this.state=X.DOCTYPE_NAME;break;case W.GREATER_THAN_SIGN:{this._err(G.missingDoctypeName),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this.state=X.DATA;break}case W.EOF:{this._err(G.eofInDoctype),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(e)),this.state=X.DOCTYPE_NAME}}_stateDoctypeName(e){let t=this.currentToken;switch(e){case W.SPACE:case W.LINE_FEED:case W.TABULATION:case W.FORM_FEED:this.state=X.AFTER_DOCTYPE_NAME;break;case W.GREATER_THAN_SIGN:this.state=X.DATA,this.emitCurrentDoctype(t);break;case W.NULL:this._err(G.unexpectedNullCharacter),t.name+=`�`;break;case W.EOF:this._err(G.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.name+=String.fromCodePoint(RZ(e)?VZ(e):e)}}_stateAfterDoctypeName(e){let t=this.currentToken;switch(e){case W.SPACE:case W.LINE_FEED:case W.TABULATION:case W.FORM_FEED:break;case W.GREATER_THAN_SIGN:this.state=X.DATA,this.emitCurrentDoctype(t);break;case W.EOF:this._err(G.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._consumeSequenceIfMatch(SZ.PUBLIC,!1)?this.state=X.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(SZ.SYSTEM,!1)?this.state=X.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(G.invalidCharacterSequenceAfterDoctypeName),t.forceQuirks=!0,this.state=X.BOGUS_DOCTYPE,this._stateBogusDoctype(e))}}_stateAfterDoctypePublicKeyword(e){let t=this.currentToken;switch(e){case W.SPACE:case W.LINE_FEED:case W.TABULATION:case W.FORM_FEED:this.state=X.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break;case W.QUOTATION_MARK:this._err(G.missingWhitespaceAfterDoctypePublicKeyword),t.publicId=``,this.state=X.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break;case W.APOSTROPHE:this._err(G.missingWhitespaceAfterDoctypePublicKeyword),t.publicId=``,this.state=X.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break;case W.GREATER_THAN_SIGN:this._err(G.missingDoctypePublicIdentifier),t.forceQuirks=!0,this.state=X.DATA,this.emitCurrentDoctype(t);break;case W.EOF:this._err(G.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(G.missingQuoteBeforeDoctypePublicIdentifier),t.forceQuirks=!0,this.state=X.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypePublicIdentifier(e){let t=this.currentToken;switch(e){case W.SPACE:case W.LINE_FEED:case W.TABULATION:case W.FORM_FEED:break;case W.QUOTATION_MARK:t.publicId=``,this.state=X.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break;case W.APOSTROPHE:t.publicId=``,this.state=X.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break;case W.GREATER_THAN_SIGN:this._err(G.missingDoctypePublicIdentifier),t.forceQuirks=!0,this.state=X.DATA,this.emitCurrentDoctype(t);break;case W.EOF:this._err(G.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(G.missingQuoteBeforeDoctypePublicIdentifier),t.forceQuirks=!0,this.state=X.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypePublicIdentifierDoubleQuoted(e){let t=this.currentToken;switch(e){case W.QUOTATION_MARK:this.state=X.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break;case W.NULL:this._err(G.unexpectedNullCharacter),t.publicId+=`�`;break;case W.GREATER_THAN_SIGN:this._err(G.abruptDoctypePublicIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=X.DATA;break;case W.EOF:this._err(G.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.publicId+=String.fromCodePoint(e)}}_stateDoctypePublicIdentifierSingleQuoted(e){let t=this.currentToken;switch(e){case W.APOSTROPHE:this.state=X.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break;case W.NULL:this._err(G.unexpectedNullCharacter),t.publicId+=`�`;break;case W.GREATER_THAN_SIGN:this._err(G.abruptDoctypePublicIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=X.DATA;break;case W.EOF:this._err(G.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.publicId+=String.fromCodePoint(e)}}_stateAfterDoctypePublicIdentifier(e){let t=this.currentToken;switch(e){case W.SPACE:case W.LINE_FEED:case W.TABULATION:case W.FORM_FEED:this.state=X.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break;case W.GREATER_THAN_SIGN:this.state=X.DATA,this.emitCurrentDoctype(t);break;case W.QUOTATION_MARK:this._err(G.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),t.systemId=``,this.state=X.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case W.APOSTROPHE:this._err(G.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),t.systemId=``,this.state=X.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case W.EOF:this._err(G.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(G.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=X.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBetweenDoctypePublicAndSystemIdentifiers(e){let t=this.currentToken;switch(e){case W.SPACE:case W.LINE_FEED:case W.TABULATION:case W.FORM_FEED:break;case W.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=X.DATA;break;case W.QUOTATION_MARK:t.systemId=``,this.state=X.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case W.APOSTROPHE:t.systemId=``,this.state=X.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case W.EOF:this._err(G.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(G.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=X.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateAfterDoctypeSystemKeyword(e){let t=this.currentToken;switch(e){case W.SPACE:case W.LINE_FEED:case W.TABULATION:case W.FORM_FEED:this.state=X.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break;case W.QUOTATION_MARK:this._err(G.missingWhitespaceAfterDoctypeSystemKeyword),t.systemId=``,this.state=X.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case W.APOSTROPHE:this._err(G.missingWhitespaceAfterDoctypeSystemKeyword),t.systemId=``,this.state=X.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case W.GREATER_THAN_SIGN:this._err(G.missingDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=X.DATA,this.emitCurrentDoctype(t);break;case W.EOF:this._err(G.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(G.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=X.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypeSystemIdentifier(e){let t=this.currentToken;switch(e){case W.SPACE:case W.LINE_FEED:case W.TABULATION:case W.FORM_FEED:break;case W.QUOTATION_MARK:t.systemId=``,this.state=X.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case W.APOSTROPHE:t.systemId=``,this.state=X.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case W.GREATER_THAN_SIGN:this._err(G.missingDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=X.DATA,this.emitCurrentDoctype(t);break;case W.EOF:this._err(G.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(G.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=X.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypeSystemIdentifierDoubleQuoted(e){let t=this.currentToken;switch(e){case W.QUOTATION_MARK:this.state=X.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break;case W.NULL:this._err(G.unexpectedNullCharacter),t.systemId+=`�`;break;case W.GREATER_THAN_SIGN:this._err(G.abruptDoctypeSystemIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=X.DATA;break;case W.EOF:this._err(G.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.systemId+=String.fromCodePoint(e)}}_stateDoctypeSystemIdentifierSingleQuoted(e){let t=this.currentToken;switch(e){case W.APOSTROPHE:this.state=X.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break;case W.NULL:this._err(G.unexpectedNullCharacter),t.systemId+=`�`;break;case W.GREATER_THAN_SIGN:this._err(G.abruptDoctypeSystemIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=X.DATA;break;case W.EOF:this._err(G.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.systemId+=String.fromCodePoint(e)}}_stateAfterDoctypeSystemIdentifier(e){let t=this.currentToken;switch(e){case W.SPACE:case W.LINE_FEED:case W.TABULATION:case W.FORM_FEED:break;case W.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=X.DATA;break;case W.EOF:this._err(G.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(G.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=X.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBogusDoctype(e){let t=this.currentToken;switch(e){case W.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=X.DATA;break;case W.NULL:this._err(G.unexpectedNullCharacter);break;case W.EOF:this.emitCurrentDoctype(t),this._emitEOFToken();break;default:}}_stateCdataSection(e){switch(e){case W.RIGHT_SQUARE_BRACKET:this.state=X.CDATA_SECTION_BRACKET;break;case W.EOF:this._err(G.eofInCdata),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateCdataSectionBracket(e){e===W.RIGHT_SQUARE_BRACKET?this.state=X.CDATA_SECTION_END:(this._emitChars(`]`),this.state=X.CDATA_SECTION,this._stateCdataSection(e))}_stateCdataSectionEnd(e){switch(e){case W.GREATER_THAN_SIGN:this.state=X.DATA;break;case W.RIGHT_SQUARE_BRACKET:this._emitChars(`]`);break;default:this._emitChars(`]]`),this.state=X.CDATA_SECTION,this._stateCdataSection(e)}}_stateCharacterReference(){let e=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(e<0)if(this.preprocessor.lastChunkWritten)e=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}e===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(W.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&BZ(this.preprocessor.peek(1))?X.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(e){BZ(e)?this._flushCodePointConsumedAsCharacterReference(e):(e===W.SEMICOLON&&this._err(G.unknownNamedCharacterReference),this.state=this.returnState,this._callState(e))}},WZ=new Set([J.DD,J.DT,J.LI,J.OPTGROUP,J.OPTION,J.P,J.RB,J.RP,J.RT,J.RTC]),GZ=new Set([...WZ,J.CAPTION,J.COLGROUP,J.TBODY,J.TD,J.TFOOT,J.TH,J.THEAD,J.TR]),KZ=new Set([J.APPLET,J.CAPTION,J.HTML,J.MARQUEE,J.OBJECT,J.TABLE,J.TD,J.TEMPLATE,J.TH]),Sat=new Set([...KZ,J.OL,J.UL]),Cat=new Set([...KZ,J.BUTTON]),qZ=new Set([J.ANNOTATION_XML,J.MI,J.MN,J.MO,J.MS,J.MTEXT]),JZ=new Set([J.DESC,J.FOREIGN_OBJECT,J.TITLE]),wat=new Set([J.TR,J.TEMPLATE,J.HTML]),Tat=new Set([J.TBODY,J.TFOOT,J.THEAD,J.TEMPLATE,J.HTML]),Eat=new Set([J.TABLE,J.TEMPLATE,J.HTML]),Dat=new Set([J.TD,J.TH]),Oat=class{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(e,t,n){this.treeAdapter=t,this.handler=n,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=J.UNKNOWN,this.current=e}_indexOf(e){return this.items.lastIndexOf(e,this.stackTop)}_isInTemplate(){return this.currentTagId===J.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===K.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(e,t){this.stackTop++,this.items[this.stackTop]=e,this.current=e,this.tagIDs[this.stackTop]=t,this.currentTagId=t,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(e,t,!0)}pop(){let e=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!0)}replace(e,t){let n=this._indexOf(e);this.items[n]=t,n===this.stackTop&&(this.current=t)}insertAfter(e,t,n){let r=this._indexOf(e)+1;this.items.splice(r,0,t),this.tagIDs.splice(r,0,n),this.stackTop++,r===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,r===this.stackTop)}popUntilTagNamePopped(e){let t=this.stackTop+1;do t=this.tagIDs.lastIndexOf(e,t-1);while(t>0&&this.treeAdapter.getNamespaceURI(this.items[t])!==K.HTML);this.shortenToLength(Math.max(t,0))}shortenToLength(e){for(;this.stackTop>=e;){let t=this.current;this.tmplCount>0&&this._isInTemplate()&&--this.tmplCount,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,this.stackTop<e)}}popUntilElementPopped(e){let t=this._indexOf(e);this.shortenToLength(Math.max(t,0))}popUntilPopped(e,t){let n=this._indexOfTagNames(e,t);this.shortenToLength(Math.max(n,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(IZ,K.HTML)}popUntilTableCellPopped(){this.popUntilPopped(Dat,K.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(e,t){for(let n=this.stackTop;n>=0;n--)if(e.has(this.tagIDs[n])&&this.treeAdapter.getNamespaceURI(this.items[n])===t)return n;return-1}clearBackTo(e,t){let n=this._indexOfTagNames(e,t);this.shortenToLength(n+1)}clearBackToTableContext(){this.clearBackTo(Eat,K.HTML)}clearBackToTableBodyContext(){this.clearBackTo(Tat,K.HTML)}clearBackToTableRowContext(){this.clearBackTo(wat,K.HTML)}remove(e){let t=this._indexOf(e);t>=0&&(t===this.stackTop?this.pop():(this.items.splice(t,1),this.tagIDs.splice(t,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===J.BODY?this.items[1]:null}contains(e){return this._indexOf(e)>-1}getCommonAncestor(e){let t=this._indexOf(e)-1;return t>=0?this.items[t]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===J.HTML}hasInDynamicScope(e,t){for(let n=this.stackTop;n>=0;n--){let r=this.tagIDs[n];switch(this.treeAdapter.getNamespaceURI(this.items[n])){case K.HTML:if(r===e)return!0;if(t.has(r))return!1;break;case K.SVG:if(JZ.has(r))return!1;break;case K.MATHML:if(qZ.has(r))return!1;break}}return!0}hasInScope(e){return this.hasInDynamicScope(e,KZ)}hasInListItemScope(e){return this.hasInDynamicScope(e,Sat)}hasInButtonScope(e){return this.hasInDynamicScope(e,Cat)}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){let t=this.tagIDs[e];switch(this.treeAdapter.getNamespaceURI(this.items[e])){case K.HTML:if(IZ.has(t))return!0;if(KZ.has(t))return!1;break;case K.SVG:if(JZ.has(t))return!1;break;case K.MATHML:if(qZ.has(t))return!1;break}}return!0}hasInTableScope(e){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===K.HTML)switch(this.tagIDs[t]){case e:return!0;case J.TABLE:case J.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--)if(this.treeAdapter.getNamespaceURI(this.items[e])===K.HTML)switch(this.tagIDs[e]){case J.TBODY:case J.THEAD:case J.TFOOT:return!0;case J.TABLE:case J.HTML:return!1}return!0}hasInSelectScope(e){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===K.HTML)switch(this.tagIDs[t]){case e:return!0;case J.OPTION:case J.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&WZ.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&GZ.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;this.currentTagId!==void 0&&this.currentTagId!==e&&GZ.has(this.currentTagId);)this.pop()}},YZ=3,XZ;(function(e){e[e.Marker=0]=`Marker`,e[e.Element=1]=`Element`})(XZ||={});var ZZ={type:XZ.Marker},kat=class{constructor(e){this.treeAdapter=e,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(e,t){let n=[],r=t.length,i=this.treeAdapter.getTagName(e),a=this.treeAdapter.getNamespaceURI(e);for(let e=0;e<this.entries.length;e++){let t=this.entries[e];if(t.type===XZ.Marker)break;let{element:o}=t;if(this.treeAdapter.getTagName(o)===i&&this.treeAdapter.getNamespaceURI(o)===a){let t=this.treeAdapter.getAttrList(o);t.length===r&&n.push({idx:e,attrs:t})}}return n}_ensureNoahArkCondition(e){if(this.entries.length<YZ)return;let t=this.treeAdapter.getAttrList(e),n=this._getNoahArkConditionCandidates(e,t);if(n.length<YZ)return;let r=new Map(t.map(e=>[e.name,e.value])),i=0;for(let e=0;e<n.length;e++){let t=n[e];t.attrs.every(e=>r.get(e.name)===e.value)&&(i+=1,i>=YZ&&this.entries.splice(t.idx,1))}}insertMarker(){this.entries.unshift(ZZ)}pushElement(e,t){this._ensureNoahArkCondition(e),this.entries.unshift({type:XZ.Element,element:e,token:t})}insertElementAfterBookmark(e,t){let n=this.entries.indexOf(this.bookmark);this.entries.splice(n,0,{type:XZ.Element,element:e,token:t})}removeEntry(e){let t=this.entries.indexOf(e);t!==-1&&this.entries.splice(t,1)}clearToLastMarker(){let e=this.entries.indexOf(ZZ);e===-1?this.entries.length=0:this.entries.splice(0,e+1)}getElementEntryInScopeWithTagName(e){let t=this.entries.find(t=>t.type===XZ.Marker||this.treeAdapter.getTagName(t.element)===e);return t&&t.type===XZ.Element?t:null}getElementEntry(e){return this.entries.find(t=>t.type===XZ.Element&&t.element===e)}},QZ={createDocument(){return{nodeName:`#document`,mode:PZ.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:`#document-fragment`,childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:`#comment`,data:e,parentNode:null}},createTextNode(e){return{nodeName:`#text`,value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){let r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,r){let i=e.childNodes.find(e=>e.nodeName===`#documentType`);if(i)i.name=t,i.publicId=n,i.systemId=r;else{let i={nodeName:`#documentType`,name:t,publicId:n,systemId:r,parentNode:null};QZ.appendChild(e,i)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){let t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){let n=e.childNodes[e.childNodes.length-1];if(QZ.isTextNode(n)){n.value+=t;return}}QZ.appendChild(e,QZ.createTextNode(t))},insertTextBefore(e,t,n){let r=e.childNodes[e.childNodes.indexOf(n)-1];r&&QZ.isTextNode(r)?r.value+=t:QZ.insertBefore(e,QZ.createTextNode(t),n)},adoptAttributes(e,t){let n=new Set(e.attrs.map(e=>e.name));for(let r=0;r<t.length;r++)n.has(t[r].name)||e.attrs.push(t[r])},getFirstChild(e){return e.childNodes[0]},getChildNodes(e){return e.childNodes},getParentNode(e){return e.parentNode},getAttrList(e){return e.attrs},getTagName(e){return e.tagName},getNamespaceURI(e){return e.namespaceURI},getTextNodeContent(e){return e.value},getCommentNodeContent(e){return e.data},getDocumentTypeNodeName(e){return e.name},getDocumentTypeNodePublicId(e){return e.publicId},getDocumentTypeNodeSystemId(e){return e.systemId},isTextNode(e){return e.nodeName===`#text`},isCommentNode(e){return e.nodeName===`#comment`},isDocumentTypeNode(e){return e.nodeName===`#documentType`},isElementNode(e){return Object.prototype.hasOwnProperty.call(e,`tagName`)},setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation(e){return e.sourceCodeLocation},updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation={...e.sourceCodeLocation,...t}}},$Z=`html`,Aat=`about:legacy-compat`,jat=`http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd`,eQ=`+//silmaril//dtd html pro v0r11 19970101//,-//as//dtd html 3.0 aswedit + extensions//,-//advasoft ltd//dtd html 3.0 aswedit + extensions//,-//ietf//dtd html 2.0 level 1//,-//ietf//dtd html 2.0 level 2//,-//ietf//dtd html 2.0 strict level 1//,-//ietf//dtd html 2.0 strict level 2//,-//ietf//dtd html 2.0 strict//,-//ietf//dtd html 2.0//,-//ietf//dtd html 2.1e//,-//ietf//dtd html 3.0//,-//ietf//dtd html 3.2 final//,-//ietf//dtd html 3.2//,-//ietf//dtd html 3//,-//ietf//dtd html level 0//,-//ietf//dtd html level 1//,-//ietf//dtd html level 2//,-//ietf//dtd html level 3//,-//ietf//dtd html strict level 0//,-//ietf//dtd html strict level 1//,-//ietf//dtd html strict level 2//,-//ietf//dtd html strict level 3//,-//ietf//dtd html strict//,-//ietf//dtd html//,-//metrius//dtd metrius presentational//,-//microsoft//dtd internet explorer 2.0 html strict//,-//microsoft//dtd internet explorer 2.0 html//,-//microsoft//dtd internet explorer 2.0 tables//,-//microsoft//dtd internet explorer 3.0 html strict//,-//microsoft//dtd internet explorer 3.0 html//,-//microsoft//dtd internet explorer 3.0 tables//,-//netscape comm. corp.//dtd html//,-//netscape comm. corp.//dtd strict html//,-//o'reilly and associates//dtd html 2.0//,-//o'reilly and associates//dtd html extended 1.0//,-//o'reilly and associates//dtd html extended relaxed 1.0//,-//sq//dtd html 2.0 hotmetal + extensions//,-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//,-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//,-//spyglass//dtd html 2.0 extended//,-//sun microsystems corp.//dtd hotjava html//,-//sun microsystems corp.//dtd hotjava strict html//,-//w3c//dtd html 3 1995-03-24//,-//w3c//dtd html 3.2 draft//,-//w3c//dtd html 3.2 final//,-//w3c//dtd html 3.2//,-//w3c//dtd html 3.2s draft//,-//w3c//dtd html 4.0 frameset//,-//w3c//dtd html 4.0 transitional//,-//w3c//dtd html experimental 19960712//,-//w3c//dtd html experimental 970421//,-//w3c//dtd w3 html//,-//w3o//dtd w3 html 3.0//,-//webtechs//dtd mozilla html 2.0//,-//webtechs//dtd mozilla html//`.split(`,`),Mat=[...eQ,`-//w3c//dtd html 4.01 frameset//`,`-//w3c//dtd html 4.01 transitional//`],Nat=new Set([`-//w3o//dtd w3 html strict 3.0//en//`,`-/w3c/dtd html 4.0 transitional/en`,`html`]),tQ=[`-//w3c//dtd xhtml 1.0 frameset//`,`-//w3c//dtd xhtml 1.0 transitional//`],Pat=[...tQ,`-//w3c//dtd html 4.01 frameset//`,`-//w3c//dtd html 4.01 transitional//`];function nQ(e,t){return t.some(t=>e.startsWith(t))}function Fat(e){return e.name===$Z&&e.publicId===null&&(e.systemId===null||e.systemId===Aat)}function Iat(e){if(e.name!==$Z)return PZ.QUIRKS;let{systemId:t}=e;if(t&&t.toLowerCase()===jat)return PZ.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),Nat.has(n))return PZ.QUIRKS;let e=t===null?Mat:eQ;if(nQ(n,e))return PZ.QUIRKS;if(e=t===null?tQ:Pat,nQ(n,e))return PZ.LIMITED_QUIRKS}return PZ.NO_QUIRKS}var rQ={TEXT_HTML:`text/html`,APPLICATION_XML:`application/xhtml+xml`},Lat=`definitionurl`,Rat=`definitionURL`,zat=new Map(`attributeName.attributeType.baseFrequency.baseProfile.calcMode.clipPathUnits.diffuseConstant.edgeMode.filterUnits.glyphRef.gradientTransform.gradientUnits.kernelMatrix.kernelUnitLength.keyPoints.keySplines.keyTimes.lengthAdjust.limitingConeAngle.markerHeight.markerUnits.markerWidth.maskContentUnits.maskUnits.numOctaves.pathLength.patternContentUnits.patternTransform.patternUnits.pointsAtX.pointsAtY.pointsAtZ.preserveAlpha.preserveAspectRatio.primitiveUnits.refX.refY.repeatCount.repeatDur.requiredExtensions.requiredFeatures.specularConstant.specularExponent.spreadMethod.startOffset.stdDeviation.stitchTiles.surfaceScale.systemLanguage.tableValues.targetX.targetY.textLength.viewBox.viewTarget.xChannelSelector.yChannelSelector.zoomAndPan`.split(`.`).map(e=>[e.toLowerCase(),e])),Bat=new Map([[`xlink:actuate`,{prefix:`xlink`,name:`actuate`,namespace:K.XLINK}],[`xlink:arcrole`,{prefix:`xlink`,name:`arcrole`,namespace:K.XLINK}],[`xlink:href`,{prefix:`xlink`,name:`href`,namespace:K.XLINK}],[`xlink:role`,{prefix:`xlink`,name:`role`,namespace:K.XLINK}],[`xlink:show`,{prefix:`xlink`,name:`show`,namespace:K.XLINK}],[`xlink:title`,{prefix:`xlink`,name:`title`,namespace:K.XLINK}],[`xlink:type`,{prefix:`xlink`,name:`type`,namespace:K.XLINK}],[`xml:lang`,{prefix:`xml`,name:`lang`,namespace:K.XML}],[`xml:space`,{prefix:`xml`,name:`space`,namespace:K.XML}],[`xmlns`,{prefix:``,name:`xmlns`,namespace:K.XMLNS}],[`xmlns:xlink`,{prefix:`xmlns`,name:`xlink`,namespace:K.XMLNS}]]),Vat=new Map(`altGlyph.altGlyphDef.altGlyphItem.animateColor.animateMotion.animateTransform.clipPath.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.foreignObject.glyphRef.linearGradient.radialGradient.textPath`.split(`.`).map(e=>[e.toLowerCase(),e])),Hat=new Set([J.B,J.BIG,J.BLOCKQUOTE,J.BODY,J.BR,J.CENTER,J.CODE,J.DD,J.DIV,J.DL,J.DT,J.EM,J.EMBED,J.H1,J.H2,J.H3,J.H4,J.H5,J.H6,J.HEAD,J.HR,J.I,J.IMG,J.LI,J.LISTING,J.MENU,J.META,J.NOBR,J.OL,J.P,J.PRE,J.RUBY,J.S,J.SMALL,J.SPAN,J.STRONG,J.STRIKE,J.SUB,J.SUP,J.TABLE,J.TT,J.U,J.UL,J.VAR]);function Uat(e){let t=e.tagID;return t===J.FONT&&e.attrs.some(({name:e})=>e===NZ.COLOR||e===NZ.SIZE||e===NZ.FACE)||Hat.has(t)}function iQ(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===Lat){e.attrs[t].name=Rat;break}}function aQ(e){for(let t=0;t<e.attrs.length;t++){let n=zat.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function oQ(e){for(let t=0;t<e.attrs.length;t++){let n=Bat.get(e.attrs[t].name);n&&(e.attrs[t].prefix=n.prefix,e.attrs[t].name=n.name,e.attrs[t].namespace=n.namespace)}}function Wat(e){let t=Vat.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=FZ(e.tagName))}function Gat(e,t){return t===K.MATHML&&(e===J.MI||e===J.MO||e===J.MN||e===J.MS||e===J.MTEXT)}function Kat(e,t,n){if(t===K.MATHML&&e===J.ANNOTATION_XML){for(let e=0;e<n.length;e++)if(n[e].name===NZ.ENCODING){let t=n[e].value.toLowerCase();return t===rQ.TEXT_HTML||t===rQ.APPLICATION_XML}}return t===K.SVG&&(e===J.FOREIGN_OBJECT||e===J.DESC||e===J.TITLE)}function qat(e,t,n,r){return(!r||r===K.HTML)&&Kat(e,t,n)||(!r||r===K.MATHML)&&Gat(e,t)}var Jat=`hidden`,Yat=8,Xat=3,Z;(function(e){e[e.INITIAL=0]=`INITIAL`,e[e.BEFORE_HTML=1]=`BEFORE_HTML`,e[e.BEFORE_HEAD=2]=`BEFORE_HEAD`,e[e.IN_HEAD=3]=`IN_HEAD`,e[e.IN_HEAD_NO_SCRIPT=4]=`IN_HEAD_NO_SCRIPT`,e[e.AFTER_HEAD=5]=`AFTER_HEAD`,e[e.IN_BODY=6]=`IN_BODY`,e[e.TEXT=7]=`TEXT`,e[e.IN_TABLE=8]=`IN_TABLE`,e[e.IN_TABLE_TEXT=9]=`IN_TABLE_TEXT`,e[e.IN_CAPTION=10]=`IN_CAPTION`,e[e.IN_COLUMN_GROUP=11]=`IN_COLUMN_GROUP`,e[e.IN_TABLE_BODY=12]=`IN_TABLE_BODY`,e[e.IN_ROW=13]=`IN_ROW`,e[e.IN_CELL=14]=`IN_CELL`,e[e.IN_SELECT=15]=`IN_SELECT`,e[e.IN_SELECT_IN_TABLE=16]=`IN_SELECT_IN_TABLE`,e[e.IN_TEMPLATE=17]=`IN_TEMPLATE`,e[e.AFTER_BODY=18]=`AFTER_BODY`,e[e.IN_FRAMESET=19]=`IN_FRAMESET`,e[e.AFTER_FRAMESET=20]=`AFTER_FRAMESET`,e[e.AFTER_AFTER_BODY=21]=`AFTER_AFTER_BODY`,e[e.AFTER_AFTER_FRAMESET=22]=`AFTER_AFTER_FRAMESET`})(Z||={});var Zat={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},sQ=new Set([J.TABLE,J.TBODY,J.TFOOT,J.THEAD,J.TR]),cQ={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:QZ,onParseError:null},lQ=class{constructor(e,t,n=null,r=null){this.fragmentContext=n,this.scriptHandler=r,this.currentToken=null,this.stopped=!1,this.insertionMode=Z.INITIAL,this.originalInsertionMode=Z.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...cQ,...e},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=t??this.treeAdapter.createDocument(),this.tokenizer=new xat(this.options,this),this.activeFormattingElements=new kat(this.treeAdapter),this.fragmentContextID=n?FZ(this.treeAdapter.getTagName(n)):J.UNKNOWN,this._setContextModes(n??this.document,this.fragmentContextID),this.openElements=new Oat(this.document,this.treeAdapter,this)}static parse(e,t){let n=new this(t);return n.tokenizer.write(e,!0),n.document}static getFragmentParser(e,t){let n={...cQ,...t};e??=n.treeAdapter.createElement(q.TEMPLATE,K.HTML,[]);let r=n.treeAdapter.createElement(`documentmock`,K.HTML,[]),i=new this(n,r,e);return i.fragmentContextID===J.TEMPLATE&&i.tmplInsertionModeStack.unshift(Z.IN_TEMPLATE),i._initTokenizerForFragmentParsing(),i._insertFakeRootElement(),i._resetInsertionMode(),i._findFormInFragmentContext(),i}getFragment(){let e=this.treeAdapter.getFirstChild(this.document),t=this.treeAdapter.createDocumentFragment();return this._adoptNodes(e,t),t}_err(e,t,n){if(!this.onParseError)return;let r=e.location??Zat,i={code:t,startLine:r.startLine,startCol:r.startCol,startOffset:r.startOffset,endLine:n?r.startLine:r.endLine,endCol:n?r.startCol:r.endCol,endOffset:n?r.startOffset:r.endOffset};this.onParseError(i)}onItemPush(e,t,n){var r,i;(i=(r=this.treeAdapter).onItemPush)==null||i.call(r,e),n&&this.openElements.stackTop>0&&this._setContextModes(e,t)}onItemPop(e,t){var n,r;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(e,this.currentToken),(r=(n=this.treeAdapter).onItemPop)==null||r.call(n,e,this.openElements.current),t){let e,t;this.openElements.stackTop===0&&this.fragmentContext?(e=this.fragmentContext,t=this.fragmentContextID):{current:e,currentTagId:t}=this.openElements,this._setContextModes(e,t)}}_setContextModes(e,t){let n=e===this.document||e&&this.treeAdapter.getNamespaceURI(e)===K.HTML;this.currentNotInHTML=!n,this.tokenizer.inForeignNode=!n&&e!==void 0&&t!==void 0&&!this._isIntegrationPoint(t,e)}_switchToTextParsing(e,t){this._insertElement(e,K.HTML),this.tokenizer.state=t,this.originalInsertionMode=this.insertionMode,this.insertionMode=Z.TEXT}switchToPlaintextParsing(){this.insertionMode=Z.TEXT,this.originalInsertionMode=Z.IN_BODY,this.tokenizer.state=LZ.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let e=this.fragmentContext;for(;e;){if(this.treeAdapter.getTagName(e)===q.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==K.HTML))switch(this.fragmentContextID){case J.TITLE:case J.TEXTAREA:this.tokenizer.state=LZ.RCDATA;break;case J.STYLE:case J.XMP:case J.IFRAME:case J.NOEMBED:case J.NOFRAMES:case J.NOSCRIPT:this.tokenizer.state=LZ.RAWTEXT;break;case J.SCRIPT:this.tokenizer.state=LZ.SCRIPT_DATA;break;case J.PLAINTEXT:this.tokenizer.state=LZ.PLAINTEXT;break;default:}}_setDocumentType(e){let t=e.name||``,n=e.publicId||``,r=e.systemId||``;if(this.treeAdapter.setDocumentType(this.document,t,n,r),e.location){let t=this.treeAdapter.getChildNodes(this.document).find(e=>this.treeAdapter.isDocumentTypeNode(e));t&&this.treeAdapter.setNodeSourceCodeLocation(t,e.location)}}_attachElementToTree(e,t){if(this.options.sourceCodeLocationInfo){let n=t&&{...t,startTag:t};this.treeAdapter.setNodeSourceCodeLocation(e,n)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(e);else{let t=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(t??this.document,e)}}_appendElement(e,t){let n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n,e.location)}_insertElement(e,t){let n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n,e.location),this.openElements.push(n,e.tagID)}_insertFakeElement(e,t){let n=this.treeAdapter.createElement(e,K.HTML,[]);this._attachElementToTree(n,null),this.openElements.push(n,t)}_insertTemplate(e){let t=this.treeAdapter.createElement(e.tagName,K.HTML,e.attrs),n=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(t,n),this._attachElementToTree(t,e.location),this.openElements.push(t,e.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,null)}_insertFakeRootElement(){let e=this.treeAdapter.createElement(q.HTML,K.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(e,null),this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e,J.HTML)}_appendCommentNode(e,t){let n=this.treeAdapter.createCommentNode(e.data);this.treeAdapter.appendChild(t,n),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,e.location)}_insertCharacters(e){let t,n;if(this._shouldFosterParentOnInsertion()?({parent:t,beforeElement:n}=this._findFosterParentingLocation(),n?this.treeAdapter.insertTextBefore(t,e.chars,n):this.treeAdapter.insertText(t,e.chars)):(t=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(t,e.chars)),!e.location)return;let r=this.treeAdapter.getChildNodes(t),i=r[(n?r.lastIndexOf(n):r.length)-1];if(this.treeAdapter.getNodeSourceCodeLocation(i)){let{endLine:t,endCol:n,endOffset:r}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(i,{endLine:t,endCol:n,endOffset:r})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(i,e.location)}_adoptNodes(e,t){for(let n=this.treeAdapter.getFirstChild(e);n;n=this.treeAdapter.getFirstChild(e))this.treeAdapter.detachNode(n),this.treeAdapter.appendChild(t,n)}_setEndLocation(e,t){if(this.treeAdapter.getNodeSourceCodeLocation(e)&&t.location){let n=t.location,r=this.treeAdapter.getTagName(e),i=t.type===EZ.END_TAG&&r===t.tagName?{endTag:{...n},endLine:n.endLine,endCol:n.endCol,endOffset:n.endOffset}:{endLine:n.startLine,endCol:n.startCol,endOffset:n.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(e,i)}}shouldProcessStartTagTokenInForeignContent(e){if(!this.currentNotInHTML)return!1;let t,n;return this.openElements.stackTop===0&&this.fragmentContext?(t=this.fragmentContext,n=this.fragmentContextID):{current:t,currentTagId:n}=this.openElements,e.tagID===J.SVG&&this.treeAdapter.getTagName(t)===q.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(t)===K.MATHML?!1:this.tokenizer.inForeignNode||(e.tagID===J.MGLYPH||e.tagID===J.MALIGNMARK)&&n!==void 0&&!this._isIntegrationPoint(n,t,K.HTML)}_processToken(e){switch(e.type){case EZ.CHARACTER:this.onCharacter(e);break;case EZ.NULL_CHARACTER:this.onNullCharacter(e);break;case EZ.COMMENT:this.onComment(e);break;case EZ.DOCTYPE:this.onDoctype(e);break;case EZ.START_TAG:this._processStartTag(e);break;case EZ.END_TAG:this.onEndTag(e);break;case EZ.EOF:this.onEof(e);break;case EZ.WHITESPACE_CHARACTER:this.onWhitespaceCharacter(e);break}}_isIntegrationPoint(e,t,n){return qat(e,this.treeAdapter.getNamespaceURI(t),this.treeAdapter.getAttrList(t),n)}_reconstructActiveFormattingElements(){let e=this.activeFormattingElements.entries.length;if(e){let t=this.activeFormattingElements.entries.findIndex(e=>e.type===XZ.Marker||this.openElements.contains(e.element)),n=t===-1?e-1:t-1;for(let e=n;e>=0;e--){let t=this.activeFormattingElements.entries[e];this._insertElement(t.token,this.treeAdapter.getNamespaceURI(t.element)),t.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=Z.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(J.P),this.openElements.popUntilTagNamePopped(J.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop;e>=0;e--)switch(e===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[e]){case J.TR:this.insertionMode=Z.IN_ROW;return;case J.TBODY:case J.THEAD:case J.TFOOT:this.insertionMode=Z.IN_TABLE_BODY;return;case J.CAPTION:this.insertionMode=Z.IN_CAPTION;return;case J.COLGROUP:this.insertionMode=Z.IN_COLUMN_GROUP;return;case J.TABLE:this.insertionMode=Z.IN_TABLE;return;case J.BODY:this.insertionMode=Z.IN_BODY;return;case J.FRAMESET:this.insertionMode=Z.IN_FRAMESET;return;case J.SELECT:this._resetInsertionModeForSelect(e);return;case J.TEMPLATE:this.insertionMode=this.tmplInsertionModeStack[0];return;case J.HTML:this.insertionMode=this.headElement?Z.AFTER_HEAD:Z.BEFORE_HEAD;return;case J.TD:case J.TH:if(e>0){this.insertionMode=Z.IN_CELL;return}break;case J.HEAD:if(e>0){this.insertionMode=Z.IN_HEAD;return}break}this.insertionMode=Z.IN_BODY}_resetInsertionModeForSelect(e){if(e>0)for(let t=e-1;t>0;t--){let e=this.openElements.tagIDs[t];if(e===J.TEMPLATE)break;if(e===J.TABLE){this.insertionMode=Z.IN_SELECT_IN_TABLE;return}}this.insertionMode=Z.IN_SELECT}_isElementCausesFosterParenting(e){return sQ.has(e)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let e=this.openElements.stackTop;e>=0;e--){let t=this.openElements.items[e];switch(this.openElements.tagIDs[e]){case J.TEMPLATE:if(this.treeAdapter.getNamespaceURI(t)===K.HTML)return{parent:this.treeAdapter.getTemplateContent(t),beforeElement:null};break;case J.TABLE:{let n=this.treeAdapter.getParentNode(t);return n?{parent:n,beforeElement:t}:{parent:this.openElements.items[e-1],beforeElement:null}}default:}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(e){let t=this._findFosterParentingLocation();t.beforeElement?this.treeAdapter.insertBefore(t.parent,e,t.beforeElement):this.treeAdapter.appendChild(t.parent,e)}_isSpecialElement(e,t){return _at[this.treeAdapter.getNamespaceURI(e)].has(t)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){Dst(this,e);return}switch(this.insertionMode){case Z.INITIAL:pQ(this,e);break;case Z.BEFORE_HTML:mQ(this,e);break;case Z.BEFORE_HEAD:hQ(this,e);break;case Z.IN_HEAD:vQ(this,e);break;case Z.IN_HEAD_NO_SCRIPT:yQ(this,e);break;case Z.AFTER_HEAD:bQ(this,e);break;case Z.IN_BODY:case Z.IN_CAPTION:case Z.IN_CELL:case Z.IN_TEMPLATE:CQ(this,e);break;case Z.TEXT:case Z.IN_SELECT:case Z.IN_SELECT_IN_TABLE:this._insertCharacters(e);break;case Z.IN_TABLE:case Z.IN_TABLE_BODY:case Z.IN_ROW:MQ(this,e);break;case Z.IN_TABLE_TEXT:LQ(this,e);break;case Z.IN_COLUMN_GROUP:VQ(this,e);break;case Z.AFTER_BODY:XQ(this,e);break;case Z.AFTER_AFTER_BODY:ZQ(this,e);break;default:}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){Est(this,e);return}switch(this.insertionMode){case Z.INITIAL:pQ(this,e);break;case Z.BEFORE_HTML:mQ(this,e);break;case Z.BEFORE_HEAD:hQ(this,e);break;case Z.IN_HEAD:vQ(this,e);break;case Z.IN_HEAD_NO_SCRIPT:yQ(this,e);break;case Z.AFTER_HEAD:bQ(this,e);break;case Z.TEXT:this._insertCharacters(e);break;case Z.IN_TABLE:case Z.IN_TABLE_BODY:case Z.IN_ROW:MQ(this,e);break;case Z.IN_COLUMN_GROUP:VQ(this,e);break;case Z.AFTER_BODY:XQ(this,e);break;case Z.AFTER_AFTER_BODY:ZQ(this,e);break;default:}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML){dQ(this,e);return}switch(this.insertionMode){case Z.INITIAL:case Z.BEFORE_HTML:case Z.BEFORE_HEAD:case Z.IN_HEAD:case Z.IN_HEAD_NO_SCRIPT:case Z.AFTER_HEAD:case Z.IN_BODY:case Z.IN_TABLE:case Z.IN_CAPTION:case Z.IN_COLUMN_GROUP:case Z.IN_TABLE_BODY:case Z.IN_ROW:case Z.IN_CELL:case Z.IN_SELECT:case Z.IN_SELECT_IN_TABLE:case Z.IN_TEMPLATE:case Z.IN_FRAMESET:case Z.AFTER_FRAMESET:dQ(this,e);break;case Z.IN_TABLE_TEXT:RQ(this,e);break;case Z.AFTER_BODY:iot(this,e);break;case Z.AFTER_AFTER_BODY:case Z.AFTER_AFTER_FRAMESET:aot(this,e);break;default:}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case Z.INITIAL:oot(this,e);break;case Z.BEFORE_HEAD:case Z.IN_HEAD:case Z.IN_HEAD_NO_SCRIPT:case Z.AFTER_HEAD:this._err(e,G.misplacedDoctype);break;case Z.IN_TABLE_TEXT:RQ(this,e);break;default:}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,G.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?Ost(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case Z.INITIAL:pQ(this,e);break;case Z.BEFORE_HTML:sot(this,e);break;case Z.BEFORE_HEAD:lot(this,e);break;case Z.IN_HEAD:gQ(this,e);break;case Z.IN_HEAD_NO_SCRIPT:fot(this,e);break;case Z.AFTER_HEAD:mot(this,e);break;case Z.IN_BODY:OQ(this,e);break;case Z.IN_TABLE:NQ(this,e);break;case Z.IN_TABLE_TEXT:RQ(this,e);break;case Z.IN_CAPTION:ust(this,e);break;case Z.IN_COLUMN_GROUP:BQ(this,e);break;case Z.IN_TABLE_BODY:HQ(this,e);break;case Z.IN_ROW:WQ(this,e);break;case Z.IN_CELL:pst(this,e);break;case Z.IN_SELECT:KQ(this,e);break;case Z.IN_SELECT_IN_TABLE:hst(this,e);break;case Z.IN_TEMPLATE:_st(this,e);break;case Z.AFTER_BODY:yst(this,e);break;case Z.IN_FRAMESET:bst(this,e);break;case Z.AFTER_FRAMESET:Sst(this,e);break;case Z.AFTER_AFTER_BODY:wst(this,e);break;case Z.AFTER_AFTER_FRAMESET:Tst(this,e);break;default:}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?kst(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case Z.INITIAL:pQ(this,e);break;case Z.BEFORE_HTML:cot(this,e);break;case Z.BEFORE_HEAD:uot(this,e);break;case Z.IN_HEAD:dot(this,e);break;case Z.IN_HEAD_NO_SCRIPT:pot(this,e);break;case Z.AFTER_HEAD:hot(this,e);break;case Z.IN_BODY:AQ(this,e);break;case Z.TEXT:est(this,e);break;case Z.IN_TABLE:PQ(this,e);break;case Z.IN_TABLE_TEXT:RQ(this,e);break;case Z.IN_CAPTION:dst(this,e);break;case Z.IN_COLUMN_GROUP:fst(this,e);break;case Z.IN_TABLE_BODY:UQ(this,e);break;case Z.IN_ROW:GQ(this,e);break;case Z.IN_CELL:mst(this,e);break;case Z.IN_SELECT:qQ(this,e);break;case Z.IN_SELECT_IN_TABLE:gst(this,e);break;case Z.IN_TEMPLATE:vst(this,e);break;case Z.AFTER_BODY:YQ(this,e);break;case Z.IN_FRAMESET:xst(this,e);break;case Z.AFTER_FRAMESET:Cst(this,e);break;case Z.AFTER_AFTER_BODY:ZQ(this,e);break;default:}}onEof(e){switch(this.insertionMode){case Z.INITIAL:pQ(this,e);break;case Z.BEFORE_HTML:mQ(this,e);break;case Z.BEFORE_HEAD:hQ(this,e);break;case Z.IN_HEAD:vQ(this,e);break;case Z.IN_HEAD_NO_SCRIPT:yQ(this,e);break;case Z.AFTER_HEAD:bQ(this,e);break;case Z.IN_BODY:case Z.IN_TABLE:case Z.IN_CAPTION:case Z.IN_COLUMN_GROUP:case Z.IN_TABLE_BODY:case Z.IN_ROW:case Z.IN_CELL:case Z.IN_SELECT:case Z.IN_SELECT_IN_TABLE:jQ(this,e);break;case Z.TEXT:tst(this,e);break;case Z.IN_TABLE_TEXT:RQ(this,e);break;case Z.IN_TEMPLATE:JQ(this,e);break;case Z.AFTER_BODY:case Z.IN_FRAMESET:case Z.AFTER_FRAMESET:case Z.AFTER_AFTER_BODY:case Z.AFTER_AFTER_FRAMESET:fQ(this,e);break;default:}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===W.LINE_FEED)){if(e.chars.length===1)return;e.chars=e.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(e);return}switch(this.insertionMode){case Z.IN_HEAD:case Z.IN_HEAD_NO_SCRIPT:case Z.AFTER_HEAD:case Z.TEXT:case Z.IN_COLUMN_GROUP:case Z.IN_SELECT:case Z.IN_SELECT_IN_TABLE:case Z.IN_FRAMESET:case Z.AFTER_FRAMESET:this._insertCharacters(e);break;case Z.IN_BODY:case Z.IN_CAPTION:case Z.IN_CELL:case Z.IN_TEMPLATE:case Z.AFTER_BODY:case Z.AFTER_AFTER_BODY:case Z.AFTER_AFTER_FRAMESET:SQ(this,e);break;case Z.IN_TABLE:case Z.IN_TABLE_BODY:case Z.IN_ROW:MQ(this,e);break;case Z.IN_TABLE_TEXT:IQ(this,e);break;default:}}};function Qat(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):kQ(e,t),n}function $at(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){let i=e.openElements.items[r];if(i===t.element)break;e._isSpecialElement(i,e.openElements.tagIDs[r])&&(n=i)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function eot(e,t,n){let r=t,i=e.openElements.getCommonAncestor(t);for(let a=0,o=i;o!==n;a++,o=i){i=e.openElements.getCommonAncestor(o);let n=e.activeFormattingElements.getElementEntry(o),s=n&&a>=Xat;!n||s?(s&&e.activeFormattingElements.removeEntry(n),e.openElements.remove(o)):(o=tot(e,n),r===t&&(e.activeFormattingElements.bookmark=n),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(o,r),r=o)}return r}function tot(e,t){let n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function not(e,t,n){let r=FZ(e.treeAdapter.getTagName(t));if(e._isElementCausesFosterParenting(r))e._fosterParentElement(n);else{let i=e.treeAdapter.getNamespaceURI(t);r===J.TEMPLATE&&i===K.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function rot(e,t,n){let r=e.treeAdapter.getNamespaceURI(n.element),{token:i}=n,a=e.treeAdapter.createElement(i.tagName,r,i.attrs);e._adoptNodes(t,a),e.treeAdapter.appendChild(t,a),e.activeFormattingElements.insertElementAfterBookmark(a,i),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,a,i.tagID)}function uQ(e,t){for(let n=0;n<Yat;n++){let n=Qat(e,t);if(!n)break;let r=$at(e,n);if(!r)break;e.activeFormattingElements.bookmark=n;let i=eot(e,r,n.element),a=e.openElements.getCommonAncestor(n.element);e.treeAdapter.detachNode(i),a&¬(e,a,i),rot(e,r,n)}}function dQ(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function iot(e,t){e._appendCommentNode(t,e.openElements.items[0])}function aot(e,t){e._appendCommentNode(t,e.document)}function fQ(e,t){if(e.stopped=!0,t.location){let n=e.fragmentContext?0:2;for(let r=e.openElements.stackTop;r>=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){let n=e.openElements.items[0],r=e.treeAdapter.getNodeSourceCodeLocation(n);if(r&&!r.endTag&&(e._setEndLocation(n,t),e.openElements.stackTop>=1)){let n=e.openElements.items[1],r=e.treeAdapter.getNodeSourceCodeLocation(n);r&&!r.endTag&&e._setEndLocation(n,t)}}}}function oot(e,t){e._setDocumentType(t);let n=t.forceQuirks?PZ.QUIRKS:Iat(t);Fat(t)||e._err(t,G.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=Z.BEFORE_HTML}function pQ(e,t){e._err(t,G.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,PZ.QUIRKS),e.insertionMode=Z.BEFORE_HTML,e._processToken(t)}function sot(e,t){t.tagID===J.HTML?(e._insertElement(t,K.HTML),e.insertionMode=Z.BEFORE_HEAD):mQ(e,t)}function cot(e,t){let n=t.tagID;(n===J.HTML||n===J.HEAD||n===J.BODY||n===J.BR)&&mQ(e,t)}function mQ(e,t){e._insertFakeRootElement(),e.insertionMode=Z.BEFORE_HEAD,e._processToken(t)}function lot(e,t){switch(t.tagID){case J.HTML:OQ(e,t);break;case J.HEAD:e._insertElement(t,K.HTML),e.headElement=e.openElements.current,e.insertionMode=Z.IN_HEAD;break;default:hQ(e,t)}}function uot(e,t){let n=t.tagID;n===J.HEAD||n===J.BODY||n===J.HTML||n===J.BR?hQ(e,t):e._err(t,G.endTagWithoutMatchingOpenElement)}function hQ(e,t){e._insertFakeElement(q.HEAD,J.HEAD),e.headElement=e.openElements.current,e.insertionMode=Z.IN_HEAD,e._processToken(t)}function gQ(e,t){switch(t.tagID){case J.HTML:OQ(e,t);break;case J.BASE:case J.BASEFONT:case J.BGSOUND:case J.LINK:case J.META:e._appendElement(t,K.HTML),t.ackSelfClosing=!0;break;case J.TITLE:e._switchToTextParsing(t,LZ.RCDATA);break;case J.NOSCRIPT:e.options.scriptingEnabled?e._switchToTextParsing(t,LZ.RAWTEXT):(e._insertElement(t,K.HTML),e.insertionMode=Z.IN_HEAD_NO_SCRIPT);break;case J.NOFRAMES:case J.STYLE:e._switchToTextParsing(t,LZ.RAWTEXT);break;case J.SCRIPT:e._switchToTextParsing(t,LZ.SCRIPT_DATA);break;case J.TEMPLATE:e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=Z.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(Z.IN_TEMPLATE);break;case J.HEAD:e._err(t,G.misplacedStartTagForHeadElement);break;default:vQ(e,t)}}function dot(e,t){switch(t.tagID){case J.HEAD:e.openElements.pop(),e.insertionMode=Z.AFTER_HEAD;break;case J.BODY:case J.BR:case J.HTML:vQ(e,t);break;case J.TEMPLATE:_Q(e,t);break;default:e._err(t,G.endTagWithoutMatchingOpenElement)}}function _Q(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==J.TEMPLATE&&e._err(t,G.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(J.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,G.endTagWithoutMatchingOpenElement)}function vQ(e,t){e.openElements.pop(),e.insertionMode=Z.AFTER_HEAD,e._processToken(t)}function fot(e,t){switch(t.tagID){case J.HTML:OQ(e,t);break;case J.BASEFONT:case J.BGSOUND:case J.HEAD:case J.LINK:case J.META:case J.NOFRAMES:case J.STYLE:gQ(e,t);break;case J.NOSCRIPT:e._err(t,G.nestedNoscriptInHead);break;default:yQ(e,t)}}function pot(e,t){switch(t.tagID){case J.NOSCRIPT:e.openElements.pop(),e.insertionMode=Z.IN_HEAD;break;case J.BR:yQ(e,t);break;default:e._err(t,G.endTagWithoutMatchingOpenElement)}}function yQ(e,t){let n=t.type===EZ.EOF?G.openElementsLeftAfterEof:G.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=Z.IN_HEAD,e._processToken(t)}function mot(e,t){switch(t.tagID){case J.HTML:OQ(e,t);break;case J.BODY:e._insertElement(t,K.HTML),e.framesetOk=!1,e.insertionMode=Z.IN_BODY;break;case J.FRAMESET:e._insertElement(t,K.HTML),e.insertionMode=Z.IN_FRAMESET;break;case J.BASE:case J.BASEFONT:case J.BGSOUND:case J.LINK:case J.META:case J.NOFRAMES:case J.SCRIPT:case J.STYLE:case J.TEMPLATE:case J.TITLE:e._err(t,G.abandonedHeadElementChild),e.openElements.push(e.headElement,J.HEAD),gQ(e,t),e.openElements.remove(e.headElement);break;case J.HEAD:e._err(t,G.misplacedStartTagForHeadElement);break;default:bQ(e,t)}}function hot(e,t){switch(t.tagID){case J.BODY:case J.HTML:case J.BR:bQ(e,t);break;case J.TEMPLATE:_Q(e,t);break;default:e._err(t,G.endTagWithoutMatchingOpenElement)}}function bQ(e,t){e._insertFakeElement(q.BODY,J.BODY),e.insertionMode=Z.IN_BODY,xQ(e,t)}function xQ(e,t){switch(t.type){case EZ.CHARACTER:CQ(e,t);break;case EZ.WHITESPACE_CHARACTER:SQ(e,t);break;case EZ.COMMENT:dQ(e,t);break;case EZ.START_TAG:OQ(e,t);break;case EZ.END_TAG:AQ(e,t);break;case EZ.EOF:jQ(e,t);break;default:}}function SQ(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function CQ(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function got(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function _ot(e,t){let n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function vot(e,t){let n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,K.HTML),e.insertionMode=Z.IN_FRAMESET)}function yot(e,t){e.openElements.hasInButtonScope(J.P)&&e._closePElement(),e._insertElement(t,K.HTML)}function bot(e,t){e.openElements.hasInButtonScope(J.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&IZ.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,K.HTML)}function xot(e,t){e.openElements.hasInButtonScope(J.P)&&e._closePElement(),e._insertElement(t,K.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function Sot(e,t){let n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(J.P)&&e._closePElement(),e._insertElement(t,K.HTML),n||(e.formElement=e.openElements.current))}function Cot(e,t){e.framesetOk=!1;let n=t.tagID;for(let t=e.openElements.stackTop;t>=0;t--){let r=e.openElements.tagIDs[t];if(n===J.LI&&r===J.LI||(n===J.DD||n===J.DT)&&(r===J.DD||r===J.DT)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.popUntilTagNamePopped(r);break}if(r!==J.ADDRESS&&r!==J.DIV&&r!==J.P&&e._isSpecialElement(e.openElements.items[t],r))break}e.openElements.hasInButtonScope(J.P)&&e._closePElement(),e._insertElement(t,K.HTML)}function wot(e,t){e.openElements.hasInButtonScope(J.P)&&e._closePElement(),e._insertElement(t,K.HTML),e.tokenizer.state=LZ.PLAINTEXT}function Tot(e,t){e.openElements.hasInScope(J.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(J.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,K.HTML),e.framesetOk=!1}function Eot(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(q.A);n&&(uQ(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,K.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Dot(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,K.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Oot(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(J.NOBR)&&(uQ(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,K.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function kot(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,K.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function Aot(e,t){e.treeAdapter.getDocumentMode(e.document)!==PZ.QUIRKS&&e.openElements.hasInButtonScope(J.P)&&e._closePElement(),e._insertElement(t,K.HTML),e.framesetOk=!1,e.insertionMode=Z.IN_TABLE}function wQ(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,K.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function TQ(e){let t=DZ(e,NZ.TYPE);return t!=null&&t.toLowerCase()===Jat}function jot(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,K.HTML),TQ(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function Mot(e,t){e._appendElement(t,K.HTML),t.ackSelfClosing=!0}function Not(e,t){e.openElements.hasInButtonScope(J.P)&&e._closePElement(),e._appendElement(t,K.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function Pot(e,t){t.tagName=q.IMG,t.tagID=J.IMG,wQ(e,t)}function Fot(e,t){e._insertElement(t,K.HTML),e.skipNextNewLine=!0,e.tokenizer.state=LZ.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=Z.TEXT}function Iot(e,t){e.openElements.hasInButtonScope(J.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,LZ.RAWTEXT)}function Lot(e,t){e.framesetOk=!1,e._switchToTextParsing(t,LZ.RAWTEXT)}function EQ(e,t){e._switchToTextParsing(t,LZ.RAWTEXT)}function Rot(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,K.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===Z.IN_TABLE||e.insertionMode===Z.IN_CAPTION||e.insertionMode===Z.IN_TABLE_BODY||e.insertionMode===Z.IN_ROW||e.insertionMode===Z.IN_CELL?Z.IN_SELECT_IN_TABLE:Z.IN_SELECT}function zot(e,t){e.openElements.currentTagId===J.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,K.HTML)}function Bot(e,t){e.openElements.hasInScope(J.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,K.HTML)}function Vot(e,t){e.openElements.hasInScope(J.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(J.RTC),e._insertElement(t,K.HTML)}function Hot(e,t){e._reconstructActiveFormattingElements(),iQ(t),oQ(t),t.selfClosing?e._appendElement(t,K.MATHML):e._insertElement(t,K.MATHML),t.ackSelfClosing=!0}function Uot(e,t){e._reconstructActiveFormattingElements(),aQ(t),oQ(t),t.selfClosing?e._appendElement(t,K.SVG):e._insertElement(t,K.SVG),t.ackSelfClosing=!0}function DQ(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,K.HTML)}function OQ(e,t){switch(t.tagID){case J.I:case J.S:case J.B:case J.U:case J.EM:case J.TT:case J.BIG:case J.CODE:case J.FONT:case J.SMALL:case J.STRIKE:case J.STRONG:Dot(e,t);break;case J.A:Eot(e,t);break;case J.H1:case J.H2:case J.H3:case J.H4:case J.H5:case J.H6:bot(e,t);break;case J.P:case J.DL:case J.OL:case J.UL:case J.DIV:case J.DIR:case J.NAV:case J.MAIN:case J.MENU:case J.ASIDE:case J.CENTER:case J.FIGURE:case J.FOOTER:case J.HEADER:case J.HGROUP:case J.DIALOG:case J.DETAILS:case J.ADDRESS:case J.ARTICLE:case J.SEARCH:case J.SECTION:case J.SUMMARY:case J.FIELDSET:case J.BLOCKQUOTE:case J.FIGCAPTION:yot(e,t);break;case J.LI:case J.DD:case J.DT:Cot(e,t);break;case J.BR:case J.IMG:case J.WBR:case J.AREA:case J.EMBED:case J.KEYGEN:wQ(e,t);break;case J.HR:Not(e,t);break;case J.RB:case J.RTC:Bot(e,t);break;case J.RT:case J.RP:Vot(e,t);break;case J.PRE:case J.LISTING:xot(e,t);break;case J.XMP:Iot(e,t);break;case J.SVG:Uot(e,t);break;case J.HTML:got(e,t);break;case J.BASE:case J.LINK:case J.META:case J.STYLE:case J.TITLE:case J.SCRIPT:case J.BGSOUND:case J.BASEFONT:case J.TEMPLATE:gQ(e,t);break;case J.BODY:_ot(e,t);break;case J.FORM:Sot(e,t);break;case J.NOBR:Oot(e,t);break;case J.MATH:Hot(e,t);break;case J.TABLE:Aot(e,t);break;case J.INPUT:jot(e,t);break;case J.PARAM:case J.TRACK:case J.SOURCE:Mot(e,t);break;case J.IMAGE:Pot(e,t);break;case J.BUTTON:Tot(e,t);break;case J.APPLET:case J.OBJECT:case J.MARQUEE:kot(e,t);break;case J.IFRAME:Lot(e,t);break;case J.SELECT:Rot(e,t);break;case J.OPTION:case J.OPTGROUP:zot(e,t);break;case J.NOEMBED:case J.NOFRAMES:EQ(e,t);break;case J.FRAMESET:vot(e,t);break;case J.TEXTAREA:Fot(e,t);break;case J.NOSCRIPT:e.options.scriptingEnabled?EQ(e,t):DQ(e,t);break;case J.PLAINTEXT:wot(e,t);break;case J.COL:case J.TH:case J.TD:case J.TR:case J.HEAD:case J.FRAME:case J.TBODY:case J.TFOOT:case J.THEAD:case J.CAPTION:case J.COLGROUP:break;default:DQ(e,t)}}function Wot(e,t){if(e.openElements.hasInScope(J.BODY)&&(e.insertionMode=Z.AFTER_BODY,e.options.sourceCodeLocationInfo)){let n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function Got(e,t){e.openElements.hasInScope(J.BODY)&&(e.insertionMode=Z.AFTER_BODY,YQ(e,t))}function Kot(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function qot(e){let t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(J.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(J.FORM):n&&e.openElements.remove(n))}function Jot(e){e.openElements.hasInButtonScope(J.P)||e._insertFakeElement(q.P,J.P),e._closePElement()}function Yot(e){e.openElements.hasInListItemScope(J.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(J.LI),e.openElements.popUntilTagNamePopped(J.LI))}function Xot(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function Zot(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function Qot(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function $ot(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(q.BR,J.BR),e.openElements.pop(),e.framesetOk=!1}function kQ(e,t){let n=t.tagName,r=t.tagID;for(let t=e.openElements.stackTop;t>0;t--){let i=e.openElements.items[t],a=e.openElements.tagIDs[t];if(r===a&&(r!==J.UNKNOWN||e.treeAdapter.getTagName(i)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=t&&e.openElements.shortenToLength(t);break}if(e._isSpecialElement(i,a))break}}function AQ(e,t){switch(t.tagID){case J.A:case J.B:case J.I:case J.S:case J.U:case J.EM:case J.TT:case J.BIG:case J.CODE:case J.FONT:case J.NOBR:case J.SMALL:case J.STRIKE:case J.STRONG:uQ(e,t);break;case J.P:Jot(e);break;case J.DL:case J.UL:case J.OL:case J.DIR:case J.DIV:case J.NAV:case J.PRE:case J.MAIN:case J.MENU:case J.ASIDE:case J.BUTTON:case J.CENTER:case J.FIGURE:case J.FOOTER:case J.HEADER:case J.HGROUP:case J.DIALOG:case J.ADDRESS:case J.ARTICLE:case J.DETAILS:case J.SEARCH:case J.SECTION:case J.SUMMARY:case J.LISTING:case J.FIELDSET:case J.BLOCKQUOTE:case J.FIGCAPTION:Kot(e,t);break;case J.LI:Yot(e);break;case J.DD:case J.DT:Xot(e,t);break;case J.H1:case J.H2:case J.H3:case J.H4:case J.H5:case J.H6:Zot(e);break;case J.BR:$ot(e);break;case J.BODY:Wot(e,t);break;case J.HTML:Got(e,t);break;case J.FORM:qot(e);break;case J.APPLET:case J.OBJECT:case J.MARQUEE:Qot(e,t);break;case J.TEMPLATE:_Q(e,t);break;default:kQ(e,t)}}function jQ(e,t){e.tmplInsertionModeStack.length>0?JQ(e,t):fQ(e,t)}function est(e,t){var n;t.tagID===J.SCRIPT&&((n=e.scriptHandler)==null||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function tst(e,t){e._err(t,G.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function MQ(e,t){if(e.openElements.currentTagId!==void 0&&sQ.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=Z.IN_TABLE_TEXT,t.type){case EZ.CHARACTER:LQ(e,t);break;case EZ.WHITESPACE_CHARACTER:IQ(e,t);break}else FQ(e,t)}function nst(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,K.HTML),e.insertionMode=Z.IN_CAPTION}function rst(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,K.HTML),e.insertionMode=Z.IN_COLUMN_GROUP}function ist(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(q.COLGROUP,J.COLGROUP),e.insertionMode=Z.IN_COLUMN_GROUP,BQ(e,t)}function ast(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,K.HTML),e.insertionMode=Z.IN_TABLE_BODY}function ost(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(q.TBODY,J.TBODY),e.insertionMode=Z.IN_TABLE_BODY,HQ(e,t)}function sst(e,t){e.openElements.hasInTableScope(J.TABLE)&&(e.openElements.popUntilTagNamePopped(J.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function cst(e,t){TQ(t)?e._appendElement(t,K.HTML):FQ(e,t),t.ackSelfClosing=!0}function lst(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,K.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function NQ(e,t){switch(t.tagID){case J.TD:case J.TH:case J.TR:ost(e,t);break;case J.STYLE:case J.SCRIPT:case J.TEMPLATE:gQ(e,t);break;case J.COL:ist(e,t);break;case J.FORM:lst(e,t);break;case J.TABLE:sst(e,t);break;case J.TBODY:case J.TFOOT:case J.THEAD:ast(e,t);break;case J.INPUT:cst(e,t);break;case J.CAPTION:nst(e,t);break;case J.COLGROUP:rst(e,t);break;default:FQ(e,t)}}function PQ(e,t){switch(t.tagID){case J.TABLE:e.openElements.hasInTableScope(J.TABLE)&&(e.openElements.popUntilTagNamePopped(J.TABLE),e._resetInsertionMode());break;case J.TEMPLATE:_Q(e,t);break;case J.BODY:case J.CAPTION:case J.COL:case J.COLGROUP:case J.HTML:case J.TBODY:case J.TD:case J.TFOOT:case J.TH:case J.THEAD:case J.TR:break;default:FQ(e,t)}}function FQ(e,t){let n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,xQ(e,t),e.fosterParentingEnabled=n}function IQ(e,t){e.pendingCharacterTokens.push(t)}function LQ(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function RQ(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)FQ(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}var zQ=new Set([J.CAPTION,J.COL,J.COLGROUP,J.TBODY,J.TD,J.TFOOT,J.TH,J.THEAD,J.TR]);function ust(e,t){let n=t.tagID;zQ.has(n)?e.openElements.hasInTableScope(J.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(J.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=Z.IN_TABLE,NQ(e,t)):OQ(e,t)}function dst(e,t){let n=t.tagID;switch(n){case J.CAPTION:case J.TABLE:e.openElements.hasInTableScope(J.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(J.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=Z.IN_TABLE,n===J.TABLE&&PQ(e,t));break;case J.BODY:case J.COL:case J.COLGROUP:case J.HTML:case J.TBODY:case J.TD:case J.TFOOT:case J.TH:case J.THEAD:case J.TR:break;default:AQ(e,t)}}function BQ(e,t){switch(t.tagID){case J.HTML:OQ(e,t);break;case J.COL:e._appendElement(t,K.HTML),t.ackSelfClosing=!0;break;case J.TEMPLATE:gQ(e,t);break;default:VQ(e,t)}}function fst(e,t){switch(t.tagID){case J.COLGROUP:e.openElements.currentTagId===J.COLGROUP&&(e.openElements.pop(),e.insertionMode=Z.IN_TABLE);break;case J.TEMPLATE:_Q(e,t);break;case J.COL:break;default:VQ(e,t)}}function VQ(e,t){e.openElements.currentTagId===J.COLGROUP&&(e.openElements.pop(),e.insertionMode=Z.IN_TABLE,e._processToken(t))}function HQ(e,t){switch(t.tagID){case J.TR:e.openElements.clearBackToTableBodyContext(),e._insertElement(t,K.HTML),e.insertionMode=Z.IN_ROW;break;case J.TH:case J.TD:e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(q.TR,J.TR),e.insertionMode=Z.IN_ROW,WQ(e,t);break;case J.CAPTION:case J.COL:case J.COLGROUP:case J.TBODY:case J.TFOOT:case J.THEAD:e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=Z.IN_TABLE,NQ(e,t));break;default:NQ(e,t)}}function UQ(e,t){let n=t.tagID;switch(t.tagID){case J.TBODY:case J.TFOOT:case J.THEAD:e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=Z.IN_TABLE);break;case J.TABLE:e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=Z.IN_TABLE,PQ(e,t));break;case J.BODY:case J.CAPTION:case J.COL:case J.COLGROUP:case J.HTML:case J.TD:case J.TH:case J.TR:break;default:PQ(e,t)}}function WQ(e,t){switch(t.tagID){case J.TH:case J.TD:e.openElements.clearBackToTableRowContext(),e._insertElement(t,K.HTML),e.insertionMode=Z.IN_CELL,e.activeFormattingElements.insertMarker();break;case J.CAPTION:case J.COL:case J.COLGROUP:case J.TBODY:case J.TFOOT:case J.THEAD:case J.TR:e.openElements.hasInTableScope(J.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=Z.IN_TABLE_BODY,HQ(e,t));break;default:NQ(e,t)}}function GQ(e,t){switch(t.tagID){case J.TR:e.openElements.hasInTableScope(J.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=Z.IN_TABLE_BODY);break;case J.TABLE:e.openElements.hasInTableScope(J.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=Z.IN_TABLE_BODY,UQ(e,t));break;case J.TBODY:case J.TFOOT:case J.THEAD:(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(J.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=Z.IN_TABLE_BODY,UQ(e,t));break;case J.BODY:case J.CAPTION:case J.COL:case J.COLGROUP:case J.HTML:case J.TD:case J.TH:break;default:PQ(e,t)}}function pst(e,t){let n=t.tagID;zQ.has(n)?(e.openElements.hasInTableScope(J.TD)||e.openElements.hasInTableScope(J.TH))&&(e._closeTableCell(),WQ(e,t)):OQ(e,t)}function mst(e,t){let n=t.tagID;switch(n){case J.TD:case J.TH:e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=Z.IN_ROW);break;case J.TABLE:case J.TBODY:case J.TFOOT:case J.THEAD:case J.TR:e.openElements.hasInTableScope(n)&&(e._closeTableCell(),GQ(e,t));break;case J.BODY:case J.CAPTION:case J.COL:case J.COLGROUP:case J.HTML:break;default:AQ(e,t)}}function KQ(e,t){switch(t.tagID){case J.HTML:OQ(e,t);break;case J.OPTION:e.openElements.currentTagId===J.OPTION&&e.openElements.pop(),e._insertElement(t,K.HTML);break;case J.OPTGROUP:e.openElements.currentTagId===J.OPTION&&e.openElements.pop(),e.openElements.currentTagId===J.OPTGROUP&&e.openElements.pop(),e._insertElement(t,K.HTML);break;case J.HR:e.openElements.currentTagId===J.OPTION&&e.openElements.pop(),e.openElements.currentTagId===J.OPTGROUP&&e.openElements.pop(),e._appendElement(t,K.HTML),t.ackSelfClosing=!0;break;case J.INPUT:case J.KEYGEN:case J.TEXTAREA:case J.SELECT:e.openElements.hasInSelectScope(J.SELECT)&&(e.openElements.popUntilTagNamePopped(J.SELECT),e._resetInsertionMode(),t.tagID!==J.SELECT&&e._processStartTag(t));break;case J.SCRIPT:case J.TEMPLATE:gQ(e,t);break;default:}}function qQ(e,t){switch(t.tagID){case J.OPTGROUP:e.openElements.stackTop>0&&e.openElements.currentTagId===J.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===J.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===J.OPTGROUP&&e.openElements.pop();break;case J.OPTION:e.openElements.currentTagId===J.OPTION&&e.openElements.pop();break;case J.SELECT:e.openElements.hasInSelectScope(J.SELECT)&&(e.openElements.popUntilTagNamePopped(J.SELECT),e._resetInsertionMode());break;case J.TEMPLATE:_Q(e,t);break;default:}}function hst(e,t){let n=t.tagID;n===J.CAPTION||n===J.TABLE||n===J.TBODY||n===J.TFOOT||n===J.THEAD||n===J.TR||n===J.TD||n===J.TH?(e.openElements.popUntilTagNamePopped(J.SELECT),e._resetInsertionMode(),e._processStartTag(t)):KQ(e,t)}function gst(e,t){let n=t.tagID;n===J.CAPTION||n===J.TABLE||n===J.TBODY||n===J.TFOOT||n===J.THEAD||n===J.TR||n===J.TD||n===J.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(J.SELECT),e._resetInsertionMode(),e.onEndTag(t)):qQ(e,t)}function _st(e,t){switch(t.tagID){case J.BASE:case J.BASEFONT:case J.BGSOUND:case J.LINK:case J.META:case J.NOFRAMES:case J.SCRIPT:case J.STYLE:case J.TEMPLATE:case J.TITLE:gQ(e,t);break;case J.CAPTION:case J.COLGROUP:case J.TBODY:case J.TFOOT:case J.THEAD:e.tmplInsertionModeStack[0]=Z.IN_TABLE,e.insertionMode=Z.IN_TABLE,NQ(e,t);break;case J.COL:e.tmplInsertionModeStack[0]=Z.IN_COLUMN_GROUP,e.insertionMode=Z.IN_COLUMN_GROUP,BQ(e,t);break;case J.TR:e.tmplInsertionModeStack[0]=Z.IN_TABLE_BODY,e.insertionMode=Z.IN_TABLE_BODY,HQ(e,t);break;case J.TD:case J.TH:e.tmplInsertionModeStack[0]=Z.IN_ROW,e.insertionMode=Z.IN_ROW,WQ(e,t);break;default:e.tmplInsertionModeStack[0]=Z.IN_BODY,e.insertionMode=Z.IN_BODY,OQ(e,t)}}function vst(e,t){t.tagID===J.TEMPLATE&&_Q(e,t)}function JQ(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(J.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):fQ(e,t)}function yst(e,t){t.tagID===J.HTML?OQ(e,t):XQ(e,t)}function YQ(e,t){if(t.tagID===J.HTML){if(e.fragmentContext||(e.insertionMode=Z.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===J.HTML){e._setEndLocation(e.openElements.items[0],t);let n=e.openElements.items[1];n&&!e.treeAdapter.getNodeSourceCodeLocation(n)?.endTag&&e._setEndLocation(n,t)}}else XQ(e,t)}function XQ(e,t){e.insertionMode=Z.IN_BODY,xQ(e,t)}function bst(e,t){switch(t.tagID){case J.HTML:OQ(e,t);break;case J.FRAMESET:e._insertElement(t,K.HTML);break;case J.FRAME:e._appendElement(t,K.HTML),t.ackSelfClosing=!0;break;case J.NOFRAMES:gQ(e,t);break;default:}}function xst(e,t){t.tagID===J.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==J.FRAMESET&&(e.insertionMode=Z.AFTER_FRAMESET))}function Sst(e,t){switch(t.tagID){case J.HTML:OQ(e,t);break;case J.NOFRAMES:gQ(e,t);break;default:}}function Cst(e,t){t.tagID===J.HTML&&(e.insertionMode=Z.AFTER_AFTER_FRAMESET)}function wst(e,t){t.tagID===J.HTML?OQ(e,t):ZQ(e,t)}function ZQ(e,t){e.insertionMode=Z.IN_BODY,xQ(e,t)}function Tst(e,t){switch(t.tagID){case J.HTML:OQ(e,t);break;case J.NOFRAMES:gQ(e,t);break;default:}}function Est(e,t){t.chars=`�`,e._insertCharacters(t)}function Dst(e,t){e._insertCharacters(t),e.framesetOk=!1}function QQ(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==K.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function Ost(e,t){if(Uat(t))QQ(e),e._startTagOutsideForeignContent(t);else{let n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===K.MATHML?iQ(t):r===K.SVG&&(Wat(t),aQ(t)),oQ(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function kst(e,t){if(t.tagID===J.P||t.tagID===J.BR){QQ(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){let r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===K.HTML){e._endTagOutsideForeignContent(t);break}let i=e.treeAdapter.getTagName(r);if(i.toLowerCase()===t.tagName){t.tagName=i,e.openElements.shortenToLength(n);break}}}new Set([q.AREA,q.BASE,q.BASEFONT,q.BGSOUND,q.BR,q.COL,q.EMBED,q.FRAME,q.HR,q.IMG,q.INPUT,q.KEYGEN,q.LINK,q.META,q.PARAM,q.SOURCE,q.TRACK,q.WBR]);var $Q=t$(`end`),e$=t$(`start`);function t$(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function n$(e){let t=e$(e),n=$Q(e);if(t&&n)return{start:t,end:n}}var Ast=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,jst=new Set([`mdxFlowExpression`,`mdxJsxFlowElement`,`mdxJsxTextElement`,`mdxTextExpression`,`mdxjsEsm`]),r$={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function i$(e,t){let n=Vst(e),r=vZ(`type`,{handlers:{root:Mst,element:Nst,text:Pst,comment:o$,doctype:Fst,raw:Lst},unknown:Rst}),i={parser:n?new lQ(r$):lQ.getFragmentParser(void 0,r$),handle(e){r(e,i)},stitches:!1,options:t||{}};r(e,i),s$(i,e$());let a=Hit(n?i.parser.document:i.parser.getFragment(),{file:i.options.file});return i.stitches&&hX(a,`comment`,function(e,t,n){let r=e;if(r.value.stitch&&n&&t!==void 0){let e=n.children;return e[t]=r.value.stitch,t}}),a.type===`root`&&a.children.length===1&&a.children[0].type===e.type?a.children[0]:a}function a$(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function Mst(e,t){a$(e.children,t)}function Nst(e,t){zst(e,t),a$(e.children,t),Bst(e,t)}function Pst(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);let n={type:EZ.CHARACTER,chars:e.value,location:l$(e)};s$(t,e$(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function Fst(e,t){let n={type:EZ.DOCTYPE,name:`html`,forceQuirks:!1,publicId:``,systemId:``,location:l$(e)};s$(t,e$(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function Ist(e,t){t.stitches=!0;let n=Hst(e);`children`in e&&`children`in n&&(n.children=i$({type:`root`,children:e.children},t.options).children),o$({type:`comment`,value:{stitch:n}},t)}function o$(e,t){let n=e.value,r={type:EZ.COMMENT,data:n,location:l$(e)};s$(t,e$(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function Lst(e,t){if(t.parser.tokenizer.preprocessor.html=``,t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,c$(t,e$(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(Ast,`<$1$2`):e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;let e=t.parser.tokenizer._consume();t.parser.tokenizer._callState(e)}}function Rst(e,t){let n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))Ist(n,t);else{let e=``;throw jst.has(n.type)&&(e=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),Error("Cannot compile `"+n.type+"` node"+e)}}function s$(e,t){c$(e,t);let n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=LZ.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:``,value:``}}function c$(e,t){if(t&&t.offset!==void 0){let n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function zst(e,t){let n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===LZ.PLAINTEXT)return;s$(t,e$(e));let r=t.parser.openElements.current,i=`namespaceURI`in r?r.namespaceURI:uZ.html;i===uZ.html&&n===`svg`&&(i=uZ.svg);let a=qit({...e,children:[]},{space:i===uZ.svg?`svg`:`html`}),o={type:EZ.START_TAG,tagName:n,tagID:FZ(n),selfClosing:!1,ackSelfClosing:!1,attrs:`attrs`in a?a.attrs:[],location:l$(e)};t.parser.currentToken=o,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function Bst(e,t){let n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&tat.includes(n)||t.parser.tokenizer.state===LZ.PLAINTEXT)return;s$(t,$Q(e));let r={type:EZ.END_TAG,tagName:n,tagID:FZ(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:l$(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===LZ.RCDATA||t.parser.tokenizer.state===LZ.RAWTEXT||t.parser.tokenizer.state===LZ.SCRIPT_DATA)&&(t.parser.tokenizer.state=LZ.DATA)}function Vst(e){let t=e.type===`root`?e.children[0]:e;return!!(t&&(t.type===`doctype`||t.type===`element`&&t.tagName.toLowerCase()===`html`))}function l$(e){let t=e$(e)||{line:void 0,column:void 0,offset:void 0},n=$Q(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function Hst(e){return`children`in e?OX({...e,children:[]}):OX(e)}function u$(e){return function(t,n){return i$(t,{...e,file:n})}}var d$=[`ariaDescribedBy`,`ariaLabel`,`ariaLabelledBy`],f$={ancestors:{tbody:[`table`],td:[`table`],th:[`table`],thead:[`table`],tfoot:[`table`],tr:[`table`]},attributes:{a:[...d$,`dataFootnoteBackref`,`dataFootnoteRef`,[`className`,`data-footnote-backref`],`href`],blockquote:[`cite`],code:[[`className`,/^language-./]],del:[`cite`],div:[`itemScope`,`itemType`],dl:[...d$],h2:[[`className`,`sr-only`]],img:[...d$,`longDesc`,`src`],input:[[`disabled`,!0],[`type`,`checkbox`]],ins:[`cite`],li:[[`className`,`task-list-item`]],ol:[...d$,[`className`,`contains-task-list`]],q:[`cite`],section:[`dataFootnotes`,[`className`,`footnotes`]],source:[`srcSet`],summary:[...d$],table:[...d$],ul:[...d$,[`className`,`contains-task-list`]],"*":`abbr.accept.acceptCharset.accessKey.action.align.alt.axis.border.cellPadding.cellSpacing.char.charOff.charSet.checked.clear.colSpan.color.cols.compact.coords.dateTime.dir.encType.frame.hSpace.headers.height.hrefLang.htmlFor.id.isMap.itemProp.label.lang.maxLength.media.method.multiple.name.noHref.noShade.noWrap.open.prompt.readOnly.rev.rowSpan.rows.rules.scope.selected.shape.size.span.start.summary.tabIndex.title.useMap.vAlign.value.width`.split(`.`)},clobber:[`ariaDescribedBy`,`ariaLabelledBy`,`id`,`name`],clobberPrefix:`user-content-`,protocols:{cite:[`http`,`https`],href:[`http`,`https`,`irc`,`ircs`,`mailto`,`xmpp`],longDesc:[`http`,`https`],src:[`http`,`https`]},required:{input:{disabled:!0,type:`checkbox`}},strip:[`script`],tagNames:`a.b.blockquote.br.code.dd.del.details.div.dl.dt.em.h1.h2.h3.h4.h5.h6.hr.i.img.input.ins.kbd.li.ol.p.picture.pre.q.rp.rt.ruby.s.samp.section.source.span.strike.strong.sub.summary.sup.table.tbody.td.tfoot.th.thead.tr.tt.ul.var`.split(`.`)},p$={}.hasOwnProperty;function Ust(e,t){let n={type:`root`,children:[]},r=m$({schema:t?{...f$,...t}:f$,stack:[]},e);return r&&(Array.isArray(r)?r.length===1?n=r[0]:n.children=r:n=r),n}function m$(e,t){if(t&&typeof t==`object`){let n=t;switch(typeof n.type==`string`?n.type:``){case`comment`:return Wst(e,n);case`doctype`:return Gst(e,n);case`element`:return Kst(e,n);case`root`:return qst(e,n);case`text`:return Jst(e,n);default:}}}function Wst(e,t){if(e.schema.allowComments){let e=typeof t.value==`string`?t.value:``,n=e.indexOf(`-->`),r={type:`comment`,value:n<0?e:e.slice(0,n)};return v$(r,t),r}}function Gst(e,t){if(e.schema.allowDoctypes){let e={type:`doctype`};return v$(e,t),e}}function Kst(e,t){let n=typeof t.tagName==`string`?t.tagName:``;e.stack.push(n);let r=h$(e,t.children),i=Yst(e,t.properties);e.stack.pop();let a=!1;if(n&&n!==`*`&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(a=!0,e.schema.ancestors&&p$.call(e.schema.ancestors,n))){let t=e.schema.ancestors[n],r=-1;for(a=!1;++r<t.length;)e.stack.includes(t[r])&&(a=!0)}if(!a)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;let o={type:`element`,tagName:n,properties:i,children:r};return v$(o,t),o}function qst(e,t){let n={type:`root`,children:h$(e,t.children)};return v$(n,t),n}function Jst(e,t){let n={type:`text`,value:typeof t.value==`string`?t.value:``};return v$(n,t),n}function h$(e,t){let n=[];if(Array.isArray(t)){let r=t,i=-1;for(;++i<r.length;){let t=m$(e,r[i]);t&&(Array.isArray(t)?n.push(...t):n.push(t))}}return n}function Yst(e,t){let n=e.stack[e.stack.length-1],r=e.schema.attributes,i=e.schema.required,a=r&&p$.call(r,n)?r[n]:void 0,o=r&&p$.call(r,`*`)?r[`*`]:void 0,s=t&&typeof t==`object`?t:{},c={},l;for(l in s)if(p$.call(s,l)){let t=s[l],n=g$(e,y$(a,l),l,t);n??=g$(e,y$(o,l),l,t),n!=null&&(c[l]=n)}if(i&&p$.call(i,n)){let e=i[n];for(l in e)p$.call(e,l)&&!p$.call(c,l)&&(c[l]=e[l])}return c}function g$(e,t,n,r){return t?Array.isArray(r)?Xst(e,t,n,r):_$(e,t,n,r):void 0}function Xst(e,t,n,r){let i=-1,a=[];for(;++i<r.length;){let o=_$(e,t,n,r[i]);(typeof o==`number`||typeof o==`string`)&&a.push(o)}return a}function _$(e,t,n,r){if(!(typeof r!=`boolean`&&typeof r!=`number`&&typeof r!=`string`)&&Zst(e,n,r)){if(typeof t==`object`&&t.length>1){let e=!1,n=0;for(;++n<t.length;){let i=t[n];if(i&&typeof i==`object`&&`flags`in i){if(i.test(String(r))){e=!0;break}}else if(i===r){e=!0;break}}if(!e)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function Zst(e,t,n){let r=e.schema.protocols&&p$.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||r.length===0)return!0;let i=String(n),a=i.indexOf(`:`),o=i.indexOf(`?`),s=i.indexOf(`#`),c=i.indexOf(`/`);if(a<0||c>-1&&a>c||o>-1&&a>o||s>-1&&a>s)return!0;let l=-1;for(;++l<r.length;){let e=r[l];if(a===e.length&&i.slice(0,e.length)===e)return!0}return!1}function v$(e,t){let n=n$(t);t.data&&(e.data=OX(t.data)),n&&(e.position=n)}function y$(e,t){let n,r=-1;if(e)for(;++r<e.length;){let i=e[r],a=typeof i==`string`?i:i[0];if(a===t)return i;a===`data*`&&(n=i)}if(t.length>4&&t.slice(0,4).toLowerCase()===`data`)return n}function b$(e){return function(t){return Ust(t,e)}}function x$(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}var S$=j$(/[A-Za-z]/),C$=j$(/[\dA-Za-z]/),Qst=j$(/[#-'*+\--9=?A-Z^-~]/);function w$(e){return e!==null&&(e<32||e===127)}var T$=j$(/\d/),$st=j$(/[\dA-Fa-f]/),ect=j$(/[!-/:-@[-`{-~]/);function E$(e){return e!==null&&e<-2}function D$(e){return e!==null&&(e<0||e===32)}function O$(e){return e===-2||e===-1||e===32}var k$=j$(/\p{P}|\p{S}/u),A$=j$(/\s/);function j$(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function tct(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function nct(e,t,n){let r=uX((n||{}).ignore||[]),i=rct(t),a=-1;for(;++a<i.length;)mX(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function rct(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([ict(e[0]),act(e[1])])}return t}function ict(e){return typeof e==`string`?new RegExp(tct(e),`g`):e}function act(e){return typeof e==`function`?e:function(){return e}}var M$=`phrasing`,N$=[`autolink`,`link`,`image`,`label`];function oct(){return{transforms:[pct],enter:{literalAutolink:cct,literalAutolinkEmail:P$,literalAutolinkHttp:P$,literalAutolinkWww:P$},exit:{literalAutolink:fct,literalAutolinkEmail:dct,literalAutolinkHttp:lct,literalAutolinkWww:uct}}}function sct(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:M$,notInConstruct:N$},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:M$,notInConstruct:N$},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:M$,notInConstruct:N$}]}}function cct(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function P$(e){this.config.enter.autolinkProtocol.call(this,e)}function lct(e){this.config.exit.autolinkProtocol.call(this,e)}function uct(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function dct(e){this.config.exit.autolinkEmail.call(this,e)}function fct(e){this.exit(e)}function pct(e){nct(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,mct],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,hct]],{ignore:[`link`,`linkReference`]})}function mct(e,t,n,r,i){let a=``;if(!F$(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!gct(n)))return!1;let o=_ct(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function hct(e,t,n,r){return!F$(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function gct(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function _ct(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=x$(e,`(`),a=x$(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function F$(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||A$(n)||k$(n))&&(!t||n!==47)}function I$(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}L$.peek=Ect;function vct(){this.buffer()}function yct(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function bct(){this.buffer()}function xct(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function Sct(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=I$(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Cct(e){this.exit(e)}function wct(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=I$(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Tct(e){this.exit(e)}function Ect(){return`[`}function L$(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function Dct(){return{enter:{gfmFootnoteCallString:vct,gfmFootnoteCall:yct,gfmFootnoteDefinitionLabelString:bct,gfmFootnoteDefinition:xct},exit:{gfmFootnoteCallString:Sct,gfmFootnoteCall:Cct,gfmFootnoteDefinitionLabelString:wct,gfmFootnoteDefinition:Tct}}}function Oct(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:L$},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
|
|
156
|
+
`:` `)+r.indentLines(r.containerFlow(e,a.current()),t?R$:kct))),s(),o}}function kct(e,t,n){return t===0?e:R$(e,t,n)}function R$(e,t,n){return(n?``:` `)+e}var Act=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];z$.peek=Fct;function jct(){return{canContainEols:[`delete`],enter:{strikethrough:Nct},exit:{strikethrough:Pct}}}function Mct(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:Act}],handlers:{delete:z$}}}function Nct(e){this.enter({type:`delete`,children:[]},e)}function Pct(e){this.exit(e)}function z$(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function Fct(){return`~`}function Ict(e){return e.length}function Lct(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||Ict,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=Rct(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=B$(r[d]);else{let e=B$(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&!(n.alignDelimiters===!1&&i===``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
|
|
157
|
+
`)}function Rct(e){return e==null?``:String(e)}function B$(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function zct(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),Bct);return i(),o}function Bct(e,t,n){return`>`+(n?``:` `)+e}function Vct(e,t){return V$(e,t.inConstruct,!0)&&!V$(e,t.notInConstruct,!1)}function V$(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function H$(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
158
|
+
`&&Vct(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
|
|
159
|
+
`}function Hct(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function Uct(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function Wct(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function Gct(e,t,n,r){let i=Wct(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(Uct(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,Kct);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(Hct(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:`
|
|
160
|
+
`,encode:["`"],...s.current()})),t()}return u+=s.move(`
|
|
161
|
+
`),a&&(u+=s.move(a+`
|
|
162
|
+
`)),u+=s.move(c),l(),u}function Kct(e,t,n){return(n?``:` `)+e}function U$(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function qct(e,t,n,r){let i=U$(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
|
|
163
|
+
`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function Jct(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function W$(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function G$(e){if(e===null||D$(e)||A$(e))return 1;if(k$(e))return 2}function K$(e,t,n){let r=G$(e),i=G$(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}q$.peek=Yct;function q$(e,t,n,r){let i=Jct(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=K$(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=W$(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=K$(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+W$(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function Yct(e,t,n){return n.options.emphasis||`*`}var Xct={};function J$(e,t){let n=t||Xct;return Y$(e,typeof n.includeImageAlt==`boolean`?n.includeImageAlt:!0,typeof n.includeHtml==`boolean`?n.includeHtml:!0)}function Y$(e,t,n){if(Zct(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return X$(e.children,t,n)}return Array.isArray(e)?X$(e,t,n):``}function X$(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=Y$(e[i],t,n);return r.join(``)}function Zct(e){return!!(e&&typeof e==`object`)}function Qct(e,t){let n=!1;return hX(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&J$(e)&&(t.options.setext||n))}function $ct(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(Qct(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
|
|
164
|
+
`,after:`
|
|
165
|
+
`});return r(),t(),o+`
|
|
166
|
+
`+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
|
|
167
|
+
`))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
|
|
168
|
+
`,...a.current()});return/^[\t ]/.test(l)&&(l=W$(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}Z$.peek=elt;function Z$(e){return e.value||``}function elt(){return`<`}Q$.peek=tlt;function Q$(e,t,n,r){let i=U$(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function tlt(){return`!`}$$.peek=nlt;function $$(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function nlt(){return`!`}e1.peek=rlt;function e1(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function rlt(){return"`"}function t1(e,t){let n=J$(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type===`text`&&(n===e.url||`mailto:`+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}n1.peek=ilt;function n1(e,t,n,r){let i=U$(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(t1(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function ilt(e,t,n){return t1(e,n)?`<`:`[`}r1.peek=alt;function r1(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function alt(){return`[`}function i1(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function olt(e){let t=i1(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function slt(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function a1(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function clt(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?slt(n):i1(n),s=e.ordered?o===`.`?`)`:`.`:olt(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),a1(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function llt(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function ult(e,t,n,r){let i=llt(n),a=n.bulletCurrent||i1(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function dlt(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var flt=uX([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function plt(e,t,n,r){return(e.children.some(function(e){return flt(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function mlt(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}o1.peek=hlt;function o1(e,t,n,r){let i=mlt(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=K$(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=W$(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=K$(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+W$(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function hlt(e,t,n){return n.options.strong||`*`}function glt(e,t,n,r){return n.safe(e.value,r)}function _lt(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function vlt(e,t,n){let r=(a1(n)+(n.options.ruleSpaces?` `:``)).repeat(_lt(n));return n.options.ruleSpaces?r.slice(0,-1):r}var s1={blockquote:zct,break:H$,code:Gct,definition:qct,emphasis:q$,hardBreak:H$,heading:$ct,html:Z$,image:Q$,imageReference:$$,inlineCode:e1,link:n1,linkReference:r1,list:clt,listItem:ult,paragraph:dlt,root:plt,strong:o1,text:glt,thematicBreak:vlt},c1=document.createElement(`i`);function l1(e){let t=`&`+e+`;`;c1.innerHTML=t;let n=c1.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`||n===t?!1:n}function u1(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}var ylt=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function blt(e){return e.replace(ylt,xlt)}function xlt(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return u1(n.slice(t?2:1),t?16:10)}return l1(n)||e}function Slt(){return{enter:{table:Clt,tableData:f1,tableHeader:f1,tableRow:Tlt},exit:{codeText:Elt,table:wlt,tableData:d1,tableHeader:d1,tableRow:d1}}}function Clt(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function wlt(e){this.exit(e),this.data.inTable=void 0}function Tlt(e){this.enter({type:`tableRow`,children:[]},e)}function d1(e){this.exit(e)}function f1(e){this.enter({type:`tableCell`,children:[]},e)}function Elt(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Dlt));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Dlt(e,t){return t===`|`?t:e}function Olt(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
|
|
169
|
+
`,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
|
|
170
|
+
`))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return Lct(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=s1.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function klt(){return{exit:{taskListCheckValueChecked:p1,taskListCheckValueUnchecked:p1,paragraph:jlt}}}function Alt(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:Mlt}}}function p1(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function jlt(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function Mlt(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=s1.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function Nlt(){return[oct(),Dct(),jct(),Slt(),klt()]}function Plt(e){return{extensions:[sct(),Oct(e),Mct(),Olt(e),Alt()]}}function m1(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function h1(e,t){return e.length>0?(m1(e,e.length,0,t),e):t}var g1={}.hasOwnProperty;function _1(e){let t={},n=-1;for(;++n<e.length;)Flt(t,e[n]);return t}function Flt(e,t){let n;for(n in t){let r=(g1.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){g1.call(r,a)||(r[a]=[]);let e=i[a];Ilt(r[a],Array.isArray(e)?e:e?[e]:[])}}}function Ilt(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);m1(e,0,0,r)}var Llt={tokenize:Ult,partial:!0},v1={tokenize:Wlt,partial:!0},y1={tokenize:Glt,partial:!0},b1={tokenize:Klt,partial:!0},Rlt={tokenize:qlt,partial:!0},x1={name:`wwwAutolink`,tokenize:Vlt,previous:E1},S1={name:`protocolAutolink`,tokenize:Hlt,previous:D1},C1={name:`emailAutolink`,tokenize:Blt,previous:O1},w1={};function zlt(){return{text:w1}}for(var T1=48;T1<123;)w1[T1]=C1,T1++,T1===58?T1=65:T1===91&&(T1=97);w1[43]=C1,w1[45]=C1,w1[46]=C1,w1[95]=C1,w1[72]=[C1,S1],w1[104]=[C1,S1],w1[87]=[C1,x1],w1[119]=[C1,x1];function Blt(e,t,n){let r=this,i,a;return o;function o(t){return!k1(t)||!O1.call(r,r.previous)||A1(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return k1(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(Rlt,u,l)(t):t===45||t===95||C$(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&S$(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function Vlt(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!E1.call(r,r.previous)||A1(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(Llt,e.attempt(v1,e.attempt(y1,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function Hlt(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&D1.call(r,r.previous)&&!A1(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(S$(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||w$(t)||D$(t)||A$(t)||k$(t)?n(t):e.attempt(v1,e.attempt(y1,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function Ult(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function Wlt(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(b1,c,s)(t):t===null||D$(t)||A$(t)||t!==45&&k$(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function Glt(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(b1,t,a)(o):o===null||D$(o)||A$(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function Klt(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||D$(o)||A$(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||D$(e)||A$(e)?t(e):r(e)}function a(e){return S$(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):S$(t)?(e.consume(t),o):n(t)}}function qlt(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return C$(e)?n(e):t(e)}}function E1(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||D$(e)}function D1(e){return!S$(e)}function O1(e){return!(e===47||k1(e))}function k1(e){return e===43||e===45||e===46||e===95||C$(e)}function A1(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}function j1(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&C$(e.charCodeAt(n+1))&&C$(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function M1(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var N1={name:`attention`,resolveAll:Jlt,tokenize:Ylt};function Jlt(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};P1(d,-c),P1(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=h1(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=h1(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=h1(l,M1(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=h1(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=h1(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,m1(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function Ylt(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=G$(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=G$(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function P1(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var Xlt={name:`autolink`,tokenize:Zlt};function Zlt(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return S$(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||C$(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||C$(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||w$(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):Qst(t)?(e.consume(t),l):n(t)}function u(e){return C$(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||C$(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}function F1(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return O$(r)?(e.enter(n),s(r)):t(r)}function s(r){return O$(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var I1={partial:!0,tokenize:Qlt};function Qlt(e,t,n){return r;function r(t){return O$(t)?F1(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||E$(e)?t(e):n(e)}}var L1={continuation:{tokenize:eut},exit:tut,name:`blockQuote`,tokenize:$lt};function $lt(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return O$(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function eut(e,t,n){let r=this;return i;function i(t){return O$(t)?F1(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(L1,t,n)(r)}}function tut(e){e.exit(`blockQuote`)}var R1={name:`characterEscape`,tokenize:nut};function nut(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return ect(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var z1={name:`characterReference`,tokenize:rut};function rut(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=C$,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=$st,u):(e.enter(`characterReferenceValue`),a=7,o=T$,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===C$&&!l1(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var B1={partial:!0,tokenize:aut},V1={concrete:!0,name:`codeFenced`,tokenize:iut};function iut(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),O$(t)?F1(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||E$(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(B1,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||E$(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):O$(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),F1(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||E$(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||E$(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&O$(t)?F1(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||E$(t)?e.check(B1,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||E$(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),O$(t)?F1(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),O$(t)?F1(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||E$(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function aut(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var H1={name:`codeIndented`,tokenize:sut},out={partial:!0,tokenize:cut};function sut(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),F1(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):E$(t)?e.attempt(out,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||E$(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function cut(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):E$(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):F1(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):E$(e)?i(e):n(e)}}var lut={name:`codeText`,previous:dut,resolve:uut,tokenize:fut};function uut(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function dut(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function fut(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):E$(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||E$(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var put=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&U1(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),U1(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),U1(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){let t=this.left.splice(e,1/0);U1(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);U1(this.left,t.reverse())}}};function U1(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function W1(e){let t={},n=-1,r,i,a,o,s,c,l,u=new put(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,mut(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(!(o[1].type===`linePrefix`||o[1].type===`listItemIndent`))break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return m1(e,0,1/0,u.slice(0)),!l}function mut(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var hut={resolve:_ut,tokenize:vut},gut={partial:!0,tokenize:yut};function _ut(e){return W1(e),e}function vut(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):E$(t)?e.check(gut,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function yut(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),F1(e,a,`linePrefix`)}function a(i){if(i===null||E$(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function G1(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||w$(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||E$(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||D$(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||w$(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function K1(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):E$(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||E$(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!O$(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function q1(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):E$(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),F1(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||E$(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function J1(e,t){let n;return r;function r(i){return E$(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):O$(i)?F1(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var but={name:`definition`,tokenize:Sut},xut={partial:!0,tokenize:Cut};function Sut(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return K1.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=I$(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return D$(t)?J1(e,l)(t):l(t)}function l(t){return G1(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(xut,d,d)(t)}function d(t){return O$(t)?F1(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||E$(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function Cut(e,t,n){return r;function r(t){return D$(t)?J1(e,i)(t):n(t)}function i(t){return q1(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return O$(t)?F1(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||E$(e)?t(e):n(e)}}var wut={name:`hardBreakEscape`,tokenize:Tut};function Tut(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return E$(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var Eut={name:`headingAtx`,resolve:Dut,tokenize:Out};function Dut(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},m1(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function Out(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||D$(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||E$(n)?(e.exit(`atxHeading`),t(n)):O$(n)?F1(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||D$(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var kut=`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.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),Y1=[`pre`,`script`,`style`,`textarea`],Aut={concrete:!0,name:`htmlFlow`,resolveTo:Nut,tokenize:Put},jut={partial:!0,tokenize:Iut},Mut={partial:!0,tokenize:Fut};function Nut(e){let t=e.length;for(;t--&&!(e[t][0]===`enter`&&e[t][1].type===`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Put(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:j):S$(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):S$(a)?(e.consume(a),i=4,r.interrupt?t:j):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:j):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return S$(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||D$(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&Y1.includes(l)?(i=1,r.interrupt?t(s):O(s)):kut.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||C$(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return O$(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||S$(t)?(e.consume(t),b):O$(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||C$(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):O$(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):O$(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||E$(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||D$(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||O$(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||E$(t)?O(t):O$(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),A):t===60&&i===1?(e.consume(t),ne):t===62&&i===4?(e.consume(t),ae):t===63&&i===3?(e.consume(t),j):t===93&&i===5?(e.consume(t),ie):E$(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(jut,oe,ee)(t)):t===null||E$(t)?(e.exit(`htmlFlowData`),ee(t)):(e.consume(t),O)}function ee(t){return e.check(Mut,te,oe)(t)}function te(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),k}function k(t){return t===null||E$(t)?ee(t):(e.enter(`htmlFlowData`),O(t))}function A(t){return t===45?(e.consume(t),j):O(t)}function ne(t){return t===47?(e.consume(t),o=``,re):O(t)}function re(t){if(t===62){let n=o.toLowerCase();return Y1.includes(n)?(e.consume(t),ae):O(t)}return S$(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),re):O(t)}function ie(t){return t===93?(e.consume(t),j):O(t)}function j(t){return t===62?(e.consume(t),ae):t===45&&i===2?(e.consume(t),j):O(t)}function ae(t){return t===null||E$(t)?(e.exit(`htmlFlowData`),oe(t)):(e.consume(t),ae)}function oe(n){return e.exit(`htmlFlow`),t(n)}}function Fut(e,t,n){let r=this;return i;function i(t){return E$(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function Iut(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(I1,t,n)}}var Lut={name:`htmlText`,tokenize:Rut};function Rut(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):S$(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):S$(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):E$(t)?(o=d,ne(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?A(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):E$(t)?(o=h,ne(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?A(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?A(t):E$(t)?(o=v,ne(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):E$(t)?(o=y,ne(t)):(e.consume(t),y)}function b(e){return e===62?A(e):y(e)}function x(t){return S$(t)?(e.consume(t),S):n(t)}function S(t){return t===45||C$(t)?(e.consume(t),S):C(t)}function C(t){return E$(t)?(o=C,ne(t)):O$(t)?(e.consume(t),C):A(t)}function w(t){return t===45||C$(t)?(e.consume(t),w):t===47||t===62||D$(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),A):t===58||t===95||S$(t)?(e.consume(t),E):E$(t)?(o=T,ne(t)):O$(t)?(e.consume(t),T):A(t)}function E(t){return t===45||t===46||t===58||t===95||C$(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):E$(t)?(o=D,ne(t)):O$(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,ee):E$(t)?(o=O,ne(t)):O$(t)?(e.consume(t),O):(e.consume(t),te)}function ee(t){return t===i?(e.consume(t),i=void 0,k):t===null?n(t):E$(t)?(o=ee,ne(t)):(e.consume(t),ee)}function te(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||D$(t)?T(t):(e.consume(t),te)}function k(e){return e===47||e===62||D$(e)?T(e):n(e)}function A(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function ne(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),re}function re(t){return O$(t)?F1(e,ie,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):ie(t)}function ie(t){return e.enter(`htmlTextData`),o(t)}}var X1={name:`labelEnd`,resolveAll:Hut,resolveTo:Uut,tokenize:Wut},zut={tokenize:Gut},But={tokenize:Kut},Vut={tokenize:qut};function Hut(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&m1(e,0,e.length,n),e}function Uut(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=h1(s,e.slice(a+1,a+r+3)),s=h1(s,[[`enter`,u,t]]),s=h1(s,M1(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=h1(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=h1(s,e.slice(o+1)),s=h1(s,[[`exit`,c,t]]),m1(e,a,e.length,s),e}function Wut(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(I$(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(zut,u,o?u:d)(t):t===91?e.attempt(But,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(Vut,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function Gut(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return D$(t)?J1(e,a)(t):a(t)}function a(t){return t===41?u(t):G1(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return D$(t)?J1(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?q1(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return D$(t)?J1(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function Kut(e,t,n){let r=this;return i;function i(t){return K1.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(I$(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function qut(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var Jut={name:`labelStartImage`,resolveAll:X1.resolveAll,tokenize:Yut};function Yut(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var Xut={name:`labelStartLink`,resolveAll:X1.resolveAll,tokenize:Zut};function Zut(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var Z1={name:`lineEnding`,tokenize:Qut};function Qut(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),F1(e,t,`linePrefix`)}}var Q1={name:`thematicBreak`,tokenize:$ut};function $ut(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||E$(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),O$(t)?F1(e,s,`whitespace`)(t):s(t))}}var $1={continuation:{tokenize:rdt},exit:adt,name:`list`,tokenize:ndt},edt={partial:!0,tokenize:odt},tdt={partial:!0,tokenize:idt};function ndt(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:T$(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(Q1,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return T$(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(I1,r.interrupt?n:u,e.attempt(edt,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return O$(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function rdt(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(I1,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,F1(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!O$(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(tdt,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,F1(e,e.attempt($1,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function idt(e,t,n){let r=this;return F1(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function adt(e){e.exit(this.containerState.type)}function odt(e,t,n){let r=this;return F1(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!O$(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var e0={name:`setextUnderline`,resolveTo:sdt,tokenize:cdt};function sdt(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function cdt(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),O$(t)?F1(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||E$(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var ldt={tokenize:_dt,partial:!0};function udt(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:mdt,continuation:{tokenize:hdt},exit:gdt}},text:{91:{name:`gfmFootnoteCall`,tokenize:pdt},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:ddt,resolveTo:fdt}}}}function ddt(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=I$(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function fdt(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function pdt(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||D$(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(I$(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return D$(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function mdt(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||D$(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=I$(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return D$(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),F1(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function hdt(e,t,n){return e.check(I1,t,e.attempt(ldt,t,n))}function gdt(e){e.exit(`gfmFootnoteDefinition`)}function _dt(e,t,n){let r=this;return F1(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function vdt(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&m1(o,o.length,0,M1(s,e.slice(r+1,n),t)),m1(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),m1(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=G$(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=G$(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var ydt=class{constructor(){this.map=[]}add(e,t,n){bdt(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function bdt(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function xdt(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function Sdt(){return{flow:{null:{name:`table`,tokenize:Cdt,resolveAll:wdt}}}}function Cdt(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):E$(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):O$(t)?F1(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||D$(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,O$(t)?F1(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return O$(t)?F1(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||E$(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return O$(t)?F1(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||E$(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||E$(n)?(e.exit(`tableRow`),t(n)):O$(n)?F1(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||D$(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function wdt(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new ydt;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(n0(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=t0(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=t0(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=t0(f,t,o,i,n,d)):(o[0]=o[1],d=t0(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&n0(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=xdt(t.events,n))}return e}function t0(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},r0(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=r0(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=r0(t.events,n[2]),a=r0(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},r0(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function n0(e,t,n,r,i){let a=[],o=r0(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function r0(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var Tdt={name:`tasklistCheck`,tokenize:Ddt};function Edt(){return{text:{91:Tdt}}}function Ddt(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return D$(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return E$(r)?t(r):O$(r)?e.check({tokenize:Odt},t,n)(r):n(r)}}function Odt(e,t,n){return F1(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function kdt(e){return _1([zlt(),udt(),vdt(e),Sdt(),Edt()])}var Adt={};function jdt(e){let t=this,n=e||Adt,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(kdt(n)),a.push(Nlt()),o.push(Plt(n))}var Mdt=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ndt=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Pdt={};function i0(e,t){return((t||Pdt).jsx?Ndt:Mdt).test(e)}var Fdt=/[ \t\n\f\r]/g;function Idt(e){return typeof e==`object`?e.type===`text`?a0(e.value):!1:a0(e)}function a0(e){return e.replace(Fdt,``)===``}var Ldt=o(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g,u=`
|
|
171
|
+
`,d=`/`,f=`*`,p=``,m=`comment`,h=`declaration`;function g(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,g=1;function v(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(u);g=~n?e.length-n:g+e.length}function y(){var e={line:l,column:g};return function(t){return t.position=new b(e),C(),t}}function b(e){this.start=e,this.end={line:l,column:g},this.source=t.source}b.prototype.content=e;function x(n){var r=Error(t.source+`:`+l+`:`+g+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=g,r.source=e,!t.silent)throw r}function S(t){var n=t.exec(e);if(n){var r=n[0];return v(r),e=e.slice(r.length),n}}function C(){S(i)}function w(e){var t;for(e||=[];t=T();)t!==!1&&e.push(t);return e}function T(){var t=y();if(!(d!=e.charAt(0)||f!=e.charAt(1))){for(var n=2;p!=e.charAt(n)&&(f!=e.charAt(n)||d!=e.charAt(n+1));)++n;if(n+=2,p===e.charAt(n-1))return x(`End of comment missing`);var r=e.slice(2,n-2);return g+=2,v(r),e=e.slice(n),g+=2,t({type:m,comment:r})}}function E(){var e=y(),t=S(a);if(t){if(T(),!S(o))return x(`property missing ':'`);var r=S(s),i=e({type:h,property:_(t[0].replace(n,p)),value:r?_(r[0].replace(n,p)):p});return S(c),i}}function D(){var e=[];w(e);for(var t;t=E();)t!==!1&&(e.push(t),w(e));return e}return C(),D()}function _(e){return e?e.replace(l,p):p}t.exports=g})),Rdt=o((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var n=t(Ldt());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),zdt=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),Bdt=o(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(Rdt()),r=zdt();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i}));function o0(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?c0(e.position):`start`in e||`end`in e?c0(e):`line`in e||`column`in e?s0(e):``}function s0(e){return l0(e&&e.line)+`:`+l0(e&&e.column)}function c0(e){return s0(e&&e.start)+`-`+s0(e&&e.end)}function l0(e){return e&&typeof e==`number`?e:1}var u0=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=o0(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};u0.prototype.file=``,u0.prototype.name=``,u0.prototype.reason=``,u0.prototype.message=``,u0.prototype.stack=``,u0.prototype.column=void 0,u0.prototype.line=void 0,u0.prototype.ancestors=void 0,u0.prototype.cause=void 0,u0.prototype.fatal=void 0,u0.prototype.place=void 0,u0.prototype.ruleId=void 0,u0.prototype.source=void 0;var Vdt=u(Bdt(),1),d0={}.hasOwnProperty,Hdt=new Map,Udt=/[A-Z]/g,Wdt=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),Gdt=new Set([`td`,`th`]);function Kdt(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=eft(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=$dt(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?eZ:$X,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=f0(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function f0(e,t,n){if(t.type===`element`)return qdt(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return Jdt(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return Xdt(e,t,n);if(t.type===`mdxjsEsm`)return Ydt(e,t);if(t.type===`root`)return Zdt(e,t,n);if(t.type===`text`)return Qdt(e,t)}function qdt(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=eZ,e.schema=i),e.ancestors.push(t);let a=g0(e,t.tagName,!1),o=tft(e,t),s=h0(e,t);return Wdt.has(t.tagName)&&(s=s.filter(function(e){return typeof e==`string`?!Idt(e):!0})),p0(e,o,a,t),m0(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Jdt(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}_0(e,t.position)}function Ydt(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);_0(e,t.position)}function Xdt(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=eZ,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:g0(e,t.name,!0),o=nft(e,t),s=h0(e,t);return p0(e,o,a,t),m0(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Zdt(e,t,n){let r={};return m0(r,h0(e,t)),e.create(t,e.Fragment,r,n)}function Qdt(e,t){return t.value}function p0(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function m0(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function $dt(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function eft(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=e$(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function tft(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&d0.call(t.properties,i)){let a=rft(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&Gdt.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function nft(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`)if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else _0(e,t.position);else{let i=r.name,a;if(r.value&&typeof r.value==`object`)if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else _0(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function h0(e,t){let n=[],r=-1,i=e.passKeys?new Map:Hdt;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=f0(e,a,o);s!==void 0&&n.push(s)}return n}function rft(e,t,n){let r=QX(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?nZ(n):aZ(n)),r.property===`style`){let t=typeof n==`object`?n:ift(e,String(n));return e.stylePropertyNameCase===`css`&&(t=aft(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?Dit[r.property]||r.property:r.attribute,n]}}function ift(e,t){try{return(0,Vdt.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new u0("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=`https://github.com/syntax-tree/hast-util-to-jsx-runtime#cannot-parse-style-attribute`,r}}function g0(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=i0(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=i0(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return d0.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);_0(e)}function _0(e,t){let n=new u0("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=`https://github.com/syntax-tree/hast-util-to-jsx-runtime#cannot-handle-mdx-estrees-without-createevaluater`,n}function aft(e){let t={},n;for(n in e)d0.call(e,n)&&(t[oft(n)]=e[n]);return t}function oft(e){let t=e.replace(Udt,sft);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function sft(e){return`-`+e.toLowerCase()}var v0={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},cft={tokenize:lft};function lft(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),F1(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return E$(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var uft={tokenize:dft},y0={tokenize:fft};function dft(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return m1(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(y0,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(y0,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return E$(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;m1(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-- >r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function fft(e,t,n){return F1(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}var pft={tokenize:mft};function mft(e){let t=this,n=e.attempt(I1,r,e.attempt(this.parser.constructs.flowInitial,i,F1(e,e.attempt(this.parser.constructs.flow,i,e.attempt(hut,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var hft={resolveAll:x0()},gft=b0(`string`),_ft=b0(`text`);function b0(e){return{resolveAll:x0(e===`text`?vft:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function x0(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function vft(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var yft=s({attentionMarkers:()=>Dft,contentInitial:()=>xft,disable:()=>Oft,document:()=>bft,flow:()=>Cft,flowInitial:()=>Sft,insideSpan:()=>Eft,string:()=>wft,text:()=>Tft}),bft={42:$1,43:$1,45:$1,48:$1,49:$1,50:$1,51:$1,52:$1,53:$1,54:$1,55:$1,56:$1,57:$1,62:L1},xft={91:but},Sft={[-2]:H1,[-1]:H1,32:H1},Cft={35:Eut,42:Q1,45:[e0,Q1],60:Aut,61:e0,95:Q1,96:V1,126:V1},wft={38:z1,92:R1},Tft={[-5]:Z1,[-4]:Z1,[-3]:Z1,33:Jut,38:z1,42:N1,60:[Xlt,Lut],91:Xut,92:[wut,R1],93:X1,95:N1,96:lut},Eft={null:[N1,hft]},Dft={null:[42,95]},Oft={null:[]};function kft(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=h1(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=M1(a,l.events,l),l.events):[]}function f(e,t){return jft(p(e),t)}function p(e){return Aft(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){E$(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&m1(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Aft(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function jft(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
|
|
172
|
+
`;break;case-3:o=`\r
|
|
173
|
+
`;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function Mft(e){let t={constructs:_1([yft,...(e||{}).extensions||[]]),content:n(cft),defined:[],document:n(uft),flow:n(pft),lazy:{},string:n(gft),text:n(_ft)};return t;function n(e){return n;function n(n){return kft(t,e,n)}}}function Nft(e){for(;!W1(e););return e}var S0=/[\0\t\n\r]/g;function Pft(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(S0.lastIndex=u,c=S0.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var C0={}.hasOwnProperty;function Fft(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),Ift(n)(Nft(Mft(n).document().write(Pft()(e,t,!0))))}function Ift(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(Ce),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(ye),blockQuote:a(me),characterEscape:T,characterReference:T,codeFenced:a(he),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(he,o),codeText:a(ge,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(_e),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(ve),hardBreakEscape:a(be),hardBreakTrailing:a(be),htmlFlow:a(xe,o),htmlFlowData:T,htmlText:a(xe,o),htmlTextData:T,image:a(Se),label:o,link:a(Ce),listItem:a(Te),listItemValue:f,listOrdered:a(we,d),listUnordered:a(we),paragraph:a(Ee),reference:se,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(ye),strong:a(De),thematicBreak:a(ke)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:pe,autolinkProtocol:fe,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:le,characterReferenceMarkerNumeric:le,characterReferenceValue:ue,characterReference:de,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(k),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(ee),htmlFlowData:E,htmlText:c(te),htmlTextData:E,image:c(ne),label:ie,labelText:re,lineEnding:D,link:c(A),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:ce,resourceDestinationString:j,resourceTitleString:ae,resource:oe,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};T0(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];C0.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||E0).call(a,void 0,e[0])}for(r.position={start:w0(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:w0(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(!(t[1].type===`linePrefix`||t[1].type===`blockQuotePrefix`||t[1].type===`blockQuotePrefixWhitespace`||t[1].type===`blockQuoteMarker`||t[1].type===`listItemIndent`))break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:w0(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||E0).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+o0({start:e.start,end:e.end})+`): it’s not open`);n.position.end=w0(e.end)}function u(){return J$(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=I$(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=Oe(),n.position={start:w0(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=w0(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=w0(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function O(){this.data.atHardBreak=!0}function ee(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function te(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function ne(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function re(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=blt(t),n.identifier=I$(t).toLowerCase()}function ie(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function ae(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function oe(){this.data.inReference=void 0}function se(){this.data.referenceType=`collapsed`}function ce(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=I$(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function le(e){this.data.characterReferenceType=e.type}function ue(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=u1(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=l1(t);let i=this.stack[this.stack.length-1];i.value+=r}function de(e){let t=this.stack.pop();t.position.end=w0(e.end)}function fe(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function pe(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function me(){return{type:`blockquote`,children:[]}}function he(){return{type:`code`,lang:null,meta:null,value:``}}function ge(){return{type:`inlineCode`,value:``}}function _e(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function ve(){return{type:`emphasis`,children:[]}}function ye(){return{type:`heading`,depth:0,children:[]}}function be(){return{type:`break`}}function xe(){return{type:`html`,value:``}}function Se(){return{type:`image`,title:null,url:``,alt:null}}function Ce(){return{type:`link`,title:null,url:``,children:[]}}function we(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function Te(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function Ee(){return{type:`paragraph`,children:[]}}function De(){return{type:`strong`,children:[]}}function Oe(){return{type:`text`,value:``}}function ke(){return{type:`thematicBreak`}}}function w0(e){return{line:e.line,column:e.column,offset:e.offset}}function T0(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?T0(e,r):Lft(e,r)}}function Lft(e,t){let n;for(n in t)if(C0.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function E0(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+o0({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+o0({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+o0({start:t.start,end:t.end})+`) is still open`)}function Rft(e){let t=this;t.parser=n;function n(n){return Fft(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function zft(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Bft(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
|
|
174
|
+
`}]}function Vft(e,t){let n=t.value?t.value+`
|
|
175
|
+
`:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function Hft(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Uft(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Wft(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=j1(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function Gft(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Kft(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function D0(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function qft(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return D0(e,t);let i={src:j1(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function Jft(e,t){let n={src:j1(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function Yft(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function Xft(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return D0(e,t);let i={href:j1(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function Zft(e,t){let n={href:j1(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Qft(e,t,n){let r=e.all(t),i=n?$ft(n):O0(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
|
|
176
|
+
`}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
|
|
177
|
+
`});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function $ft(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=O0(n[r])}return t}function O0(e){return e.spread??e.children.length>1}function ept(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function tpt(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function npt(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function rpt(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ipt(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=e$(t.children[1]),o=$Q(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function apt(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function opt(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var k0=9,A0=32;function spt(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(j0(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(j0(t.slice(i),i>0,!1)),a.join(``)}function j0(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===k0||t===A0;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===k0||t===A0;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function cpt(e,t){let n={type:`text`,value:spt(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function lpt(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var upt={blockquote:zft,break:Bft,code:Vft,delete:Hft,emphasis:Uft,footnoteReference:Wft,heading:Gft,html:Kft,imageReference:qft,image:Jft,inlineCode:Yft,linkReference:Xft,link:Zft,listItem:Qft,list:ept,paragraph:tpt,root:npt,strong:rpt,table:ipt,tableCell:opt,tableRow:apt,text:cpt,thematicBreak:lpt,toml:M0,yaml:M0,definition:M0,footnoteDefinition:M0};function M0(){}function dpt(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function fpt(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function ppt(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||dpt,r=e.options.footnoteBackLabel||fpt,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=j1(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...OX(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
|
|
178
|
+
`},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
|
|
179
|
+
`}]}}var N0={}.hasOwnProperty,mpt={};function hpt(e,t){let n=t||mpt,r=new Map,i=new Map,a={all:s,applyData:_pt,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...upt,...n.handlers},one:o,options:n,patch:gpt,wrap:ypt};return hX(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(N0.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=OX(n);return r.children=a.all(e),r}return OX(e)}return(a.options.unknownHandler||vpt)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=P0(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=P0(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function gpt(e,t){e.position&&(t.position=n$(e))}function _pt(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,OX(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function vpt(e,t){let n=t.data||{},r=`value`in t&&!(N0.call(n,`hProperties`)||N0.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function ypt(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
|
|
180
|
+
`});++r<e.length;)r&&n.push({type:`text`,value:`
|
|
181
|
+
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
|
|
182
|
+
`}),n}function P0(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function F0(e,t){let n=hpt(e,t),r=n.one(e,void 0),i=ppt(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
|
|
183
|
+
`},i)),a}function bpt(e,t){return e&&`run`in e?async function(n,r){let i=F0(n,{file:r,...t});await e.run(i,r)}:function(n,r){return F0(n,{file:r,...e||t})}}function I0(e){if(e)throw e}var xpt=o(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function L0(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Spt(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?Cpt(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function Cpt(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var R0={basename:wpt,dirname:Tpt,extname:Ept,join:Dpt,sep:`/`};function wpt(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);z0(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function Tpt(e){if(z0(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function Ept(e){z0(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function Dpt(...e){let t=-1,n;for(;++t<e.length;)z0(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:Opt(n)}function Opt(e){z0(e);let t=e.codePointAt(0)===47,n=kpt(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function kpt(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(!(i===o-1||a===1))if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function z0(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var Apt={cwd:jpt};function jpt(){return`/`}function B0(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function Mpt(e){if(typeof e==`string`)e=new URL(e);else if(!B0(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return Npt(e)}function Npt(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var V0=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],Ppt=class{constructor(e){let t;t=e?B0(e)?{path:e}:typeof e==`string`||Fpt(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:Apt.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<V0.length;){let e=V0[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)V0.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?R0.basename(this.path):void 0}set basename(e){U0(e,`basename`),H0(e,`basename`),this.path=R0.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?R0.dirname(this.path):void 0}set dirname(e){W0(this.basename,`dirname`),this.path=R0.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?R0.extname(this.path):void 0}set extname(e){if(H0(e,`extname`),W0(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=R0.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){B0(e)&&(e=Mpt(e)),U0(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?R0.basename(this.path,this.extname):void 0}set stem(e){U0(e,`stem`),H0(e,`stem`),this.path=R0.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new u0(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function H0(e,t){if(e&&e.includes(R0.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+R0.sep+"`")}function U0(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function W0(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function Fpt(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var Ipt=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),G0=u(xpt(),1),Lpt={}.hasOwnProperty,Rpt=new class e extends Ipt{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Spt()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,G0.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(J0(`data`,this.frozen),this.namespace[e]=t,this):Lpt.call(this.namespace,e)&&this.namespace[e]||void 0:e?(J0(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=Z0(e),n=this.parser||this.Parser;return K0(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),K0(`process`,this.parser||this.Parser),q0(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=Z0(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);Bpt(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),K0(`processSync`,this.parser||this.Parser),q0(`processSync`,this.compiler||this.Compiler),this.process(e,r),X0(`processSync`,`process`,t),n;function r(e,r){t=!0,I0(e),n=r}}run(e,t,n){Y0(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=Z0(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),X0(`runSync`,`run`,n),r;function i(e,t){I0(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=Z0(t),r=this.compiler||this.Compiler;return q0(`stringify`,r),Y0(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(J0(`use`,this.frozen),e!=null)if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`)if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e);else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,G0.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null)if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];L0(o)&&L0(r)&&(r=(0,G0.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function K0(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function q0(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function J0(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Y0(e){if(!L0(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function X0(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function Z0(e){return zpt(e)?e:new Ppt(e)}function zpt(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function Bpt(e){return typeof e==`string`||Vpt(e)}function Vpt(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}function Q0(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var $0=Q0();function e2(e){$0=e}var t2={exec:()=>null};function n2(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(r2.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var Hpt=(()=>{try{return!0}catch{return!1}})(),r2={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:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,`i`),blockquoteBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}>`)},Upt=/^(?:[ \t]*(?:\n|$))+/,Wpt=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Gpt=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,i2=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Kpt=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,a2=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,o2=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,s2=n2(o2).replace(/bull/g,a2).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}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),qpt=n2(o2).replace(/bull/g,a2).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}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),c2=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Jpt=/^[^\n]+/,l2=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Ypt=n2(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,l2).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Xpt=n2(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,a2).getRegex(),u2=`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`,d2=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Zpt=n2(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\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`,d2).replace(`tag`,u2).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),f2=n2(c2).replace(`hr`,i2).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,u2).getRegex(),p2={blockquote:n2(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,f2).getRegex(),code:Wpt,def:Ypt,fences:Gpt,heading:Kpt,hr:i2,html:Zpt,lheading:s2,list:Xpt,newline:Upt,paragraph:f2,table:t2,text:Jpt},m2=n2(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,i2).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,u2).getRegex(),Qpt={...p2,lheading:qpt,table:m2,paragraph:n2(c2).replace(`hr`,i2).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,m2).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,u2).getRegex()},$pt={...p2,html:n2(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,d2).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:t2,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:n2(c2).replace(`hr`,i2).replace(`heading`,` *#{1,6} *[^
|
|
184
|
+
]`).replace(`lheading`,s2).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},emt=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,tmt=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,h2=/^( {2,}|\\)\n(?!\s*$)/,nmt=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,g2=/[\p{P}\p{S}]/u,_2=/[\s\p{P}\p{S}]/u,v2=/[^\s\p{P}\p{S}]/u,rmt=n2(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,_2).getRegex(),y2=/(?!~)[\p{P}\p{S}]/u,imt=/(?!~)[\s\p{P}\p{S}]/u,amt=/(?:[^\s\p{P}\p{S}]|~)/u,omt=n2(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,Hpt?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),b2=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,smt=n2(b2,`u`).replace(/punct/g,g2).getRegex(),cmt=n2(b2,`u`).replace(/punct/g,y2).getRegex(),x2=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,lmt=n2(x2,`gu`).replace(/notPunctSpace/g,v2).replace(/punctSpace/g,_2).replace(/punct/g,g2).getRegex(),umt=n2(x2,`gu`).replace(/notPunctSpace/g,amt).replace(/punctSpace/g,imt).replace(/punct/g,y2).getRegex(),dmt=n2(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,v2).replace(/punctSpace/g,_2).replace(/punct/g,g2).getRegex(),fmt=n2(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,g2).getRegex(),pmt=n2(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,v2).replace(/punctSpace/g,_2).replace(/punct/g,g2).getRegex(),mmt=n2(/\\(punct)/,`gu`).replace(/punct/g,g2).getRegex(),hmt=n2(/^<(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(),gmt=n2(d2).replace(`(?:-->|$)`,`-->`).getRegex(),_mt=n2(`^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`,gmt).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),S2=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,vmt=n2(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace(`label`,S2).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),C2=n2(/^!?\[(label)\]\[(ref)\]/).replace(`label`,S2).replace(`ref`,l2).getRegex(),w2=n2(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,l2).getRegex(),ymt=n2(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,C2).replace(`nolink`,w2).getRegex(),T2=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,E2={_backpedal:t2,anyPunctuation:mmt,autolink:hmt,blockSkip:omt,br:h2,code:tmt,del:t2,delLDelim:t2,delRDelim:t2,emStrongLDelim:smt,emStrongRDelimAst:lmt,emStrongRDelimUnd:dmt,escape:emt,link:vmt,nolink:w2,punctuation:rmt,reflink:C2,reflinkSearch:ymt,tag:_mt,text:nmt,url:t2},bmt={...E2,link:n2(/^!?\[(label)\]\((.*?)\)/).replace(`label`,S2).getRegex(),reflink:n2(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,S2).getRegex()},D2={...E2,emStrongRDelimAst:umt,emStrongLDelim:cmt,delLDelim:fmt,delRDelim:pmt,url:n2(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`protocol`,T2).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:n2(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace(`protocol`,T2).getRegex()},xmt={...D2,br:n2(h2).replace(`{2,}`,`*`).getRegex(),text:n2(D2.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},O2={normal:p2,gfm:Qpt,pedantic:$pt},k2={normal:E2,gfm:D2,breaks:xmt,pedantic:bmt},Smt={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},A2=e=>Smt[e];function j2(e,t){if(t){if(r2.escapeTest.test(e))return e.replace(r2.escapeReplace,A2)}else if(r2.escapeTestNoEncode.test(e))return e.replace(r2.escapeReplaceNoEncode,A2);return e}function M2(e){try{e=encodeURI(e).replace(r2.percentDecode,`%`)}catch{return null}return e}function N2(e,t){let n=e.replace(r2.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(r2.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(r2.slashPipe,`|`);return n}function P2(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 Cmt(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 wmt(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 F2(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`);r.state.inLink=!0;let c={type:e[0].charAt(0)===`!`?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,c}function Tmt(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
|
|
185
|
+
`).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(`
|
|
186
|
+
`)}var I2=class{options;rules;lexer;constructor(e){this.options=e||$0}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=t[0].replace(this.rules.other.codeRemoveIndent,``);return{type:`code`,raw:t[0],codeBlockStyle:`indented`,text:this.options.pedantic?e:P2(e,`
|
|
187
|
+
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=Tmt(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=P2(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:t[0],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:P2(t[0],`
|
|
188
|
+
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=P2(t[0],`
|
|
189
|
+
`).split(`
|
|
190
|
+
`),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(`
|
|
191
|
+
`),c=s.replace(this.rules.other.blockquoteSetextReplace,`
|
|
192
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
|
|
193
|
+
${s}`:s,r=r?`${r}
|
|
194
|
+
${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=t.raw+`
|
|
195
|
+
`+e.join(`
|
|
196
|
+
`),o=this.blockquote(a);i[i.length-1]=o,n=n.substring(0,n.length-t.raw.length)+o.raw,r=r.substring(0,r.length-t.text.length)+o.text;break}else if(u?.type===`list`){let t=u,a=t.raw+`
|
|
197
|
+
`+e.join(`
|
|
198
|
+
`),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(`
|
|
199
|
+
`);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=wmt(t[2].split(`
|
|
200
|
+
`,1)[0],t[1].length),l=e.split(`
|
|
201
|
+
`,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+`
|
|
202
|
+
`,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(`
|
|
203
|
+
`,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+=`
|
|
204
|
+
`+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+=`
|
|
205
|
+
`+l}u=!l.trim(),r+=p+`
|
|
206
|
+
`,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,[]),e.task){if(e.text=e.text.replace(this.rules.other.listReplaceTask,``),e.tokens[0]?.type===`text`||e.tokens[0]?.type===`paragraph`){e.tokens[0].raw=e.tokens[0].raw.replace(this.rules.other.listReplaceTask,``),e.tokens[0].text=e.tokens[0].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 t=this.rules.other.listTaskCheckbox.exec(e.raw);if(t){let n={type:`checkbox`,raw:t[0]+` `,checked:t[0]!==`[ ]`};e.checked=n.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=n.raw+e.tokens[0].raw,e.tokens[0].text=n.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(n)):e.tokens.unshift({type:`paragraph`,raw:n.raw,text:n.raw,tokens:[n]}):e.tokens.unshift(n)}}if(!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))}}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)return{type:`html`,block:!0,raw:t[0],pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:t[0]}}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:t[0],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=N2(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
|
|
207
|
+
`):[],a={type:`table`,raw:t[0],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(N2(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:t[0],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)===`
|
|
208
|
+
`?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=P2(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=Cmt(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)),F2(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 F2(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 n=[...r[0]].length-1,i,a,o=n,s=0,c=r[0][0]===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);(r=c.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(a=[...i].length,r[3]||r[4]){o+=a;continue}else if((r[5]||r[6])&&n%3&&!((n+a)%3)){s+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+s);let t=[...r[0]][0].length,c=e.slice(0,n+r.index+t+a);if(Math.min(n,a)%2){let e=c.slice(1,-1);return{type:`em`,raw:c,text:e,tokens:this.lexer.inlineTokens(e)}}let l=c.slice(2,-2);return{type:`strong`,raw:c,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}}}},L2=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||$0,this.options.tokenizer=this.options.tokenizer||new I2,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:r2,block:O2.normal,inline:k2.normal};this.options.pedantic?(t.block=O2.pedantic,t.inline=k2.pedantic):this.options.gfm&&(t.block=O2.gfm,this.options.breaks?t.inline=k2.breaks:t.inline=k2.gfm),this.tokenizer.rules=t}static get rules(){return{block:O2,inline:k2}}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(r2.carriageReturn,`
|
|
209
|
+
`),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){for(this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(r2.tabCharGlobal,` `).replace(r2.spaceLine,``));e;){let r;if(this.options.extensions?.block?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let n=t.at(-1);r.raw.length===1&&n!==void 0?n.raw+=`
|
|
210
|
+
`:t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
211
|
+
`)?``:`
|
|
212
|
+
`)+r.raw,n.text+=`
|
|
213
|
+
`+r.text,this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
214
|
+
`)?``:`
|
|
215
|
+
`)+r.raw,n.text+=`
|
|
216
|
+
`+r.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title},t.push(r));continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}let i=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&&(i=e.substring(0,t+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){let a=t.at(-1);n&&a?.type===`paragraph`?(a.raw+=(a.raw.endsWith(`
|
|
217
|
+
`)?``:`
|
|
218
|
+
`)+r.raw,a.text+=`
|
|
219
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(r),n=i.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
220
|
+
`)?``:`
|
|
221
|
+
`)+r.raw,n.text+=`
|
|
222
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}else throw Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=e,r=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(n))!==null;)e.includes(r[0].slice(r[0].lastIndexOf(`[`)+1,-1))&&(n=n.slice(0,r.index)+`[`+`a`.repeat(r[0].length-2)+`]`+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(n))!==null;)n=n.slice(0,r.index)+`++`+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(n))!==null;)i=r[2]?r[2].length:0,n=n.slice(0,r.index+i)+`[`+`a`.repeat(r[0].length-i-2)+`]`+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let a=!1,o=``;for(;e;){a||(o=``),a=!1;let r;if(this.options.extensions?.inline?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.escape(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.tag(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.link(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length);let n=t.at(-1);r.type===`text`&&n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(r=this.tokenizer.emStrong(e,n,o)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.codespan(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.br(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.del(e,n,o)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.autolink(e)){e=e.substring(r.raw.length),t.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(e))){e=e.substring(r.raw.length),t.push(r);continue}let i=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&&(i=e.substring(0,t+1))}if(r=this.tokenizer.inlineText(i)){e=e.substring(r.raw.length),r.raw.slice(-1)!==`_`&&(o=r.raw.slice(-1)),a=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}else throw Error(t)}}return t}},R2=class{options;parser;constructor(e){this.options=e||$0}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(r2.notSpaceStart)?.[0],i=e.replace(r2.endingNewline,``)+`
|
|
223
|
+
`;return r?`<pre><code class="language-`+j2(r)+`">`+(n?i:j2(i,!0))+`</code></pre>
|
|
224
|
+
`:`<pre><code>`+(n?i:j2(i,!0))+`</code></pre>
|
|
225
|
+
`}blockquote({tokens:e}){return`<blockquote>
|
|
226
|
+
${this.parser.parse(e)}</blockquote>
|
|
227
|
+
`}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
228
|
+
`}hr(e){return`<hr>
|
|
229
|
+
`}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+`>
|
|
230
|
+
`+r+`</`+i+`>
|
|
231
|
+
`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
|
|
232
|
+
`}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox"> `}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
233
|
+
`}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>
|
|
234
|
+
<thead>
|
|
235
|
+
`+t+`</thead>
|
|
236
|
+
`+r+`</table>
|
|
237
|
+
`}tablerow({text:e}){return`<tr>
|
|
238
|
+
${e}</tr>
|
|
239
|
+
`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
240
|
+
`}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>${j2(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=M2(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+j2(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=M2(e);if(i===null)return j2(n);e=i;let a=`<img src="${e}" alt="${j2(n)}"`;return t&&(a+=` title="${j2(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:j2(e.text)}},z2=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}},B2=class e{options;renderer;textRenderer;constructor(e){this.options=e||$0,this.options.renderer=this.options.renderer||new R2,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new z2}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`,`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`,`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}},V2=class{options;block;constructor(e){this.options=e||$0}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?L2.lex:L2.lexInline}provideParser(e=this.block){return e?B2.parse:B2.parseInline}},H2=new class{defaults=Q0();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=B2;Renderer=R2;TextRenderer=z2;Lexer=L2;Tokenizer=I2;Hooks=V2;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 R2(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 I2(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 V2;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];V2.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async&&V2.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)}: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 L2.lex(e,t??this.defaults)}parser(e,t){return B2.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?L2.lex:L2.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?B2.parse:B2.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?L2.lex:L2.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?B2.parse:B2.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+=`
|
|
241
|
+
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+j2(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function U2(e,t){return H2.parse(e,t)}U2.options=U2.setOptions=function(e){return H2.setOptions(e),U2.defaults=H2.defaults,e2(U2.defaults),U2},U2.getDefaults=Q0,U2.defaults=$0,U2.use=function(...e){return H2.use(...e),U2.defaults=H2.defaults,e2(U2.defaults),U2},U2.walkTokens=function(e,t){return H2.walkTokens(e,t)},U2.parseInline=H2.parseInline,U2.Parser=B2,U2.parser=B2.parse,U2.Renderer=R2,U2.TextRenderer=z2,U2.Lexer=L2,U2.lexer=L2.lex,U2.Tokenizer=I2,U2.Hooks=V2,U2.parse=U2,U2.options,U2.setOptions,U2.use,U2.walkTokens,U2.parseInline,B2.parse,L2.lex;var Emt=`modulepreload`,Dmt=function(e){return`/`+e},W2={},G2=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=Dmt(t,n),t in W2)return;W2[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:Emt,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Omt=300,kmt=`300px`,Amt=500;function jmt(e={}){let{immediate:t=!1,debounceDelay:n=Omt,rootMargin:r=kmt,idleTimeout:i=Amt}=e,[a,o]=(0,M.useState)(!1),s=(0,M.useRef)(null),c=(0,M.useRef)(null),l=(0,M.useRef)(null),u=(0,M.useMemo)(()=>e=>{let t=Date.now();return window.setTimeout(()=>{e({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-t))})},1)},[]),d=(0,M.useMemo)(()=>typeof window<`u`&&window.requestIdleCallback?(e,t)=>window.requestIdleCallback(e,t):u,[u]),f=(0,M.useMemo)(()=>typeof window<`u`&&window.cancelIdleCallback?e=>window.cancelIdleCallback(e):e=>{clearTimeout(e)},[]);return(0,M.useEffect)(()=>{if(t){o(!0);return}let e=s.current;if(!e)return;c.current&&=(clearTimeout(c.current),null),l.current&&=(f(l.current),null);let a=()=>{c.current&&=(clearTimeout(c.current),null),l.current&&=(f(l.current),null)},u=e=>{l.current=d(t=>{t.timeRemaining()>0||t.didTimeout?(o(!0),e.disconnect()):l.current=d(()=>{o(!0),e.disconnect()},{timeout:i/2})},{timeout:i})},p=e=>{a(),c.current=window.setTimeout(()=>{var t;let n=e.takeRecords();(n.length===0||(t=n.at(-1)?.isIntersecting)!=null&&t)&&u(e)},n)},m=(e,t)=>{e.isIntersecting?p(t):a()},h=new IntersectionObserver(e=>{for(let t of e)m(t,h)},{rootMargin:r,threshold:0});return h.observe(e),()=>{c.current&&clearTimeout(c.current),l.current&&f(l.current),h.disconnect()}},[t,n,r,i,f,d]),{shouldRender:a,containerRef:s}}var K2=/\s/,Mmt=/^\s+$/,Nmt=new Set([`code`,`pre`,`svg`,`math`,`annotation`]),Pmt=e=>typeof e==`object`&&!!e&&`type`in e&&e.type===`element`,Fmt=e=>e.some(e=>Pmt(e)&&Nmt.has(e.tagName)),Imt=e=>{let t=[],n=``,r=!1;for(let i of e){let e=K2.test(i);e!==r&&n&&(t.push(n),n=``),n+=i,r=e}return n&&t.push(n),t},Lmt=e=>{let t=[],n=``;for(let r of e)K2.test(r)?n+=r:(n&&=(t.push(n),``),t.push(r));return n&&t.push(n),t},Rmt=(e,t,n,r,i,a)=>{let o=`--sd-animation:sd-${t};--sd-duration:${i?0:n}ms;--sd-easing:${r}`;return a&&(o+=`;--sd-delay:${a}ms`),{type:`element`,tagName:`span`,properties:{"data-sd-animate":!0,style:o},children:[{type:`text`,value:e}]}},zmt=(e,t,n,r,i)=>{let a=t.at(-1);if(!(a&&`children`in a))return;if(Fmt(t))return pX;let o=a,s=o.children.indexOf(e);if(s===-1)return;let c=e.value;if(!c.trim()){i.count+=c.length;return}let l=n.sep===`char`?Lmt(c):Imt(c),u=r.prevContentLength,d=l.map(e=>{let t=i.count;if(i.count+=e.length,Mmt.test(e))return{type:`text`,value:e};let r=u>0&&t<u,a=r?0:i.newIndex++*n.stagger;return Rmt(e,n.animation,n.duration,n.easing,r,a)});return o.children.splice(s,1,...d),s+d.length},Bmt=0;function q2(e){let t={animation:e?.animation??`fadeIn`,duration:e?.duration??150,easing:e?.easing??`ease`,sep:e?.sep??`word`,stagger:e?.stagger??40},n={prevContentLength:0,lastRenderCharCount:0},r=Bmt++,i=()=>e=>{let r={count:0,newIndex:0};mX(e,`text`,(e,i)=>zmt(e,i,t,n,r)),n.lastRenderCharCount=r.count,n.prevContentLength=0};return Object.defineProperty(i,"name",{value:`rehypeAnimate$${r}`}),{name:`animate`,type:`animate`,rehypePlugin:i,setPrevContentLength(e){n.prevContentLength=e},getLastRenderCharCount(){let e=n.lastRenderCharCount;return n.lastRenderCharCount=0,e}}}q2();var J2=(0,M.createContext)(!1),Vmt=()=>(0,M.useContext)(J2),Y2=(...e)=>wJ(zq(e)),Hmt=(e,t)=>{if(!e||!t)return t;let n=`${e}:`;return t.split(/\s+/).filter(Boolean).map(t=>t.startsWith(n)?t:`${e}:${t}`).join(` `)},Umt=e=>e?(...t)=>Hmt(e,wJ(zq(t))):Y2,X2=(e,t,n)=>{let r=typeof t==`string`&&n.startsWith(`text/csv`)?``:``,i=typeof t==`string`?new Blob([r+t],{type:n}):t,a=URL.createObjectURL(i),o=document.createElement(`a`);o.href=a,o.download=e,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(a)},Z2=(0,M.createContext)(Y2),Q2=()=>(0,M.useContext)(Z2),Wmt=Y2(`block`,`before:content-[counter(line)]`,`before:inline-block`,`before:[counter-increment:line]`,`before:w-6`,`before:mr-4`,`before:text-[13px]`,`before:text-right`,`before:text-muted-foreground/50`,`before:font-mono`,`before:select-none`),Gmt=e=>{let t={};for(let n of e.split(`;`)){let e=n.indexOf(`:`);if(e>0){let r=n.slice(0,e).trim(),i=n.slice(e+1).trim();r&&i&&(t[r]=i)}}return t},$2=(0,M.memo)(({children:e,result:t,language:n,className:r,startLine:i,lineNumbers:a=!0,...o})=>{let s=Q2(),c=(0,M.useMemo)(()=>s(Wmt),[s]),l=(0,M.useMemo)(()=>{let e={};return t.bg&&(e[`--sdm-bg`]=t.bg),t.fg&&(e[`--sdm-fg`]=t.fg),t.rootStyle&&Object.assign(e,Gmt(t.rootStyle)),e},[t.bg,t.fg,t.rootStyle]);return(0,F.jsx)(`div`,{className:s(r,`overflow-x-auto rounded-md border border-border bg-background p-4 text-sm`),"data-language":n,"data-streamdown":`code-block-body`,...o,children:(0,F.jsx)(`pre`,{className:s(r,`bg-[var(--sdm-bg,inherit]`,`dark:bg-[var(--shiki-dark-bg,var(--sdm-bg,inherit)]`),style:l,children:(0,F.jsx)(`code`,{className:a?s(`[counter-increment:line_0] [counter-reset:line]`):void 0,style:a&&i&&i>1?{counterReset:`line ${i-1}`}:void 0,children:t.tokens.map((e,t)=>(0,F.jsx)(`span`,{className:a?c:void 0,children:e.length===0||e.length===1&&e[0].content===``?`
|
|
242
|
+
`:e.map((e,t)=>{let n={},r=!!e.bgColor;if(e.color&&(n[`--sdm-c`]=e.color),e.bgColor&&(n[`--sdm-tbg`]=e.bgColor),e.htmlStyle)for(let[t,i]of Object.entries(e.htmlStyle))t===`color`?n[`--sdm-c`]=i:t===`background-color`?(n[`--sdm-tbg`]=i,r=!0):n[t]=i;return(0,F.jsx)(`span`,{className:s(`text-[var(--sdm-c,inherit)]`,`dark:text-[var(--shiki-dark,var(--sdm-c,inherit))]`,r&&`bg-[var(--sdm-tbg)]`,r&&`dark:bg-[var(--shiki-dark-bg,var(--sdm-tbg))]`),style:n,...e.htmlAttrs,children:e.content},t)})},t))})})})},(e,t)=>e.result===t.result&&e.language===t.language&&e.className===t.className&&e.startLine===t.startLine&&e.lineNumbers===t.lineNumbers),Kmt=({className:e,language:t,style:n,isIncomplete:r,...i})=>(0,F.jsx)(`div`,{className:Q2()(`my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2`,e),"data-incomplete":r||void 0,"data-language":t,"data-streamdown":`code-block`,style:{contentVisibility:`auto`,containIntrinsicSize:`auto 200px`,...n},...i}),e4=(0,M.createContext)({code:``}),t4=()=>(0,M.useContext)(e4),qmt=({language:e})=>{let t=Q2();return(0,F.jsx)(`div`,{className:t(`flex h-8 items-center text-muted-foreground text-xs`),"data-language":e,"data-streamdown":`code-block-header`,children:(0,F.jsx)(`span`,{className:t(`ml-1 font-mono lowercase`),children:e})})},Jmt=e=>{let t=e.length;for(;t>0&&e[t-1]===`
|
|
243
|
+
`;)t--;return e.slice(0,t)},Ymt=(0,M.lazy)(()=>G2(()=>import(`./highlighted-body-OFNGDK62-bt3ucuhQ.js`).then(e=>({default:e.HighlightedCodeBlockBody})),[])),Xmt=({code:e,language:t,className:n,children:r,isIncomplete:i=!1,startLine:a,lineNumbers:o,...s})=>{let c=Q2(),l=(0,M.useMemo)(()=>Jmt(e),[e]),u=(0,M.useMemo)(()=>({bg:`transparent`,fg:`inherit`,tokens:l.split(`
|
|
244
|
+
`).map(e=>[{content:e,color:`inherit`,bgColor:`transparent`,htmlStyle:{},offset:0}])}),[l]);return(0,F.jsx)(e4.Provider,{value:{code:e},children:(0,F.jsxs)(Kmt,{isIncomplete:i,language:t,children:[(0,F.jsx)(qmt,{language:t}),r?(0,F.jsx)(`div`,{className:c(`pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end`),children:(0,F.jsx)(`div`,{className:c(`pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur`),"data-streamdown":`code-block-actions`,children:r})}):null,(0,F.jsx)(M.Suspense,{fallback:(0,F.jsx)($2,{className:n,language:t,lineNumbers:o,result:u,startLine:a,...s}),children:(0,F.jsx)(Ymt,{className:n,code:l,language:t,lineNumbers:o,raw:u,startLine:a,...s})})]})})},n4={CheckIcon:e=>(0,F.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,F.jsx)(`path`,{clipRule:`evenodd`,d:`M15.5607 3.99999L15.0303 4.53032L6.23744 13.3232C5.55403 14.0066 4.44599 14.0066 3.76257 13.3232L4.2929 12.7929L3.76257 13.3232L0.969676 10.5303L0.439346 9.99999L1.50001 8.93933L2.03034 9.46966L4.82323 12.2626C4.92086 12.3602 5.07915 12.3602 5.17678 12.2626L13.9697 3.46966L14.5 2.93933L15.5607 3.99999Z`,fill:`currentColor`,fillRule:`evenodd`})}),CopyIcon:e=>(0,F.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,F.jsx)(`path`,{clipRule:`evenodd`,d:`M2.75 0.5C1.7835 0.5 1 1.2835 1 2.25V9.75C1 10.7165 1.7835 11.5 2.75 11.5H3.75H4.5V10H3.75H2.75C2.61193 10 2.5 9.88807 2.5 9.75V2.25C2.5 2.11193 2.61193 2 2.75 2H8.25C8.38807 2 8.5 2.11193 8.5 2.25V3H10V2.25C10 1.2835 9.2165 0.5 8.25 0.5H2.75ZM7.75 4.5C6.7835 4.5 6 5.2835 6 6.25V13.75C6 14.7165 6.7835 15.5 7.75 15.5H13.25C14.2165 15.5 15 14.7165 15 13.75V6.25C15 5.2835 14.2165 4.5 13.25 4.5H7.75ZM7.5 6.25C7.5 6.11193 7.61193 6 7.75 6H13.25C13.3881 6 13.5 6.11193 13.5 6.25V13.75C13.5 13.8881 13.3881 14 13.25 14H7.75C7.61193 14 7.5 13.8881 7.5 13.75V6.25Z`,fill:`currentColor`,fillRule:`evenodd`})}),DownloadIcon:e=>(0,F.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,F.jsx)(`path`,{clipRule:`evenodd`,d:`M8.75 1V1.75V8.68934L10.7197 6.71967L11.25 6.18934L12.3107 7.25L11.7803 7.78033L8.70711 10.8536C8.31658 11.2441 7.68342 11.2441 7.29289 10.8536L4.21967 7.78033L3.68934 7.25L4.75 6.18934L5.28033 6.71967L7.25 8.68934V1.75V1H8.75ZM13.5 9.25V13.5H2.5V9.25V8.5H1V9.25V14C1 14.5523 1.44771 15 2 15H14C14.5523 15 15 14.5523 15 14V9.25V8.5H13.5V9.25Z`,fill:`currentColor`,fillRule:`evenodd`})}),ExternalLinkIcon:e=>(0,F.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,F.jsx)(`path`,{clipRule:`evenodd`,d:`M13.5 10.25V13.25C13.5 13.3881 13.3881 13.5 13.25 13.5H2.75C2.61193 13.5 2.5 13.3881 2.5 13.25L2.5 2.75C2.5 2.61193 2.61193 2.5 2.75 2.5H5.75H6.5V1H5.75H2.75C1.7835 1 1 1.7835 1 2.75V13.25C1 14.2165 1.7835 15 2.75 15H13.25C14.2165 15 15 14.2165 15 13.25V10.25V9.5H13.5V10.25ZM9 1H9.75H14.2495C14.6637 1 14.9995 1.33579 14.9995 1.75V6.25V7H13.4995V6.25V3.56066L8.53033 8.52978L8 9.06011L6.93934 7.99945L7.46967 7.46912L12.4388 2.5H9.75H9V1Z`,fill:`currentColor`,fillRule:`evenodd`})}),Loader2Icon:e=>(0,F.jsxs)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:[(0,F.jsx)(`path`,{d:`M8 0V4`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,F.jsx)(`path`,{d:`M8 16V12`,opacity:`0.5`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,F.jsx)(`path`,{d:`M3.29773 1.52783L5.64887 4.7639`,opacity:`0.9`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,F.jsx)(`path`,{d:`M12.7023 1.52783L10.3511 4.7639`,opacity:`0.1`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,F.jsx)(`path`,{d:`M12.7023 14.472L10.3511 11.236`,opacity:`0.4`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,F.jsx)(`path`,{d:`M3.29773 14.472L5.64887 11.236`,opacity:`0.6`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,F.jsx)(`path`,{d:`M15.6085 5.52783L11.8043 6.7639`,opacity:`0.2`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,F.jsx)(`path`,{d:`M0.391602 10.472L4.19583 9.23598`,opacity:`0.7`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,F.jsx)(`path`,{d:`M15.6085 10.4722L11.8043 9.2361`,opacity:`0.3`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,F.jsx)(`path`,{d:`M0.391602 5.52783L4.19583 6.7639`,opacity:`0.8`,stroke:`currentColor`,strokeWidth:`1.5`})]}),Maximize2Icon:e=>(0,F.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,F.jsx)(`path`,{clipRule:`evenodd`,d:`M1 5.25V6H2.5V5.25V2.5H5.25H6V1H5.25H2C1.44772 1 1 1.44772 1 2V5.25ZM5.25 14.9994H6V13.4994H5.25H2.5V10.7494V9.99939H1V10.7494V13.9994C1 14.5517 1.44772 14.9994 2 14.9994H5.25ZM15 10V10.75V14C15 14.5523 14.5523 15 14 15H10.75H10V13.5H10.75H13.5V10.75V10H15ZM10.75 1H10V2.5H10.75H13.5V5.25V6H15V5.25V2C15 1.44772 14.5523 1 14 1H10.75Z`,fill:`currentColor`,fillRule:`evenodd`})}),RotateCcwIcon:e=>(0,F.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,F.jsx)(`path`,{clipRule:`evenodd`,d:`M13.5 8C13.5 4.96643 11.0257 2.5 7.96452 2.5C5.42843 2.5 3.29365 4.19393 2.63724 6.5H5.25H6V8H5.25H0.75C0.335787 8 0 7.66421 0 7.25V2.75V2H1.5V2.75V5.23347C2.57851 2.74164 5.06835 1 7.96452 1C11.8461 1 15 4.13001 15 8C15 11.87 11.8461 15 7.96452 15C5.62368 15 3.54872 13.8617 2.27046 12.1122L1.828 11.5066L3.03915 10.6217L3.48161 11.2273C4.48831 12.6051 6.12055 13.5 7.96452 13.5C11.0257 13.5 13.5 11.0336 13.5 8Z`,fill:`currentColor`,fillRule:`evenodd`})}),XIcon:e=>(0,F.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,F.jsx)(`path`,{clipRule:`evenodd`,d:`M12.4697 13.5303L13 14.0607L14.0607 13L13.5303 12.4697L9.06065 7.99999L13.5303 3.53032L14.0607 2.99999L13 1.93933L12.4697 2.46966L7.99999 6.93933L3.53032 2.46966L2.99999 1.93933L1.93933 2.99999L2.46966 3.53032L6.93933 7.99999L2.46966 12.4697L1.93933 13L2.99999 14.0607L3.53032 13.5303L7.99999 9.06065L12.4697 13.5303Z`,fill:`currentColor`,fillRule:`evenodd`})}),ZoomInIcon:e=>(0,F.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,F.jsx)(`path`,{clipRule:`evenodd`,d:`M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H5.875V4.75V4.125H7.125V4.75V5.875H8.25H8.875V7.125H8.25H7.125V8.25V8.875H5.875V8.25V7.125H4.75H4.125V5.875Z`,fill:`currentColor`,fillRule:`evenodd`})}),ZoomOutIcon:e=>(0,F.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,F.jsx)(`path`,{clipRule:`evenodd`,d:`M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H8.25H8.875V7.125H8.25H4.75H4.125V5.875Z`,fill:`currentColor`,fillRule:`evenodd`})})},r4=(0,M.createContext)(n4),Zmt=(e,t)=>{if(e===t)return!0;if(!(e&&t))return e===t;let n=Object.keys(e),r=Object.keys(t);return n.length===r.length?n.every(n=>e[n]===t[n]):!1},i4=({icons:e,children:t})=>{let n=(0,M.useRef)(e),r=(0,M.useRef)(e?{...n4,...e}:n4);Zmt(n.current,e)||(n.current=e,r.current=e?{...n4,...e}:n4);let i=r.current;return(0,F.jsx)(r4.Provider,{value:i,children:t})},a4=()=>(0,M.useContext)(r4),o4={copyCode:`Copy Code`,downloadFile:`Download file`,downloadDiagram:`Download diagram`,downloadDiagramAsSvg:`Download diagram as SVG`,downloadDiagramAsPng:`Download diagram as PNG`,downloadDiagramAsMmd:`Download diagram as MMD`,viewFullscreen:`View fullscreen`,exitFullscreen:`Exit fullscreen`,mermaidFormatSvg:`SVG`,mermaidFormatPng:`PNG`,mermaidFormatMmd:`MMD`,copyTable:`Copy table`,copyTableAsMarkdown:`Copy table as Markdown`,copyTableAsCsv:`Copy table as CSV`,copyTableAsTsv:`Copy table as TSV`,downloadTable:`Download table`,downloadTableAsCsv:`Download table as CSV`,downloadTableAsMarkdown:`Download table as Markdown`,tableFormatMarkdown:`Markdown`,tableFormatCsv:`CSV`,tableFormatTsv:`TSV`,imageNotAvailable:`Image not available`,downloadImage:`Download image`,openExternalLink:`Open external link?`,externalLinkWarning:`You're about to visit an external website.`,close:`Close`,copyLink:`Copy link`,copied:`Copied`,openLink:`Open link`},s4=(0,M.createContext)(o4),c4=()=>(0,M.useContext)(s4),l4=({onCopy:e,onError:t,timeout:n=2e3,children:r,className:i,code:a,...o})=>{let s=Q2(),[c,l]=(0,M.useState)(!1),u=(0,M.useRef)(0),{code:d}=t4(),{isAnimating:f}=(0,M.useContext)(v3),p=c4(),m=a??d,h=async()=>{var r;if(typeof window>`u`||!((r=navigator==null?void 0:navigator.clipboard)!=null&&r.writeText)){t?.(Error(`Clipboard API not available`));return}try{c||(await navigator.clipboard.writeText(m),l(!0),e?.(),u.current=window.setTimeout(()=>l(!1),n))}catch(e){t?.(e)}};(0,M.useEffect)(()=>()=>{window.clearTimeout(u.current)},[]);let g=a4(),_=c?g.CheckIcon:g.CopyIcon;return(0,F.jsx)(`button`,{className:s(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,i),"data-streamdown":`code-block-copy-button`,disabled:f,onClick:h,title:p.copyCode,type:`button`,...o,children:r??(0,F.jsx)(_,{size:14})})},u4={"1c":`1c`,"1c-query":`1cq`,abap:`abap`,"actionscript-3":`as`,ada:`ada`,adoc:`adoc`,"angular-html":`html`,"angular-ts":`ts`,apache:`conf`,apex:`cls`,apl:`apl`,applescript:`applescript`,ara:`ara`,asciidoc:`adoc`,asm:`asm`,astro:`astro`,awk:`awk`,ballerina:`bal`,bash:`sh`,bat:`bat`,batch:`bat`,be:`be`,beancount:`beancount`,berry:`berry`,bibtex:`bib`,bicep:`bicep`,blade:`blade.php`,bsl:`bsl`,c:`c`,"c#":`cs`,"c++":`cpp`,cadence:`cdc`,cairo:`cairo`,cdc:`cdc`,clarity:`clar`,clj:`clj`,clojure:`clj`,"closure-templates":`soy`,cmake:`cmake`,cmd:`cmd`,cobol:`cob`,codeowners:`CODEOWNERS`,codeql:`ql`,coffee:`coffee`,coffeescript:`coffee`,"common-lisp":`lisp`,console:`sh`,coq:`v`,cpp:`cpp`,cql:`cql`,crystal:`cr`,cs:`cs`,csharp:`cs`,css:`css`,csv:`csv`,cue:`cue`,cypher:`cql`,d:`d`,dart:`dart`,dax:`dax`,desktop:`desktop`,diff:`diff`,docker:`dockerfile`,dockerfile:`dockerfile`,dotenv:`env`,"dream-maker":`dm`,edge:`edge`,elisp:`el`,elixir:`ex`,elm:`elm`,"emacs-lisp":`el`,erb:`erb`,erl:`erl`,erlang:`erl`,f:`f`,"f#":`fs`,f03:`f03`,f08:`f08`,f18:`f18`,f77:`f77`,f90:`f90`,f95:`f95`,fennel:`fnl`,fish:`fish`,fluent:`ftl`,for:`for`,"fortran-fixed-form":`f`,"fortran-free-form":`f90`,fs:`fs`,fsharp:`fs`,fsl:`fsl`,ftl:`ftl`,gdresource:`tres`,gdscript:`gd`,gdshader:`gdshader`,genie:`gs`,gherkin:`feature`,"git-commit":`gitcommit`,"git-rebase":`gitrebase`,gjs:`js`,gleam:`gleam`,"glimmer-js":`js`,"glimmer-ts":`ts`,glsl:`glsl`,gnuplot:`plt`,go:`go`,gql:`gql`,graphql:`graphql`,groovy:`groovy`,gts:`gts`,hack:`hack`,haml:`haml`,handlebars:`hbs`,haskell:`hs`,haxe:`hx`,hbs:`hbs`,hcl:`hcl`,hjson:`hjson`,hlsl:`hlsl`,hs:`hs`,html:`html`,"html-derivative":`html`,http:`http`,hxml:`hxml`,hy:`hy`,imba:`imba`,ini:`ini`,jade:`jade`,java:`java`,javascript:`js`,jinja:`jinja`,jison:`jison`,jl:`jl`,js:`js`,json:`json`,json5:`json5`,jsonc:`jsonc`,jsonl:`jsonl`,jsonnet:`jsonnet`,jssm:`jssm`,jsx:`jsx`,julia:`jl`,kotlin:`kt`,kql:`kql`,kt:`kt`,kts:`kts`,kusto:`kql`,latex:`tex`,lean:`lean`,lean4:`lean`,less:`less`,liquid:`liquid`,lisp:`lisp`,lit:`lit`,llvm:`ll`,log:`log`,logo:`logo`,lua:`lua`,luau:`luau`,make:`mak`,makefile:`mak`,markdown:`md`,marko:`marko`,matlab:`m`,md:`md`,mdc:`mdc`,mdx:`mdx`,mediawiki:`wiki`,mermaid:`mmd`,mips:`s`,mipsasm:`s`,mmd:`mmd`,mojo:`mojo`,move:`move`,nar:`nar`,narrat:`narrat`,nextflow:`nf`,nf:`nf`,nginx:`conf`,nim:`nim`,nix:`nix`,nu:`nu`,nushell:`nu`,objc:`m`,"objective-c":`m`,"objective-cpp":`mm`,ocaml:`ml`,pascal:`pas`,perl:`pl`,perl6:`p6`,php:`php`,plsql:`pls`,po:`po`,polar:`polar`,postcss:`pcss`,pot:`pot`,potx:`potx`,powerquery:`pq`,powershell:`ps1`,prisma:`prisma`,prolog:`pl`,properties:`properties`,proto:`proto`,protobuf:`proto`,ps:`ps`,ps1:`ps1`,pug:`pug`,puppet:`pp`,purescript:`purs`,py:`py`,python:`py`,ql:`ql`,qml:`qml`,qmldir:`qmldir`,qss:`qss`,r:`r`,racket:`rkt`,raku:`raku`,razor:`cshtml`,rb:`rb`,reg:`reg`,regex:`regex`,regexp:`regexp`,rel:`rel`,riscv:`s`,rs:`rs`,rst:`rst`,ruby:`rb`,rust:`rs`,sas:`sas`,sass:`sass`,scala:`scala`,scheme:`scm`,scss:`scss`,sdbl:`sdbl`,sh:`sh`,shader:`shader`,shaderlab:`shader`,shell:`sh`,shellscript:`sh`,shellsession:`sh`,smalltalk:`st`,solidity:`sol`,soy:`soy`,sparql:`rq`,spl:`spl`,splunk:`spl`,sql:`sql`,"ssh-config":`config`,stata:`do`,styl:`styl`,stylus:`styl`,svelte:`svelte`,swift:`swift`,"system-verilog":`sv`,systemd:`service`,talon:`talon`,talonscript:`talon`,tasl:`tasl`,tcl:`tcl`,templ:`templ`,terraform:`tf`,tex:`tex`,tf:`tf`,tfvars:`tfvars`,toml:`toml`,ts:`ts`,"ts-tags":`ts`,tsp:`tsp`,tsv:`tsv`,tsx:`tsx`,turtle:`ttl`,twig:`twig`,typ:`typ`,typescript:`ts`,typespec:`tsp`,typst:`typ`,v:`v`,vala:`vala`,vb:`vb`,verilog:`v`,vhdl:`vhdl`,vim:`vim`,viml:`vim`,vimscript:`vim`,vue:`vue`,"vue-html":`html`,"vue-vine":`vine`,vy:`vy`,vyper:`vy`,wasm:`wasm`,wenyan:`wy`,wgsl:`wgsl`,wiki:`wiki`,wikitext:`wiki`,wit:`wit`,wl:`wl`,wolfram:`wl`,xml:`xml`,xsl:`xsl`,yaml:`yaml`,yml:`yml`,zenscript:`zs`,zig:`zig`,zsh:`zsh`,文言:`wy`},Qmt=({onDownload:e,onError:t,language:n,children:r,className:i,code:a,...o})=>{let s=Q2(),{code:c}=t4(),{isAnimating:l}=(0,M.useContext)(v3),u=c4(),d=a4(),f=a??c,p=`file.${n&&n in u4?u4[n]:`txt`}`;return(0,F.jsx)(`button`,{className:s(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,i),"data-streamdown":`code-block-download-button`,disabled:l,onClick:()=>{try{X2(p,f,`text/plain`),e?.()}catch(e){t?.(e)}},title:u.downloadFile,type:`button`,...o,children:r??(0,F.jsx)(d.DownloadIcon,{size:14})})},d4=()=>{let{Loader2Icon:e}=a4(),t=Q2();return(0,F.jsxs)(`div`,{className:t(`w-full divide-y divide-border overflow-hidden rounded-xl border border-border`),children:[(0,F.jsx)(`div`,{className:t(`h-[46px] w-full bg-muted/80`)}),(0,F.jsx)(`div`,{className:t(`flex w-full items-center justify-center p-4`),children:(0,F.jsx)(e,{className:t(`size-4 animate-spin`)})})]})},$mt=/\.[^/.]+$/,eht=({node:e,className:t,src:n,alt:r,onLoad:i,onError:a,...o})=>{let{DownloadIcon:s}=a4(),c=Q2(),l=(0,M.useRef)(null),[u,d]=(0,M.useState)(!1),[f,p]=(0,M.useState)(!1),m=c4(),h=o.width!=null||o.height!=null,g=(u||h)&&!f,_=f&&!h;(0,M.useEffect)(()=>{let e=l.current;if(e!=null&&e.complete){let t=e.naturalWidth>0;d(t),p(!t)}},[]);let v=(0,M.useCallback)(e=>{d(!0),p(!1),i?.(e)},[i]),y=(0,M.useCallback)(e=>{d(!1),p(!0),a?.(e)},[a]),b=async()=>{if(n)try{let e=await(await fetch(n)).blob(),t=new URL(n,window.location.origin).pathname.split(`/`).pop()||``,i=t.split(`.`).pop(),a=t.includes(`.`)&&i!==void 0&&i.length<=4,o=``;if(a)o=t;else{let n=e.type,i=`png`;n.includes(`jpeg`)||n.includes(`jpg`)?i=`jpg`:n.includes(`png`)?i=`png`:n.includes(`svg`)?i=`svg`:n.includes(`gif`)?i=`gif`:n.includes(`webp`)&&(i=`webp`),o=`${(r||t||`image`).replace($mt,``)}.${i}`}X2(o,e,e.type)}catch{window.open(n,`_blank`)}};return n?(0,F.jsxs)(`div`,{className:c(`group relative my-4 inline-block`),"data-streamdown":`image-wrapper`,children:[(0,F.jsx)(`img`,{alt:r,className:c(`max-w-full rounded-lg`,_&&`hidden`,t),"data-streamdown":`image`,onError:y,onLoad:v,ref:l,src:n,...o}),_&&(0,F.jsx)(`span`,{className:c(`text-muted-foreground text-xs italic`),"data-streamdown":`image-fallback`,children:m.imageNotAvailable}),(0,F.jsx)(`div`,{className:c(`pointer-events-none absolute inset-0 hidden rounded-lg bg-black/10 group-hover:block`)}),g&&(0,F.jsx)(`button`,{className:c(`absolute right-2 bottom-2 flex h-8 w-8 cursor-pointer items-center justify-center rounded-md border border-border bg-background/90 shadow-sm backdrop-blur-sm transition-all duration-200 hover:bg-background`,`opacity-0 group-hover:opacity-100`),onClick:b,title:m.downloadImage,type:`button`,children:(0,F.jsx)(s,{size:14})})]}):null},f4=0,p4=()=>{f4+=1,f4===1&&(document.body.style.overflow=`hidden`)},m4=()=>{f4=Math.max(0,f4-1),f4===0&&(document.body.style.overflow=``)},tht=({url:e,isOpen:t,onClose:n,onConfirm:r})=>{let{CheckIcon:i,CopyIcon:a,ExternalLinkIcon:o,XIcon:s}=a4(),c=Q2(),[l,u]=(0,M.useState)(!1),d=c4(),f=(0,M.useCallback)(async()=>{try{await navigator.clipboard.writeText(e),u(!0),setTimeout(()=>u(!1),2e3)}catch{}},[e]),p=(0,M.useCallback)(()=>{r(),n()},[r,n]);return(0,M.useEffect)(()=>{if(t){p4();let e=e=>{e.key===`Escape`&&n()};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),m4()}}},[t,n]),t?(0,F.jsx)(`div`,{className:c(`fixed inset-0 z-50 flex items-center justify-center bg-background/50 backdrop-blur-sm`),"data-streamdown":`link-safety-modal`,onClick:n,onKeyDown:e=>{e.key===`Escape`&&n()},role:`button`,tabIndex:0,children:(0,F.jsxs)(`div`,{className:c(`relative mx-4 flex w-full max-w-md flex-col gap-4 rounded-xl border bg-background p-6 shadow-lg`),onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:`presentation`,children:[(0,F.jsx)(`button`,{className:c(`absolute top-4 right-4 rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground`),onClick:n,title:d.close,type:`button`,children:(0,F.jsx)(s,{size:16})}),(0,F.jsxs)(`div`,{className:c(`flex flex-col gap-2`),children:[(0,F.jsxs)(`div`,{className:c(`flex items-center gap-2 font-semibold text-lg`),children:[(0,F.jsx)(o,{size:20}),(0,F.jsx)(`span`,{children:d.openExternalLink})]}),(0,F.jsx)(`p`,{className:c(`text-muted-foreground text-sm`),children:d.externalLinkWarning})]}),(0,F.jsx)(`div`,{className:c(`break-all rounded-md bg-muted p-3 font-mono text-sm`,e.length>100&&`max-h-32 overflow-y-auto`),children:e}),(0,F.jsxs)(`div`,{className:c(`flex gap-2`),children:[(0,F.jsx)(`button`,{className:c(`flex flex-1 items-center justify-center gap-2 rounded-md border bg-background px-4 py-2 font-medium text-sm transition-all hover:bg-muted`),onClick:f,type:`button`,children:l?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(i,{size:14}),(0,F.jsx)(`span`,{children:d.copied})]}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(a,{size:14}),(0,F.jsx)(`span`,{children:d.copyLink})]})}),(0,F.jsxs)(`button`,{className:c(`flex flex-1 items-center justify-center gap-2 rounded-md bg-primary px-4 py-2 font-medium text-primary-foreground text-sm transition-all hover:bg-primary/90`),onClick:p,type:`button`,children:[(0,F.jsx)(o,{size:14}),(0,F.jsx)(`span`,{children:d.openLink})]})]})]})}):null},h4=(0,M.createContext)(null),g4=()=>(0,M.useContext)(h4),nht=()=>g4()?.code??null,_4=()=>g4()?.mermaid??null,rht=e=>{var t;let n=g4();return n!=null&&n.renderers&&e&&(t=n.renderers.find(t=>Array.isArray(t.language)?t.language.includes(e):t.language===e))!=null?t:null},iht=(e,t)=>new Promise((t,n)=>{let r=`data:image/svg+xml;base64,`+btoa(unescape(encodeURIComponent(e))),i=new Image;i.crossOrigin=`anonymous`,i.onload=()=>{let e=document.createElement(`canvas`),r=i.width*5,a=i.height*5;e.width=r,e.height=a;let o=e.getContext(`2d`);if(!o){n(Error(`Failed to create 2D canvas context for PNG export`));return}o.drawImage(i,0,0,r,a),e.toBlob(e=>{if(!e){n(Error(`Failed to create PNG blob`));return}t(e)},`image/png`)},i.onerror=()=>n(Error(`Failed to load SVG image`)),i.src=r}),aht=({chart:e,children:t,className:n,onDownload:r,config:i,onError:a})=>{let o=Q2(),[s,c]=(0,M.useState)(!1),l=(0,M.useRef)(null),{isAnimating:u}=(0,M.useContext)(v3),d=a4(),f=_4(),p=c4(),m=async t=>{try{if(t===`mmd`){X2(`diagram.mmd`,e,`text/plain`),c(!1),r?.(t);return}if(!f){a?.(Error(`Mermaid plugin not available`));return}let n=f.getMermaid(i),o=e.split(``).reduce((e,t)=>(e<<5)-e+t.charCodeAt(0)|0,0),s=`mermaid-${Math.abs(o)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:l}=await n.render(s,e);if(!l){a?.(Error(`SVG not found. Please wait for the diagram to render.`));return}if(t===`svg`){X2(`diagram.svg`,l,`image/svg+xml`),c(!1),r?.(t);return}if(t===`png`){X2(`diagram.png`,await iht(l),`image/png`),r?.(t),c(!1);return}}catch(e){a?.(e)}};return(0,M.useEffect)(()=>{let e=e=>{let t=e.composedPath();l.current&&!t.includes(l.current)&&c(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[]),(0,F.jsxs)(`div`,{className:o(`relative`),ref:l,children:[(0,F.jsx)(`button`,{className:o(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,n),disabled:u,onClick:()=>c(!s),title:p.downloadDiagram,type:`button`,children:t??(0,F.jsx)(d.DownloadIcon,{size:14})}),s?(0,F.jsxs)(`div`,{className:o(`absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`),children:[(0,F.jsx)(`button`,{className:o(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>m(`svg`),title:p.downloadDiagramAsSvg,type:`button`,children:p.mermaidFormatSvg}),(0,F.jsx)(`button`,{className:o(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>m(`png`),title:p.downloadDiagramAsPng,type:`button`,children:p.mermaidFormatPng}),(0,F.jsx)(`button`,{className:o(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>m(`mmd`),title:p.downloadDiagramAsMmd,type:`button`,children:p.mermaidFormatMmd})]}):null]})},oht=({chart:e,config:t,onFullscreen:n,onExit:r,className:i,...a})=>{let{Maximize2Icon:o,XIcon:s}=a4(),c=Q2(),[l,u]=(0,M.useState)(!1),{isAnimating:d,controls:f}=(0,M.useContext)(v3),p=c4(),m=(()=>{if(typeof f==`boolean`)return f;let e=f.mermaid;return e===!1?!1:e===!0||e===void 0?!0:e.panZoom!==!1})(),h=()=>{u(!l)};return(0,M.useEffect)(()=>{if(l){p4();let e=e=>{e.key===`Escape`&&u(!1)};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),m4()}}},[l]),(0,M.useEffect)(()=>{l?n?.():r&&r()},[l,n,r]),(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`button`,{className:c(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,i),disabled:d,onClick:h,title:p.viewFullscreen,type:`button`,...a,children:(0,F.jsx)(o,{size:14})}),l?(0,us.createPortal)((0,F.jsxs)(`div`,{className:c(`fixed inset-0 z-50 flex items-center justify-center bg-background/95 backdrop-blur-sm`),onClick:h,onKeyDown:e=>{e.key===`Escape`&&h()},role:`button`,tabIndex:0,children:[(0,F.jsx)(`button`,{className:c(`absolute top-4 right-4 z-10 rounded-md p-2 text-muted-foreground transition-all hover:bg-muted hover:text-foreground`),onClick:h,title:p.exitFullscreen,type:`button`,children:(0,F.jsx)(s,{size:20})}),(0,F.jsx)(`div`,{className:c(`flex size-full items-center justify-center p-4`),onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:`presentation`,children:(0,F.jsx)(x3,{chart:e,className:c(`size-full [&_svg]:h-auto [&_svg]:w-auto`),config:t,fullscreen:!0,showControls:m})})]}),document.body):null]})},v4=e=>{let t=[],n=[],r=e.querySelectorAll(`thead th`);for(let e of r)t.push(e.textContent?.trim()||``);let i=e.querySelectorAll(`tbody tr`);for(let e of i){let t=[],r=e.querySelectorAll(`td`);for(let e of r)t.push(e.textContent?.trim()||``);n.push(t)}return{headers:t,rows:n}},y4=e=>{let{headers:t,rows:n}=e,r=e=>{let t=!1,n=!1;for(let r of e){if(r===`"`){t=!0,n=!0;break}(r===`,`||r===`
|
|
245
|
+
`)&&(t=!0)}return t?n?`"${e.replace(/"/g,`""`)}"`:`"${e}"`:e},i=t.length>0?n.length+1:n.length,a=Array(i),o=0;t.length>0&&(a[o]=t.map(r).join(`,`),o+=1);for(let e of n)a[o]=e.map(r).join(`,`),o+=1;return a.join(`
|
|
246
|
+
`)},sht=e=>{let{headers:t,rows:n}=e,r=e=>{let t=!1;for(let n of e)if(n===` `||n===`
|
|
247
|
+
`||n===`\r`){t=!0;break}if(!t)return e;let n=[];for(let t of e)t===` `?n.push(`\\t`):t===`
|
|
248
|
+
`?n.push(`\\n`):t===`\r`?n.push(`\\r`):n.push(t);return n.join(``)},i=t.length>0?n.length+1:n.length,a=Array(i),o=0;t.length>0&&(a[o]=t.map(r).join(` `),o+=1);for(let e of n)a[o]=e.map(r).join(` `),o+=1;return a.join(`
|
|
249
|
+
`)},b4=e=>{let t=!1;for(let n of e)if(n===`\\`||n===`|`){t=!0;break}if(!t)return e;let n=[];for(let t of e)t===`\\`?n.push(`\\\\`):t===`|`?n.push(`\\|`):n.push(t);return n.join(``)},x4=e=>{let{headers:t,rows:n}=e;if(t.length===0)return``;let r=Array(n.length+2),i=0;r[i]=`| ${t.map(e=>b4(e)).join(` | `)} |`,i+=1;let a=Array(t.length);for(let e=0;e<t.length;e+=1)a[e]=`---`;r[i]=`| ${a.join(` | `)} |`,i+=1;for(let e of n)if(e.length<t.length){let n=Array(t.length);for(let r=0;r<t.length;r+=1)n[r]=r<e.length?b4(e[r]):``;r[i]=`| ${n.join(` | `)} |`,i+=1}else r[i]=`| ${e.map(e=>b4(e)).join(` | `)} |`,i+=1;return r.join(`
|
|
250
|
+
`)},S4=({children:e,className:t,onCopy:n,onError:r,timeout:i=2e3})=>{let a=Q2(),[o,s]=(0,M.useState)(!1),[c,l]=(0,M.useState)(!1),u=(0,M.useRef)(null),d=(0,M.useRef)(0),{isAnimating:f}=(0,M.useContext)(v3),p=c4(),m=async e=>{var t;if(typeof window>`u`||!((t=navigator==null?void 0:navigator.clipboard)!=null&&t.write)){r?.(Error(`Clipboard API not available`));return}try{let t=(u.current?.closest(`[data-streamdown="table-wrapper"]`))?.querySelector(`table`);if(!t){r?.(Error(`Table not found`));return}let a=v4(t),o=({csv:y4,tsv:sht,md:x4}[e]||x4)(a),c=new ClipboardItem({"text/plain":new Blob([o],{type:`text/plain`}),"text/html":new Blob([t.outerHTML],{type:`text/html`})});await navigator.clipboard.write([c]),l(!0),s(!1),n?.(e),d.current=window.setTimeout(()=>l(!1),i)}catch(e){r?.(e)}};(0,M.useEffect)(()=>{let e=e=>{let t=e.composedPath();u.current&&!t.includes(u.current)&&s(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e),window.clearTimeout(d.current)}},[]);let h=a4(),g=c?h.CheckIcon:h.CopyIcon;return(0,F.jsxs)(`div`,{className:a(`relative`),ref:u,children:[(0,F.jsx)(`button`,{className:a(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:f,onClick:()=>s(!o),title:p.copyTable,type:`button`,children:e??(0,F.jsx)(g,{height:14,width:14})}),o?(0,F.jsxs)(`div`,{className:a(`absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`),children:[(0,F.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>m(`md`),title:p.copyTableAsMarkdown,type:`button`,children:p.tableFormatMarkdown}),(0,F.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>m(`csv`),title:p.copyTableAsCsv,type:`button`,children:p.tableFormatCsv}),(0,F.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>m(`tsv`),title:p.copyTableAsTsv,type:`button`,children:p.tableFormatTsv})]}):null]})},C4=({children:e,className:t,onDownload:n,onError:r})=>{let i=Q2(),[a,o]=(0,M.useState)(!1),s=(0,M.useRef)(null),{isAnimating:c}=(0,M.useContext)(v3),l=c4(),u=a4(),d=e=>{try{let t=(s.current?.closest(`[data-streamdown="table-wrapper"]`))?.querySelector(`table`);if(!t){r?.(Error(`Table not found`));return}let i=v4(t),a=e===`csv`?y4(i):x4(i);X2(`table.${e===`csv`?`csv`:`md`}`,a,e===`csv`?`text/csv`:`text/markdown`),o(!1),n?.(e)}catch(e){r?.(e)}};return(0,M.useEffect)(()=>{let e=e=>{let t=e.composedPath();s.current&&!t.includes(s.current)&&o(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[]),(0,F.jsxs)(`div`,{className:i(`relative`),ref:s,children:[(0,F.jsx)(`button`,{className:i(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:c,onClick:()=>o(!a),title:l.downloadTable,type:`button`,children:e??(0,F.jsx)(u.DownloadIcon,{size:14})}),a?(0,F.jsxs)(`div`,{className:i(`absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`),children:[(0,F.jsx)(`button`,{className:i(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>d(`csv`),title:l.downloadTableAsCsv,type:`button`,children:l.tableFormatCsv}),(0,F.jsx)(`button`,{className:i(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>d(`markdown`),title:l.downloadTableAsMarkdown,type:`button`,children:l.tableFormatMarkdown})]}):null]})},cht=({children:e,className:t,showCopy:n=!0,showDownload:r=!0})=>{let{Maximize2Icon:i,XIcon:a}=a4(),o=Q2(),[s,c]=(0,M.useState)(!1),{isAnimating:l}=(0,M.useContext)(v3),u=c4(),d=()=>{c(!0)},f=()=>{c(!1)};return(0,M.useEffect)(()=>{if(s){p4();let e=e=>{e.key===`Escape`&&c(!1)};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),m4()}}},[s]),(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`button`,{className:o(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:l,onClick:d,title:u.viewFullscreen,type:`button`,children:(0,F.jsx)(i,{size:14})}),s?(0,us.createPortal)((0,F.jsx)(`div`,{"aria-label":u.viewFullscreen,"aria-modal":`true`,className:o(`fixed inset-0 z-50 flex flex-col bg-background`),"data-streamdown":`table-fullscreen`,onClick:f,onKeyDown:e=>{e.key===`Escape`&&f()},role:`dialog`,children:(0,F.jsxs)(`div`,{className:o(`flex h-full flex-col`),onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:`presentation`,children:[(0,F.jsxs)(`div`,{className:o(`flex items-center justify-end gap-1 p-4`),children:[n?(0,F.jsx)(S4,{}):null,r?(0,F.jsx)(C4,{}):null,(0,F.jsx)(`button`,{className:o(`rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground`),onClick:f,title:u.exitFullscreen,type:`button`,children:(0,F.jsx)(a,{size:20})})]}),(0,F.jsx)(`div`,{className:o(`flex-1 overflow-auto p-4 pt-0 [&_thead]:sticky [&_thead]:top-0 [&_thead]:z-10`),children:(0,F.jsx)(`table`,{className:o(`w-full border-collapse border border-border`),"data-streamdown":`table`,children:e})})]})}),document.body):null]})},lht=({children:e,className:t,showControls:n,showCopy:r=!0,showDownload:i=!0,showFullscreen:a=!0,...o})=>{let s=Q2(),c=n&&r,l=n&&i,u=n&&a,d=c||l||u;return(0,F.jsxs)(`div`,{className:s(`my-4 flex flex-col gap-2 rounded-lg border border-border bg-sidebar p-2`),"data-streamdown":`table-wrapper`,children:[d?(0,F.jsxs)(`div`,{className:s(`flex items-center justify-end gap-1`),children:[c?(0,F.jsx)(S4,{}):null,l?(0,F.jsx)(C4,{}):null,u?(0,F.jsx)(cht,{showCopy:c,showDownload:l,children:e}):null]}):null,(0,F.jsx)(`div`,{className:s(`border-collapse overflow-x-auto overflow-y-auto rounded-md border border-border bg-background`),children:(0,F.jsx)(`table`,{className:s(`w-full divide-y divide-border`,t),"data-streamdown":`table`,...o,children:e})})]})},uht=/startLine=(\d+)/,dht=/\bnoLineNumbers\b/,fht=(0,M.lazy)(()=>G2(()=>import(`./mermaid-GHXKKRXX-AdR6Q7xN.js`).then(e=>({default:e.Mermaid})),[])),pht=/language-([^\s]+)/;function w4(e,t){if(!(e!=null&&e.position||t!=null&&t.position))return!0;if(!(e!=null&&e.position&&t!=null&&t.position))return!1;let n=e.position.start,r=t.position.start,i=e.position.end,a=t.position.end;return n?.line===r?.line&&n?.column===r?.column&&i?.line===a?.line&&i?.column===a?.column}function T4(e,t){return e.className===t.className&&w4(e.node,t.node)}var E4=(e,t)=>typeof e==`boolean`?e:e[t]!==!1,D4=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.table;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},O4=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.code;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},k4=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.mermaid;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},A4=(0,M.memo)(({children:e,className:t,node:n,...r})=>(0,F.jsx)(`ol`,{className:Q2()(`list-inside list-decimal whitespace-normal [li_&]:pl-6`,t),"data-streamdown":`ordered-list`,...r,children:e}),(e,t)=>T4(e,t));A4.displayName=`MarkdownOl`;var j4=(0,M.memo)(({children:e,className:t,node:n,...r})=>(0,F.jsx)(`li`,{className:Q2()(`py-1 [&>p]:inline`,t),"data-streamdown":`list-item`,...r,children:e}),(e,t)=>e.className===t.className&&w4(e.node,t.node));j4.displayName=`MarkdownLi`;var M4=(0,M.memo)(({children:e,className:t,node:n,...r})=>(0,F.jsx)(`ul`,{className:Q2()(`list-inside list-disc whitespace-normal [li_&]:pl-6`,t),"data-streamdown":`unordered-list`,...r,children:e}),(e,t)=>T4(e,t));M4.displayName=`MarkdownUl`;var N4=(0,M.memo)(({className:e,node:t,...n})=>(0,F.jsx)(`hr`,{className:Q2()(`my-6 border-border`,e),"data-streamdown":`horizontal-rule`,...n}),(e,t)=>T4(e,t));N4.displayName=`MarkdownHr`;var P4=(0,M.memo)(({children:e,className:t,node:n,...r})=>(0,F.jsx)(`span`,{className:Q2()(`font-semibold`,t),"data-streamdown":`strong`,...r,children:e}),(e,t)=>T4(e,t));P4.displayName=`MarkdownStrong`;var F4=(0,M.memo)(({children:e,className:t,href:n,node:r,...i})=>{let a=Q2(),{linkSafety:o}=(0,M.useContext)(v3),[s,c]=(0,M.useState)(!1),l=n===`streamdown:incomplete-link`,u=(0,M.useCallback)(async e=>{if(!(!(o!=null&&o.enabled&&n)||l)){if(e.preventDefault(),o.onLinkCheck&&await o.onLinkCheck(n)){window.open(n,`_blank`,`noreferrer`);return}c(!0)}},[o,n,l]),d=(0,M.useCallback)(()=>{n&&window.open(n,`_blank`,`noreferrer`)},[n]),f=(0,M.useCallback)(()=>{c(!1)},[]),p={url:n??``,isOpen:s,onClose:f,onConfirm:d};return o!=null&&o.enabled&&n?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`button`,{className:a(`wrap-anywhere appearance-none text-left font-medium text-primary underline`,t),"data-incomplete":l,"data-streamdown":`link`,onClick:u,type:`button`,children:e}),o.renderModal?o.renderModal(p):(0,F.jsx)(tht,{...p})]}):(0,F.jsx)(`a`,{className:a(`wrap-anywhere font-medium text-primary underline`,t),"data-incomplete":l,"data-streamdown":`link`,href:n,rel:`noreferrer`,target:`_blank`,...i,children:e})},(e,t)=>T4(e,t)&&e.href===t.href);F4.displayName=`MarkdownA`;var I4=(0,M.memo)(({children:e,className:t,node:n,...r})=>(0,F.jsx)(`h1`,{className:Q2()(`mt-6 mb-2 font-semibold text-3xl`,t),"data-streamdown":`heading-1`,...r,children:e}),(e,t)=>T4(e,t));I4.displayName=`MarkdownH1`;var L4=(0,M.memo)(({children:e,className:t,node:n,...r})=>(0,F.jsx)(`h2`,{className:Q2()(`mt-6 mb-2 font-semibold text-2xl`,t),"data-streamdown":`heading-2`,...r,children:e}),(e,t)=>T4(e,t));L4.displayName=`MarkdownH2`;var R4=(0,M.memo)(({children:e,className:t,node:n,...r})=>(0,F.jsx)(`h3`,{className:Q2()(`mt-6 mb-2 font-semibold text-xl`,t),"data-streamdown":`heading-3`,...r,children:e}),(e,t)=>T4(e,t));R4.displayName=`MarkdownH3`;var z4=(0,M.memo)(({children:e,className:t,node:n,...r})=>(0,F.jsx)(`h4`,{className:Q2()(`mt-6 mb-2 font-semibold text-lg`,t),"data-streamdown":`heading-4`,...r,children:e}),(e,t)=>T4(e,t));z4.displayName=`MarkdownH4`;var B4=(0,M.memo)(({children:e,className:t,node:n,...r})=>(0,F.jsx)(`h5`,{className:Q2()(`mt-6 mb-2 font-semibold text-base`,t),"data-streamdown":`heading-5`,...r,children:e}),(e,t)=>T4(e,t));B4.displayName=`MarkdownH5`;var V4=(0,M.memo)(({children:e,className:t,node:n,...r})=>(0,F.jsx)(`h6`,{className:Q2()(`mt-6 mb-2 font-semibold text-sm`,t),"data-streamdown":`heading-6`,...r,children:e}),(e,t)=>T4(e,t));V4.displayName=`MarkdownH6`;var H4=(0,M.memo)(({children:e,className:t,node:n,...r})=>{let{controls:i}=(0,M.useContext)(v3);return(0,F.jsx)(lht,{className:t,showControls:E4(i,`table`),showCopy:D4(i,`copy`),showDownload:D4(i,`download`),showFullscreen:D4(i,`fullscreen`),...r,children:e})},(e,t)=>T4(e,t));H4.displayName=`MarkdownTable`;var U4=(0,M.memo)(({children:e,className:t,node:n,...r})=>(0,F.jsx)(`thead`,{className:Q2()(`bg-muted/80`,t),"data-streamdown":`table-header`,...r,children:e}),(e,t)=>T4(e,t));U4.displayName=`MarkdownThead`;var W4=(0,M.memo)(({children:e,className:t,node:n,...r})=>(0,F.jsx)(`tbody`,{className:Q2()(`divide-y divide-border`,t),"data-streamdown":`table-body`,...r,children:e}),(e,t)=>T4(e,t));W4.displayName=`MarkdownTbody`;var G4=(0,M.memo)(({children:e,className:t,node:n,...r})=>(0,F.jsx)(`tr`,{className:Q2()(`border-border`,t),"data-streamdown":`table-row`,...r,children:e}),(e,t)=>T4(e,t));G4.displayName=`MarkdownTr`;var K4=(0,M.memo)(({children:e,className:t,node:n,...r})=>(0,F.jsx)(`th`,{className:Q2()(`whitespace-nowrap px-4 py-2 text-left font-semibold text-sm`,t),"data-streamdown":`table-header-cell`,...r,children:e}),(e,t)=>T4(e,t));K4.displayName=`MarkdownTh`;var q4=(0,M.memo)(({children:e,className:t,node:n,...r})=>(0,F.jsx)(`td`,{className:Q2()(`px-4 py-2 text-sm`,t),"data-streamdown":`table-cell`,...r,children:e}),(e,t)=>T4(e,t));q4.displayName=`MarkdownTd`;var J4=(0,M.memo)(({children:e,className:t,node:n,...r})=>(0,F.jsx)(`blockquote`,{className:Q2()(`my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic`,t),"data-streamdown":`blockquote`,...r,children:e}),(e,t)=>T4(e,t));J4.displayName=`MarkdownBlockquote`;var Y4=(0,M.memo)(({children:e,className:t,node:n,...r})=>(0,F.jsx)(`sup`,{className:Q2()(`text-sm`,t),"data-streamdown":`superscript`,...r,children:e}),(e,t)=>T4(e,t));Y4.displayName=`MarkdownSup`;var X4=(0,M.memo)(({children:e,className:t,node:n,...r})=>(0,F.jsx)(`sub`,{className:Q2()(`text-sm`,t),"data-streamdown":`subscript`,...r,children:e}),(e,t)=>T4(e,t));X4.displayName=`MarkdownSub`;var Z4=(0,M.memo)(({children:e,className:t,node:n,...r})=>{if(`data-footnotes`in r){let n=e=>{if(!(0,M.isValidElement)(e))return!1;let t=Array.isArray(e.props.children)?e.props.children:[e.props.children],n=!1,r=!1;for(let e of t)if(e){if(typeof e==`string`)e.trim()!==``&&(n=!0);else if((0,M.isValidElement)(e))if(e.props?.[`data-footnote-backref`]!==void 0)r=!0;else{let t=Array.isArray(e.props.children)?e.props.children:[e.props.children];for(let e of t){if(typeof e==`string`&&e.trim()!==``){n=!0;break}if((0,M.isValidElement)(e)&&e.props?.[`data-footnote-backref`]===void 0){n=!0;break}}}}return r&&!n},i=Array.isArray(e)?e.map(e=>{if(!(0,M.isValidElement)(e))return e;if(e.type===A4){let t=(Array.isArray(e.props.children)?e.props.children:[e.props.children]).filter(e=>!n(e));return t.length===0?null:{...e,props:{...e.props,children:t}}}return e}):e;return(Array.isArray(i)?i.some(e=>e!==null):i!==null)?(0,F.jsx)(`section`,{className:t,...r,children:i}):null}return(0,F.jsx)(`section`,{className:t,...r,children:e})},(e,t)=>T4(e,t));Z4.displayName=`MarkdownSection`;var Q4=(0,M.memo)(({node:e,className:t,children:n,...r})=>{let i=Q2(),a=!(`data-block`in r),{mermaid:o,controls:s,lineNumbers:c}=(0,M.useContext)(v3),l=_4(),u=Vmt(),d=(t?.match(pht))?.at(1)??``,f=rht(d);if(a)return(0,F.jsx)(`code`,{className:i(`rounded bg-muted px-1.5 py-0.5 font-mono text-sm`,t),"data-streamdown":`inline-code`,...r,children:n});let p=e?.properties?.metastring,m=p?.match(uht),h=m?Number.parseInt(m[1],10):void 0,g=h!==void 0&&h>=1?h:void 0,_=!(p&&dht.test(p))&&c!==!1,v=``;if((0,M.isValidElement)(n)&&n.props&&typeof n.props==`object`&&`children`in n.props&&typeof n.props.children==`string`?v=n.props.children:typeof n==`string`&&(v=n),f){let e=f.component;return(0,F.jsx)(M.Suspense,{fallback:(0,F.jsx)(d4,{}),children:(0,F.jsx)(e,{code:v,isIncomplete:u,language:d,meta:p})})}if(d===`mermaid`&&l){let e=E4(s,`mermaid`),n=k4(s,`download`),r=k4(s,`copy`),a=k4(s,`fullscreen`),c=k4(s,`panZoom`),l=e&&(n||r||a);return(0,F.jsx)(M.Suspense,{fallback:(0,F.jsx)(d4,{}),children:(0,F.jsxs)(`div`,{className:i(`group relative my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2`,t),"data-streamdown":`mermaid-block`,children:[(0,F.jsx)(`div`,{className:i(`flex h-8 items-center text-muted-foreground text-xs`),children:(0,F.jsx)(`span`,{className:i(`ml-1 font-mono lowercase`),children:`mermaid`})}),l?(0,F.jsx)(`div`,{className:i(`pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end`),children:(0,F.jsxs)(`div`,{className:i(`pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur`),"data-streamdown":`mermaid-block-actions`,children:[n?(0,F.jsx)(aht,{chart:v,config:o?.config}):null,r?(0,F.jsx)(l4,{code:v}):null,a?(0,F.jsx)(oht,{chart:v,config:o?.config}):null]})}):null,(0,F.jsx)(`div`,{className:i(`rounded-md border border-border bg-background`),children:(0,F.jsx)(fht,{chart:v,config:o?.config,showControls:c})})]})})}let y=E4(s,`code`),b=O4(s,`download`),x=O4(s,`copy`);return(0,F.jsx)(Xmt,{className:t,code:v,isIncomplete:u,language:d,lineNumbers:_,startLine:g,children:y?(0,F.jsxs)(F.Fragment,{children:[b?(0,F.jsx)(Qmt,{code:v,language:d}):null,x?(0,F.jsx)(l4,{}):null]}):null})},(e,t)=>e.className===t.className&&w4(e.node,t.node));Q4.displayName=`MarkdownCode`;var $4=(0,M.memo)(eht,(e,t)=>e.className===t.className&&w4(e.node,t.node));$4.displayName=`MarkdownImg`;var e3=(0,M.memo)(({children:e,node:t,...n})=>{let r=(Array.isArray(e)?e:[e]).filter(e=>e!=null&&e!==``);if(r.length===1&&(0,M.isValidElement)(r[0])){let t=r[0].props.node?.tagName;if(t===`img`||t===`code`&&`data-block`in r[0].props)return(0,F.jsx)(F.Fragment,{children:e})}return(0,F.jsx)(`p`,{...n,children:e})},(e,t)=>T4(e,t));e3.displayName=`MarkdownParagraph`;var mht={ol:A4,li:j4,ul:M4,hr:N4,strong:P4,a:F4,h1:I4,h2:L4,h3:R4,h4:z4,h5:B4,h6:V4,table:H4,thead:U4,tbody:W4,tr:G4,th:K4,td:q4,blockquote:J4,code:Q4,img:$4,pre:({children:e})=>(0,M.isValidElement)(e)?(0,M.cloneElement)(e,{"data-block":`true`}):e,sup:Y4,sub:X4,p:e3,section:Z4},hht=/[\u0590-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFF]/,ght=/\p{L}/u;function t3(e){let t=e.replace(/^#{1,6}\s+/gm,``).replace(/(\*{1,3}|_{1,3})/g,``).replace(/`[^`]*`/g,``).replace(/\[([^\]]*)\]\([^)]*\)/g,`$1`).replace(/^[\s>*\-+\d.]+/gm,``);for(let e of t){if(hht.test(e))return`rtl`;if(ght.test(e))return`ltr`}return`ltr`}var _ht=/^[ \t]{0,3}(`{3,}|~{3,})/,vht=/^\|?[ \t]*:?-{1,}:?[ \t]*(\|[ \t]*:?-{1,}:?[ \t]*)*\|?$/,n3=e=>{let t=e.split(`
|
|
251
|
+
`),n=null,r=0;for(let e of t){let t=_ht.exec(e);if(n===null){if(t){let e=t[1];n=e[0],r=e.length}}else if(t){let e=t[1],i=e[0],a=e.length;i===n&&a>=r&&(n=null,r=0)}}return n!==null},yht=e=>{let t=e.split(`
|
|
252
|
+
`);for(let e of t){let t=e.trim();if(t.length>0&&t.includes(`|`)&&vht.test(t))return!0}return!1},bht=()=>e=>{hX(e,`html`,(e,t,n)=>{!n||typeof t!=`number`||(n.children[t]={type:`text`,value:e.value})})},r3=[],i3={allowDangerousHtml:!0},a3=new WeakMap,o3=new class{constructor(){this.cache=new Map,this.keyCache=new WeakMap,this.maxSize=100}generateCacheKey(e){let t=this.keyCache.get(e);if(t)return t;let n=e.rehypePlugins,r=e.remarkPlugins,i=e.remarkRehypeOptions;if(!(n||r||i)){let t=`default`;return this.keyCache.set(e,t),t}let a=e=>{if(!e||e.length===0)return``;let t=``;for(let n=0;n<e.length;n+=1){let r=e[n];if(n>0&&(t+=`,`),Array.isArray(r)){let[e,n]=r;if(typeof e==`function`){let n=a3.get(e);n||(n=e.name,a3.set(e,n)),t+=n}else t+=String(e);t+=`:`,t+=JSON.stringify(n)}else if(typeof r==`function`){let e=a3.get(r);e||(e=r.name,a3.set(r,e)),t+=e}else t+=String(r)}return t},o=a(n),s=`${a(r)}::${o}::${i?JSON.stringify(i):``}`;return this.keyCache.set(e,s),s}get(e){let t=this.generateCacheKey(e),n=this.cache.get(t);return n&&(this.cache.delete(t),this.cache.set(t,n)),n}set(e,t){let n=this.generateCacheKey(e);if(this.cache.size>=this.maxSize){let e=this.cache.keys().next().value;e&&this.cache.delete(e)}this.cache.set(n,t)}clear(){this.cache.clear()}},s3=e=>{let t=xht(e),n=e.children||``;return Oht(t.runSync(t.parse(n),n),e)},xht=e=>{let t=o3.get(e);if(t)return t;let n=Cht(e);return o3.set(e,n),n},Sht=e=>e.some(e=>Array.isArray(e)?e[0]===u$:e===u$),Cht=e=>{let t=e.rehypePlugins||r3,n=e.remarkPlugins||r3,r=Sht(t)?n:[...n,bht],i=e.remarkRehypeOptions?{...i3,...e.remarkRehypeOptions}:i3;return Rpt().use(Rft).use(r).use(bpt,i).use(t)},wht=e=>e,Tht=(e,t,n,r)=>{n?e.children.splice(t,1):e.children[t]={type:`text`,value:r}},Eht=(e,t)=>{for(let n in v0)if(Object.hasOwn(v0,n)&&Object.hasOwn(e.properties,n)){let r=e.properties[n],i=v0[n];(i===null||i.includes(e.tagName))&&(e.properties[n]=t(String(r||``),n,e)??void 0)}},Dht=(e,t,n,r,i,a)=>{let o=!1;return r?o=!r.includes(e.tagName):i&&(o=i.includes(e.tagName)),!o&&a&&typeof t==`number`&&(o=!a(e,t,n)),o},Oht=(e,t)=>{let{allowElement:n,allowedElements:r,disallowedElements:i,skipHtml:a,unwrapDisallowed:o,urlTransform:s}=t;if(n||r||i||a||s){let t=s||wht;hX(e,(e,s,c)=>{if(e.type===`raw`&&c&&typeof s==`number`)return Tht(c,s,a,e.value),s;if(e.type===`element`&&(Eht(e,t),Dht(e,s,c,r,i,n)&&c&&typeof s==`number`))return o&&e.children?c.children.splice(s,1,...e.children):c.children.splice(s,1),s})}return Kdt(e,{Fragment:F.Fragment,components:t.components,ignoreInvalidStyle:!0,jsx:F.jsx,jsxs:F.jsxs,passKeys:!0,passNode:!0})},kht=/\[\^[\w-]{1,200}\](?!:)/,Aht=/\[\^[\w-]{1,200}\]:/,jht=/<(\w+)[\s>]/,Mht=new Set([`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`]),c3=new Map,l3=new Map,Nht=e=>{let t=e.toLowerCase(),n=c3.get(t);if(n)return n;let r=RegExp(`<${t}(?=[\\s>/])[^>]*>`,`gi`);return c3.set(t,r),r},Pht=e=>{let t=e.toLowerCase(),n=l3.get(t);if(n)return n;let r=RegExp(`</${t}(?=[\\s>])[^>]*>`,`gi`);return l3.set(t,r),r},u3=(e,t)=>{if(Mht.has(t.toLowerCase()))return 0;let n=e.match(Nht(t));if(!n)return 0;let r=0;for(let e of n)e.trimEnd().endsWith(`/>`)||(r+=1);return r},d3=(e,t)=>{let n=e.match(Pht(t));return n?n.length:0},Fht=e=>{let t=0;for(let n=0;n<e.length-1;n+=1)e[n]===`$`&&e[n+1]===`$`&&(t+=1,n+=1);return t},Iht=e=>{let t=kht.test(e),n=Aht.test(e);if(t||n)return[e];let r=L2.lex(e,{gfm:!0}),i=[],a=[],o=!1;for(let e of r){let t=e.raw,n=i.length;if(a.length>0){i[n-1]+=t;let e=a.at(-1),r=u3(t,e),o=d3(t,e);for(let t=0;t<r;t+=1)a.push(e);for(let t=0;t<o;t+=1)a.length>0&&a.at(-1)===e&&a.pop();continue}if(e.type===`html`&&e.block){let e=t.match(jht);if(e){let n=e[1];u3(t,n)>d3(t,n)&&a.push(n)}}if(n>0&&!o){let e=i[n-1];if(Fht(e)%2==1){i[n-1]=e+t;continue}}i.push(t),e.type!==`space`&&(o=e.type===`code`)}return i},Lht=(e,t)=>{if(!t.length)return e;let n=e;for(let e of t){let t=RegExp(`(<${e}(?=[\\s>/])[^>]*>)([\\s\\S]*?)(</${e}\\s*>)`,`gi`);n=n.replace(t,(e,t,n,r)=>{if(!n.includes(`
|
|
253
|
+
|
|
254
|
+
`))return t+n+r;let i=n.replace(/\n\n/g,`
|
|
255
|
+
<!---->
|
|
256
|
+
`);return`${t}${(i.startsWith(`
|
|
257
|
+
`)?``:`
|
|
258
|
+
`)+i+(i.endsWith(`
|
|
259
|
+
`)?``:`
|
|
260
|
+
`)}${r}
|
|
261
|
+
|
|
262
|
+
`})}return n},Rht=/([\\`*_~[\]|])/g,zht=e=>e.replace(Rht,`\\$1`),Bht=(e,t)=>{if(!t.length)return e;let n=e;for(let e of t){let t=RegExp(`(<${e}(?=[\\s>/])[^>]*>)([\\s\\S]*?)(</${e}\\s*>)`,`gi`);n=n.replace(t,(e,t,n,r)=>t+zht(n).replace(/\n\n/g,` `)+r)}return n},f3=e=>e.type===`text`?e.value:`children`in e&&Array.isArray(e.children)?e.children.map(f3).join(``):``,Vht=e=>t=>{if(!e||e.length===0)return;let n=new Set(e.map(e=>e.toLowerCase()));hX(t,`element`,e=>{if(n.has(e.tagName.toLowerCase())){let t=f3(e);e.children=t?[{type:`text`,value:t}]:[]}})},Hht=()=>e=>{hX(e,`code`,e=>{e.meta&&(e.data=e.data??{},e.data.hProperties={...e.data.hProperties??{},metastring:e.meta})})},Uht=/^[ \t]*<[\w!/?-]/,Wht=/(^|\n)[ \t]{4,}(?=<[\w!/?-])/g,Ght=e=>typeof e!=`string`||e.length===0||!Uht.test(e)?e:e.replace(Wht,`$1`),p3={...f$,protocols:{...f$.protocols,href:[...f$.protocols?.href??[],`tel`]},attributes:{...f$.attributes,code:[...f$.attributes?.code??[],`metastring`]}},m3={raw:u$,sanitize:[b$,p3],harden:[_X,{allowedImagePrefixes:[`*`],allowedLinkPrefixes:[`*`],allowedProtocols:[`*`],defaultOrigin:void 0,allowDataImages:!0}]},Kht={gfm:[jdt,{}],codeMeta:Hht},h3=Object.values(m3),qht=Object.values(Kht),Jht={block:` ▋`,circle:` ●`},g3=[`github-light`,`github-dark`],_3={enabled:!0},v3=(0,M.createContext)({shikiTheme:g3,controls:!0,isAnimating:!1,lineNumbers:!0,mode:`streaming`,mermaid:void 0,linkSafety:_3}),y3=(0,M.memo)(({content:e,shouldParseIncompleteMarkdown:t,shouldNormalizeHtmlIndentation:n,index:r,isIncomplete:i,dir:a,animatePlugin:o,...s})=>{if(o){let e=o.getLastRenderCharCount();o.setPrevContentLength(e)}let c=typeof e==`string`&&n?Ght(e):e,l=(0,F.jsx)(s3,{...s,children:c});return(0,F.jsx)(J2.Provider,{value:i,children:a?(0,F.jsx)(`div`,{dir:a,style:{display:`contents`},children:l}):l})},(e,t)=>{if(e.content!==t.content||e.shouldNormalizeHtmlIndentation!==t.shouldNormalizeHtmlIndentation||e.index!==t.index||e.isIncomplete!==t.isIncomplete||e.dir!==t.dir)return!1;if(e.components!==t.components){let n=Object.keys(e.components||{}),r=Object.keys(t.components||{});if(n.length!==r.length||n.some(n=>e.components?.[n]!==t.components?.[n]))return!1}return!(e.rehypePlugins!==t.rehypePlugins||e.remarkPlugins!==t.remarkPlugins)});y3.displayName=`Block`;var b3=(0,M.memo)(({children:e,mode:t=`streaming`,dir:n,parseIncompleteMarkdown:r=!0,normalizeHtmlIndentation:i=!1,components:a,rehypePlugins:o=h3,remarkPlugins:s=qht,className:c,shikiTheme:l=g3,mermaid:u,controls:d=!0,isAnimating:f=!1,animated:p,BlockComponent:m=y3,parseMarkdownIntoBlocksFn:h=Iht,caret:g,plugins:_,remend:v,linkSafety:y=_3,lineNumbers:b=!0,allowedTags:x,literalTagContent:S,translations:C,icons:w,prefix:T,onAnimationStart:E,onAnimationEnd:D,...O})=>{let ee=(0,M.useId)(),[te,k]=(0,M.useTransition)(),A=(0,M.useMemo)(()=>Umt(T),[T]),ne=(0,M.useRef)(null),re=(0,M.useRef)(E),ie=(0,M.useRef)(D);re.current=E,ie.current=D,(0,M.useEffect)(()=>{var e,n,r;if(t===`static`)return;let i=ne.current;if(ne.current=f,i===null){f&&((e=re.current)==null||e.call(re));return}f&&!i?(n=re.current)==null||n.call(re):!f&&i&&((r=ie.current)==null||r.call(ie))},[f,t]);let j=(0,M.useMemo)(()=>x?Object.keys(x):[],[x]),ae=(0,M.useMemo)(()=>{if(typeof e!=`string`)return``;let n=t===`streaming`&&r?sX(e,v):e;return S&&S.length>0&&(n=Bht(n,S)),j.length>0&&(n=Lht(n,j)),n},[e,t,r,v,j,S]),oe=(0,M.useMemo)(()=>h(ae),[ae,h]),[se,ce]=(0,M.useState)(oe);(0,M.useEffect)(()=>{t===`streaming`&&!pe?k(()=>{ce(oe)}):ce(oe)},[oe,t]);let le=t===`streaming`?se:oe,ue=(0,M.useMemo)(()=>n===`auto`?le.map(t3):void 0,[le,n]),de=(0,M.useMemo)(()=>le.map((e,t)=>`${ee}-${t}`),[le.length,ee]),fe=(0,M.useMemo)(()=>p===!0?`true`:p?JSON.stringify(p):``,[p]),pe=(0,M.useMemo)(()=>fe?fe===`true`?q2():q2(p):null,[fe]),me=(0,M.useMemo)(()=>({shikiTheme:(_?.code)?.getThemes()??l,controls:d,isAnimating:f,lineNumbers:b,mode:t,mermaid:u,linkSafety:y}),[l,d,f,b,t,u,y,_?.code]),he=(0,M.useMemo)(()=>({...o4,...C}),[(0,M.useMemo)(()=>C?JSON.stringify(C):``,[C])]),ge=(0,M.useMemo)(()=>{let{inlineCode:e,...t}=a??{},n={...mht,...t};if(e){let t=n.code;n.code=n=>`data-block`in n?t?(0,M.createElement)(t,n):null:(0,M.createElement)(e,n)}return n},[a]),_e=(0,M.useMemo)(()=>{let e=[];return _!=null&&_.cjk&&(e=[...e,..._.cjk.remarkPluginsBefore]),e=[...e,...s],_!=null&&_.cjk&&(e=[...e,..._.cjk.remarkPluginsAfter]),_!=null&&_.math&&(e=[...e,_.math.remarkPlugin]),e},[s,_?.math,_?.cjk]),ve=(0,M.useMemo)(()=>{let e=o;if(x&&Object.keys(x).length>0&&o===h3){let t={...p3,tagNames:[...p3.tagNames??[],...Object.keys(x)],attributes:{...p3.attributes,...x}};e=[m3.raw,[b$,t],m3.harden]}return S&&S.length>0&&(e=[...e,[Vht,S]]),_!=null&&_.math&&(e=[...e,_.math.rehypePlugin]),pe&&f&&(e=[...e,pe.rehypePlugin]),e},[o,_?.math,pe,f,x,S]),ye=(0,M.useMemo)(()=>{if(!f||le.length===0)return!1;let e=le.at(-1);return n3(e)||yht(e)},[f,le]),be=(0,M.useMemo)(()=>g&&f&&!ye?{"--streamdown-caret":`"${Jht[g]}"`}:void 0,[g,f,ye]);return t===`static`?(0,F.jsx)(s4.Provider,{value:he,children:(0,F.jsx)(h4.Provider,{value:_??null,children:(0,F.jsx)(v3.Provider,{value:me,children:(0,F.jsx)(i4,{icons:w,children:(0,F.jsx)(Z2.Provider,{value:A,children:(0,F.jsx)(`div`,{className:A(`space-y-4 whitespace-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0`,c),dir:n===`auto`?t3(ae):n,children:(0,F.jsx)(s3,{components:ge,rehypePlugins:ve,remarkPlugins:_e,...O,children:ae})})})})})})}):(0,F.jsx)(s4.Provider,{value:he,children:(0,F.jsx)(h4.Provider,{value:_??null,children:(0,F.jsx)(v3.Provider,{value:me,children:(0,F.jsx)(i4,{icons:w,children:(0,F.jsx)(Z2.Provider,{value:A,children:(0,F.jsxs)(`div`,{className:A(`space-y-4 whitespace-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0`,g&&!ye?`[&>*:last-child]:after:inline [&>*:last-child]:after:align-baseline [&>*:last-child]:after:content-[var(--streamdown-caret)]`:null,c),style:be,children:[le.length===0&&g&&f&&(0,F.jsx)(`span`,{}),le.map((e,t)=>{let a=t===le.length-1,o=f&&a&&n3(e);return(0,F.jsx)(m,{animatePlugin:pe,components:ge,content:e,dir:ue?.[t]??(n===`auto`?void 0:n),index:t,isIncomplete:o,rehypePlugins:ve,remarkPlugins:_e,shouldNormalizeHtmlIndentation:i,shouldParseIncompleteMarkdown:r,...O},de[t])})]})})})})})})},(e,t)=>e.children===t.children&&e.shikiTheme===t.shikiTheme&&e.isAnimating===t.isAnimating&&e.animated===t.animated&&e.mode===t.mode&&e.plugins===t.plugins&&e.className===t.className&&e.linkSafety===t.linkSafety&&e.lineNumbers===t.lineNumbers&&e.normalizeHtmlIndentation===t.normalizeHtmlIndentation&&e.literalTagContent===t.literalTagContent&&JSON.stringify(e.translations)===JSON.stringify(t.translations)&&e.prefix===t.prefix&&e.dir===t.dir);b3.displayName=`Streamdown`;var Yht=({children:e,className:t,minZoom:n=.5,maxZoom:r=3,zoomStep:i=.1,showControls:a=!0,initialZoom:o=1,fullscreen:s=!1})=>{let{RotateCcwIcon:c,ZoomInIcon:l,ZoomOutIcon:u}=a4(),d=Q2(),f=(0,M.useRef)(null),p=(0,M.useRef)(null),[m,h]=(0,M.useState)(o),[g,_]=(0,M.useState)({x:0,y:0}),[v,y]=(0,M.useState)(!1),[b,x]=(0,M.useState)({x:0,y:0}),[S,C]=(0,M.useState)({x:0,y:0}),w=(0,M.useCallback)(e=>{h(t=>Math.max(n,Math.min(r,t+e)))},[n,r]),T=(0,M.useCallback)(()=>{w(i)},[w,i]),E=(0,M.useCallback)(()=>{w(-i)},[w,i]),D=(0,M.useCallback)(()=>{h(o),_({x:0,y:0})},[o]),O=(0,M.useCallback)(e=>{e.preventDefault(),w(e.deltaY>0?-i:i)},[w,i]),ee=(0,M.useCallback)(e=>{if(e.button!==0||e.isPrimary===!1)return;y(!0),x({x:e.clientX,y:e.clientY}),C(g);let t=e.currentTarget;t instanceof HTMLElement&&t.setPointerCapture(e.pointerId)},[g]),te=(0,M.useCallback)(e=>{if(!v)return;e.preventDefault();let t=e.clientX-b.x,n=e.clientY-b.y;_({x:S.x+t,y:S.y+n})},[v,b,S]),k=(0,M.useCallback)(e=>{y(!1);let t=e.currentTarget;t instanceof HTMLElement&&t.releasePointerCapture(e.pointerId)},[]);return(0,M.useEffect)(()=>{let e=f.current;if(e)return e.addEventListener(`wheel`,O,{passive:!1}),()=>{e.removeEventListener(`wheel`,O)}},[O]),(0,M.useEffect)(()=>{let e=p.current;if(e&&v)return document.body.style.userSelect=`none`,e.addEventListener(`pointermove`,te,{passive:!1}),e.addEventListener(`pointerup`,k),e.addEventListener(`pointercancel`,k),()=>{document.body.style.userSelect=``,e.removeEventListener(`pointermove`,te),e.removeEventListener(`pointerup`,k),e.removeEventListener(`pointercancel`,k)}},[v,te,k]),(0,F.jsxs)(`div`,{className:d(`relative flex flex-col`,s?`h-full w-full`:`min-h-28 w-full`,t),ref:f,style:{cursor:v?`grabbing`:`grab`},children:[a?(0,F.jsxs)(`div`,{className:d(`absolute z-10 flex flex-col gap-1 rounded-md border border-border bg-background/80 p-1 supports-[backdrop-filter]:bg-background/70 supports-[backdrop-filter]:backdrop-blur-sm`,s?`bottom-4 left-4`:`bottom-2 left-2`),children:[(0,F.jsx)(`button`,{className:d(`flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`),disabled:m>=r,onClick:T,title:`Zoom in`,type:`button`,children:(0,F.jsx)(l,{size:16})}),(0,F.jsx)(`button`,{className:d(`flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`),disabled:m<=n,onClick:E,title:`Zoom out`,type:`button`,children:(0,F.jsx)(u,{size:16})}),(0,F.jsx)(`button`,{className:d(`flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`),onClick:D,title:`Reset zoom and pan`,type:`button`,children:(0,F.jsx)(c,{size:16})})]}):null,(0,F.jsx)(`div`,{className:d(`flex-1 origin-center transition-transform duration-150 ease-out`,s?`flex h-full w-full items-center justify-center`:`flex w-full items-center justify-center`),onPointerDown:ee,ref:p,role:`application`,style:{transform:`translate(${g.x}px, ${g.y}px) scale(${m})`,transformOrigin:`center center`,touchAction:`none`,willChange:`transform`},children:e})]})},x3=({chart:e,className:t,config:n,fullscreen:r=!1,showControls:i=!0})=>{let a=Q2(),[o,s]=(0,M.useState)(null),[c,l]=(0,M.useState)(!1),[u,d]=(0,M.useState)(``),[f,p]=(0,M.useState)(``),[m,h]=(0,M.useState)(0),{mermaid:g}=(0,M.useContext)(v3),_=_4(),v=g?.errorComponent,{shouldRender:y,containerRef:b}=jmt({immediate:r});if((0,M.useEffect)(()=>{if(y){if(!_){s(`Mermaid plugin not available. Please add the mermaid plugin to enable diagram rendering.`);return}(async()=>{try{s(null),l(!0);let t=_.getMermaid(n),r=e.split(``).reduce((e,t)=>(e<<5)-e+t.charCodeAt(0)|0,0),i=`mermaid-${Math.abs(r)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:a}=await t.render(i,e);d(a),p(a)}catch(e){f||u||s(e instanceof Error?e.message:`Failed to render Mermaid chart`)}finally{l(!1)}})()}},[e,n,m,y,_]),!(y||u||f))return(0,F.jsx)(`div`,{className:a(`my-4 min-h-[200px]`,t),ref:b});if(c&&!u&&!f)return(0,F.jsx)(`div`,{className:a(`my-4 flex justify-center p-4`,t),ref:b,children:(0,F.jsxs)(`div`,{className:a(`flex items-center space-x-2 text-muted-foreground`),children:[(0,F.jsx)(`div`,{className:a(`h-4 w-4 animate-spin rounded-full border-current border-b-2`)}),(0,F.jsx)(`span`,{className:a(`text-sm`),children:`Loading diagram...`})]})});if(o&&!u&&!f)return v?(0,F.jsx)(`div`,{ref:b,children:(0,F.jsx)(v,{chart:e,error:o,retry:()=>h(e=>e+1)})}):(0,F.jsxs)(`div`,{className:a(`rounded-md bg-red-50 p-4`,t),ref:b,children:[(0,F.jsxs)(`p`,{className:a(`font-mono text-red-700 text-sm`),children:[`Mermaid Error: `,o]}),(0,F.jsxs)(`details`,{className:a(`mt-2`),children:[(0,F.jsx)(`summary`,{className:a(`cursor-pointer text-red-600 text-xs`),children:`Show Code`}),(0,F.jsx)(`pre`,{className:a(`mt-2 overflow-x-auto rounded bg-red-100 p-2 text-red-800 text-xs`),children:e})]})]});let x=u||f;return(0,F.jsx)(`div`,{className:a(`size-full`,t),"data-streamdown":`mermaid`,ref:b,children:(0,F.jsx)(Yht,{className:a(r?`size-full overflow-hidden`:`overflow-hidden`,t),fullscreen:r,maxZoom:3,minZoom:.5,showControls:i,zoomStep:.1,children:(0,F.jsx)(`div`,{"aria-label":`Mermaid chart`,className:a(`flex justify-center`,r?`size-full items-center`:null),dangerouslySetInnerHTML:{__html:x},role:`img`})})})};function Xht(e){return[u$,[b$,{}],[_X,{allowedImagePrefixes:e.allowedImagePrefixes??[`*`],allowedLinkPrefixes:e.allowedLinkPrefixes??[`*`],allowedProtocols:e.allowedProtocols??[`*`],allowDataImages:e.allowDataImages??!0,defaultOrigin:e.defaultOrigin,blockedLinkClass:e.blockedLinkClass,blockedImageClass:e.blockedImageClass}]]}var S3=(0,M.forwardRef)(({components:e,componentsByLanguage:t,preprocess:n,defer:r=!1,smooth:i=!1,plugins:a,containerProps:o,containerClassName:s,caret:c,controls:l,linkSafety:u,remend:d,mermaid:f,parseIncompleteMarkdown:p,allowedTags:m,remarkRehypeOptions:h,security:g,BlockComponent:_,parseMarkdownIntoBlocksFn:v,mode:y=`streaming`,className:b,shikiTheme:x,...S},C)=>{let w=lO(),{text:T,status:E}=mO((0,M.useMemo)(()=>n?{...w,text:n(w.text)}:w,[w,n]),i),D=(0,M.useDeferredValue)(T),O=r?D:T,ee=y===`streaming`&&p!==!1&&!v,te=(0,M.useMemo)(()=>ee?$rt(O,d):O,[ee,O,d]),k=ee?!1:p,A=(0,M.useMemo)(()=>{let e=jnt(a,{});return Object.keys(e).length>0?e:void 0},[a]),ne=(0,M.useMemo)(()=>x??(A?.code?knt:void 0),[x,A?.code]),re=ait({components:e,componentsByLanguage:t}),ie=(0,M.useMemo)(()=>{let{SyntaxHighlighter:t,CodeHeader:n,...r}=e??{};return{...r,...re}},[e,re]),j=(0,M.useMemo)(()=>[s,o?.className].filter(Boolean).join(` `)||void 0,[s,o?.className]),ae=(0,M.useMemo)(()=>g?Xht(g):void 0,[g]),oe={...b&&{className:b},...c&&{caret:c},...l!==void 0&&{controls:l},...u&&{linkSafety:u},...d&&{remend:d},...f&&{mermaid:f},...k!==void 0&&{parseIncompleteMarkdown:k},...m&&{allowedTags:m},...A&&{plugins:A},...ne&&{shikiTheme:ne},...h&&{remarkRehypeOptions:h},...ae&&{rehypePlugins:ae},..._&&{BlockComponent:_},...v&&{parseMarkdownIntoBlocksFn:v}};return(0,F.jsx)(`div`,{ref:C,"data-status":E.type,...o,className:j,children:(0,F.jsx)(b3,{mode:y,isAnimating:E.type===`running`,components:ie,...oe,...S,children:te})})});S3.displayName=`StreamdownTextPrimitive`;function Zht(e){return typeof e==`string`&&/^(https?:|mailto:)/i.test(e.trim())}function Qht({href:e,children:t,node:n,...r}){return Zht(e)?(0,F.jsx)(`a`,{...r,href:e,target:`_blank`,rel:`noopener noreferrer`,children:t}):(0,F.jsx)(`span`,{...r,children:t})}var $ht={a:Qht},egt=(0,M.memo)(function(){return(0,F.jsx)(S3,{className:`oc-md`,smooth:!0,components:$ht})});function C3(e){return(0,F.jsx)(QT,{"data-slot":`select`,...e})}function w3(e){return(0,F.jsx)(nE,{"data-slot":`select-value`,...e})}function T3({className:e,size:t=`default`,children:n,...r}){return(0,F.jsxs)(eE,{"data-slot":`select-trigger`,"data-size":t,className:TJ(`flex w-fit items-center justify-between gap-2 rounded-lg border border-input bg-background px-2.5 py-1 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-8 data-[size=sm]:h-7 data-[placeholder]:text-muted-foreground dark:bg-input/30 dark:hover:bg-input/50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...r,children:[n,(0,F.jsx)(rE,{asChild:!0,children:(0,F.jsx)(gm,{className:`size-4 opacity-50`})})]})}function E3({className:e,children:t,position:n=`popper`,...r}){return(0,F.jsx)(aE,{children:(0,F.jsxs)(sE,{"data-slot":`select-content`,className:TJ(`relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] origin-[--radix-select-content-transform-origin] overflow-y-auto overflow-x-hidden rounded-lg border border-border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95`,n===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=top]:-translate-y-1`,e),position:n,...r,children:[(0,F.jsx)(OE,{className:`flex cursor-default items-center justify-center py-1`,children:(0,F.jsx)(vm,{className:`size-4`})}),(0,F.jsx)(_E,{className:TJ(`p-1`,n===`popper`&&`h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]`),children:t}),(0,F.jsx)(AE,{className:`flex cursor-default items-center justify-center py-1`,children:(0,F.jsx)(gm,{className:`size-4`})})]})})}function Q({className:e,children:t,...n}){return(0,F.jsxs)(SE,{"data-slot":`select-item`,className:TJ(`relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-none select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,e),...n,children:[(0,F.jsx)(`span`,{className:`absolute right-2 flex size-3.5 items-center justify-center`,children:(0,F.jsx)(EE,{children:(0,F.jsx)(hm,{className:`size-4`})})}),(0,F.jsx)(wE,{children:t})]})}var D3=1e3;function tgt(){return[{id:`incorrect`,label:hFe()},{id:`incoherence`,label:vFe()},{id:`altered_words`,label:xFe()},{id:`formatting`,label:wFe()},{id:`latency`,label:DFe()},{id:`api_error`,label:AFe()},{id:`other`,label:WK()}]}function ngt(){return[{id:`altered_words`,label:FFe()},{id:`formatting`,label:RFe()},{id:`other`,label:WK()}]}function rgt(e){return e===`user`?ngt():tgt()}var igt=[{name:`Grammarly`,selector:`grammarly-desktop-integration, grammarly-extension, [data-grammarly-shadow-root]`},{name:`LanguageTool`,selector:`[data-lt-installed], .lt-toolbar`},{name:`DeepL`,selector:`deepl-inline-translate, .deepl-translator`},{name:`ProWritingAad`,selector:`pwa-shadow-host, .pwa-tag`}];function agt(){let e=[];try{e=Array.from(navigator.plugins??[]).map(e=>e.name).slice(0,40)}catch{e=[]}let t=[];for(let{name:e,selector:n}of igt)try{document.querySelector(n)&&t.push(e)}catch{}return{plugins:e,extensionsDetected:t}}var O3=M.createContext(null);function ogt(){let e=M.useContext(O3);if(!e)throw Error(`useFeedback must be used within <FeedbackProvider>`);return e}function sgt({children:e}){let t=P(L.feedback.submitFeedback),[n,r]=(0,M.useState)(null),[i,a]=(0,M.useState)(``),[o,s]=(0,M.useState)(``),[c,l]=(0,M.useState)(!1),[u,d]=(0,M.useState)(null),f=M.useCallback(e=>{a(``),s(``),l(!1),d(null),r(e)},[]);function p(e){e||r(null)}async function m(){if(!(!n||!i||c)){l(!0);try{d((await t({chatId:n.chatId,messageId:n.messageId,category:i,comment:o.trim()||void 0,client:{displayedText:n.displayedText,sourceWasOpen:n.sourceWasOpen,userAgent:navigator.userAgent,language:navigator.language,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,theme:document.documentElement.classList.contains(`dark`)?`dark`:`light`,...agt()}})).displayedMatchesStored)}catch{l(!1)}}}let h=u!==null,g=n?.role===`user`;return(0,F.jsxs)(O3.Provider,{value:f,children:[e,(0,F.jsx)(YJ,{open:n!==null,onOpenChange:p,children:n?(0,F.jsxs)(XJ,{className:`sm:max-w-md`,children:[(0,F.jsxs)(ZJ,{children:[(0,F.jsx)($J,{children:VFe()}),(0,F.jsx)(eY,{children:h?WFe():g?qFe():XFe()})]}),h?(0,F.jsx)(`div`,{className:`oc-feedback__result`,role:`status`,children:n.sourceWasOpen?u===!0?(0,F.jsx)(`p`,{className:`oc-feedback__fidelity is-ok`,children:$Fe()}):(0,F.jsx)(`p`,{className:`oc-feedback__fidelity is-warn`,children:nIe()}):(0,F.jsx)(`p`,{className:`oc-feedback__fidelity`,children:aIe()})}):(0,F.jsxs)(`div`,{className:`oc-feedback__form`,children:[(0,F.jsx)(`label`,{className:`oc-feedback__label`,children:cIe()}),(0,F.jsxs)(C3,{value:i,onValueChange:a,children:[(0,F.jsx)(T3,{children:(0,F.jsx)(w3,{placeholder:dIe()})}),(0,F.jsx)(E3,{children:rgt(n.role).map(e=>(0,F.jsx)(Q,{value:e.id,children:e.label},e.id))})]}),(0,F.jsx)(`label`,{className:`oc-feedback__label`,htmlFor:`oc-feedback-comment`,children:mIe()}),(0,F.jsx)(`textarea`,{id:`oc-feedback-comment`,className:`oc-feedback__textarea`,placeholder:_Ie(),value:o,maxLength:D3,onChange:e=>s(e.target.value.slice(0,D3)),rows:4}),(0,F.jsxs)(`div`,{className:`oc-feedback__count`,children:[o.length,`/`,D3]})]}),(0,F.jsx)(QJ,{children:h?(0,F.jsx)(H,{onClick:()=>p(!1),children:bIe()}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(H,{variant:`outline`,onClick:()=>p(!1),children:CIe()}),(0,F.jsx)(H,{onClick:()=>void m(),disabled:!i||c,children:c?EIe():kIe()})]})})]}):null})]})}function cgt(e,t){let n=e.closest(`.oc-msg`)?.querySelector(`.oc-msg__source-pre`),r=n?.textContent;return n&&r!=null&&r!==`(aucun texte)`?{displayedText:r,sourceWasOpen:!0}:{displayedText:t,sourceWasOpen:!1}}function k3(){let e=ogt(),t=Ny(e=>e.metadata?.custom?.messageId),n=Ny(e=>e.metadata?.custom?.chatId),r=Ny(e=>e.role),i=Ny(e=>e.metadata?.custom?.rawText??``),a=N(L.feedback.myReportedMessageIds,n?{chatId:n}:`skip`);if(!t||!n)return null;let o=(a??[]).includes(t);function s(a){e({chatId:n,messageId:t,role:r,...cgt(a.currentTarget,i)})}return(0,F.jsx)(`button`,{type:`button`,className:`oc-iconbtn${o?` is-on`:``}`,title:o?MIe():FIe(),"aria-label":RIe(),onClick:s,children:(0,F.jsx)(Dee,{size:15,"aria-hidden":!0})})}function A3(e,t){return e!=null&&e[t]!==void 0}var lgt=[`inherit`,`fast`,`standard`];function ugt(e){return e==null||e.fastMode===void 0?`inherit`:e.fastMode?`fast`:`standard`}function dgt(e){return e===`inherit`?w6e():e===`fast`?kq():Aq()}function fgt(e){return e===`inherit`?null:e===`fast`}function j3(e){return e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function M3(e){return e.length?e[0].toUpperCase()+e.slice(1):e}var pgt={off:`Off`,minimal:`Min`,low:`Low`,medium:`Med`,high:`High`,xhigh:`XHigh`};function mgt(e,t){return pgt[e]??t}function N3(e,t){return e==null||!t||t<=0?null:Math.round(e/t*100)}function hgt(e,t){let n=N3(e,t);return n===null?null:t8e({pct:n,used:j3(e),total:j3(t)})}function ggt(e){return s8e({level:e??`full`})}function _gt(e,t){let n=typeof e==`number`,r=typeof t==`number`;return n&&r?g8e({cost:e.toFixed(2),tokens:j3(t)}):n?y8e({cost:e.toFixed(2)}):r?S8e({tokens:j3(t)}):null}function vgt(e){let t=e.filter(e=>typeof e==`string`&&e.length>0);return t.length>0?t.join(` · `):null}var ygt=new Set([`knobThinkingLevel`,`knobModel`,`knobFastMode`,`knobUnset`,`agentFiles`,`sessionCompact`,`configDefaults`]),bgt=new Set([`knobThinkingLevel`,`knobModel`]);function P3(e,t){return ygt.has(t)?e==null?bgt.has(t):e[t]===!0:!1}function xgt(e,t){return{model:e(`knobModel`)&&t.hasModels,thinking:e(`knobThinkingLevel`)&&t.hasLevels,speed:e(`knobFastMode`),reset:e(`knobUnset`)}}function F3(e,t){return e===void 0?`loading`:e===null?{blocked:!P3(null,t),gatewayVersion:null}:{blocked:!P3(e.capabilities,t),gatewayVersion:e.gatewayVersion}}function I3(e){let t=N(L.compat.forChat,e===null?`skip`:{chatId:e}),n=t==null?null:t.capabilities;return{can:(0,M.useCallback)(e=>P3(n,e),[n]),loading:t===void 0,gatewayVersion:t?.gatewayVersion??null}}function Sgt(e){let t=P(L.chats.setSessionKnob),[n,r]=(0,M.useState)(null),[i,a]=(0,M.useState)(null);return{apply:(0,M.useCallback)(async(n,i)=>{r(n),a(null);let o={chatId:e};n===`fastMode`?o.fastMode=i:o[n]=i;try{await t(o)}catch{a({field:n,value:i})}finally{r(null)}},[e,t]),pending:n,error:i}}function L3({label:e,overridden:t,onReset:n,pending:r,error:i,onRetry:a,help:o,children:s,resettable:c=!0}){return(0,F.jsxs)(`div`,{className:`oc-spanel__row${t?` is-overridden`:``}`,children:[(0,F.jsxs)(`div`,{className:`oc-spanel__rowhead`,children:[(0,F.jsx)(`span`,{className:`oc-spanel__label`,children:e}),r?(0,F.jsx)(Om,{size:13,className:`oc-spanel__spin`,"aria-label":Dq()}):t?c?(0,F.jsx)(`button`,{type:`button`,className:`oc-spanel__reset`,title:Eq(),"aria-label":Eq(),onClick:n,children:(0,F.jsx)(Pm,{size:12,"aria-hidden":!0})}):null:(0,F.jsx)(`span`,{className:`oc-spanel__badge`,children:o6e()})]}),(0,F.jsx)(`div`,{className:`oc-spanel__ctl`,children:s}),o?(0,F.jsx)(`p`,{className:`oc-spanel__help`,children:o}):null,i?(0,F.jsxs)(`p`,{className:`oc-spanel__error`,role:`alert`,children:[p6e(),(0,F.jsx)(`button`,{type:`button`,className:`oc-spanel__retry`,onClick:a,children:Oq()})]}):null]})}function R3({options:e,value:t,onChange:n,disabled:r}){return(0,F.jsx)(`div`,{className:`oc-spanel__seg`,role:`group`,children:e.map(e=>(0,F.jsx)(`button`,{type:`button`,className:`oc-spanel__seg-btn${t===e.id?` is-active`:``}`,"aria-pressed":t===e.id,title:e.title??e.label,"aria-label":e.title??e.label,disabled:r,onClick:()=>{e.id!==t&&n(e.id)},children:e.label},e.id))})}function Cgt({options:e,value:t,onChange:n,disabled:r,ariaLabel:i}){let a=t===null||e.some(e=>e.id===t);return(0,F.jsxs)(`select`,{className:`oc-spanel__select`,value:t??``,disabled:r,"aria-label":i,onChange:e=>{e.target.value&&e.target.value!==t&&n(e.target.value)},children:[t===null?(0,F.jsx)(`option`,{value:``,disabled:!0,hidden:!0}):null,a?null:(0,F.jsx)(`option`,{value:t,children:t}),e.map(e=>(0,F.jsx)(`option`,{value:e.id,children:e.label},e.id))]})}function z3({chatId:e,sm:t,settings:n}){let{apply:r,pending:i,error:a}=Sgt(e),{can:o}=I3(e),s=i!==null,c=(0,M.useCallback)(()=>{a&&r(a.field,a.value)},[r,a]),l=t.thinkingLevels??[],u=t.availableModels??[],d=ugt(n),f=xgt(o,{hasModels:u.length>0,hasLevels:l.length>0});return(0,F.jsxs)(F.Fragment,{children:[f.model?(0,F.jsx)(L3,{label:wB(),overridden:A3(n,`model`),onReset:()=>void r(`model`,null),pending:i===`model`,error:a?.field===`model`,onRetry:c,resettable:f.reset,children:u.length<=4?(0,F.jsx)(R3,{options:u,value:t.model??null,onChange:e=>void r(`model`,e),disabled:s}):(0,F.jsx)(Cgt,{options:u,value:t.model??null,onChange:e=>void r(`model`,e),disabled:s,ariaLabel:wB()})}):null,f.thinking?(0,F.jsx)(L3,{label:v6e(),overridden:A3(n,`thinkingLevel`),onReset:()=>void r(`thinkingLevel`,null),pending:i===`thinkingLevel`,error:a?.field===`thinkingLevel`,onRetry:c,resettable:f.reset,children:(0,F.jsx)(R3,{options:l.map(e=>({id:e.id,label:mgt(e.id,M3(e.label)),title:M3(e.label)})),value:t.thinkingLevel??null,onChange:e=>void r(`thinkingLevel`,e),disabled:s})}):null,f.speed?(0,F.jsx)(L3,{label:x6e(),overridden:A3(n,`fastMode`),onReset:()=>void r(`fastMode`,null),pending:i===`fastMode`,error:a?.field===`fastMode`,onRetry:c,resettable:f.reset,children:(0,F.jsx)(R3,{options:lgt.map(e=>({id:e,label:dgt(e)})),value:d,onChange:e=>void r(`fastMode`,fgt(e)),disabled:s})}):null]})}function B3({label:e,state:t,destructive:n,onClick:r,onRetry:i}){return(0,F.jsxs)(`div`,{className:`oc-spanel__action`,children:[(0,F.jsxs)(H,{variant:n?`destructive`:`outline`,size:`sm`,disabled:t===`pending`,onClick:r,children:[t===`pending`?(0,F.jsx)(Om,{className:`oc-spanel__spin`,"aria-hidden":!0}):null,e]}),t===`done`?(0,F.jsx)(`p`,{className:`oc-spanel__action-note`,role:`status`,children:Y8e()}):null,t===`error`?(0,F.jsxs)(`p`,{className:`oc-spanel__error`,role:`alert`,children:[Q8e(),(0,F.jsx)(`button`,{type:`button`,className:`oc-spanel__retry`,onClick:i,children:Oq()})]}):null]})}function wgt({chatId:e,open:t,onOpenChange:n}){let r=N(L.messages.getSessionMeta,t?{chatId:e}:`skip`),i=N(L.agents.getChatAgent,t?{chatId:e}:`skip`),a=r?.sessionMeta??null,o=r?.sessionSettings??null,{can:s}=I3(t?e:null),c=rY(),l=er(L.agentFiles.compactSession),u=P(L.chats.resetSession),[d,f]=(0,M.useState)(`idle`),[p,m]=(0,M.useState)(`idle`);async function h(){f(`pending`);try{await l({chatId:e}),f(`done`)}catch{f(`error`)}}async function g(){m(`pending`);try{await u({chatId:e}),m(`done`)}catch{m(`error`)}}async function _(){await c({title:O8e(),description:j8e(),confirmLabel:P8e(),cancelLabel:xV()})&&await h()}async function v(){await c({title:B8e(),description:U8e(),confirmLabel:K8e(),cancelLabel:xV(),destructive:!0})&&await g()}let y=N3(a?.totalTokens,a?.contextTokens),b=y==null?``:y>=90?`is-critical`:y>=75?`is-warn`:`is-ok`,x=hgt(a?.totalTokens,a?.contextTokens),S=_gt(a?.estimatedCostUsd,a?.totalTokens),C=i?.agent??null,w=vgt([C?C.displayName??C.agentId:null,a?.agentRuntime,a?.model]);return(0,F.jsx)(jY,{open:t,onOpenChange:n,children:(0,F.jsxs)(MY,{side:`right`,className:`oc-spanel`,children:[(0,F.jsxs)(NY,{children:[(0,F.jsx)(FY,{children:P6e()}),(0,F.jsx)(IY,{children:L6e()})]}),(0,F.jsx)(`div`,{className:`oc-spanel__body`,children:r===void 0?(0,F.jsx)(`p`,{className:`oc-spanel__loading`,children:dk()}):(0,F.jsxs)(F.Fragment,{children:[a?(0,F.jsxs)(`section`,{children:[(0,F.jsx)(`h3`,{className:`oc-spanel__cat`,children:B6e()}),(0,F.jsx)(z3,{chatId:e,sm:a,settings:o})]}):null,(0,F.jsxs)(`section`,{children:[(0,F.jsx)(`h3`,{className:`oc-spanel__cat`,children:U6e()}),x!==null&&y!==null?(0,F.jsxs)(`div`,{className:`oc-spanel__static`,children:[(0,F.jsx)(`span`,{className:`oc-spanel__label`,children:Q6e()}),(0,F.jsxs)(`span`,{className:`oc-meter oc-spanel__meter ${b}`,children:[(0,F.jsx)(`span`,{className:`oc-meter__track`,children:(0,F.jsx)(`span`,{className:`oc-meter__fill`,style:{width:`${Math.min(y,100)}%`}})}),(0,F.jsx)(`span`,{className:`oc-meter__label`,children:x})]})]}):null,(0,F.jsxs)(`div`,{className:`oc-spanel__static`,children:[(0,F.jsx)(`span`,{className:`oc-spanel__label`,children:i8e()}),(0,F.jsx)(`span`,{className:`oc-spanel__value`,children:ggt(a?.verboseLevel)}),(0,F.jsx)(`p`,{className:`oc-spanel__help`,children:u8e()})]}),S===null?null:(0,F.jsxs)(`div`,{className:`oc-spanel__static`,children:[(0,F.jsx)(`span`,{className:`oc-spanel__label`,children:p8e()}),(0,F.jsx)(`span`,{className:`oc-spanel__value`,children:S})]})]}),w===null?null:(0,F.jsxs)(`section`,{children:[(0,F.jsx)(`h3`,{className:`oc-spanel__cat`,children:K6e()}),(0,F.jsx)(`div`,{className:`oc-spanel__static`,children:(0,F.jsx)(`span`,{className:`oc-spanel__value`,children:w})})]})]})}),(0,F.jsxs)(PY,{className:`oc-spanel__actions`,children:[(0,F.jsx)(`h3`,{className:`oc-spanel__cat`,children:Y6e()}),s(`sessionCompact`)?(0,F.jsx)(B3,{label:T8e(),state:d,onClick:()=>void _(),onRetry:()=>void h()}):null,(0,F.jsx)(B3,{label:L8e(),state:p,destructive:!0,onClick:()=>void v(),onRetry:()=>void g()})]})]})})}var V3={showSource:!0,showReport:!0,copyAssistant:!0,copyUser:!0,showDelete:!0,showTools:!1,voiceInput:!1},H3=(0,M.createContext)(V3);function U3(){return(0,M.useContext)(H3)}var W3=(0,M.createContext)(null),G3=(0,M.createContext)(null);function K3({className:e}){let t=Fq();return(0,F.jsx)(`div`,{className:e,"aria-hidden":!0,children:t.logoUrl?t.logoMasked?(0,F.jsx)(`span`,{className:`oc-avatar__img oc-avatar__img--mask`,style:{"--oc-logo-url":`url("${t.logoUrl}")`}}):(0,F.jsx)(`img`,{className:`oc-avatar__img`,src:t.logoUrl,alt:``}):t.isDefault?(0,F.jsx)(QO,{className:`oc-avatar__mark`}):t.initials})}function q3({chatId:e,focusMessageId:t}){let{runtime:n,turnGate:r,queueSend:i}=Jtt({chatId:e}),a=N(L.me.getMe,{host:BO}),o=a?.ui?.effective??V3,s=o.showTools,c=UO(a?.resolvedThemeMode),l=a?.resolvedChartBrand,u=a?.resolvedChartTokens,d=N(L.agents.getChatAgent,e?{chatId:e}:`skip`),f=d?.multiAgent?d.agent:null,p=(0,M.useMemo)(()=>{let e=l?.label??`Atrium`,t=u?.colors?.[c],n=Sme(l,Cme(t?.primary,t?.[`primary-foreground`],c));return{label:e,logoUrl:n?.url??null,logoMasked:n?.masked??!1,isDefault:l?.isDefault??!0,initials:wme(e),agentName:f?.displayName??f?.agentId??null,agentEmoji:f?.emoji??null}},[l,c,u,f]),m=P(L.me.setUiPref).withOptimisticUpdate(cY),h=N(L.messages.getSessionMeta,e?{chatId:e}:`skip`),g=e!==null&&h===null,_=kY(),{width:v,startResize:y}=AY({storageKey:`oc.sources.width`,defaultWidth:380,min:300,max:680,edge:`right`}),[b,x]=(0,M.useState)(null);(0,M.useEffect)(()=>{x(null)},[e]);let S=(0,M.useMemo)(()=>({activeMessageId:b,openFor:e=>x(e),close:()=>x(null)}),[b]),C=b!==null;return(0,F.jsx)(toe,{runtime:n,children:(0,F.jsx)(W3.Provider,{value:r,children:(0,F.jsx)(G3.Provider,{value:i,children:(0,F.jsx)(H3.Provider,{value:o,children:(0,F.jsx)(Pq.Provider,{value:p,children:(0,F.jsxs)(SY.Provider,{value:S,children:[(0,F.jsxs)(`div`,{className:`oc-chat`,children:[(0,F.jsx)(`div`,{className:`oc-chat__convo`,children:e?g?(0,F.jsx)(Tgt,{}):(0,F.jsx)(Dgt,{chatId:e,showTools:s,onToggleTools:()=>void m({key:`showTools`,value:!s}),focusMessageId:t??null}):(0,F.jsx)(`div`,{className:`oc-empty`,children:Nz()})}),C&&!_?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`div`,{className:`oc-sources-resizer`,onPointerDown:y,role:`separator`,"aria-orientation":`vertical`,"aria-label":IU()}),(0,F.jsx)(`aside`,{className:`oc-sources-col`,style:{width:v,flex:`0 0 ${v}px`},children:(0,F.jsx)(CY,{messageId:b,onClose:S.close})})]}):null]}),C&&_?(0,F.jsx)(jY,{open:!0,onOpenChange:e=>{e||S.close()},children:(0,F.jsx)(MY,{side:`right`,className:`oc-sources-panel-sheet`,children:(0,F.jsx)(CY,{messageId:b,onClose:S.close})})}):null]})})})})})})}function Tgt(){let e=cs();return(0,F.jsxs)(`div`,{className:`oc-notfound`,role:`status`,children:[(0,F.jsx)(`div`,{className:`oc-notfound__icon`,"aria-hidden":!0,children:(0,F.jsx)(Fm,{size:28})}),(0,F.jsx)(`h2`,{className:`oc-notfound__title`,children:Iz()}),(0,F.jsx)(`p`,{className:`oc-notfound__body`,children:zz()}),(0,F.jsxs)(`button`,{type:`button`,className:`oc-notfound__cta`,onClick:()=>void e({to:`/`}),children:[(0,F.jsx)(Nm,{size:16,"aria-hidden":!0}),Hz()]})]})}function Egt(e,t){(0,M.useEffect)(()=>{if(!t)return;let e=!1,n=0,r=0,i=()=>{if(e)return;let a=document.querySelector(`[data-message-id="${CSS.escape(t)}"]`);if(a){a.scrollIntoView({block:`center`,behavior:`smooth`}),a.classList.remove(`oc-msg--highlight`),a.offsetWidth,a.classList.add(`oc-msg--highlight`),window.setTimeout(()=>a.classList.remove(`oc-msg--highlight`),2400);return}n++<40&&(r=window.setTimeout(i,150))};return r=window.setTimeout(i,0),()=>{e=!0,window.clearTimeout(r)}},[e,t])}function Dgt({chatId:e,showTools:t,onToggleTools:n,focusMessageId:r}){let i=N(L.bridgeHealth.getBridgeAvailability,{chatId:e}),a=i&&!i.available?i:null,o=N(L.agents.getChatAgent,{chatId:e})?.readOnly===!0;return Egt(e,r),(0,F.jsxs)(zO.Root,{className:`oc-thread`,children:[(0,F.jsx)(Mgt,{chatId:e}),(0,F.jsx)(Agt,{chatId:e}),(0,F.jsxs)(zO.Viewport,{className:`oc-thread__viewport`,children:[(0,F.jsx)(zO.Empty,{children:(0,F.jsx)(jgt,{})}),(0,F.jsx)(zO.Messages,{components:{UserMessage:zgt,AssistantMessage:Bgt,SystemMessage:Vgt}})]}),(0,F.jsx)(zO.If,{empty:!1,children:(0,F.jsxs)(zO.ScrollToBottom,{className:`oc-scrolldown`,children:[(0,F.jsx)(Lgt,{}),(0,F.jsx)(`span`,{children:Gz()})]})}),o?(0,F.jsx)(kgt,{}):a?(0,F.jsx)(Ogt,{}):null,(0,F.jsx)(Ggt,{showTools:t,onToggleTools:n,unavailable:a!==null||o})]})}function Ogt(){return(0,F.jsxs)(`div`,{className:`oc-chat-banner oc-chat-banner--error`,role:`status`,children:[(0,F.jsx)(bm,{size:16,"aria-hidden":!0}),(0,F.jsx)(`span`,{children:Jz()})]})}function kgt(){return(0,F.jsxs)(`div`,{className:`oc-chat-banner oc-chat-banner--error`,role:`status`,children:[(0,F.jsx)(km,{size:16,"aria-hidden":!0}),(0,F.jsx)(`span`,{children:Zz()})]})}function Agt({chatId:e}){let t=N(L.messages.listByChat,{chatId:e}),[n,r]=(0,M.useState)(``),i=(0,M.useRef)(null);return(0,M.useEffect)(()=>{i.current=null,r(``)},[e]),(0,M.useEffect)(()=>{if(!t)return;let e;for(let n of t)n.role===`assistant`&&(e=n);if(!(!e||e.status!==`complete`)){if(i.current===null){i.current=e._id;return}i.current!==e._id&&(i.current=e._id,r(e=>e===eB()?`${eB()} `:eB()))}},[t]),(0,F.jsx)(`div`,{"aria-live":`polite`,"aria-atomic":`true`,className:`oc-sr-only`,children:n})}function jgt(){return(0,F.jsxs)(`div`,{className:`oc-emptystate`,children:[(0,F.jsx)(K3,{className:`oc-emptystate__avatar`}),(0,F.jsx)(`h2`,{className:`oc-emptystate__title`,children:rB()})]})}function J3({sm:e,detail:t=!0}){let n=e.totalTokens!=null&&e.contextTokens&&e.contextTokens>0?Math.round(e.totalTokens/e.contextTokens*100):null;return n==null?null:(0,F.jsxs)(`span`,{className:`oc-meter ${n>=90?`is-critical`:n>=75?`is-warn`:`is-ok`}`,title:HB({pct:n,used:j3(e.totalTokens),total:j3(e.contextTokens)}),children:[(0,F.jsx)(`span`,{className:`oc-meter__track`,children:(0,F.jsx)(`span`,{className:`oc-meter__fill`,style:{width:`${Math.min(n,100)}%`}})}),(0,F.jsxs)(`span`,{className:`oc-meter__label`,children:[n,`%`,t?(0,F.jsxs)(`span`,{className:`oc-meter__detail`,children:[` · `,j3(e.totalTokens),`/`,j3(e.contextTokens)]}):null]})]})}function Mgt({chatId:e}){let t=N(L.messages.getSessionMeta,{chatId:e}),n=N(L.agents.getChatAgent,{chatId:e}),r=t?.sessionMeta??null,i=t?.sessionSettings??null,a=n?.multiAgent?n.agent:null,o=U3(),[s,c]=(0,M.useState)(!1),l=(0,M.useRef)(null),u=(0,M.useRef)(null),d=(0,M.useRef)(null),[f,p]=(0,M.useState)(!1),m=!A3(i,`thinkingLevel`),h=(s,l)=>(0,F.jsxs)(F.Fragment,{children:[a?(0,F.jsxs)(`span`,{className:`oc-chip oc-chip--agent${a.state===`ok`?``:` is-warn`}`,title:lB({name:a.displayName??a.agentId})+(a.inheritedDefault?fB():``)+(a.state===`deleted`?hB():a.state===`stale`?vB():``),children:[a.emoji?(0,F.jsx)(`span`,{className:`oc-chip__emoji`,"aria-hidden":!0,children:a.emoji}):(0,F.jsx)(mm,{size:13,"aria-hidden":!0}),(0,F.jsx)(`span`,{className:`oc-chip__label`,children:a.displayName??a.agentId}),o.showTools&&n?.multiInstance?(0,F.jsxs)(`span`,{className:`oc-chip__instance`,title:xB({instance:a.instanceName}),children:[(0,F.jsx)(Im,{size:11,"aria-hidden":!0}),a.instanceName]}):null]}):null,o.showTools&&!s&&r?.model?(0,F.jsxs)(`span`,{className:`oc-chip oc-chip--info`,title:r.modelProvider?DB({provider:r.modelProvider}):wB(),children:[(0,F.jsx)(Fgt,{}),(0,F.jsx)(`span`,{className:`oc-chip__label`,children:r.model})]}):null,o.showTools&&!s&&r?.thinkingLevel?(0,F.jsxs)(`span`,{className:`oc-chip oc-chip--info`,title:m?AB():NB(),children:[(0,F.jsx)(Igt,{}),(0,F.jsxs)(`span`,{className:`oc-chip__label`,children:[IB(),`\xA0: `,M3(r.thinkingLevel)]}),m?(0,F.jsx)(`span`,{className:`oc-chip__hint`,children:zB()}):null]}):null,o.showTools&&r?(0,F.jsx)(J3,{sm:r,detail:!s}):null,(0,F.jsx)(Ngt,{chatId:e,title:t?.title??null,compact:s,ghost:l}),r?(0,F.jsx)(Pgt,{chatId:e,sm:r,settings:i,onOpenPanel:()=>c(!0),compact:s,ghost:l}):null]});return(0,M.useLayoutEffect)(()=>{let e=l.current;if(!e)return;let t=()=>{let t=d.current?.offsetWidth??0;if(t===0)return;let n=Math.min(u.current?.scrollWidth??0,360),r=e.clientWidth-n-16<t;p(e=>e===r?e:r)};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[[ZB(),lV(),r?.model??``,r?.thinkingLevel??``,a?.displayName??a?.agentId??``,n?.multiInstance?a?.instanceName??``:``,t?.title??``,o.showTools?`1`:`0`].join(`|`)]),(0,F.jsxs)(`header`,{className:`oc-chathead`,ref:l,children:[(0,F.jsx)(`div`,{className:`oc-chathead__title`,title:t?.title??void 0,ref:u,children:t?.title||oB()}),(0,F.jsx)(`div`,{className:`oc-chathead__meta`,children:h(f,!1)}),(0,F.jsx)(`div`,{className:`oc-chathead-ghost`,"aria-hidden":!0,ref:d,children:h(!1,!0)}),(0,F.jsx)(wgt,{chatId:e,open:s,onOpenChange:c})]})}function Y3(e,t,n){let r=new Blob([e],{type:`${n};charset=utf-8`}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=t,document.body.appendChild(a),a.click(),a.remove(),URL.revokeObjectURL(i)}function Ngt({chatId:e,title:t,compact:n=!1,ghost:r=!1}){let i=Qn();async function a(n){let[r,a]=await Promise.all([i.query(L.messages.listByChat,{chatId:e}),i.query(L.messages.getStreamingText,{chatId:e})]),o=new Map(a.map(e=>[e.messageId,e.text])),s=r.map(e=>({role:e.role,text:e.status===`streaming`?o.get(e._id)??e.text:e.text,createdAt:e.updatedAt??e._creationTime,parts:e.parts.map(e=>({kind:e.kind,filename:`filename`in e?e.filename:void 0,name:`name`in e?e.name:void 0}))})),c=r.length>=200,l={title:t??void 0,truncated:c,exportedAt:Date.now()},u=jet(t);n===`md`?Y3(ket(s,l),`${u}.md`,`text/markdown`):Y3(Aet(s,l),`${u}.json`,`application/json`)}let o=(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(Cm,{size:13,"aria-hidden":!0}),n?null:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`span`,{className:`oc-chip__label`,children:ZB()}),(0,F.jsx)(gm,{size:13,className:`oc-chip__chev`,"aria-hidden":!0})]})]});return r?(0,F.jsx)(`span`,{className:`oc-chip oc-chip--btn`,children:o}):(0,F.jsxs)(EJ,{children:[(0,F.jsx)(DJ,{asChild:!0,children:(0,F.jsx)(`button`,{type:`button`,className:`oc-chip oc-chip--btn`,title:JB(),children:o})}),(0,F.jsxs)(OJ,{align:`end`,className:`w-44`,children:[(0,F.jsx)(AJ,{children:ZB()}),(0,F.jsx)(kJ,{onClick:()=>void a(`md`),children:eV()}),(0,F.jsx)(kJ,{onClick:()=>void a(`json`),children:rV()})]})]})}function Pgt({chatId:e,sm:t,settings:n,onOpenPanel:r,compact:i=!1,ghost:a=!1}){let[o,s]=(0,M.useState)(!1),c=(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(Rm,{size:13,"aria-hidden":!0}),i?null:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`span`,{className:`oc-chip__label`,children:lV()}),(0,F.jsx)(gm,{size:13,className:`oc-chip__chev`,"aria-hidden":!0})]})]});return a?(0,F.jsx)(`span`,{className:`oc-chip oc-chip--btn`,children:c}):(0,F.jsxs)(NJ,{open:o,onOpenChange:s,children:[(0,F.jsx)(PJ,{asChild:!0,children:(0,F.jsx)(`button`,{type:`button`,className:`oc-chip oc-chip--btn`,title:oV(),children:c})}),(0,F.jsxs)(FJ,{align:`end`,className:`oc-spanel-pop w-80 p-2`,children:[t.totalTokens!=null&&t.contextTokens?(0,F.jsxs)(`div`,{className:`oc-spanel-pop__usage`,children:[(0,F.jsx)(`span`,{className:`oc-spanel-pop__usage-label`,children:GB()}),(0,F.jsx)(J3,{sm:t})]}):null,(0,F.jsx)(z3,{chatId:e,sm:t,settings:n}),(0,F.jsxs)(`button`,{type:`button`,className:`oc-spanel-pop__all`,onClick:()=>{s(!1),r()},children:[(0,F.jsx)(Rm,{size:13,"aria-hidden":!0}),j6e(),(0,F.jsx)(_m,{size:13,"aria-hidden":!0})]})]})]})}function Fgt(){return(0,F.jsxs)(`svg`,{className:`oc-chip__icon`,viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,children:[(0,F.jsx)(`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`}),(0,F.jsx)(`rect`,{x:`9`,y:`9`,width:`6`,height:`6`}),(0,F.jsx)(`path`,{d:`M9 1v3M15 1v3M9 20v3M15 20v3M20 9h3M20 14h3M1 9h3M1 14h3`})]})}function Igt(){return(0,F.jsxs)(`svg`,{className:`oc-chip__icon`,viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,children:[(0,F.jsx)(`path`,{d:`M12 5a3 3 0 1 0-5.997.142 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z`}),(0,F.jsx)(`path`,{d:`M12 5a3 3 0 1 1 5.997.142 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z`})]})}function X3({children:e}){return(0,F.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`16`,height:`16`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,children:e})}function Lgt(){return(0,F.jsx)(X3,{children:(0,F.jsx)(`path`,{d:`M12 5v14M19 12l-7 7-7-7`})})}function Z3(){return(0,F.jsxs)(X3,{children:[(0,F.jsx)(`rect`,{x:`9`,y:`9`,width:`13`,height:`13`,rx:`2`}),(0,F.jsx)(`path`,{d:`M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1`})]})}function Q3(){return(0,F.jsx)(X3,{children:(0,F.jsx)(`path`,{d:`M20 6 9 17l-5-5`})})}var $3={File:Ont},Rgt={...$3,Text:egt};function e6({kind:e}){let t=Ny(e=>e.metadata?.custom?.messageId),n=P(L.messages.deleteMessage).withOptimisticUpdate(Ytt),r=rY(),i=sY(),a=(0,M.useContext)(W3),[o,s]=(0,M.useState)(!1);if(!t)return null;async function c(){if(await r(e===`assistant`?{title:fV(),description:hV(),confirmLabel:vV(),cancelLabel:xV(),destructive:!0}:{title:wV(),description:DV(),confirmLabel:AV(),cancelLabel:xV(),destructive:!0})){s(!0),e===`assistant`&&a?.begin();try{await n({messageId:t})}catch(t){e===`assistant`&&a?.cancel(),i.error(HV(),t)}finally{s(!1)}}}return(0,F.jsx)(`button`,{type:`button`,className:`oc-iconbtn oc-iconbtn--danger`,title:e===`assistant`?NV():IV(),"aria-label":zV(),"aria-busy":o,disabled:o,onClick:()=>void c(),children:o?(0,F.jsx)(Om,{size:15,className:`oc-iconbtn__spin`,"aria-hidden":!0}):(0,F.jsx)(Bm,{size:15,"aria-hidden":!0})})}function t6(){let e=Ny(e=>e.metadata?.custom?.rawText??``),[t,n]=(0,M.useState)(!1),r=[...e].length;return(0,F.jsxs)(`div`,{className:`oc-msg__source`,children:[(0,F.jsxs)(`div`,{className:`oc-msg__source-head`,children:[(0,F.jsx)(`span`,{className:`oc-msg__source-label`,children:r>1?HU({count:r}):zU({count:r})}),(0,F.jsx)(`button`,{type:`button`,className:`oc-iconbtn`,title:GU(),"aria-label":GU(),onClick:()=>{navigator.clipboard?.writeText(e).then(()=>{n(!0),window.setTimeout(()=>n(!1),1200)})},children:t?(0,F.jsx)(Q3,{}):(0,F.jsx)(Z3,{})})]}),(0,F.jsx)(`pre`,{className:`oc-msg__source-pre`,children:e.length>0?e:JU()})]})}function n6({active:e,onToggle:t}){return(0,F.jsx)(`button`,{type:`button`,className:`oc-iconbtn${e?` is-on`:``}`,onClick:t,"aria-pressed":e,title:e?ZU():eW(),"aria-label":rW(),children:(0,F.jsx)(wee,{size:15,"aria-hidden":!0})})}function zgt(){let[e,t]=(0,M.useState)(!1),n=U3(),r=Ny(e=>e.id.startsWith(`optimistic-`)),i=Ny(e=>e.id);return(0,F.jsx)(OO.Root,{className:`oc-msg oc-msg--user${r?` is-sending`:``}`,"data-message-id":i,children:(0,F.jsxs)(`div`,{className:`oc-msg__col oc-msg__col--user`,children:[(0,F.jsx)(`div`,{className:`oc-msg__bubble`,children:e?(0,F.jsx)(t6,{}):(0,F.jsx)(OO.Parts,{components:$3})}),r?(0,F.jsxs)(`span`,{className:`oc-msg__sending`,role:`status`,children:[(0,F.jsx)(`span`,{className:`oc-msg__sending-spin`,"aria-hidden":!0}),lW()]}):(0,F.jsxs)(rb.Root,{className:`oc-msg__actions oc-msg__actions--user`,hideWhenRunning:!0,autohide:`not-last`,children:[n.copyUser?(0,F.jsxs)(rb.Copy,{className:`oc-iconbtn`,title:oW(),children:[(0,F.jsx)(OO.If,{copied:!0,children:(0,F.jsx)(Q3,{})}),(0,F.jsx)(OO.If,{copied:!1,children:(0,F.jsx)(Z3,{})})]}):null,n.showSource?(0,F.jsx)(n6,{active:e,onToggle:()=>t(e=>!e)}):null,n.showReport?(0,F.jsx)(k3,{}):null,n.showDelete?(0,F.jsx)(e6,{kind:`user`}):null]})]})})}function Bgt(){let[e,t]=(0,M.useState)(!1),n=U3(),r=Fq(),i=Ny(e=>e.id);return(0,F.jsxs)(OO.Root,{className:`oc-msg oc-msg--assistant`,"data-message-id":i,children:[(0,F.jsx)(K3,{className:`oc-msg__avatar`}),(0,F.jsxs)(`div`,{className:`oc-msg__col`,children:[(0,F.jsxs)(`div`,{className:`oc-msg__name`,children:[r.agentEmoji?(0,F.jsx)(`span`,{className:`oc-msg__name-emoji`,"aria-hidden":!0,children:r.agentEmoji}):null,Tet(r)]}),(0,F.jsxs)(`div`,{className:`oc-msg__body`,children:[n.showTools?(0,F.jsxs)(`div`,{className:`oc-msg__meta`,children:[(0,F.jsx)(gnt,{}),(0,F.jsx)(bnt,{})]}):null,e?(0,F.jsx)(t6,{}):(0,F.jsx)(OO.Parts,{components:Rgt}),(0,F.jsx)(nnt,{})]}),(0,F.jsxs)(rb.Root,{className:`oc-msg__actions`,hideWhenRunning:!0,autohide:`not-last`,children:[n.copyAssistant?(0,F.jsxs)(rb.Copy,{className:`oc-iconbtn`,title:vW(),children:[(0,F.jsx)(OO.If,{copied:!0,children:(0,F.jsx)(Q3,{})}),(0,F.jsx)(OO.If,{copied:!1,children:(0,F.jsx)(Z3,{})})]}):null,n.showSource?(0,F.jsx)(n6,{active:e,onToggle:()=>t(e=>!e)}):null,n.showReport?(0,F.jsx)(k3,{}):null,n.showDelete?(0,F.jsx)(e6,{kind:`assistant`}):null]})]})]})}function Vgt(){let e=Ny(e=>e.id);return(0,F.jsx)(OO.Root,{className:`oc-msg oc-msg--system`,"data-message-id":e,children:(0,F.jsx)(`div`,{className:`oc-msg__body`,children:(0,F.jsx)(OO.Parts,{components:$3})})})}function Hgt(){let e=jy(e=>e.status?.type),t=jy(e=>e.type),n=e===`incomplete`;return(0,F.jsxs)(_D.Root,{className:`oc-attach${n?` oc-attach--error`:``}`,"data-status":e,children:[(0,F.jsx)(`span`,{className:`oc-attach__icon`,"aria-hidden":!0,children:n?(0,F.jsx)(bm,{size:14}):t===`image`?(0,F.jsx)(kee,{size:14}):(0,F.jsx)(Lee,{size:14})}),(0,F.jsx)(`span`,{className:`oc-attach__name`,children:(0,F.jsx)(_D.Name,{})}),n?(0,F.jsx)(`span`,{className:`oc-attach__state`,children:AW()}):null,(0,F.jsx)(_D.Remove,{className:`oc-attach__remove`,"aria-label":zW(),children:(0,F.jsx)(Gm,{size:13,"aria-hidden":!0})})]})}function Ugt(){let e=(0,M.useSyncExternalStore)(YO.subscribe,YO.getSnapshot);return e.active?(0,F.jsxs)(`div`,{className:`oc-upload`,role:`status`,"aria-live":`polite`,children:[(0,F.jsxs)(`div`,{className:`oc-upload__head`,children:[(0,F.jsx)(Om,{className:`oc-upload__spin`,size:14,"aria-hidden":!0}),(0,F.jsx)(`span`,{children:e.count>1?IW({count:e.count,percent:e.percent}):NW({percent:e.percent})})]}),(0,F.jsx)(`div`,{className:`oc-upload__track`,"aria-hidden":!0,children:(0,F.jsx)(`div`,{className:`oc-upload__bar`,style:{width:`${e.percent}%`}})})]}):null}function Wgt(){let e=(0,M.useContext)(G3),t=My(),n=ooe(e=>e.text).trim().length>0;return(0,F.jsx)(`button`,{type:`button`,className:`oc-composer__send`,disabled:!n||e===null,"aria-label":GG(),title:n?JG():HG(),onClick:()=>{if(e===null)return;let n=t.getState().text;n.trim()!==``&&e(n).then(e=>{e&&t.setText(``)})},children:(0,F.jsx)(fm,{size:18,"aria-hidden":!0})})}function Ggt({showTools:e,onToggleTools:t,unavailable:n=!1}){let r=U3().voiceInput,i=loe(e=>e.isRunning),a=(0,M.useContext)(G3),o=My();return(0,F.jsxs)(cO.Root,{className:`oc-composer${n?` oc-composer--disabled`:``}`,children:[(0,F.jsx)(cO.Attachments,{components:{Attachment:Hgt}}),(0,F.jsx)(Ugt,{}),(0,F.jsx)(cO.Input,{className:`oc-composer__input`,placeholder:n?xW():wW(),autoFocus:!0,rows:1,disabled:n,onKeyDownCapture:e=>{if(!i||a===null||e.key!==`Enter`||e.shiftKey||e.nativeEvent.isComposing)return;e.preventDefault(),e.stopPropagation();let t=o.getState().text;t.trim()!==``&&a(t).then(e=>{e&&o.setText(``)})},autoCorrect:`off`,autoCapitalize:`off`,autoComplete:`off`,"data-gramm":`false`,"data-gramm_editor":`false`,"data-enable-grammarly":`false`}),(0,F.jsxs)(`div`,{className:`oc-composer__bar`,children:[(0,F.jsxs)(`div`,{className:`oc-composer__group`,children:[(0,F.jsx)(cO.AddAttachment,{className:`oc-composer__icon`,"aria-label":DW(),disabled:i||n,title:i?HG():void 0,children:(0,F.jsx)(Nm,{size:18,"aria-hidden":!0})}),(0,F.jsxs)(`button`,{type:`button`,className:`oc-composer__tools${e?` is-on`:``}`,onClick:t,"aria-pressed":e,title:e?HW():GW(),children:[(0,F.jsx)(Rm,{size:15,"aria-hidden":!0}),JW()]})]}),(0,F.jsxs)(`div`,{className:`oc-composer__group`,children:[r?(0,F.jsx)(`button`,{type:`button`,className:`oc-composer__icon`,title:AG(),"aria-label":NG(),children:(0,F.jsx)(Aee,{size:18,"aria-hidden":!0})}):null,n?(0,F.jsx)(`button`,{type:`button`,className:`oc-composer__send`,disabled:!0,"aria-label":IG(),children:(0,F.jsx)(fm,{size:18,"aria-hidden":!0})}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(zO.If,{running:!1,children:(0,F.jsx)(cO.Send,{className:`oc-composer__send`,"aria-label":zG(),children:(0,F.jsx)(fm,{size:18,"aria-hidden":!0})})}),(0,F.jsx)(zO.If,{running:!0,children:(0,F.jsx)(Wgt,{})})]})]})]})]})}function Kgt(){var e=[...arguments];return(0,M.useMemo)(()=>t=>{e.forEach(e=>e(t))},e)}var r6=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function i6(e){let t=Object.prototype.toString.call(e);return t===`[object Window]`||t===`[object global]`}function a6(e){return`nodeType`in e}function o6(e){return e?i6(e)?e:a6(e)?e.ownerDocument?.defaultView??window:window:window}function s6(e){let{Document:t}=o6(e);return e instanceof t}function c6(e){return i6(e)?!1:e instanceof o6(e).HTMLElement}function l6(e){return e instanceof o6(e).SVGElement}function u6(e){return e?i6(e)?e.document:a6(e)?s6(e)?e:c6(e)||l6(e)?e.ownerDocument:document:document:document}var d6=r6?M.useLayoutEffect:M.useEffect;function f6(e){let t=(0,M.useRef)(e);return d6(()=>{t.current=e}),(0,M.useCallback)(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}function qgt(){let e=(0,M.useRef)(null);return[(0,M.useCallback)((t,n)=>{e.current=setInterval(t,n)},[]),(0,M.useCallback)(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[])]}function p6(e,t){t===void 0&&(t=[e]);let n=(0,M.useRef)(e);return d6(()=>{n.current!==e&&(n.current=e)},t),n}function m6(e,t){let n=(0,M.useRef)();return(0,M.useMemo)(()=>{let t=e(n.current);return n.current=t,t},[...t])}function h6(e){let t=f6(e),n=(0,M.useRef)(null);return[n,(0,M.useCallback)(e=>{e!==n.current&&t?.(e,n.current),n.current=e},[])]}function g6(e){let t=(0,M.useRef)();return(0,M.useEffect)(()=>{t.current=e},[e]),t.current}var _6={};function v6(e,t){return(0,M.useMemo)(()=>{if(t)return t;let n=_6[e]==null?0:_6[e]+1;return _6[e]=n,e+`-`+n},[e,t])}function y6(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>{let r=Object.entries(n);for(let[n,i]of r){let r=t[n];r!=null&&(t[n]=r+e*i)}return t},{...t})}}var b6=y6(1),x6=y6(-1);function Jgt(e){return`clientX`in e&&`clientY`in e}function S6(e){if(!e)return!1;let{KeyboardEvent:t}=o6(e.target);return t&&e instanceof t}function Ygt(e){if(!e)return!1;let{TouchEvent:t}=o6(e.target);return t&&e instanceof t}function C6(e){if(Ygt(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return Jgt(e)?{x:e.clientX,y:e.clientY}:null}var w6=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:n}=e;return`translate3d(`+(t?Math.round(t):0)+`px, `+(n?Math.round(n):0)+`px, 0)`}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:n}=e;return`scaleX(`+t+`) scaleY(`+n+`)`}},Transform:{toString(e){if(e)return[w6.Translate.toString(e),w6.Scale.toString(e)].join(` `)}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+` `+n+`ms `+r}}}),T6=`a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]`;function Xgt(e){return e.matches(T6)?e:e.querySelector(T6)}var Zgt={display:`none`};function Qgt(e){let{id:t,value:n}=e;return M.createElement(`div`,{id:t,style:Zgt},n)}function $gt(e){let{id:t,announcement:n,ariaLiveType:r=`assertive`}=e;return M.createElement(`div`,{id:t,style:{position:`fixed`,top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0 0 0 0)`,clipPath:`inset(100%)`,whiteSpace:`nowrap`},role:`status`,"aria-live":r,"aria-atomic":!0},n)}function e_t(){let[e,t]=(0,M.useState)(``);return{announce:(0,M.useCallback)(e=>{e!=null&&t(e)},[]),announcement:e}}var E6=(0,M.createContext)(null);function t_t(e){let t=(0,M.useContext)(E6);(0,M.useEffect)(()=>{if(!t)throw Error(`useDndMonitor must be used within a children of <DndContext>`);return t(e)},[e,t])}function n_t(){let[e]=(0,M.useState)(()=>new Set),t=(0,M.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]);return[(0,M.useCallback)(t=>{let{type:n,event:r}=t;e.forEach(e=>e[n]?.call(e,r))},[e]),t]}var r_t={draggable:`
|
|
263
|
+
To pick up a draggable item, press the space bar.
|
|
264
|
+
While dragging, use the arrow keys to move the item.
|
|
265
|
+
Press space again to drop the item in its new position, or press escape to cancel.
|
|
266
|
+
`},i_t={onDragStart(e){let{active:t}=e;return`Picked up draggable item `+t.id+`.`},onDragOver(e){let{active:t,over:n}=e;return n?`Draggable item `+t.id+` was moved over droppable area `+n.id+`.`:`Draggable item `+t.id+` is no longer over a droppable area.`},onDragEnd(e){let{active:t,over:n}=e;return n?`Draggable item `+t.id+` was dropped over droppable area `+n.id:`Draggable item `+t.id+` was dropped.`},onDragCancel(e){let{active:t}=e;return`Dragging was cancelled. Draggable item `+t.id+` was dropped.`}};function a_t(e){let{announcements:t=i_t,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=r_t}=e,{announce:a,announcement:o}=e_t(),s=v6(`DndLiveRegion`),[c,l]=(0,M.useState)(!1);if((0,M.useEffect)(()=>{l(!0)},[]),t_t((0,M.useMemo)(()=>({onDragStart(e){let{active:n}=e;a(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&a(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;a(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;a(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;a(t.onDragCancel({active:n,over:r}))}}),[a,t])),!c)return null;let u=M.createElement(M.Fragment,null,M.createElement(Qgt,{id:r,value:i.draggable}),M.createElement($gt,{id:s,announcement:o}));return n?(0,us.createPortal)(u,n):u}var D6;(function(e){e.DragStart=`dragStart`,e.DragMove=`dragMove`,e.DragEnd=`dragEnd`,e.DragCancel=`dragCancel`,e.DragOver=`dragOver`,e.RegisterDroppable=`registerDroppable`,e.SetDroppableDisabled=`setDroppableDisabled`,e.UnregisterDroppable=`unregisterDroppable`})(D6||={});function O6(){}function k6(e,t){return(0,M.useMemo)(()=>({sensor:e,options:t??{}}),[e,t])}function A6(){var e=[...arguments];return(0,M.useMemo)(()=>[...e].filter(e=>e!=null),[...e])}var j6=Object.freeze({x:0,y:0});function M6(e,t){return Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2)}function o_t(e,t){let n=C6(e);if(!n)return`0 0`;let r={x:(n.x-t.left)/t.width*100,y:(n.y-t.top)/t.height*100};return r.x+`% `+r.y+`%`}function N6(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function s_t(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function P6(e){let{left:t,top:n,height:r,width:i}=e;return[{x:t,y:n},{x:t+i,y:n},{x:t,y:n+r},{x:t+i,y:n+r}]}function F6(e,t){if(!e||e.length===0)return null;let[n]=e;return t?n[t]:n}function I6(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}var c_t=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=I6(t,t.left,t.top),a=[];for(let e of r){let{id:t}=e,r=n.get(t);if(r){let n=M6(I6(r),i);a.push({id:t,data:{droppableContainer:e,value:n}})}}return a.sort(N6)},L6=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=P6(t),a=[];for(let e of r){let{id:t}=e,r=n.get(t);if(r){let n=P6(r),o=i.reduce((e,t,r)=>e+M6(n[r],t),0),s=Number((o/4).toFixed(4));a.push({id:t,data:{droppableContainer:e,value:s}})}}return a.sort(N6)};function l_t(e,t){let n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),o=i-r,s=a-n;if(r<i&&n<a){let n=t.width*t.height,r=e.width*e.height,i=o*s,a=i/(n+r-i);return Number(a.toFixed(4))}return 0}var u_t=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=[];for(let e of r){let{id:r}=e,a=n.get(r);if(a){let n=l_t(a,t);n>0&&i.push({id:r,data:{droppableContainer:e,value:n}})}}return i.sort(s_t)};function d_t(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function R6(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:j6}function f_t(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x}),{...t})}}var p_t=f_t(1);function z6(e){if(e.startsWith(`matrix3d(`)){let t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith(`matrix(`)){let t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function m_t(e,t,n){let r=z6(t);if(!r)return e;let{scaleX:i,scaleY:a,x:o,y:s}=r,c=e.left-o-(1-i)*parseFloat(n),l=e.top-s-(1-a)*parseFloat(n.slice(n.indexOf(` `)+1)),u=i?e.width/i:e.width,d=a?e.height/a:e.height;return{width:u,height:d,top:l,right:c+u,bottom:l+d,left:c}}var h_t={ignoreTransform:!1};function B6(e,t){t===void 0&&(t=h_t);let n=e.getBoundingClientRect();if(t.ignoreTransform){let{transform:t,transformOrigin:r}=o6(e).getComputedStyle(e);t&&(n=m_t(n,t,r))}let{top:r,left:i,width:a,height:o,bottom:s,right:c}=n;return{top:r,left:i,width:a,height:o,bottom:s,right:c}}function V6(e){return B6(e,{ignoreTransform:!0})}function g_t(e){let t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function __t(e,t){return t===void 0&&(t=o6(e).getComputedStyle(e)),t.position===`fixed`}function v_t(e,t){t===void 0&&(t=o6(e).getComputedStyle(e));let n=/(auto|scroll|overlay)/;return[`overflow`,`overflowX`,`overflowY`].some(e=>{let r=t[e];return typeof r==`string`?n.test(r):!1})}function H6(e,t){let n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(s6(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!c6(i)||l6(i)||n.includes(i))return n;let a=o6(e).getComputedStyle(i);return i!==e&&v_t(i,a)&&n.push(i),__t(i,a)?n:r(i.parentNode)}return e?r(e):n}function U6(e){let[t]=H6(e,1);return t??null}function W6(e){return!r6||!e?null:i6(e)?e:a6(e)?s6(e)||e===u6(e).scrollingElement?window:c6(e)?e:null:null}function G6(e){return i6(e)?e.scrollX:e.scrollLeft}function K6(e){return i6(e)?e.scrollY:e.scrollTop}function q6(e){return{x:G6(e),y:K6(e)}}var J6;(function(e){e[e.Forward=1]=`Forward`,e[e.Backward=-1]=`Backward`})(J6||={});function Y6(e){return!r6||!e?!1:e===document.scrollingElement}function X6(e){let t={x:0,y:0},n=Y6(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}var y_t={x:.2,y:.2};function b_t(e,t,n,r,i){let{top:a,left:o,right:s,bottom:c}=n;r===void 0&&(r=10),i===void 0&&(i=y_t);let{isTop:l,isBottom:u,isLeft:d,isRight:f}=X6(e),p={x:0,y:0},m={x:0,y:0},h={height:t.height*i.y,width:t.width*i.x};return!l&&a<=t.top+h.height?(p.y=J6.Backward,m.y=r*Math.abs((t.top+h.height-a)/h.height)):!u&&c>=t.bottom-h.height&&(p.y=J6.Forward,m.y=r*Math.abs((t.bottom-h.height-c)/h.height)),!f&&s>=t.right-h.width?(p.x=J6.Forward,m.x=r*Math.abs((t.right-h.width-s)/h.width)):!d&&o<=t.left+h.width&&(p.x=J6.Backward,m.x=r*Math.abs((t.left+h.width-o)/h.width)),{direction:p,speed:m}}function x_t(e){if(e===document.scrollingElement){let{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}let{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function Z6(e){return e.reduce((e,t)=>b6(e,q6(t)),j6)}function S_t(e){return e.reduce((e,t)=>e+G6(t),0)}function C_t(e){return e.reduce((e,t)=>e+K6(t),0)}function Q6(e,t){if(t===void 0&&(t=B6),!e)return;let{top:n,left:r,bottom:i,right:a}=t(e);U6(e)&&(i<=0||a<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:`center`,inline:`center`})}var w_t=[[`x`,[`left`,`right`],S_t],[`y`,[`top`,`bottom`],C_t]],$6=class{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;let n=H6(t),r=Z6(n);this.rect={...e},this.width=e.width,this.height=e.height;for(let[e,t,i]of w_t)for(let a of t)Object.defineProperty(this,a,{get:()=>{let t=i(n),o=r[e]-t;return this.rect[a]+o},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}},e8=class{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>this.target?.removeEventListener(...e))},this.target=e}add(e,t,n){var r;(r=this.target)==null||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}};function T_t(e){let{EventTarget:t}=o6(e);return e instanceof t?e:u6(e)}function t8(e,t){let n=Math.abs(e.x),r=Math.abs(e.y);return typeof t==`number`?Math.sqrt(n**2+r**2)>t:`x`in t&&`y`in t?n>t.x&&r>t.y:`x`in t?n>t.x:`y`in t?r>t.y:!1}var n8;(function(e){e.Click=`click`,e.DragStart=`dragstart`,e.Keydown=`keydown`,e.ContextMenu=`contextmenu`,e.Resize=`resize`,e.SelectionChange=`selectionchange`,e.VisibilityChange=`visibilitychange`})(n8||={});function r8(e){e.preventDefault()}function E_t(e){e.stopPropagation()}var i8;(function(e){e.Space=`Space`,e.Down=`ArrowDown`,e.Right=`ArrowRight`,e.Left=`ArrowLeft`,e.Up=`ArrowUp`,e.Esc=`Escape`,e.Enter=`Enter`,e.Tab=`Tab`})(i8||={});var a8={start:[i8.Space,i8.Enter],cancel:[i8.Esc],end:[i8.Space,i8.Enter,i8.Tab]},D_t=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case i8.Right:return{...n,x:n.x+25};case i8.Left:return{...n,x:n.x-25};case i8.Down:return{...n,y:n.y+25};case i8.Up:return{...n,y:n.y-25}}},o8=class{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;let{event:{target:t}}=e;this.props=e,this.listeners=new e8(u6(t)),this.windowListeners=new e8(o6(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(n8.Resize,this.handleCancel),this.windowListeners.add(n8.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(n8.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&Q6(n),t(j6)}handleKeyDown(e){if(S6(e)){let{active:t,context:n,options:r}=this.props,{keyboardCodes:i=a8,coordinateGetter:a=D_t,scrollBehavior:o=`smooth`}=r,{code:s}=e;if(i.end.includes(s)){this.handleEnd(e);return}if(i.cancel.includes(s)){this.handleCancel(e);return}let{collisionRect:c}=n.current,l=c?{x:c.left,y:c.top}:j6;this.referenceCoordinates||=l;let u=a(e,{active:t,context:n.current,currentCoordinates:l});if(u){let t=x6(u,l),r={x:0,y:0},{scrollableAncestors:i}=n.current;for(let n of i){let i=e.code,{isTop:a,isRight:s,isLeft:c,isBottom:l,maxScroll:d,minScroll:f}=X6(n),p=x_t(n),m={x:Math.min(i===i8.Right?p.right-p.width/2:p.right,Math.max(i===i8.Right?p.left:p.left+p.width/2,u.x)),y:Math.min(i===i8.Down?p.bottom-p.height/2:p.bottom,Math.max(i===i8.Down?p.top:p.top+p.height/2,u.y))},h=i===i8.Right&&!s||i===i8.Left&&!c,g=i===i8.Down&&!l||i===i8.Up&&!a;if(h&&m.x!==u.x){let e=n.scrollLeft+t.x,a=i===i8.Right&&e<=d.x||i===i8.Left&&e>=f.x;if(a&&!t.y){n.scrollTo({left:e,behavior:o});return}a?r.x=n.scrollLeft-e:r.x=i===i8.Right?n.scrollLeft-d.x:n.scrollLeft-f.x,r.x&&n.scrollBy({left:-r.x,behavior:o});break}else if(g&&m.y!==u.y){let e=n.scrollTop+t.y,a=i===i8.Down&&e<=d.y||i===i8.Up&&e>=f.y;if(a&&!t.x){n.scrollTo({top:e,behavior:o});return}a?r.y=n.scrollTop-e:r.y=i===i8.Down?n.scrollTop-d.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:o});break}}this.handleMove(e,b6(x6(u,this.referenceCoordinates),r))}}}handleMove(e,t){let{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){let{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){let{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}};o8.activators=[{eventName:`onKeyDown`,handler:(e,t,n)=>{let{keyboardCodes:r=a8,onActivation:i}=t,{active:a}=n,{code:o}=e.nativeEvent;if(r.start.includes(o)){let t=a.activatorNode.current;return t&&e.target!==t?!1:(e.preventDefault(),i?.({event:e.nativeEvent}),!0)}return!1}}];function s8(e){return!!(e&&`distance`in e)}function c8(e){return!!(e&&`delay`in e)}var l8=class{constructor(e,t,n){n===void 0&&(n=T_t(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;let{event:r}=e,{target:i}=r;this.props=e,this.events=t,this.document=u6(i),this.documentListeners=new e8(this.document),this.listeners=new e8(n),this.windowListeners=new e8(o6(i)),this.initialCoordinates=C6(r)??j6,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){let{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(n8.Resize,this.handleCancel),this.windowListeners.add(n8.DragStart,r8),this.windowListeners.add(n8.VisibilityChange,this.handleCancel),this.windowListeners.add(n8.ContextMenu,r8),this.documentListeners.add(n8.Keydown,this.handleKeydown),t){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(c8(t)){this.timeoutId=setTimeout(this.handleStart,t.delay),this.handlePending(t);return}if(s8(t)){this.handlePending(t);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){let{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){let{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(n8.Click,E_t,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(n8.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){let{activated:t,initialCoordinates:n,props:r}=this,{onMove:i,options:{activationConstraint:a}}=r;if(!n)return;let o=C6(e)??j6,s=x6(n,o);if(!t&&a){if(s8(a)){if(a.tolerance!=null&&t8(s,a.tolerance))return this.handleCancel();if(t8(s,a.distance))return this.handleStart()}if(c8(a)&&t8(s,a.tolerance))return this.handleCancel();this.handlePending(a,s);return}e.cancelable&&e.preventDefault(),i(o)}handleEnd(){let{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){let{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===i8.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}},O_t={cancel:{name:`pointercancel`},move:{name:`pointermove`},end:{name:`pointerup`}},u8=class extends l8{constructor(e){let{event:t}=e,n=u6(t.target);super(e,O_t,n)}};u8.activators=[{eventName:`onPointerDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];var k_t={move:{name:`mousemove`},end:{name:`mouseup`}},d8;(function(e){e[e.RightClick=2]=`RightClick`})(d8||={});var A_t=class extends l8{constructor(e){super(e,k_t,u6(e.event.target))}};A_t.activators=[{eventName:`onMouseDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===d8.RightClick?!1:(r?.({event:n}),!0)}}];var f8={cancel:{name:`touchcancel`},move:{name:`touchmove`},end:{name:`touchend`}},j_t=class extends l8{constructor(e){super(e,f8)}static setup(){return window.addEventListener(f8.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(f8.move.name,e)};function e(){}}};j_t.activators=[{eventName:`onTouchStart`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t,{touches:i}=n;return i.length>1?!1:(r?.({event:n}),!0)}}];var p8;(function(e){e[e.Pointer=0]=`Pointer`,e[e.DraggableRect=1]=`DraggableRect`})(p8||={});var m8;(function(e){e[e.TreeOrder=0]=`TreeOrder`,e[e.ReversedTreeOrder=1]=`ReversedTreeOrder`})(m8||={});function M_t(e){let{acceleration:t,activator:n=p8.Pointer,canScroll:r,draggingRect:i,enabled:a,interval:o=5,order:s=m8.TreeOrder,pointerCoordinates:c,scrollableAncestors:l,scrollableAncestorRects:u,delta:d,threshold:f}=e,p=P_t({delta:d,disabled:!a}),[m,h]=qgt(),g=(0,M.useRef)({x:0,y:0}),_=(0,M.useRef)({x:0,y:0}),v=(0,M.useMemo)(()=>{switch(n){case p8.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case p8.DraggableRect:return i}},[n,i,c]),y=(0,M.useRef)(null),b=(0,M.useCallback)(()=>{let e=y.current;if(!e)return;let t=g.current.x*_.current.x,n=g.current.y*_.current.y;e.scrollBy(t,n)},[]),x=(0,M.useMemo)(()=>s===m8.TreeOrder?[...l].reverse():l,[s,l]);(0,M.useEffect)(()=>{if(!a||!l.length||!v){h();return}for(let e of x){if(r?.(e)===!1)continue;let n=u[l.indexOf(e)];if(!n)continue;let{direction:i,speed:a}=b_t(e,n,v,t,f);for(let e of[`x`,`y`])p[e][i[e]]||(a[e]=0,i[e]=0);if(a.x>0||a.y>0){h(),y.current=e,m(b,o),g.current=a,_.current=i;return}}g.current={x:0,y:0},_.current={x:0,y:0},h()},[t,b,r,h,a,o,JSON.stringify(v),JSON.stringify(p),m,l,x,u,JSON.stringify(f)])}var N_t={x:{[J6.Backward]:!1,[J6.Forward]:!1},y:{[J6.Backward]:!1,[J6.Forward]:!1}};function P_t(e){let{delta:t,disabled:n}=e,r=g6(t);return m6(e=>{if(n||!r||!e)return N_t;let i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[J6.Backward]:e.x[J6.Backward]||i.x===-1,[J6.Forward]:e.x[J6.Forward]||i.x===1},y:{[J6.Backward]:e.y[J6.Backward]||i.y===-1,[J6.Forward]:e.y[J6.Forward]||i.y===1}}},[n,t,r])}function F_t(e,t){let n=t==null?void 0:e.get(t),r=n?n.node.current:null;return m6(e=>t==null?null:r??e??null,[r,t])}function I_t(e,t){return(0,M.useMemo)(()=>e.reduce((e,n)=>{let{sensor:r}=n,i=r.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}));return[...e,...i]},[]),[e,t])}var h8;(function(e){e[e.Always=0]=`Always`,e[e.BeforeDragging=1]=`BeforeDragging`,e[e.WhileDragging=2]=`WhileDragging`})(h8||={});var g8;(function(e){e.Optimized=`optimized`})(g8||={});var _8=new Map;function L_t(e,t){let{dragging:n,dependencies:r,config:i}=t,[a,o]=(0,M.useState)(null),{frequency:s,measure:c,strategy:l}=i,u=(0,M.useRef)(e),d=g(),f=p6(d),p=(0,M.useCallback)(function(e){e===void 0&&(e=[]),!f.current&&o(t=>t===null?e:t.concat(e.filter(e=>!t.includes(e))))},[f]),m=(0,M.useRef)(null),h=m6(t=>{if(d&&!n)return _8;if(!t||t===_8||u.current!==e||a!=null){let t=new Map;for(let n of e){if(!n)continue;if(a&&a.length>0&&!a.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}let e=n.node.current,r=e?new $6(c(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,a,n,d,c]);return(0,M.useEffect)(()=>{u.current=e},[e]),(0,M.useEffect)(()=>{d||p()},[n,d]),(0,M.useEffect)(()=>{a&&a.length>0&&o(null)},[JSON.stringify(a)]),(0,M.useEffect)(()=>{d||typeof s!=`number`||m.current!==null||(m.current=setTimeout(()=>{p(),m.current=null},s))},[s,d,p,...r]),{droppableRects:h,measureDroppableContainers:p,measuringScheduled:a!=null};function g(){switch(l){case h8.Always:return!1;case h8.BeforeDragging:return n;default:return!n}}}function v8(e,t){return m6(n=>e?n||(typeof t==`function`?t(e):e):null,[t,e])}function R_t(e,t){return v8(e,t)}function z_t(e){let{callback:t,disabled:n}=e,r=f6(t),i=(0,M.useMemo)(()=>{if(n||typeof window>`u`||window.MutationObserver===void 0)return;let{MutationObserver:e}=window;return new e(r)},[r,n]);return(0,M.useEffect)(()=>()=>i?.disconnect(),[i]),i}function y8(e){let{callback:t,disabled:n}=e,r=f6(t),i=(0,M.useMemo)(()=>{if(n||typeof window>`u`||window.ResizeObserver===void 0)return;let{ResizeObserver:e}=window;return new e(r)},[n]);return(0,M.useEffect)(()=>()=>i?.disconnect(),[i]),i}function B_t(e){return new $6(B6(e),e)}function b8(e,t,n){t===void 0&&(t=B_t);let[r,i]=(0,M.useState)(null);function a(){i(r=>{if(!e)return null;if(e.isConnected===!1)return r??n??null;let i=t(e);return JSON.stringify(r)===JSON.stringify(i)?r:i})}let o=z_t({callback(t){if(e)for(let n of t){let{type:t,target:r}=n;if(t===`childList`&&r instanceof HTMLElement&&r.contains(e)){a();break}}}}),s=y8({callback:a});return d6(()=>{a(),e?(s?.observe(e),o?.observe(document.body,{childList:!0,subtree:!0})):(s?.disconnect(),o?.disconnect())},[e]),r}function V_t(e){return R6(e,v8(e))}var x8=[];function H_t(e){let t=(0,M.useRef)(e),n=m6(n=>e?n&&n!==x8&&e&&t.current&&e.parentNode===t.current.parentNode?n:H6(e):x8,[e]);return(0,M.useEffect)(()=>{t.current=e},[e]),n}function U_t(e){let[t,n]=(0,M.useState)(null),r=(0,M.useRef)(e),i=(0,M.useCallback)(e=>{let t=W6(e.target);t&&n(e=>e?(e.set(t,q6(t)),new Map(e)):null)},[]);return(0,M.useEffect)(()=>{let t=r.current;if(e!==t){a(t);let o=e.map(e=>{let t=W6(e);return t?(t.addEventListener(`scroll`,i,{passive:!0}),[t,q6(t)]):null}).filter(e=>e!=null);n(o.length?new Map(o):null),r.current=e}return()=>{a(e),a(t)};function a(e){e.forEach(e=>{W6(e)?.removeEventListener(`scroll`,i)})}},[i,e]),(0,M.useMemo)(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>b6(e,t),j6):Z6(e):j6,[e,t])}function S8(e,t){t===void 0&&(t=[]);let n=(0,M.useRef)(null);return(0,M.useEffect)(()=>{n.current=null},t),(0,M.useEffect)(()=>{let t=e!==j6;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?x6(e,n.current):j6}function W_t(e){(0,M.useEffect)(()=>{if(!r6)return;let t=e.map(e=>{let{sensor:t}=e;return t.setup==null?void 0:t.setup()});return()=>{for(let e of t)e?.()}},e.map(e=>{let{sensor:t}=e;return t}))}function G_t(e,t){return(0,M.useMemo)(()=>e.reduce((e,n)=>{let{eventName:r,handler:i}=n;return e[r]=e=>{i(e,t)},e},{}),[e,t])}function C8(e){return(0,M.useMemo)(()=>e?g_t(e):null,[e])}var w8=[];function K_t(e,t){t===void 0&&(t=B6);let[n]=e,r=C8(n?o6(n):null),[i,a]=(0,M.useState)(w8);function o(){a(()=>e.length?e.map(e=>Y6(e)?r:new $6(t(e),e)):w8)}let s=y8({callback:o});return d6(()=>{s?.disconnect(),o(),e.forEach(e=>s?.observe(e))},[e]),i}function T8(e){if(!e)return null;if(e.children.length>1)return e;let t=e.children[0];return c6(t)?t:e}function q_t(e){let{measure:t}=e,[n,r]=(0,M.useState)(null),i=y8({callback:(0,M.useCallback)(e=>{for(let{target:n}of e)if(c6(n)){r(e=>{let r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),[a,o]=h6((0,M.useCallback)(e=>{let n=T8(e);i?.disconnect(),n&&i?.observe(n),r(n?t(n):null)},[t,i]));return(0,M.useMemo)(()=>({nodeRef:a,rect:n,setRef:o}),[n,a,o])}var J_t=[{sensor:u8,options:{}},{sensor:o8,options:{}}],Y_t={current:{}},E8={draggable:{measure:V6},droppable:{measure:V6,strategy:h8.WhileDragging,frequency:g8.Optimized},dragOverlay:{measure:B6}},D8=class extends Map{get(e){return e==null?void 0:super.get(e)??void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){return this.get(e)?.node.current??void 0}},X_t={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new D8,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:O6},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:E8,measureDroppableContainers:O6,windowRect:null,measuringScheduled:!1},O8={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:``},dispatch:O6,draggableNodes:new Map,over:null,measureDroppableContainers:O6},k8=(0,M.createContext)(O8),A8=(0,M.createContext)(X_t);function Z_t(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new D8}}}function Q_t(e,t){switch(t.type){case D6.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case D6.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case D6.DragEnd:case D6.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case D6.RegisterDroppable:{let{element:n}=t,{id:r}=n,i=new D8(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case D6.SetDroppableDisabled:{let{id:n,key:r,disabled:i}=t,a=e.droppable.containers.get(n);if(!a||r!==a.key)return e;let o=new D8(e.droppable.containers);return o.set(n,{...a,disabled:i}),{...e,droppable:{...e.droppable,containers:o}}}case D6.UnregisterDroppable:{let{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;let a=new D8(e.droppable.containers);return a.delete(n),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function $_t(e){let{disabled:t}=e,{active:n,activatorEvent:r,draggableNodes:i}=(0,M.useContext)(k8),a=g6(r),o=g6(n?.id);return(0,M.useEffect)(()=>{if(!t&&!r&&a&&o!=null){if(!S6(a)||document.activeElement===a.target)return;let e=i.get(o);if(!e)return;let{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame(()=>{for(let e of[t.current,n.current]){if(!e)continue;let t=Xgt(e);if(t){t.focus();break}}})}},[r,t,i,o,a]),null}function j8(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}function evt(e){return(0,M.useMemo)(()=>({draggable:{...E8.draggable,...e?.draggable},droppable:{...E8.droppable,...e?.droppable},dragOverlay:{...E8.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function tvt(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e,a=(0,M.useRef)(!1),{x:o,y:s}=typeof i==`boolean`?{x:i,y:i}:i;d6(()=>{if(!o&&!s||!t){a.current=!1;return}if(a.current||!r)return;let e=t?.node.current;if(!e||e.isConnected===!1)return;let i=R6(n(e),r);if(o||(i.x=0),s||(i.y=0),a.current=!0,Math.abs(i.x)>0||Math.abs(i.y)>0){let t=U6(e);t&&t.scrollBy({top:i.y,left:i.x})}},[t,o,s,r,n])}var M8=(0,M.createContext)({...j6,scaleX:1,scaleY:1}),N8;(function(e){e[e.Uninitialized=0]=`Uninitialized`,e[e.Initializing=1]=`Initializing`,e[e.Initialized=2]=`Initialized`})(N8||={});var P8=(0,M.memo)(function(e){let{id:t,accessibility:n,autoScroll:r=!0,children:i,sensors:a=J_t,collisionDetection:o=u_t,measuring:s,modifiers:c,...l}=e,[u,d]=(0,M.useReducer)(Q_t,void 0,Z_t),[f,p]=n_t(),[m,h]=(0,M.useState)(N8.Uninitialized),g=m===N8.Initialized,{draggable:{active:_,nodes:v,translate:y},droppable:{containers:b}}=u,x=_==null?null:v.get(_),S=(0,M.useRef)({initial:null,translated:null}),C=(0,M.useMemo)(()=>_==null?null:{id:_,data:x?.data??Y_t,rect:S},[_,x]),w=(0,M.useRef)(null),[T,E]=(0,M.useState)(null),[D,O]=(0,M.useState)(null),ee=p6(l,Object.values(l)),te=v6(`DndDescribedBy`,t),k=(0,M.useMemo)(()=>b.getEnabled(),[b]),A=evt(s),{droppableRects:ne,measureDroppableContainers:re,measuringScheduled:ie}=L_t(k,{dragging:g,dependencies:[y.x,y.y],config:A.droppable}),j=F_t(v,_),ae=(0,M.useMemo)(()=>D?C6(D):null,[D]),oe=Le(),se=R_t(j,A.draggable.measure);tvt({activeNode:_==null?null:v.get(_),config:oe.layoutShiftCompensation,initialRect:se,measure:A.draggable.measure});let ce=b8(j,A.draggable.measure,se),le=b8(j?j.parentElement:null),ue=(0,M.useRef)({activatorEvent:null,active:null,activeNode:j,collisionRect:null,collisions:null,droppableRects:ne,draggableNodes:v,draggingNode:null,draggingNodeRect:null,droppableContainers:b,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),de=b.getNodeFor(ue.current.over?.id),fe=q_t({measure:A.dragOverlay.measure}),pe=fe.nodeRef.current??j,me=g?fe.rect??ce:null,he=!!(fe.nodeRef.current&&fe.rect),ge=V_t(he?null:ce),_e=C8(pe?o6(pe):null),ve=H_t(g?de??j:null),ye=K_t(ve),be=j8(c,{transform:{x:y.x-ge.x,y:y.y-ge.y,scaleX:1,scaleY:1},activatorEvent:D,active:C,activeNodeRect:ce,containerNodeRect:le,draggingNodeRect:me,over:ue.current.over,overlayNodeRect:fe.rect,scrollableAncestors:ve,scrollableAncestorRects:ye,windowRect:_e}),xe=ae?b6(ae,y):null,Se=U_t(ve),Ce=S8(Se),we=S8(Se,[ce]),Te=b6(be,Ce),Ee=me?p_t(me,be):null,De=C&&Ee?o({active:C,collisionRect:Ee,droppableRects:ne,droppableContainers:k,pointerCoordinates:xe}):null,Oe=F6(De,`id`),[ke,Ae]=(0,M.useState)(null),je=d_t(he?be:b6(be,we),ke?.rect??null,ce),Me=(0,M.useRef)(null),Ne=(0,M.useCallback)((e,t)=>{let{sensor:n,options:r}=t;if(w.current==null)return;let i=v.get(w.current);if(!i)return;let a=e.nativeEvent;Me.current=new n({active:w.current,activeNode:i,event:a,options:r,context:ue,onAbort(e){if(!v.get(e))return;let{onDragAbort:t}=ee.current,n={id:e};t?.(n),f({type:`onDragAbort`,event:n})},onPending(e,t,n,r){if(!v.get(e))return;let{onDragPending:i}=ee.current,a={id:e,constraint:t,initialCoordinates:n,offset:r};i?.(a),f({type:`onDragPending`,event:a})},onStart(e){let t=w.current;if(t==null)return;let n=v.get(t);if(!n)return;let{onDragStart:r}=ee.current,i={activatorEvent:a,active:{id:t,data:n.data,rect:S}};(0,us.unstable_batchedUpdates)(()=>{r?.(i),h(N8.Initializing),d({type:D6.DragStart,initialCoordinates:e,active:t}),f({type:`onDragStart`,event:i}),E(Me.current),O(a)})},onMove(e){d({type:D6.DragMove,coordinates:e})},onEnd:o(D6.DragEnd),onCancel:o(D6.DragCancel)});function o(e){return async function(){let{active:t,collisions:n,over:r,scrollAdjustedTranslate:i}=ue.current,o=null;if(t&&i){let{cancelDrop:s}=ee.current;o={activatorEvent:a,active:t,collisions:n,delta:i,over:r},e===D6.DragEnd&&typeof s==`function`&&await Promise.resolve(s(o))&&(e=D6.DragCancel)}w.current=null,(0,us.unstable_batchedUpdates)(()=>{d({type:e}),h(N8.Uninitialized),Ae(null),E(null),O(null),Me.current=null;let t=e===D6.DragEnd?`onDragEnd`:`onDragCancel`;if(o){let e=ee.current[t];e?.(o),f({type:t,event:o})}})}}},[v]),Pe=I_t(a,(0,M.useCallback)((e,t)=>(n,r)=>{let i=n.nativeEvent,a=v.get(r);if(w.current!==null||!a||i.dndKit||i.defaultPrevented)return;let o={active:a};e(n,t.options,o)===!0&&(i.dndKit={capturedBy:t.sensor},w.current=r,Ne(n,t))},[v,Ne]));W_t(a),d6(()=>{ce&&m===N8.Initializing&&h(N8.Initialized)},[ce,m]),(0,M.useEffect)(()=>{let{onDragMove:e}=ee.current,{active:t,activatorEvent:n,collisions:r,over:i}=ue.current;if(!t||!n)return;let a={active:t,activatorEvent:n,collisions:r,delta:{x:Te.x,y:Te.y},over:i};(0,us.unstable_batchedUpdates)(()=>{e?.(a),f({type:`onDragMove`,event:a})})},[Te.x,Te.y]),(0,M.useEffect)(()=>{let{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:i}=ue.current;if(!e||w.current==null||!t||!i)return;let{onDragOver:a}=ee.current,o=r.get(Oe),s=o&&o.rect.current?{id:o.id,rect:o.rect.current,data:o.data,disabled:o.disabled}:null,c={active:e,activatorEvent:t,collisions:n,delta:{x:i.x,y:i.y},over:s};(0,us.unstable_batchedUpdates)(()=>{Ae(s),a?.(c),f({type:`onDragOver`,event:c})})},[Oe]),d6(()=>{ue.current={activatorEvent:D,active:C,activeNode:j,collisionRect:Ee,collisions:De,droppableRects:ne,draggableNodes:v,draggingNode:pe,draggingNodeRect:me,droppableContainers:b,over:ke,scrollableAncestors:ve,scrollAdjustedTranslate:Te},S.current={initial:me,translated:Ee}},[C,j,De,Ee,v,pe,me,ne,b,ke,ve,Te]),M_t({...oe,delta:y,draggingRect:Ee,pointerCoordinates:xe,scrollableAncestors:ve,scrollableAncestorRects:ye});let Fe=(0,M.useMemo)(()=>({active:C,activeNode:j,activeNodeRect:ce,activatorEvent:D,collisions:De,containerNodeRect:le,dragOverlay:fe,draggableNodes:v,droppableContainers:b,droppableRects:ne,over:ke,measureDroppableContainers:re,scrollableAncestors:ve,scrollableAncestorRects:ye,measuringConfiguration:A,measuringScheduled:ie,windowRect:_e}),[C,j,ce,D,De,le,fe,v,b,ne,ke,re,ve,ye,A,ie,_e]),Ie=(0,M.useMemo)(()=>({activatorEvent:D,activators:Pe,active:C,activeNodeRect:ce,ariaDescribedById:{draggable:te},dispatch:d,draggableNodes:v,over:ke,measureDroppableContainers:re}),[D,Pe,C,ce,d,te,v,ke,re]);return M.createElement(E6.Provider,{value:p},M.createElement(k8.Provider,{value:Ie},M.createElement(A8.Provider,{value:Fe},M.createElement(M8.Provider,{value:je},i)),M.createElement($_t,{disabled:n?.restoreFocus===!1})),M.createElement(a_t,{...n,hiddenTextDescribedById:te}));function Le(){let e=T?.autoScrollEnabled===!1,t=typeof r==`object`?r.enabled===!1:r===!1,n=g&&!e&&!t;return typeof r==`object`?{...r,enabled:n}:{enabled:n}}}),nvt=(0,M.createContext)(null),F8=`button`,rvt=`Draggable`;function ivt(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e,a=v6(rvt),{activators:o,activatorEvent:s,active:c,activeNodeRect:l,ariaDescribedById:u,draggableNodes:d,over:f}=(0,M.useContext)(k8),{role:p=F8,roleDescription:m=`draggable`,tabIndex:h=0}=i??{},g=c?.id===t,_=(0,M.useContext)(g?M8:nvt),[v,y]=h6(),[b,x]=h6(),S=G_t(o,t),C=p6(n);return d6(()=>(d.set(t,{id:t,key:a,node:v,activatorNode:b,data:C}),()=>{let e=d.get(t);e&&e.key===a&&d.delete(t)}),[d,t]),{active:c,activatorEvent:s,activeNodeRect:l,attributes:(0,M.useMemo)(()=>({role:p,tabIndex:h,"aria-disabled":r,"aria-pressed":g&&p===F8?!0:void 0,"aria-roledescription":m,"aria-describedby":u.draggable}),[r,p,h,g,m,u.draggable]),isDragging:g,listeners:r?void 0:S,node:v,over:f,setNodeRef:y,setActivatorNodeRef:x,transform:_}}function I8(){return(0,M.useContext)(A8)}var avt=`Droppable`,ovt={timeout:25};function L8(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e,a=v6(avt),{active:o,dispatch:s,over:c,measureDroppableContainers:l}=(0,M.useContext)(k8),u=(0,M.useRef)({disabled:n}),d=(0,M.useRef)(!1),f=(0,M.useRef)(null),p=(0,M.useRef)(null),{disabled:m,updateMeasurementsFor:h,timeout:g}={...ovt,...i},_=p6(h??r),v=y8({callback:(0,M.useCallback)(()=>{if(!d.current){d.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{l(Array.isArray(_.current)?_.current:[_.current]),p.current=null},g)},[g]),disabled:m||!o}),[y,b]=h6((0,M.useCallback)((e,t)=>{v&&(t&&(v.unobserve(t),d.current=!1),e&&v.observe(e))},[v])),x=p6(t);return(0,M.useEffect)(()=>{!v||!y.current||(v.disconnect(),d.current=!1,v.observe(y.current))},[y,v]),(0,M.useEffect)(()=>(s({type:D6.RegisterDroppable,element:{id:r,key:a,disabled:n,node:y,rect:f,data:x}}),()=>s({type:D6.UnregisterDroppable,key:a,id:r})),[r]),(0,M.useEffect)(()=>{n!==u.current.disabled&&(s({type:D6.SetDroppableDisabled,id:r,key:a,disabled:n}),u.current.disabled=n)},[r,a,n,s]),{active:o,rect:f,isOver:c?.id===r,node:y,over:c,setNodeRef:b}}function svt(e){let{animation:t,children:n}=e,[r,i]=(0,M.useState)(null),[a,o]=(0,M.useState)(null),s=g6(n);return!n&&!r&&s&&i(s),d6(()=>{if(!a)return;let e=r?.key,n=r?.props.id;if(e==null||n==null){i(null);return}Promise.resolve(t(n,a)).then(()=>{i(null)})},[t,r,a]),M.createElement(M.Fragment,null,n,r?(0,M.cloneElement)(r,{ref:o}):null)}var cvt={x:0,y:0,scaleX:1,scaleY:1};function lvt(e){let{children:t}=e;return M.createElement(k8.Provider,{value:O8},M.createElement(M8.Provider,{value:cvt},t))}var uvt={position:`fixed`,touchAction:`none`},dvt=e=>S6(e)?`transform 250ms ease`:void 0,fvt=(0,M.forwardRef)((e,t)=>{let{as:n,activatorEvent:r,adjustScale:i,children:a,className:o,rect:s,style:c,transform:l,transition:u=dvt}=e;if(!s)return null;let d=i?l:{...l,scaleX:1,scaleY:1},f={...uvt,width:s.width,height:s.height,top:s.top,left:s.left,transform:w6.Transform.toString(d),transformOrigin:i&&r?o_t(r,s):void 0,transition:typeof u==`function`?u(r):u,...c};return M.createElement(n,{className:o,style:f,ref:t},a)}),pvt={duration:250,easing:`ease`,keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:w6.Transform.toString(t)},{transform:w6.Transform.toString(n)}]},sideEffects:(e=>t=>{let{active:n,dragOverlay:r}=t,i={},{styles:a,className:o}=e;if(a!=null&&a.active)for(let[e,t]of Object.entries(a.active))t!==void 0&&(i[e]=n.node.style.getPropertyValue(e),n.node.style.setProperty(e,t));if(a!=null&&a.dragOverlay)for(let[e,t]of Object.entries(a.dragOverlay))t!==void 0&&r.node.style.setProperty(e,t);return o!=null&&o.active&&n.node.classList.add(o.active),o!=null&&o.dragOverlay&&r.node.classList.add(o.dragOverlay),function(){for(let[e,t]of Object.entries(i))n.node.style.setProperty(e,t);o!=null&&o.active&&n.node.classList.remove(o.active)}})({styles:{active:{opacity:`0`}}})};function mvt(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:i}=e;return f6((e,a)=>{if(t===null)return;let o=n.get(e);if(!o)return;let s=o.node.current;if(!s)return;let c=T8(a);if(!c)return;let{transform:l}=o6(a).getComputedStyle(a),u=z6(l);if(!u)return;let d=typeof t==`function`?t:hvt(t);return Q6(s,i.draggable.measure),d({active:{id:e,data:o.data,node:s,rect:i.draggable.measure(s)},draggableNodes:n,dragOverlay:{node:a,rect:i.dragOverlay.measure(c)},droppableContainers:r,measuringConfiguration:i,transform:u})})}function hvt(e){let{duration:t,easing:n,sideEffects:r,keyframes:i}={...pvt,...e};return e=>{let{active:a,dragOverlay:o,transform:s,...c}=e;if(!t)return;let l={x:o.rect.left-a.rect.left,y:o.rect.top-a.rect.top},u={scaleX:s.scaleX===1?1:a.rect.width*s.scaleX/o.rect.width,scaleY:s.scaleY===1?1:a.rect.height*s.scaleY/o.rect.height},d={x:s.x-l.x,y:s.y-l.y,...u},f=i({...c,active:a,dragOverlay:o,transform:{initial:s,final:d}}),[p]=f,m=f[f.length-1];if(JSON.stringify(p)===JSON.stringify(m))return;let h=r?.({active:a,dragOverlay:o,...c}),g=o.node.animate(f,{duration:t,easing:n,fill:`forwards`});return new Promise(e=>{g.onfinish=()=>{h?.(),e()}})}}var R8=0;function gvt(e){return(0,M.useMemo)(()=>{if(e!=null)return R8++,R8},[e])}var _vt=M.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:i,transition:a,modifiers:o,wrapperElement:s=`div`,className:c,zIndex:l=999}=e,{activatorEvent:u,active:d,activeNodeRect:f,containerNodeRect:p,draggableNodes:m,droppableContainers:h,dragOverlay:g,over:_,measuringConfiguration:v,scrollableAncestors:y,scrollableAncestorRects:b,windowRect:x}=I8(),S=(0,M.useContext)(M8),C=gvt(d?.id),w=j8(o,{activatorEvent:u,active:d,activeNodeRect:f,containerNodeRect:p,draggingNodeRect:g.rect,over:_,overlayNodeRect:g.rect,scrollableAncestors:y,scrollableAncestorRects:b,transform:S,windowRect:x}),T=v8(f),E=mvt({config:r,draggableNodes:m,droppableContainers:h,measuringConfiguration:v}),D=T?g.setRef:void 0;return M.createElement(lvt,null,M.createElement(svt,{animation:E},d&&C?M.createElement(fvt,{key:C,id:d.id,ref:D,as:s,activatorEvent:u,adjustScale:t,className:c,transition:a,rect:T,style:{zIndex:l,...i},transform:w},n):null))}),vvt=e=>{let{transform:t}=e;return{...t,y:0}};function yvt(e,t,n){let r={...e};return t.top+e.y<=n.top?r.y=n.top-t.top:t.bottom+e.y>=n.top+n.height&&(r.y=n.top+n.height-t.bottom),t.left+e.x<=n.left?r.x=n.left-t.left:t.right+e.x>=n.left+n.width&&(r.x=n.left+n.width-t.right),r}var bvt=e=>{let{draggingNodeRect:t,transform:n,scrollableAncestorRects:r}=e,i=r[0];return!t||!i?n:yvt(n,t,i)},xvt=e=>{let{transform:t}=e;return{...t,x:0}};function z8(e,t,n){let r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function Svt(e,t){return e.reduce((e,n,r)=>{let i=t.get(n);return i&&(e[r]=i),e},Array(e.length))}function B8(e){return e!==null&&e>=0}function Cvt(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function wvt(e){return typeof e==`boolean`?{draggable:e,droppable:e}:e}var V8={scaleX:1,scaleY:1},Tvt=e=>{let{rects:t,activeNodeRect:n,activeIndex:r,overIndex:i,index:a}=e,o=t[r]??n;if(!o)return null;let s=Evt(t,a,r);if(a===r){let e=t[i];return e?{x:r<i?e.left+e.width-(o.left+o.width):e.left-o.left,y:0,...V8}:null}return a>r&&a<=i?{x:-o.width-s,y:0,...V8}:a<r&&a>=i?{x:o.width+s,y:0,...V8}:{x:0,y:0,...V8}};function Evt(e,t,n){let r=e[t],i=e[t-1],a=e[t+1];return!r||!i&&!a?0:n<t?i?r.left-(i.left+i.width):a.left-(r.left+r.width):a?a.left-(r.left+r.width):r.left-(i.left+i.width)}var H8=e=>{let{rects:t,activeIndex:n,overIndex:r,index:i}=e,a=z8(t,r,n),o=t[i],s=a[i];return!s||!o?null:{x:s.left-o.left,y:s.top-o.top,scaleX:s.width/o.width,scaleY:s.height/o.height}},U8={scaleX:1,scaleY:1},Dvt=e=>{let{activeIndex:t,activeNodeRect:n,index:r,rects:i,overIndex:a}=e,o=i[t]??n;if(!o)return null;if(r===t){let e=i[a];return e?{x:0,y:t<a?e.top+e.height-(o.top+o.height):e.top-o.top,...U8}:null}let s=Ovt(i,r,t);return r>t&&r<=a?{x:0,y:-o.height-s,...U8}:r<t&&r>=a?{x:0,y:o.height+s,...U8}:{x:0,y:0,...U8}};function Ovt(e,t,n){let r=e[t],i=e[t-1],a=e[t+1];return r?n<t?i?r.top-(i.top+i.height):a?a.top-(r.top+r.height):0:a?a.top-(r.top+r.height):i?r.top-(i.top+i.height):0:0}var W8=`Sortable`,G8=M.createContext({activeIndex:-1,containerId:W8,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:H8,disabled:{draggable:!1,droppable:!1}});function K8(e){let{children:t,id:n,items:r,strategy:i=H8,disabled:a=!1}=e,{active:o,dragOverlay:s,droppableRects:c,over:l,measureDroppableContainers:u}=I8(),d=v6(W8,n),f=s.rect!==null,p=(0,M.useMemo)(()=>r.map(e=>typeof e==`object`&&`id`in e?e.id:e),[r]),m=o!=null,h=o?p.indexOf(o.id):-1,g=l?p.indexOf(l.id):-1,_=(0,M.useRef)(p),v=!Cvt(p,_.current),y=g!==-1&&h===-1||v,b=wvt(a);d6(()=>{v&&m&&u(p)},[v,p,m,u]),(0,M.useEffect)(()=>{_.current=p},[p]);let x=(0,M.useMemo)(()=>({activeIndex:h,containerId:d,disabled:b,disableTransforms:y,items:p,overIndex:g,useDragOverlay:f,sortedRects:Svt(p,c),strategy:i}),[h,d,b.draggable,b.droppable,y,p,g,c,f,i]);return M.createElement(G8.Provider,{value:x},t)}var kvt=e=>{let{id:t,items:n,activeIndex:r,overIndex:i}=e;return z8(n,r,i).indexOf(t)},Avt=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:i,items:a,newIndex:o,previousItems:s,previousContainerId:c,transition:l}=e;return!l||!r||s!==a&&i===o?!1:n?!0:o!==i&&t===c},jvt={duration:200,easing:`ease`},q8=`transform`,Mvt=w6.Transition.toString({property:q8,duration:0,easing:`linear`}),Nvt={roleDescription:`sortable`};function Pvt(e){let{disabled:t,index:n,node:r,rect:i}=e,[a,o]=(0,M.useState)(null),s=(0,M.useRef)(n);return d6(()=>{if(!t&&n!==s.current&&r.current){let e=i.current;if(e){let t=B6(r.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&o(n)}}n!==s.current&&(s.current=n)},[t,n,r,i]),(0,M.useEffect)(()=>{a&&o(null)},[a]),a}function J8(e){let{animateLayoutChanges:t=Avt,attributes:n,disabled:r,data:i,getNewIndex:a=kvt,id:o,strategy:s,resizeObserverConfig:c,transition:l=jvt}=e,{items:u,containerId:d,activeIndex:f,disabled:p,disableTransforms:m,sortedRects:h,overIndex:g,useDragOverlay:_,strategy:v}=(0,M.useContext)(G8),y=Fvt(r,p),b=u.indexOf(o),x=(0,M.useMemo)(()=>({sortable:{containerId:d,index:b,items:u},...i}),[d,i,b,u]),S=(0,M.useMemo)(()=>u.slice(u.indexOf(o)),[u,o]),{rect:C,node:w,isOver:T,setNodeRef:E}=L8({id:o,data:x,disabled:y.droppable,resizeObserverConfig:{updateMeasurementsFor:S,...c}}),{active:D,activatorEvent:O,activeNodeRect:ee,attributes:te,setNodeRef:k,listeners:A,isDragging:ne,over:re,setActivatorNodeRef:ie,transform:j}=ivt({id:o,data:x,attributes:{...Nvt,...n},disabled:y.draggable}),ae=Kgt(E,k),oe=!!D,se=oe&&!m&&B8(f)&&B8(g),ce=!_&&ne,le=se?(ce&&se?j:null)??(s??v)({rects:h,activeNodeRect:ee,activeIndex:f,overIndex:g,index:b}):null,ue=B8(f)&&B8(g)?a({id:o,items:u,activeIndex:f,overIndex:g}):b,de=D?.id,fe=(0,M.useRef)({activeId:de,items:u,newIndex:ue,containerId:d}),pe=u!==fe.current.items,me=t({active:D,containerId:d,isDragging:ne,isSorting:oe,id:o,index:b,items:u,newIndex:fe.current.newIndex,previousItems:fe.current.items,previousContainerId:fe.current.containerId,transition:l,wasDragging:fe.current.activeId!=null}),he=Pvt({disabled:!me,index:b,node:w,rect:C});return(0,M.useEffect)(()=>{oe&&fe.current.newIndex!==ue&&(fe.current.newIndex=ue),d!==fe.current.containerId&&(fe.current.containerId=d),u!==fe.current.items&&(fe.current.items=u)},[oe,ue,d,u]),(0,M.useEffect)(()=>{if(de===fe.current.activeId)return;if(de!=null&&fe.current.activeId==null){fe.current.activeId=de;return}let e=setTimeout(()=>{fe.current.activeId=de},50);return()=>clearTimeout(e)},[de]),{active:D,activeIndex:f,attributes:te,data:x,rect:C,index:b,newIndex:ue,items:u,isOver:T,isSorting:oe,isDragging:ne,listeners:A,node:w,overIndex:g,over:re,setNodeRef:ae,setActivatorNodeRef:ie,setDroppableNodeRef:E,setDraggableNodeRef:k,transform:he??le,transition:ge()};function ge(){if(he||pe&&fe.current.newIndex===b)return Mvt;if(!(ce&&!S6(O)||!l)&&(oe||me))return w6.Transition.toString({...l,property:q8})}}function Fvt(e,t){return typeof e==`boolean`?{draggable:e,droppable:!1}:{draggable:e?.draggable??t.draggable,droppable:e?.droppable??t.droppable}}function Y8(e){if(!e)return!1;let t=e.data.current;return!!(t&&`sortable`in t&&typeof t.sortable==`object`&&`containerId`in t.sortable&&`items`in t.sortable&&`index`in t.sortable)}var Ivt=[i8.Down,i8.Right,i8.Up,i8.Left],X8=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:i,droppableContainers:a,over:o,scrollableAncestors:s}}=t;if(Ivt.includes(e.code)){if(e.preventDefault(),!n||!r)return;let t=[];a.getEnabled().forEach(n=>{if(!n||n!=null&&n.disabled)return;let a=i.get(n.id);if(a)switch(e.code){case i8.Down:r.top<a.top&&t.push(n);break;case i8.Up:r.top>a.top&&t.push(n);break;case i8.Left:r.left>a.left&&t.push(n);break;case i8.Right:r.left<a.left&&t.push(n);break}});let c=L6({active:n,collisionRect:r,droppableRects:i,droppableContainers:t,pointerCoordinates:null}),l=F6(c,`id`);if(l===o?.id&&c.length>1&&(l=c[1].id),l!=null){let e=a.get(n.id),t=a.get(l),o=t?i.get(t.id):null,c=t?.node.current;if(c&&o&&e&&t){let n=H6(c).some((e,t)=>s[t]!==e),i=Z8(e,t),a=Lvt(e,t),l=n||!i?{x:0,y:0}:{x:a?r.width-o.width:0,y:a?r.height-o.height:0},u={x:o.left,y:o.top};return l.x&&l.y?u:x6(u,l)}}}};function Z8(e,t){return!Y8(e)||!Y8(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function Lvt(e,t){return!Y8(e)||!Y8(t)||!Z8(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}function Q8({open:e,onOpenChange:t,title:n,description:r,children:i,onSubmit:a,submitLabel:o=`Enregistrer`,submitting:s=!1,canSubmit:c=!0}){let[l,u]=(0,M.useState)(!1),d=s||l;async function f(){if(!(!c||d))try{u(!0),await a()}finally{u(!1)}}return(0,F.jsx)(jY,{open:e,onOpenChange:t,children:(0,F.jsxs)(MY,{side:`right`,className:`w-4/5 sm:max-w-none gap-0 p-0`,children:[(0,F.jsxs)(NY,{className:`border-b px-6 py-4`,children:[(0,F.jsx)(FY,{children:n}),r?(0,F.jsx)(IY,{children:r}):null]}),(0,F.jsxs)(`form`,{className:`flex min-h-0 flex-1 flex-col`,onSubmit:e=>{e.preventDefault(),f()},children:[(0,F.jsx)(`div`,{className:`oc-sheet__body flex-1 overflow-y-auto px-6 py-4`,children:i}),(0,F.jsxs)(PY,{className:`border-t px-6 py-4`,children:[(0,F.jsxs)(H,{type:`submit`,disabled:!c||d,children:[d?(0,F.jsx)(Om,{className:`size-4 animate-spin`}):null,o]}),(0,F.jsx)(H,{type:`button`,variant:`ghost`,onClick:()=>t(!1),children:`Annuler`})]})]})]})})}var $8=6e4,e5=60*$8,t5=24*e5,n5=7*t5,r5=30*t5,i5=365*t5;function Rvt(e,t){let n=t-e;if(n<$8)return`maintenant`;if(n<e5)return`${Math.floor(n/$8)}min`;if(n<t5)return`${Math.floor(n/e5)}h`;if(n<n5)return`${Math.floor(n/t5)}j`;if(n<r5)return`${Math.floor(n/n5)}sem`;if(n<i5)return`${Math.floor(n/r5)}mois`;let r=Math.floor(n/i5);return`${r}an${r>1?`s`:``}`}var a5=[{value:`red`,hue:`oklch(0.63 0.21 25)`},{value:`orange`,hue:`oklch(0.7 0.17 50)`},{value:`amber`,hue:`oklch(0.8 0.15 85)`},{value:`green`,hue:`oklch(0.7 0.16 150)`},{value:`teal`,hue:`oklch(0.7 0.12 190)`},{value:`blue`,hue:`oklch(0.62 0.19 250)`},{value:`violet`,hue:`oklch(0.6 0.2 300)`},{value:`pink`,hue:`oklch(0.7 0.2 350)`}],o5=e=>a5.find(t=>t.value===e)?.hue??null,s5=`project:none`,zvt=e=>`project:${e}`,c5=`oc.noproject.collapsed`;function Bvt({activeChatId:e,onSelect:t,onNewChat:n,newChatShortcut:r}){let i=N(L.messages.listChats,{}),a=N(L.projects.listProjects,{}),o=N(L.me.getMe,{host:BO})?.ui?.effective,s=o?.showChatProvider??!0,c=o?.showChatAge??!0,l=new Set((i??[]).map(e=>e.providerKind).filter(e=>e!=null)),u=s&&l.size>1,[,d]=(0,M.useState)(0);(0,M.useEffect)(()=>{if(!c)return;let e=window.setInterval(()=>d(e=>e+1),6e4);return()=>window.clearInterval(e)},[c]);let f=P(L.projects.createProject),p=P(L.projects.setProjectCollapsed),m=P(L.chats.reorderChat),h=P(L.chats.moveChatToProject),g=iY(),_=gKe(),v=(0,M.useRef)(null),y=(0,M.useRef)(null),b=(0,M.useRef)(null),[x,S]=(0,M.useState)(`full`);(0,M.useLayoutEffect)(()=>{let e=v.current;if(!e)return;let t=()=>{let t=e.clientWidth,n=y.current?.offsetWidth??0,r=b.current?.offsetWidth??0,i=n===0||t>=n?`full`:t>=r?`label`:`icon`;S(e=>e===i?e:i)};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[_,r]);let[C,w]=(0,M.useState)(null),T=(0,M.useRef)(!1);(0,M.useEffect)(()=>{!T.current&&i&&w(i)},[i]);let E=C??i??[],[D,O]=(0,M.useState)(null),[ee,te]=(0,M.useState)(()=>localStorage.getItem(c5)===`1`);function k(){te(e=>(localStorage.setItem(c5,e?`0`:`1`),!e))}let A=A6(k6(u8,{activationConstraint:{distance:4}}),k6(o8,{coordinateGetter:X8})),ne=E.filter(e=>e.pinned),re=E.filter(e=>!e.pinned),ie=e=>re.filter(t=>(t.projectId??null)===e);function j(e){return E.find(t=>t._id===e)}async function ae(e){O(null);let{active:t,over:n}=e;if(!n)return;let r=j(String(t.id));if(!r)return;let i=String(n.id);if(i.startsWith(`project:`)){let e=i===s5?null:i.slice(8);if((r.projectId??null)===e)return;T.current=!0,w(t=>(t??E).map(t=>t._id===r._id?{...t,projectId:e}:t));try{await h({chatId:r._id,projectId:e})}finally{T.current=!1}return}let a=j(i);if(!a||t.id===n.id)return;if((a.projectId??null)!==(r.projectId??null)||a.pinned!==r.pinned){if(r.pinned||a.pinned)return;T.current=!0,w(e=>(e??E).map(e=>e._id===r._id?{...e,projectId:a.projectId??null}:e));try{await h({chatId:r._id,projectId:a.projectId??null})}finally{T.current=!1}return}let o=a.pinned?ne:ie(a.projectId??null),s=o.map(e=>e._id),c=s.indexOf(r._id),l=s.indexOf(a._id);if(c<0||l<0)return;let u=[...o];u.splice(c,1),u.splice(l,0,r);let d=u[l-1]??null,f=u[l+1]??null;T.current=!0,w(e=>[...(e??E).filter(e=>!o.some(t=>t._id===e._id)),...u]);try{await m({chatId:r._id,prevKey:d?d.sortKey:null,nextKey:f?f.sortKey:null})}finally{T.current=!1}}let oe=D?j(D):null;return(0,F.jsxs)(`aside`,{className:`oc-sidebar`,children:[(0,F.jsxs)(`div`,{className:`oc-sidebar__top`,ref:v,children:[(0,F.jsxs)(H,{className:x===`icon`?`oc-newchat flex-1 justify-center`:`oc-newchat flex-1 justify-start`,onClick:n,title:`${_} (${r})`,"aria-label":_,children:[(0,F.jsx)(Nm,{}),x===`icon`?null:(0,F.jsx)(`span`,{className:`oc-newchat__label`,children:_}),x===`full`?(0,F.jsx)(`kbd`,{className:`oc-newchat__kbd`,"aria-hidden":!0,children:r}):null]}),(0,F.jsx)(`div`,{className:`oc-newchat-ghost`,"aria-hidden":!0,children:(0,F.jsxs)(`div`,{className:`oc-newchat-ghost__row`,ref:y,children:[(0,F.jsxs)(H,{className:`oc-newchat justify-start`,tabIndex:-1,children:[(0,F.jsx)(Nm,{}),(0,F.jsx)(`span`,{className:`oc-newchat__label`,children:_}),(0,F.jsx)(`kbd`,{className:`oc-newchat__kbd`,children:r})]}),(0,F.jsx)(H,{variant:`outline`,size:`icon`,tabIndex:-1,children:(0,F.jsx)(Em,{})})]})}),(0,F.jsx)(`div`,{className:`oc-newchat-ghost`,"aria-hidden":!0,children:(0,F.jsxs)(`div`,{className:`oc-newchat-ghost__row`,ref:b,children:[(0,F.jsxs)(H,{className:`oc-newchat justify-start`,tabIndex:-1,children:[(0,F.jsx)(Nm,{}),(0,F.jsx)(`span`,{className:`oc-newchat__label`,children:_})]}),(0,F.jsx)(H,{variant:`outline`,size:`icon`,tabIndex:-1,children:(0,F.jsx)(Em,{})})]})}),(0,F.jsx)(H,{className:`oc-newproject`,variant:`outline`,size:`icon`,"aria-label":tq(),title:tq(),onClick:async()=>{let e=await g({title:tq(),label:xKe(),placeholder:wKe(),confirmLabel:DKe()});e&&await f({name:e})},children:(0,F.jsx)(Em,{})})]}),(0,F.jsxs)(P8,{sensors:A,collisionDetection:L6,modifiers:[xvt,bvt],onDragStart:e=>O(e.active.id),onDragCancel:()=>O(null),onDragEnd:ae,children:[(0,F.jsxs)(`div`,{className:`oc-sidebar__scroll`,children:[ne.length>0?(0,F.jsx)(l5,{label:AKe(),chats:ne,children:ne.map(n=>(0,F.jsx)(d5,{chat:n,active:n._id===e,projects:a??[],onSelect:t,showProviderBadge:u},n._id))}):null,(a??[]).map(n=>{let r=ie(n._id);return(0,F.jsx)(l5,{label:n.name,dropId:zvt(n._id),projectId:n._id,chats:r,collapsible:!0,collapsed:n.collapsed,onToggle:()=>void p({projectId:n._id,collapsed:!n.collapsed}),children:n.collapsed?null:r.length===0?(0,F.jsx)(`div`,{className:`oc-sidebar__empty`,children:NKe()}):r.map(n=>(0,F.jsx)(d5,{chat:n,active:n._id===e,projects:a??[],onSelect:t,showProviderBadge:u},n._id))},n._id)}),(0,F.jsx)(l5,{label:IKe(),dropId:s5,chats:ie(null),collapsible:!0,collapsed:ee,onToggle:k,children:ee?null:ie(null).map(n=>(0,F.jsx)(d5,{chat:n,active:n._id===e,projects:a??[],onSelect:t,showProviderBadge:u},n._id))})]}),(0,F.jsx)(_vt,{children:oe?(0,F.jsxs)(`div`,{className:`oc-chatitem oc-chatitem--overlay`,children:[(0,F.jsx)(Dm,{className:`size-3.5 opacity-60`}),o5(oe.color)?(0,F.jsx)(`span`,{className:`oc-chatitem__dot`,style:{background:o5(oe.color)}}):(0,F.jsx)(`span`,{className:`oc-chatitem__dot oc-chatitem__dot--empty`}),(0,F.jsx)(`span`,{className:`oc-chatitem__label`,children:oe.title||nq()})]}):null})]})]})}function l5({label:e,dropId:t,projectId:n,chats:r,collapsible:i,collapsed:a,onToggle:o,children:s}){let c=P(L.projects.deleteProject),l=rY(),u=N(L.projects.projectChatCount,n?{projectId:n}:`skip`),{setNodeRef:d,isOver:f}=L8({id:t??`static:${e}`});return(0,F.jsxs)(`div`,{ref:t?d:void 0,className:`oc-sidebar__group`+(f?` oc-sidebar__group--over`:``),children:[(0,F.jsxs)(`div`,{className:`oc-sidebar__group-head`+(i?` oc-sidebar__group-head--btn`:``),...i?{role:`button`,tabIndex:0,onClick:o,onKeyDown:e=>{i&&o&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),o())}}:{},children:[i?a?(0,F.jsx)(_m,{className:`size-3.5`}):(0,F.jsx)(gm,{className:`size-3.5`}):null,(0,F.jsx)(`span`,{className:`oc-sidebar__group-label`,children:e}),n?(0,F.jsx)(`button`,{className:`oc-sidebar__group-del`,"aria-label":iq(),onClick:async t=>{t.stopPropagation();let r=u??0;await l({title:GKe({name:e}),description:r>0?JKe({count:r}):ZKe(),confirmWord:aq(),confirmLabel:iq(),destructive:!0})&&await c({projectId:n})},children:(0,F.jsx)(Bm,{className:`size-3.5`})}):null]}),(0,F.jsx)(K8,{items:r.map(e=>e._id),strategy:Dvt,children:s})]})}var u5={openclaw:`OpenClaw`,hermes:`Hermes`};function d5({chat:e,active:t,projects:n,onSelect:r,showProviderBadge:i}){let{attributes:a,listeners:o,setNodeRef:s,transform:c,transition:l,isDragging:u}=J8({id:e._id}),d=P(L.chats.renameChat),f=P(L.chats.deleteChat),p=P(L.chats.pinChat),m=P(L.chats.setChatColor),h=N(L.me.getMe,{host:BO})?.ui?.effective?.showChatAge??!0,g=rY(),[_,v]=(0,M.useState)(!1),[y,b]=(0,M.useState)(e.title??``),x={transform:w6.Transform.toString(c),transition:l,opacity:+!u},S=o5(e.color);return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`div`,{ref:s,style:x,className:`oc-chatitem group/row`+(t?` oc-chatitem--active`:``),children:[(0,F.jsx)(`button`,{className:`oc-chatitem__grip`,"aria-label":nqe(),...a,...o,children:(0,F.jsx)(Dm,{className:`size-3.5`})}),S?(0,F.jsx)(`span`,{className:`oc-chatitem__dot`,style:{background:S}}):(0,F.jsx)(`span`,{className:`oc-chatitem__dot oc-chatitem__dot--empty`}),(0,F.jsx)(`button`,{className:`oc-chatitem__label`,onClick:()=>r(e._id),children:e.title||nq()}),e.readOnly?(0,F.jsx)(`span`,{className:`oc-chatitem__readonly`,title:rq(),children:(0,F.jsx)(km,{size:12,"aria-label":rq()})}):null,i&&e.providerKind?(0,F.jsx)(`span`,{className:`oc-chatitem__bridge oc-chatitem__bridge--${e.providerKind} group-hover/row:opacity-0 group-focus-within/row:opacity-0`,title:kqe({provider:u5[e.providerKind]}),children:u5[e.providerKind]}):null,h?(0,F.jsx)(`span`,{className:`oc-chatitem__age group-hover/row:opacity-0 group-focus-within/row:opacity-0`,title:new Date(e.updatedAt).toLocaleString(`fr-FR`),children:Rvt(e.updatedAt,Date.now())}):null,(0,F.jsxs)(EJ,{children:[(0,F.jsx)(DJ,{asChild:!0,children:(0,F.jsx)(H,{variant:`ghost`,size:`icon-xs`,"aria-label":aqe(),className:`opacity-0 group-hover/row:opacity-100 group-focus-within/row:opacity-100 aria-expanded:opacity-100`,children:(0,F.jsx)(wm,{})})}),(0,F.jsxs)(OJ,{align:`end`,className:`w-48`,children:[(0,F.jsxs)(kJ,{onSelect:()=>{b(e.title??``),v(!0)},children:[(0,F.jsx)(Ree,{}),` `,cqe()]}),(0,F.jsxs)(kJ,{onSelect:()=>void p({chatId:e._id,pinned:!e.pinned}),children:[e.pinned?(0,F.jsx)(Bee,{}):(0,F.jsx)(zee,{}),e.pinned?dqe():mqe()]}),(0,F.jsx)(AJ,{children:_qe()}),(0,F.jsxs)(`div`,{className:`oc-colorgrid`,onClick:e=>e.stopPropagation(),children:[(0,F.jsx)(`button`,{className:`oc-colorgrid__none`,onClick:()=>void m({chatId:e._id,color:null}),"aria-label":bqe(),children:`✕`}),a5.map(t=>(0,F.jsx)(`button`,{className:`oc-colorgrid__dot`+(e.color===t.value?` is-selected`:``),style:{background:t.hue},"aria-label":t.value,onClick:()=>void m({chatId:e._id,color:t.value})},t.value))]}),(0,F.jsx)(jJ,{}),(0,F.jsxs)(kJ,{variant:`destructive`,onSelect:()=>{requestAnimationFrame(async()=>{await g({title:Cqe(),description:Eqe(),confirmLabel:aq(),destructive:!0})&&await f({chatId:e._id})})},children:[(0,F.jsx)(Bm,{}),` `,aq()]})]})]})]}),(0,F.jsx)(Q8,{open:_,onOpenChange:v,title:Mqe(),canSubmit:y.trim().length>0,onSubmit:async()=>{await d({chatId:e._id,title:y.trim()}),v(!1)},children:(0,F.jsx)(`div`,{className:`oc-form`,children:(0,F.jsxs)(`label`,{className:`oc-field`,children:[(0,F.jsx)(`span`,{className:`oc-field__label`,children:Fqe()}),(0,F.jsx)(BJ,{value:y,onChange:e=>b(e.target.value),autoFocus:!0})]})})})]})}var Vvt=RJ(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20`,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 $({className:e,variant:t=`default`,asChild:n=!1,...r}){return(0,F.jsx)(n?By:`span`,{"data-slot":`badge`,"data-variant":t,className:TJ(Vvt({variant:t}),e),...r})}function Hvt(e){let t=new Map;for(let n of e){let e=t.get(n.instanceName);e||(e={instanceName:n.instanceName,kind:n.kind,agents:[]},t.set(n.instanceName,e)),e.agents.push(n)}let n=e=>(e.displayName??e.agentId).toLowerCase();for(let e of t.values())e.agents.sort((e,t)=>e.isDefault===t.isDefault?n(e).localeCompare(n(t)):e.isDefault?-1:1);let r=[...t.values()],i=e=>e.agents.some(e=>e.isDefault);return r.sort((e,t)=>i(e)===i(t)?e.instanceName.localeCompare(t.instanceName):i(e)?-1:1),r}function Uvt(e,t){let n=t.trim().toLowerCase();return n?e.filter(e=>[e.displayName,e.agentId,e.instanceName,e.model].filter(Boolean).some(e=>e.toLowerCase().includes(n))):e}function Wvt({open:e,onOpenChange:t,agents:n,onPick:r}){let[i,a]=(0,M.useState)(``),o=(0,M.useMemo)(()=>Hvt(Uvt(n??[],i)),[n,i]);return(0,F.jsx)(YJ,{open:e,onOpenChange:t,children:(0,F.jsxs)(XJ,{className:`oc-agentpicker`,children:[(0,F.jsxs)(ZJ,{children:[(0,F.jsx)($J,{children:BYe()}),(0,F.jsx)(eY,{children:UYe()})]}),n===void 0?(0,F.jsx)(`p`,{className:`oc-agentpicker__hint`,children:KYe()}):n.length===0?(0,F.jsx)(`p`,{className:`oc-agentpicker__hint`,children:YYe()}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(BJ,{autoFocus:!0,value:i,onChange:e=>a(e.target.value),placeholder:QYe(),className:`oc-agentpicker__search`,"aria-label":tXe()}),(0,F.jsx)(`div`,{className:`oc-agentpicker__list`,role:`listbox`,children:o.map(e=>(0,F.jsxs)(`div`,{className:`oc-agentpicker__group`,children:[(0,F.jsxs)(`div`,{className:`oc-agentpicker__instance`,children:[(0,F.jsx)(Im,{size:13,"aria-hidden":!0}),(0,F.jsx)(`span`,{children:e.instanceName}),(0,F.jsx)($,{variant:`outline`,className:`oc-agentpicker__kind`,children:e.kind})]}),e.agents.map(e=>(0,F.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":!1,className:`oc-agentpicker__item`,onClick:()=>r(e.instanceName,e.agentId),disabled:e.state===`deleted`,title:e.state===`deleted`?iXe():void 0,children:[(0,F.jsx)(mm,{size:15,"aria-hidden":!0,className:`oc-agentpicker__icon`}),(0,F.jsxs)(`span`,{className:`oc-agentpicker__label`,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]}),e.model?(0,F.jsx)(`span`,{className:`oc-agentpicker__model`,children:e.model}):null,e.isDefault?(0,F.jsx)(zm,{size:13,"aria-label":sXe(),className:`oc-agentpicker__default`}):null]},`${e.instanceName}/${e.agentId}`))]},e.instanceName))})]})]})})}function Gvt(e){let t=P(L.chats.createChat),n=N(L.agents.listMyAgents),[r,i]=(0,M.useState)(!1),a=(0,M.useCallback)(async(n,r)=>{e(await t({title:`New chat`,instanceName:n,agentId:r}))},[t,e]);return{startNewChat:(0,M.useCallback)(async()=>{let e=n;if(e&&e.length===1&&e[0].state!==`deleted`){await a(e[0].instanceName,e[0].agentId);return}i(!0)},[n,a]),picker:(0,F.jsx)(Wvt,{open:r,onOpenChange:i,agents:n,onPick:(e,t)=>{i(!1),a(e,t)}})}}var f5=[`admin`,`user`,`pending`];function p5(){let e=N(L.me.authProviders)?.anonymous===!0,[t,n]=(0,M.useState)(!1),r=N(L.dev.listUsersDev,e?{}:`skip`),i=N(L.me.getImpersonation),a=P(L.dev.setMyRole),o=P(L.dev.setRole),s=P(L.admin.startImpersonation),c=P(L.admin.stopImpersonation);if(!e)return null;let l=r?.find(e=>e.isMe),u=l?.role===`admin`,d=i?.impersonating===!0,f=(r??[]).filter(e=>!e.isMe);return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`button`,{type:`button`,className:`oc-devfab`,onClick:()=>n(!0),title:OGe(),children:[(0,F.jsx)(Wm,{size:13}),`DEV`]}),(0,F.jsx)(YJ,{open:t,onOpenChange:n,children:(0,F.jsxs)(XJ,{children:[(0,F.jsxs)(ZJ,{children:[(0,F.jsx)($J,{children:jGe()}),(0,F.jsx)(eY,{children:PGe()})]}),(0,F.jsxs)(`div`,{className:`oc-devsw__me`,children:[(0,F.jsxs)(`span`,{className:`oc-devsw__melabel`,children:[LGe({canonical:l?.canonical??`…`}),` `,(0,F.jsx)($,{variant:`outline`,children:l?.role??`…`})]}),(0,F.jsx)(`div`,{className:`oc-devsw__roles`,children:f5.map(e=>(0,F.jsx)(H,{type:`button`,size:`xs`,variant:l?.role===e?`secondary`:`ghost`,disabled:l?.role===e,onClick:()=>void a({role:e}),children:e===`admin`?BGe():e===`user`?UGe():KGe()},e))})]}),d?(0,F.jsxs)(`div`,{className:`oc-devsw__imp`,children:[YGe(),` `,(0,F.jsx)(`strong`,{children:i.targetLabel}),`.`,(0,F.jsx)(H,{type:`button`,size:`xs`,variant:`outline`,onClick:()=>void c(),children:QGe()})]}):null,(0,F.jsx)(`div`,{className:`oc-devsw__list`,children:f.length===0?(0,F.jsx)(`p`,{className:`oc-devsw__empty`,children:tKe()}):f.map(e=>(0,F.jsxs)(`div`,{className:`oc-devsw__row`,children:[(0,F.jsx)(`span`,{className:`oc-devsw__label`,children:e.name||e.email||e.canonical||e.userId.slice(0,8)}),(0,F.jsx)(`select`,{className:`oc-devsw__select`,value:e.role,disabled:!e.canonical,onChange:t=>e.canonical&&void o({canonical:e.canonical,role:t.target.value}),children:f5.map(e=>(0,F.jsx)(`option`,{value:e,children:e},e))}),(0,F.jsx)(H,{type:`button`,size:`xs`,variant:`ghost`,disabled:!u||e.role===`pending`,title:u?e.role===`pending`?sKe():uKe():iKe(),onClick:()=>{s({profileId:e.profileId}),n(!1)},children:pKe()})]},e.profileId))})]})})]})}function m5({label:e,mode:t,minimal:n=!1}){let{signOut:r}=Lr(),i=P(L.me.setThemeMode).withOptimisticUpdate((e,{mode:t})=>{let n=e.getQuery(L.me.getMe,{host:BO});if(!n)return;let r=t===null?n.defaultThemeMode??`system`:t;e.setQuery(L.me.getMe,{host:BO},{...n,themeMode:t,resolvedThemeMode:r})}),a=t??`default`;return(0,F.jsxs)(EJ,{children:[(0,F.jsx)(DJ,{asChild:!0,children:(0,F.jsxs)(H,{variant:`ghost`,size:`sm`,className:`gap-1.5`,children:[e,(0,F.jsx)(gm,{className:`opacity-60`})]})}),(0,F.jsx)(OJ,{align:`end`,className:`w-52`,children:n?(0,F.jsxs)(kJ,{onClick:()=>void r(),children:[(0,F.jsx)(Am,{}),` `,gk()]}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(AJ,{children:Rme()}),(0,F.jsxs)(xtt,{value:a,onValueChange:e=>void i({mode:e==="default"?null:e}),children:[(0,F.jsxs)(MJ,{value:`light`,children:[(0,F.jsx)(Wee,{}),` `,fk()]}),(0,F.jsxs)(MJ,{value:`dark`,children:[(0,F.jsx)(Nee,{}),` `,pk()]}),(0,F.jsxs)(MJ,{value:`system`,children:[(0,F.jsx)(Mee,{}),` `,mk()]}),(0,F.jsx)(MJ,{value:`default`,children:hk()})]}),(0,F.jsx)(jJ,{}),(0,F.jsxs)(kJ,{onClick:()=>void r(),children:[(0,F.jsx)(Am,{}),` `,gk()]})]})})]})}var Kvt={altered_words:()=>x$e(),incorrect:()=>w$e(),incoherence:()=>D$e(),formatting:()=>A$e(),latency:()=>N$e(),api_error:()=>I$e(),other:()=>z$e()},qvt=e=>Kvt[e]?.()??e,Jvt={anomaly_open:Vm,anomaly_resolved:xm,feedback_reply:jm};function Yvt(e){return e.kind===`feedback_reply`?{title:h$e(),body:v$e()}:{title:e.title,body:e.body}}function Xvt(){let e=N(L.notifications.myUnreadCount)??0,t=N(L.notifications.myNotifications),n=N(L.feedback.myFeedback),r=P(L.notifications.markRead),i=P(L.notifications.markAllRead),a=P(L.notifications.clearOne),o=P(L.notifications.clearAll),s=P(L.feedback.closeMyFeedback),c=cs(),[l,u]=(0,M.useState)(!1),d=e=>{if(e.unread&&r({notificationId:e._id}),!e.href)return;if(u(!1),e.href.startsWith(`/chat/`)){c({to:`/chat/$chatId`,params:{chatId:e.href.slice(6)}});return}let[t,n]=e.href.split(`?`);c({to:t,search:Object.fromEntries(new URLSearchParams(n??``))})};return(0,F.jsxs)(EJ,{open:l,onOpenChange:u,children:[(0,F.jsx)(DJ,{asChild:!0,children:(0,F.jsxs)(`button`,{type:`button`,className:`oc-bell`,"aria-label":e>0?hQe({count:e}):vQe(),children:[(0,F.jsx)(pm,{size:18,"aria-hidden":!0}),e>0?(0,F.jsx)(`span`,{className:`oc-bell__badge`,"aria-hidden":!0,children:e>9?`9+`:e}):null]})}),(0,F.jsxs)(OJ,{align:`end`,className:`oc-notif`,children:[(0,F.jsxs)(`div`,{className:`oc-notif__head`,children:[(0,F.jsx)(`span`,{children:xQe()}),t&&t.length>0?(0,F.jsxs)(`span`,{className:`oc-notif__bulk`,children:[(0,F.jsx)(`button`,{type:`button`,className:`oc-notif__act`,disabled:e===0,onClick:()=>void i({}),children:wQe()}),(0,F.jsx)(`button`,{type:`button`,className:`oc-notif__act`,onClick:()=>void o({}),children:DQe()})]}):null]}),t===void 0?(0,F.jsx)(`div`,{className:`oc-notif__empty`,children:dk()}):t.length===0?(0,F.jsx)(`div`,{className:`oc-notif__empty`,children:AQe()}):(0,F.jsx)(`div`,{className:`oc-notif__list`,children:t.map(e=>{let t=Jvt[e.kind]??pm,{title:n,body:i}=Yvt(e);return(0,F.jsxs)(`div`,{className:`oc-notif__item${e.unread?` is-unread`:``}${e.href?` is-link`:``}`,role:e.href?`button`:void 0,tabIndex:e.href?0:void 0,onClick:e.href?()=>d(e):void 0,children:[(0,F.jsxs)(`div`,{className:`oc-notif__item-head`,children:[(0,F.jsx)(t,{size:14,className:`oc-notif__kind oc-notif__kind--${e.kind}`,"aria-hidden":!0}),(0,F.jsx)(`span`,{className:`oc-notif__title`,children:n}),(0,F.jsxs)(`span`,{className:`oc-notif__row-actions`,children:[e.unread?(0,F.jsx)(`button`,{type:`button`,title:cq(),"aria-label":cq(),onClick:t=>{t.stopPropagation(),r({notificationId:e._id})},children:(0,F.jsx)(hm,{size:13})}):null,(0,F.jsx)(`button`,{type:`button`,title:lq(),"aria-label":lq(),onClick:t=>{t.stopPropagation(),a({notificationId:e._id})},children:(0,F.jsx)(Gm,{size:13})})]})]}),(0,F.jsx)(`p`,{className:`oc-notif__body`,children:i}),(0,F.jsx)(`div`,{className:`oc-notif__when`,children:new Date(e.createdAt).toLocaleString(V())})]},e._id)})}),n&&n.length>0?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`div`,{className:`oc-notif__head oc-notif__head--sub`,children:LQe()}),(0,F.jsx)(`div`,{className:`oc-notif__list`,children:n.map(e=>(0,F.jsx)(Zvt,{it:e,onClose:t=>s({feedbackId:e._id,reason:t}),onNavigate:()=>u(!1)},e._id))})]}):null]})]})}function Zvt({it:e,onClose:t,onNavigate:n}){let r=sY(),[i,a]=(0,M.useState)(!1),[o,s]=(0,M.useState)(!1),[c,l]=(0,M.useState)(``),[u,d]=(0,M.useState)(!1);async function f(){d(!0);try{await t(c.trim()||void 0)}catch(e){r.error(uq(),e)}finally{d(!1)}}return(0,F.jsxs)(`div`,{className:`oc-notif__item`,children:[(0,F.jsxs)(`div`,{className:`oc-notif__item-head`,children:[(0,F.jsx)(`span`,{className:`oc-notif__title`,children:qvt(e.category)}),(0,F.jsx)(`span`,{className:`oc-notif__status${e.answered?` is-answered`:``}`,children:e.answered?BQe():UQe()})]}),(0,F.jsx)(`div`,{className:`oc-notif__when`,children:new Date(e.at).toLocaleString(V())}),e.thread.length>0?(0,F.jsx)(`div`,{className:`oc-notif__thread`,children:e.thread.map((e,t)=>(0,F.jsxs)(`div`,{className:`oc-notif__msg oc-notif__msg--${e.authorRole}`,children:[(0,F.jsx)(`span`,{className:`oc-notif__msg-who`,children:e.authorRole===`admin`?KQe():YQe()}),(0,F.jsx)(`span`,{className:`oc-notif__msg-text`,children:e.text})]},t))}):null,e.messageText?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`button`,{type:`button`,className:`oc-notif__report-toggle`,"aria-expanded":i,onClick:()=>a(e=>!e),children:[i?(0,F.jsx)(gm,{size:13,"aria-hidden":!0}):(0,F.jsx)(_m,{size:13,"aria-hidden":!0}),t$e()]}),i?(0,F.jsx)(`div`,{className:`oc-notif__report-msg`,children:e.messageText}):null]}):null,(0,F.jsxs)(`div`,{className:`oc-notif__report-actions`,children:[(0,F.jsx)(Ss,{to:`/chat/$chatId`,params:{chatId:e.chatId},search:{m:e.messageId},className:`oc-notif__link`,onClick:n,children:QQe()}),o?null:(0,F.jsx)(`button`,{type:`button`,className:`oc-notif__link oc-notif__link--muted`,onClick:()=>s(!0),children:uq()})]}),o?(0,F.jsxs)(`div`,{className:`oc-notif__close-form`,children:[(0,F.jsx)(`textarea`,{className:`oc-notif__close-input`,rows:2,value:c,onChange:e=>l(e.target.value),placeholder:o$e()}),(0,F.jsxs)(`div`,{className:`oc-notif__close-actions`,children:[(0,F.jsx)(`button`,{type:`button`,className:`oc-notif__close-confirm`,disabled:u,onClick:()=>void f(),children:l$e()}),(0,F.jsx)(`button`,{type:`button`,className:`oc-notif__close-cancel`,onClick:()=>{s(!1),l(``)},children:f$e()})]})]}):null]})}var h5={mod:!0,key:`k`},g5={mod:!0,shift:!0,key:`o`};function Qvt(e){return/mac/i.test(e)}function $vt(){if(typeof navigator>`u`)return``;let e=navigator;return e.userAgentData?.platform||e.platform||e.userAgent||``}var _5=null;function v5(){return _5===null&&(_5=Qvt($vt())),_5}function y5(e,t){let n=e.key.toUpperCase();if(t){let t=``;return e.alt&&(t+=`⌥`),e.shift&&(t+=`⇧`),e.mod&&(t+=`⌘`),t+n}let r=[];return e.mod&&r.push(`Ctrl`),e.shift&&r.push(`Shift`),e.alt&&r.push(`Alt`),r.push(n),r.join(`+`)}function b5(e,t){let n=e.metaKey||e.ctrlKey;return!!t.mod!==n||!!t.shift!==e.shiftKey||!!t.alt!==e.altKey?!1:e.key.toLowerCase()===t.key.toLowerCase()}var x5=2,eyt=180;function tyt(){let e=cs(),t=(0,M.useRef)(null),n=(0,M.useRef)(null),[r,i]=(0,M.useState)(!1),[a,o]=(0,M.useState)(``),[s,c]=(0,M.useState)(``),[l,u]=(0,M.useState)(0),d=(0,M.useMemo)(()=>y5(h5,v5()),[]);(0,M.useEffect)(()=>{let e=setTimeout(()=>c(a),eyt);return()=>clearTimeout(e)},[a]);let f=s.trim(),p=N(L.search.searchConversations,f.length>=x5?{query:f}:`skip`),m=p??[],h=f.length>=x5&&p===void 0;(0,M.useEffect)(()=>{let e=e=>{b5(e,h5)&&(e.preventDefault(),i(!0))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),(0,M.useEffect)(()=>{r&&(o(``),c(``),u(0))},[r]),(0,M.useEffect)(()=>{u(0)},[p]),(0,M.useEffect)(()=>{(n.current?.querySelector(`[data-index="${l}"]`))?.scrollIntoView({block:`nearest`})},[l]);let g=(0,M.useCallback)(t=>{i(!1),e({to:`/chat/$chatId`,params:{chatId:t}})},[e]);return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`button`,{type:`button`,className:`oc-search-trigger`,onClick:()=>i(!0),"aria-label":YJe(),children:[(0,F.jsx)(Fm,{className:`oc-search-trigger__icon`,"aria-hidden":!0}),(0,F.jsx)(`span`,{className:`oc-search-trigger__label`,children:QJe()}),(0,F.jsx)(`kbd`,{className:`oc-search-trigger__kbd`,children:d})]}),(0,F.jsx)(YJ,{open:r,onOpenChange:i,children:(0,F.jsxs)(XJ,{showCloseButton:!1,className:`oc-search-palette top-[12vh] translate-y-0 max-w-xl gap-0 overflow-hidden p-0`,onOpenAutoFocus:e=>{e.preventDefault(),t.current?.focus()},children:[(0,F.jsx)($J,{className:`sr-only`,children:tYe()}),(0,F.jsxs)(`div`,{className:`oc-search-palette__head`,children:[(0,F.jsx)(Fm,{className:`oc-search-palette__head-icon`,"aria-hidden":!0}),(0,F.jsx)(`input`,{ref:t,value:a,onChange:e=>o(e.target.value),onKeyDown:e=>{if(e.key===`ArrowDown`)e.preventDefault(),u(e=>Math.min(e+1,m.length-1));else if(e.key===`ArrowUp`)e.preventDefault(),u(e=>Math.max(e-1,0));else if(e.key===`Enter`){e.preventDefault();let t=m[l];t&&g(t.chatId)}},placeholder:iYe(),className:`oc-search-palette__field`,autoComplete:`off`,spellCheck:!1,"aria-label":sYe()})]}),(0,F.jsx)(`div`,{className:`oc-search-palette__results`,ref:n,role:`listbox`,children:f.length<x5?(0,F.jsx)(`div`,{className:`oc-search-palette__hint`,children:uYe({count:x5})}):h?(0,F.jsx)(`div`,{className:`oc-search-palette__hint`,children:pYe()}):m.length===0?(0,F.jsx)(`div`,{className:`oc-search-palette__hint`,children:gYe({term:f})}):m.map((e,t)=>(0,F.jsxs)(`button`,{type:`button`,"data-index":t,role:`option`,"aria-selected":t===l,className:TJ(`oc-search-result`,t===l&&`is-active`),onMouseMove:()=>u(t),onClick:()=>g(e.chatId),children:[(0,F.jsx)(`span`,{className:`oc-search-result__icon`,"aria-hidden":!0,children:e.matchedIn===`title`?(0,F.jsx)(Oee,{size:15}):(0,F.jsx)(jm,{size:15})}),(0,F.jsxs)(`span`,{className:`oc-search-result__body`,children:[(0,F.jsx)(`span`,{className:`oc-search-result__title`,children:e.title||yYe()}),e.snippet?(0,F.jsx)(`span`,{className:`oc-search-result__snippet`,children:e.snippet}):null]}),(0,F.jsx)(`span`,{className:`oc-search-result__tag`,children:e.matchedIn===`title`?SYe():TYe()})]},e.chatId))}),(0,F.jsxs)(`div`,{className:`oc-search-palette__footer`,children:[(0,F.jsxs)(`span`,{children:[(0,F.jsx)(`kbd`,{children:`↑`}),(0,F.jsx)(`kbd`,{children:`↓`}),` `,OYe()]}),(0,F.jsxs)(`span`,{children:[(0,F.jsx)(`kbd`,{children:`↵`}),` `,jYe()]}),(0,F.jsxs)(`span`,{children:[(0,F.jsx)(`kbd`,{children:PYe()}),` `,LYe()]})]})]})})]})}var S5=[`conversational`,`documentary`],nyt=new Set(S5),ryt=`conversational`;function iyt(e){let t=new Set((e??[]).filter(e=>nyt.has(e)));return t.size===0?[ryt]:S5.filter(e=>t.has(e))}function ayt({profileId:e,userLabel:t,open:n,onOpenChange:r}){let i=N(L.agents.listAgentPoolForUser,n&&e?{profileId:e}:`skip`),a=N(L.agents.listUserAgents,n&&e?{profileId:e}:`skip`),o=new Set((a??[]).map(e=>`${e.instanceName}/${e.agentId}`)),s=(a??[]).find(e=>e.isDefault)??null,c=s?`${s.instanceName}/${s.agentId}`:null,l=new Set((i?.agents??[]).map(e=>`${e.instanceName}/${e.agentId}`)),u=[...(i?.agents??[]).map(e=>({...e,outOfPool:!1})),...(a??[]).filter(e=>!l.has(`${e.instanceName}/${e.agentId}`)).map(e=>({instanceName:e.instanceName,agentId:e.agentId,displayName:e.displayName,emoji:e.emoji,model:e.model,kind:e.kind,state:e.state,outOfPool:!0}))],d=new Map;for(let e of u){let t=d.get(e.instanceName)??[];t.push(e),d.set(e.instanceName,t)}return(0,F.jsx)(YJ,{open:n,onOpenChange:r,children:(0,F.jsxs)(XJ,{className:`oc-access`,children:[(0,F.jsxs)(ZJ,{children:[(0,F.jsx)($J,{children:vBe({user:t})}),(0,F.jsx)(eY,{children:xBe()})]}),i?(0,F.jsx)(`p`,{className:`oc-access__hint`,children:i.inGroup?wBe():DBe()}):null,(0,F.jsx)(`div`,{className:`oc-access__list`,children:i===void 0?(0,F.jsx)(`p`,{className:`oc-access__hint`,children:ABe()}):u.length===0?(0,F.jsx)(`p`,{className:`oc-access__hint`,children:zBe()}):[...d.entries()].map(([t,n])=>(0,F.jsx)(oyt,{profileId:e,instanceName:t,kind:n[0].kind,agents:n,assigned:o,defaultKey:c},t))})]})})}function oyt({profileId:e,instanceName:t,kind:n,agents:r,assigned:i,defaultKey:a}){let o=P(L.agents.assignAgent),s=P(L.agents.removeAgent),c=P(L.agents.setDefaultAgent),l=sY();if(!e)return null;async function u(n,r){try{r?await s({profileId:e,instanceName:t,agentId:n}):await o({profileId:e,instanceName:t,agentId:n})}catch(e){l.error(NBe(),e)}}async function d(n){try{await c({profileId:e,instanceName:t,agentId:n})}catch(e){l.error(IBe(),e)}}return(0,F.jsxs)(`div`,{className:`oc-access__group`,children:[(0,F.jsxs)(`div`,{className:`oc-access__instance`,children:[(0,F.jsx)(Im,{size:13,"aria-hidden":!0}),(0,F.jsx)(`span`,{children:t}),(0,F.jsx)($,{variant:`outline`,className:`oc-access__kind`,children:n})]}),r.map(e=>{let n=`${t}/${e.agentId}`,r=i.has(n),o=a===n,s=e.state===`deleted`;return(0,F.jsxs)(`div`,{className:`oc-access__row`,children:[(0,F.jsx)(uY,{checked:r,disabled:s&&!r,onCheckedChange:()=>void u(e.agentId,r),"aria-label":HBe({name:e.displayName??e.agentId})}),(0,F.jsxs)(`span`,{className:`oc-access__label`,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]}),e.model?(0,F.jsx)(`span`,{className:`oc-access__model`,children:e.model}):null,s?(0,F.jsx)($,{variant:`outline`,className:`oc-access__gone`,children:GBe()}):null,e.outOfPool?(0,F.jsx)($,{variant:`outline`,className:`oc-access__gone`,children:JBe()}):null,r?o?(0,F.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":qK(),title:qK(),children:(0,F.jsx)(zm,{size:14,fill:`currentColor`})}):(0,F.jsx)(H,{type:`button`,size:`icon-sm`,variant:`ghost`,className:`oc-access__setdefault`,"aria-label":JK(),title:JK(),onClick:()=>void d(e.agentId),children:(0,F.jsx)(zm,{size:14})}):null]},e.agentId)})]})}function syt(e,t){return typeof e==`number`&&typeof t==`number`?e-t:typeof e==`boolean`&&typeof t==`boolean`?!!e-+!!t:String(e).localeCompare(String(t),void 0,{numeric:!0,sensitivity:`base`})}function cyt(e,t,n){return[...e].sort((e,r)=>{let i=t(e),a=t(r),o=i==null,s=a==null;if(o||s)return o&&s?0:o?1:-1;let c=syt(i,a);return n===`asc`?c:-c})}function C5({className:e,...t}){return(0,F.jsx)(`div`,{"data-slot":`table-container`,className:`relative w-full overflow-x-auto`,children:(0,F.jsx)(`table`,{"data-slot":`table`,className:TJ(`w-full caption-bottom text-sm`,e),...t})})}function w5({className:e,...t}){return(0,F.jsx)(`thead`,{"data-slot":`table-header`,className:TJ(`[&_tr]:border-b`,e),...t})}function T5({className:e,...t}){return(0,F.jsx)(`tbody`,{"data-slot":`table-body`,className:TJ(`[&_tr:last-child]:border-0`,e),...t})}function E5({className:e,...t}){return(0,F.jsx)(`tr`,{"data-slot":`table-row`,className:TJ(`border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted`,e),...t})}function D5({className:e,...t}){return(0,F.jsx)(`th`,{"data-slot":`table-head`,className:TJ(`h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0`,e),...t})}function O5({className:e,...t}){return(0,F.jsx)(`td`,{"data-slot":`table-cell`,className:TJ(`p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0`,e),...t})}function k5({title:e,rows:t,columns:n,rowActions:r,onAdd:i,addLabel:a=gXe(),bulkActions:o,emptyHint:s=yXe(),isExpanded:c,renderExpanded:l}){let[u,d]=(0,M.useState)(new Set),[f,p]=(0,M.useState)(null),m=t??[],h=f?n[f.index]:void 0,g=f&&h?.sort?cyt(m,h.sort,f.dir):m;function _(e){p(t=>!t||t.index!==e?{index:e,dir:`asc`}:t.dir===`asc`?{index:e,dir:`desc`}:null)}let v=+!!o+n.length+ +!!r,y=m.length>0&&u.size===m.length,b=u.size>0&&!y;function x(){d(y?new Set:new Set(m.map(e=>e._id)))}function S(e){d(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}return(0,F.jsxs)(`div`,{className:`oc-dt`,children:[(0,F.jsxs)(`div`,{className:`oc-dt__bar`,children:[(0,F.jsx)(`h2`,{className:`oc-dt__title`,children:e}),(0,F.jsxs)(`div`,{className:`oc-dt__bar-actions`,children:[u.size>0&&o?o.map(e=>(0,F.jsxs)(H,{size:`sm`,variant:e.variant===`destructive`?`destructive`:`outline`,onClick:()=>{e.onSelect([...u]),d(new Set)},children:[e.variant===`destructive`?(0,F.jsx)(Bm,{}):null,e.label,` (`,u.size,`)`]},e.label)):null,i?(0,F.jsxs)(H,{size:`sm`,onClick:i,children:[(0,F.jsx)(Nm,{}),` `,a]}):null]})]}),t===void 0?(0,F.jsx)(`p`,{className:`oc-admin__hint`,children:SXe()}):m.length===0?(0,F.jsx)(`p`,{className:`oc-admin__hint`,children:s}):(0,F.jsxs)(C5,{children:[(0,F.jsx)(w5,{children:(0,F.jsxs)(E5,{children:[o?(0,F.jsx)(D5,{className:`w-8`,children:(0,F.jsx)(uY,{"aria-label":TXe(),checked:y?!0:b?`indeterminate`:!1,onCheckedChange:x})}):null,n.map((e,t)=>{let n=f?.index===t;return e.sort?(0,F.jsx)(D5,{className:e.className,"aria-sort":n?f.dir===`asc`?`ascending`:`descending`:`none`,children:(0,F.jsxs)(`button`,{type:`button`,className:`oc-dt__sort`,onClick:()=>_(t),"aria-label":PXe({column:e.header}),children:[e.header,n?f.dir===`asc`?(0,F.jsx)(vm,{className:`oc-dt__sort-icon`,"aria-hidden":!0}):(0,F.jsx)(gm,{className:`oc-dt__sort-icon`,"aria-hidden":!0}):(0,F.jsx)(ym,{className:`oc-dt__sort-icon oc-dt__sort-icon--idle`,"aria-hidden":!0})]})},e.header):(0,F.jsx)(D5,{className:e.className,children:e.header},e.header)}),r?(0,F.jsx)(D5,{className:`w-8`}):null]})}),(0,F.jsx)(T5,{children:g.map(e=>{let t=r?.(e)??[],i=c?.(e)??!1;return(0,F.jsxs)(M.Fragment,{children:[(0,F.jsxs)(E5,{className:`group/row`,children:[o?(0,F.jsx)(O5,{children:(0,F.jsx)(uY,{"aria-label":OXe(),checked:u.has(e._id),onCheckedChange:()=>S(e._id)})}):null,n.map(t=>(0,F.jsx)(O5,{className:t.className,children:t.cell(e)},t.header)),r?(0,F.jsx)(O5,{children:t.length>0?(0,F.jsxs)(EJ,{children:[(0,F.jsx)(DJ,{asChild:!0,children:(0,F.jsx)(H,{variant:`ghost`,size:`icon-sm`,"aria-label":jXe(),className:`opacity-0 transition-opacity group-hover/row:opacity-100 group-focus-within/row:opacity-100 aria-expanded:opacity-100`,children:(0,F.jsx)(wm,{})})}),(0,F.jsx)(OJ,{align:`end`,children:t.map((t,n)=>(0,F.jsxs)(`div`,{children:[t.variant===`destructive`&&n>0?(0,F.jsx)(jJ,{}):null,(0,F.jsx)(kJ,{variant:t.variant,onSelect:()=>t.onSelect(e),children:t.label})]},t.label))})]}):null}):null]}),i&&l?(0,F.jsx)(E5,{className:`oc-dt__expansion`,children:(0,F.jsx)(O5,{colSpan:v,className:`oc-dt__expansion-cell`,children:l(e)})}):null]},e._id)})})]})]})}function A5({icon:e,total:t,items:n}){if(t===0)return(0,F.jsxs)($,{variant:`outline`,className:`oc-group-chip oc-group-chip--empty gap-1`,children:[e,`0`]});let r=t-n.length;return(0,F.jsxs)(`div`,{className:`oc-group-detail`,children:[n.map((e,t)=>(0,F.jsxs)($,{variant:e.highlight?`secondary`:`outline`,className:`oc-group-chip gap-1`,title:e.label,children:[e.marker,(0,F.jsx)(`span`,{className:`oc-group-chip__txt`,children:e.label})]},t)),r>0?(0,F.jsxs)($,{variant:`outline`,className:`oc-group-chip`,children:[`+`,r]}):null]})}function j5({delayDuration:e=0,...t}){return(0,F.jsx)(lfe,{"data-slot":`tooltip-provider`,delayDuration:e,...t})}function M5({...e}){return(0,F.jsx)(ufe,{"data-slot":`tooltip`,...e})}function N5({...e}){return(0,F.jsx)(dfe,{"data-slot":`tooltip-trigger`,...e})}function P5({className:e,sideOffset:t=0,children:n,...r}){return(0,F.jsx)(ffe,{children:(0,F.jsxs)(pfe,{"data-slot":`tooltip-content`,sideOffset:t,className:TJ(`z-50 inline-flex w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r,children:[n,(0,F.jsx)(mfe,{className:`z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground`})]})})}var F5={AGENT_NOT_FOUND:()=>({label:LXe(),hint:BXe()}),AUTH_TOKEN_MISMATCH:()=>({label:UXe(),hint:KXe()}),DEVICE_SIGNING_FAILED:()=>({label:YXe(),hint:QXe()}),SESSION_SCOPE_DENIED:()=>({label:tZe(),hint:iZe()}),GATEWAY_TIMEOUT:()=>({label:sZe(),hint:uZe()}),GATEWAY_DISCONNECTED:()=>({label:fZe(),hint:hZe()}),ATTACHMENT_TOO_LARGE:()=>({label:wZe(),hint:DZe()}),ATTACHMENT_REJECTED:()=>({label:AZe(),hint:NZe()}),BRIDGE_UNREACHABLE:()=>({label:vZe(),hint:xZe()}),INVALID_REQUEST:()=>({label:IZe(),hint:zZe()}),NOT_CONFIGURED:()=>({label:HZe(),hint:GZe()}),UNROUTED:()=>({label:JZe(),hint:ZZe()}),UPSTREAM_ERROR:()=>({label:eQe(),hint:rQe()}),UNKNOWN:()=>({label:oQe(),hint:lQe()})};function I5(e){return e?F5[e]?.()??{label:e,hint:fQe()}:F5.UNKNOWN()}var lyt=[`gateway-http`,`shared-fs`,`off`],uyt=[`inline`,`shared-fs`];Ue.object({mediaMode:Ue.optional(Ue.union(Ue.literal(`gateway-http`),Ue.literal(`shared-fs`),Ue.literal(`off`))),inboundMediaMode:Ue.optional(Ue.union(Ue.literal(`inline`),Ue.literal(`shared-fs`))),rehydration:Ue.optional(Ue.boolean()),mediaMaxMb:Ue.optional(Ue.number()),inboundAgentMount:Ue.optional(Ue.string()),outboundAgentMount:Ue.optional(Ue.string())});var L5={mediaMode:`gateway-http`,inboundMediaMode:`inline`,rehydration:!0,mediaMaxMb:1024,inboundAgentMount:`/home/node/.openclaw/media/inbound`,outboundAgentMount:`/home/node/.openclaw/media/outbound`};function dyt(e){return{mediaMode:e.mediaMode??L5.mediaMode,inboundMediaMode:e.inboundMediaMode??L5.inboundMediaMode,rehydration:e.rehydration??L5.rehydration,mediaMaxMb:e.mediaMaxMb??L5.mediaMaxMb,inboundAgentMount:e.inboundAgentMount??L5.inboundAgentMount,outboundAgentMount:e.outboundAgentMount??L5.outboundAgentMount}}function fyt(e,t){let n={},r=r=>{(e[r]!==L5[r]||t[r]!==void 0)&&(n[r]=e[r])};return r(`mediaMode`),r(`inboundMediaMode`),r(`rehydration`),r(`mediaMaxMb`),r(`inboundAgentMount`),r(`outboundAgentMount`),n}var R5=e=>typeof e==`string`?e:null;function z5(e){return/^\d+\.\d+\.\d+$/.test(e)?e.split(`.`).map(e=>Number.parseInt(e,10)):null}function B5(e,t){let n=z5(e),r=z5(t);if(n===null||r===null)return null;for(let e=0;e<3;e++){let t=n[e]-r[e];if(t!==0)return t}return 0}function pyt(e,t){if(e===null||t===null)return!1;let n=B5(t,e.min);return n!==null&&n>=0}function V5(e,t){let n={range:null,validatedVersions:[]};if(typeof e!=`object`||!e)return n;let r=e.providers;if(typeof r!=`object`||!r)return n;let i=r[t];if(typeof i!=`object`||!i)return n;let a=i,o=null;if(typeof a.supportedRange==`object`&&a.supportedRange!==null){let e=a.supportedRange,t=R5(e.min),n=R5(e.maxValidated);t!==null&&n!==null&&(o={min:t,maxValidated:n})}let s=Array.isArray(a.validatedVersions)?a.validatedVersions.filter(e=>typeof e==`string`):[];return{range:o,validatedVersions:s}}function myt(e,t,n){if(e===null)return`unknown`;let{range:r}=V5(n,t);return pyt(r,e)?r!==null&&(B5(e,r.maxValidated)??0)>0?`beyond`:`supported`:`unknown`}function H5(e){return e===`supported`?set():e===`beyond`?det():met()}function U5(e){return e??Nq()}function W5(e){return e===null?wet():bet({version:e})}function hyt(e,t){if(typeof e!=`object`||!e)return!1;let n=e.providers;return typeof n!=`object`||!n?!1:t in n}function G5(e){return e.filter(e=>e.state===`error`)}function gyt(e){return e.reachable&&G5(e.targets).length===0}function _yt(e){return e.state===`error`&&e.lastErrorCode!==null}function vyt(e){return!!e.lastDownstreamRejectCode}function K5(e){return e.kind??`openclaw`}function yyt(e){return[...e].sort((e,t)=>e===`openclaw`?-1:t===`openclaw`?1:e.localeCompare(t))}function byt(e,t,n){let r=new Map;for(let e of t)e.instanceName&&r.set(e.instanceName,e.provider);for(let e of n)r.set(e.name,K5(e));let i=e=>(e.instanceName?r.get(e.instanceName):void 0)??`openclaw`,a=new Set;for(let e of n)a.add(K5(e));for(let e of t)a.add(e.provider);for(let t of e)a.add(i(t));return yyt(a).map(r=>({key:r,connections:e.filter(e=>i(e)===r),compatTargets:t.filter(e=>e.provider===r),instances:n.filter(e=>K5(e)===r)}))}function xyt(e){return e===`openclaw`?`OpenClaw`:e===`hermes`?`Hermes`:e.charAt(0).toUpperCase()+e.slice(1)}var q5={s:1e3,m:6e4,h:36e5,d:864e5,w:6048e5};function J5(e,t){let n=e.trim();if(n===`now`)return t;let r=/^now-(\d+)([smhdw])$/.exec(n);if(r===null)return null;let i=Number(r[1]),a=q5[r[2]];return!Number.isFinite(i)||a===void 0?null:t-i*a}function Y5(e,t=Date.now()){return e.kind===`absolute`?{from:e.from,to:e.to}:{from:J5(e.from,t)??t-q5.h,to:J5(e.to,t)??t}}var X5=[{label:iWe(),from:`now-5m`},{label:sWe(),from:`now-15m`},{label:uWe(),from:`now-30m`},{label:pWe(),from:`now-1h`},{label:gWe(),from:`now-3h`},{label:yWe(),from:`now-6h`},{label:SWe(),from:`now-12h`},{label:TWe(),from:`now-24h`},{label:OWe(),from:`now-2d`},{label:jWe(),from:`now-7d`},{label:PWe(),from:`now-30d`},{label:LWe(),from:`now-90d`}];function Z5(e){return new Date(e).toLocaleString(`fr-FR`,{day:`2-digit`,month:`2-digit`,hour:`2-digit`,minute:`2-digit`})}function Syt(e){if(e.kind===`relative`){let t=X5.find(t=>t.from===e.from&&e.to===`now`);return t?t.label:`${e.from} → ${e.to}`}return`${Z5(e.from)} → ${Z5(e.to)}`}function Q5(e){let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())}T${n(t.getHours())}:${n(t.getMinutes())}`}function $5(e){if(e===``)return null;let t=new Date(e).getTime();return Number.isNaN(t)?null:t}function Cyt(e){let t=e.trim();return t===`true`?!0:t===`false`?!1:t!==``&&Number.isFinite(Number(t))?Number(t):e}function e7(e){let[t,n]=(0,M.useState)(0);return(0,M.useEffect)(()=>{if(e.kind!==`relative`)return;let t=window.setInterval(()=>n(e=>e+1),3e4);return()=>window.clearInterval(t)},[e.kind]),(0,M.useMemo)(()=>{let{from:t,to:n}=Y5(e);return e.kind===`absolute`?{from:t,to:n}:{from:t7(t),to:t7(n)}},[e,t])}function t7(e){return Math.floor(e/6e4)*6e4}function n7({value:e,onChange:t}){let[n,r]=(0,M.useState)(!1),[i,a]=(0,M.useState)(``),o=Y5(e),[s,c]=(0,M.useState)(()=>Q5(o.from)),[l,u]=(0,M.useState)(()=>Q5(o.to));function d(t){if(t){let t=Y5(e);c(Q5(t.from)),u(Q5(t.to)),a(``)}r(t)}function f(e){t({kind:`relative`,from:e,to:`now`}),r(!1)}function p(){let e=$5(s),n=$5(l);e===null||n===null||(t({kind:`absolute`,from:e,to:n}),r(!1))}let m=(0,M.useMemo)(()=>{let e=i.trim().toLowerCase();return e===``?X5:X5.filter(t=>t.label.toLowerCase().includes(e)||t.from.toLowerCase().includes(e))},[i]),h=$5(s)!==null&&$5(l)!==null;return(0,F.jsxs)(VT,{open:n,onOpenChange:d,children:[(0,F.jsx)(HT,{asChild:!0,children:(0,F.jsxs)(H,{variant:`outline`,size:`sm`,className:`oc-timerange__trigger`,children:[(0,F.jsx)(Cee,{}),Syt(e)]})}),(0,F.jsx)(UT,{children:(0,F.jsx)(WT,{align:`end`,sideOffset:6,className:`oc-timerange__panel z-50 rounded-lg border border-border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95`,children:(0,F.jsxs)(`div`,{className:`oc-timerange__cols`,children:[(0,F.jsxs)(`div`,{className:`oc-timerange__absolute`,children:[(0,F.jsx)(`div`,{className:`oc-timerange__section-title`,children:`Plage absolue`}),(0,F.jsxs)(`label`,{className:`oc-field`,children:[(0,F.jsx)(`span`,{className:`oc-field__label`,children:`De`}),(0,F.jsx)(BJ,{type:`datetime-local`,value:s,onChange:e=>c(e.target.value)})]}),(0,F.jsxs)(`label`,{className:`oc-field`,children:[(0,F.jsx)(`span`,{className:`oc-field__label`,children:`À`}),(0,F.jsx)(BJ,{type:`datetime-local`,value:l,onChange:e=>u(e.target.value)})]}),(0,F.jsx)(H,{size:`sm`,className:`oc-timerange__apply`,disabled:!h,onClick:p,children:`Appliquer`})]}),(0,F.jsxs)(`div`,{className:`oc-timerange__relative`,children:[(0,F.jsxs)(`div`,{className:`oc-timerange__search`,children:[(0,F.jsx)(Fm,{className:`oc-timerange__search-icon`,"aria-hidden":!0}),(0,F.jsx)(BJ,{value:i,onChange:e=>a(e.target.value),placeholder:`Rechercher une plage`,"aria-label":`Rechercher une plage relative`})]}),(0,F.jsx)(`ul`,{className:`oc-timerange__list`,children:m.length===0?(0,F.jsx)(`li`,{className:`oc-timerange__empty`,children:`Aucune plage.`}):m.map(t=>(0,F.jsx)(`li`,{children:(0,F.jsx)(`button`,{type:`button`,className:`oc-timerange__option`+(e.kind===`relative`&&e.from===t.from&&e.to===`now`?` is-active`:``),onClick:()=>f(t.from),children:t.label})},t.from))})]})]})})})]})}var wyt=250;function r7({q:e,onQChange:t,searchPlaceholder:n=uXe(),children:r,timeRange:i,onTimeRangeChange:a,onReset:o,canReset:s=!0}){let[c,l]=(0,M.useState)(e);(0,M.useEffect)(()=>{l(e)},[e]);let u=(0,M.useRef)(null);function d(e){l(e),u.current!==null&&window.clearTimeout(u.current),u.current=window.setTimeout(()=>t(e),wyt)}(0,M.useEffect)(()=>()=>{u.current!==null&&window.clearTimeout(u.current)},[]);function f(){u.current!==null&&window.clearTimeout(u.current),o()}return(0,F.jsxs)(`div`,{className:`oc-filterbar`,children:[(0,F.jsxs)(`div`,{className:`oc-filterbar__search`,children:[(0,F.jsx)(Fm,{className:`oc-filterbar__search-icon`,"aria-hidden":!0}),(0,F.jsx)(BJ,{value:c,onChange:e=>d(e.target.value),placeholder:n,"aria-label":n})]}),r?(0,F.jsx)(`div`,{className:`oc-filterbar__quick`,children:r}):null,i&&a?(0,F.jsx)(n7,{value:i,onChange:a}):null,(0,F.jsxs)(H,{variant:`ghost`,size:`sm`,className:`oc-filterbar__reset`,onClick:f,disabled:!s,children:[(0,F.jsx)(Pm,{}),pXe()]})]})}var i7=`__all__`,a7={q:``,state:i7,instance:i7,version:i7},o7={connected:0,error:1,idle:2};function Tyt(e){return e.q.trim()!==``||e.state!==`__all__`||e.instance!==`__all__`||e.version!==`__all__`}function Eyt(e,t){let n=t.q.trim().toLowerCase();return e.filter(e=>!(n&&!`${e.targetLabel} ${e.gatewayHost}`.toLowerCase().includes(n)||t.state!==`__all__`&&e.state!==t.state||t.instance!==`__all__`&&(e.instanceName??``)!==t.instance||t.version!==`__all__`&&(e.gatewayVersion??``)!==t.version))}function s7(e,t){return e.localeCompare(t,void 0,{numeric:!0,sensitivity:`base`})}function c7(e,t){return e===`version`?t.gatewayVersion===null:e===`lastOk`?t.lastOkAt===null:!1}function Dyt(e,t,n){switch(e){case`state`:return(o7[t.state]??99)-(o7[n.state]??99);case`instance`:return s7(t.instanceLabel??t.instanceName??``,n.instanceLabel??n.instanceName??``);case`host`:return s7(t.gatewayHost,n.gatewayHost);case`version`:{let e=t.gatewayVersion,r=n.gatewayVersion;return B5(e,r)??s7(e,r)}case`lastOk`:return t.lastOkAt-n.lastOkAt;default:return s7(t.targetLabel,n.targetLabel)}}function Oyt(e,t){if(!t)return e;let n=t.dir===`asc`?1:-1;return[...e].sort((e,r)=>{let i=c7(t.key,e),a=c7(t.key,r);return i&&a?0:i?1:a?-1:n*Dyt(t.key,e,r)})}function kyt(e){let t=new Set;for(let n of e)t.add(n.state);return[...t].sort((e,t)=>(o7[e]??99)-(o7[t]??99))}function Ayt(e){let t=new Map;for(let n of e)n.instanceName!==null&&(t.has(n.instanceName)||t.set(n.instanceName,n.instanceLabel??n.instanceName));return[...t.entries()].map(([e,t])=>({name:e,label:t})).sort((e,t)=>s7(e.label,t.label))}function jyt(e){let t=new Set;for(let n of e)n.gatewayVersion!==null&&t.add(n.gatewayVersion);return[...t].sort((e,t)=>B5(e,t)??s7(e,t))}function Myt({connections:e,displayByInstance:t}){let[n,r]=(0,M.useState)(a7),[i,a]=(0,M.useState)(null),o=(0,M.useMemo)(()=>e.map((e,n)=>({_id:`${e.key}:${e.canonical}/${e.agentId}:${n}`,targetLabel:`${e.canonical}/${e.agentId}`,state:e.state,instanceName:e.instanceName??null,instanceLabel:e.instanceName?t.get(e.instanceName)??e.instanceName:null,gatewayHost:e.gatewayHost,gatewayVersion:e.gatewayVersion??null,okCount:e.okCount,errorCount:e.errorCount,attempts:e.attempts,lastOkAt:e.lastOkAt??null,lastErrorCode:e.lastErrorCode??null,lastErrorAt:e.lastErrorAt??null,lastDownstreamRejectCode:e.lastDownstreamRejectCode??null,lastDownstreamRejectAt:e.lastDownstreamRejectAt??null})),[e,t]),s=(0,M.useMemo)(()=>kyt(o),[o]),c=(0,M.useMemo)(()=>Ayt(o),[o]),l=(0,M.useMemo)(()=>jyt(o),[o]),u=(0,M.useMemo)(()=>Oyt(Eyt(o,n),i),[o,n,i]);function d(e){a(t=>t?.key===e?t.dir===`asc`?{key:e,dir:`desc`}:null:{key:e,dir:`asc`})}return e.length===0?(0,F.jsx)(`p`,{className:`oc-admin__hint`,children:aUe()}):(0,F.jsxs)(`div`,{className:`oc-conn`,children:[(0,F.jsxs)(r7,{q:n.q,onQChange:e=>r(t=>({...t,q:e})),searchPlaceholder:mUe(),onReset:()=>r(a7),canReset:Tyt(n),children:[(0,F.jsxs)(C3,{value:n.state,onValueChange:e=>r(t=>({...t,state:e})),children:[(0,F.jsx)(T3,{size:`sm`,className:`w-36`,children:(0,F.jsx)(w3,{placeholder:yUe()})}),(0,F.jsxs)(E3,{children:[(0,F.jsx)(Q,{value:i7,children:ZK()}),s.map(e=>(0,F.jsx)(Q,{value:e,children:Pyt(e)},e))]})]}),(0,F.jsxs)(C3,{value:n.instance,onValueChange:e=>r(t=>({...t,instance:e})),children:[(0,F.jsx)(T3,{size:`sm`,className:`w-40`,children:(0,F.jsx)(w3,{placeholder:SUe()})}),(0,F.jsxs)(E3,{children:[(0,F.jsx)(Q,{value:i7,children:ZK()}),c.map(e=>(0,F.jsx)(Q,{value:e.name,children:e.label},e.name))]})]}),(0,F.jsxs)(C3,{value:n.version,onValueChange:e=>r(t=>({...t,version:e})),children:[(0,F.jsx)(T3,{size:`sm`,className:`w-36`,children:(0,F.jsx)(w3,{placeholder:TUe()})}),(0,F.jsxs)(E3,{children:[(0,F.jsx)(Q,{value:i7,children:ZK()}),l.map(e=>(0,F.jsx)(Q,{value:e,children:e},e))]})]})]}),u.length===0?(0,F.jsx)(`p`,{className:`oc-admin__hint`,children:OUe()}):(0,F.jsxs)(C5,{className:`oc-conn__table`,children:[(0,F.jsx)(w5,{children:(0,F.jsxs)(E5,{children:[(0,F.jsx)(l7,{label:jUe(),sortKey:`target`,sort:i,onSort:d}),(0,F.jsx)(l7,{label:PUe(),sortKey:`state`,sort:i,onSort:d}),(0,F.jsx)(l7,{label:LUe(),sortKey:`instance`,sort:i,onSort:d}),(0,F.jsx)(l7,{label:BUe(),sortKey:`host`,sort:i,onSort:d}),(0,F.jsx)(l7,{label:UUe(),sortKey:`version`,sort:i,onSort:d}),(0,F.jsx)(D5,{children:KUe()}),(0,F.jsx)(l7,{label:YUe(),sortKey:`lastOk`,sort:i,onSort:d})]})}),(0,F.jsx)(T5,{children:u.map(e=>(0,F.jsx)(Nyt,{r:e},e._id))})]})]})}function l7({label:e,sortKey:t,sort:n,onSort:r}){let i=n?.key===t,a=i?n.dir:null;return(0,F.jsx)(D5,{"aria-sort":i?a===`asc`?`ascending`:`descending`:`none`,children:(0,F.jsxs)(`button`,{type:`button`,className:`oc-conn__sort`,onClick:()=>r(t),children:[e,i?a===`asc`?(0,F.jsx)(vm,{size:13,"aria-hidden":!0}):(0,F.jsx)(gm,{size:13,"aria-hidden":!0}):(0,F.jsx)(ym,{size:13,"aria-hidden":!0,className:`oc-conn__sort-idle`})]})})}function Nyt({r:e}){let t=_yt(e)?I5(e.lastErrorCode):null,n=vyt(e)?I5(e.lastDownstreamRejectCode):null;return(0,F.jsxs)(M.Fragment,{children:[(0,F.jsxs)(E5,{className:`oc-conn__row oc-conn__row--${e.state}`,children:[(0,F.jsx)(O5,{children:(0,F.jsx)(`code`,{className:`oc-traces__mono`,children:e.targetLabel})}),(0,F.jsx)(O5,{children:(0,F.jsx)(Fyt,{state:e.state})}),(0,F.jsx)(O5,{children:e.instanceLabel?(0,F.jsx)(`span`,{className:`oc-bridge-target__instance`,children:e.instanceLabel}):(0,F.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}),(0,F.jsx)(O5,{children:(0,F.jsx)(`span`,{className:`oc-bridge-target__host`,children:e.gatewayHost})}),(0,F.jsx)(O5,{children:e.gatewayVersion?(0,F.jsx)(`span`,{className:`oc-bridge-target__version`,children:e.gatewayVersion}):(0,F.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}),(0,F.jsx)(O5,{children:(0,F.jsx)(`span`,{className:`oc-conn__stats`,children:cUe({ok:e.okCount,errors:e.errorCount,attempts:e.attempts})})}),(0,F.jsx)(O5,{children:e.lastOkAt?(0,F.jsx)(`span`,{className:`oc-traces__mono`,children:new Date(e.lastOkAt).toLocaleTimeString(`fr-FR`)}):(0,F.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})})]}),t||n?(0,F.jsx)(E5,{className:`oc-conn__detail-row`,children:(0,F.jsxs)(O5,{colSpan:7,className:`oc-conn__detail-cell`,children:[t?(0,F.jsxs)(`div`,{className:`oc-bridge-target__error`,children:[(0,F.jsx)(`strong`,{children:t.label}),` `,(0,F.jsx)(`code`,{className:`oc-traces__mono`,children:e.lastErrorCode}),e.lastErrorAt?` · ${new Date(e.lastErrorAt).toLocaleTimeString(`fr-FR`)}`:``,(0,F.jsx)(`p`,{className:`oc-bridge-card__hint`,children:t.hint})]}):null,n?(0,F.jsxs)(`div`,{className:`oc-bridge-target__downstream`,children:[dUe({label:n.label}),` `,(0,F.jsx)(`code`,{className:`oc-traces__mono`,children:e.lastDownstreamRejectCode}),e.lastDownstreamRejectAt?` · ${new Date(e.lastDownstreamRejectAt).toLocaleTimeString(`fr-FR`)}`:``]}):null]})}):null]})}function Pyt(e){return e===`connected`?QK():e===`error`?$K():eq()}function Fyt({state:e}){return e===`connected`?(0,F.jsx)($,{variant:`secondary`,children:QK()}):e===`error`?(0,F.jsx)($,{variant:`destructive`,children:$K()}):(0,F.jsx)($,{variant:`outline`,children:eq()})}function Iyt(){return N(L.bridgeHealth.getBridgeHealth,{})}function Lyt(){let e=Iyt(),t=N(L.compat.getBridgeCompat,{}),n=N(L.me.getMe,{host:BO})?.role===`admin`,r=N(L.admin.listInstances,n?{}:`skip`),i=cs(),a=()=>void i({to:`/settings/anomalies`,search:{status:`open`}}),o=byt(e?e.targets:[],t?t.targets:[],r??[]),s=t?.compat??null,c=t===void 0?`loading`:t===null?`nodata`:`ready`,l=s!==null&&hyt(s,`hermes`)&&!o.some(e=>e.key===`hermes`);return(0,F.jsxs)(`div`,{className:`oc-bridge`,children:[(0,F.jsx)(Ryt,{health:e,compat:t,onSeeAnomalies:a}),(0,F.jsx)(`p`,{className:`oc-admin__hint oc-bridge__caption`,children:AHe()}),o.map(e=>(0,F.jsx)(zyt,{providerKey:e.key,connections:e.connections,instances:e.instances,manifest:s,compatStatus:c,compatReachable:t?.reachable??!0},e.key)),l?(0,F.jsx)(`p`,{className:`oc-admin__hint`,children:_et()}):null]})}function Ryt({health:e,compat:t,onSeeAnomalies:n}){let r=t&&t!==null?(0,F.jsxs)(`span`,{className:`oc-bridge-card__ver`,children:[(0,F.jsx)(`code`,{className:`oc-traces__mono`,children:U5(t.bridgeVersion)}),` · `,M9e(),` `,(0,F.jsx)(`code`,{className:`oc-traces__mono`,children:t.protocolVersion===null?Nq():String(t.protocolVersion)})]}):null;if(e===void 0)return(0,F.jsx)(`p`,{className:`oc-admin__hint`,children:XK()});if(e===null)return(0,F.jsx)(`div`,{className:`oc-bridge-card oc-bridge-card--idle`,children:FHe()});let i=G5(e.targets),a=!e.reachable,o=gyt(e),s=o?`ok`:`error`,c=new Date(e.checkedAt).toLocaleString(`fr-FR`),l=e.startedAt==null?null:new Date(e.startedAt).toLocaleString(`fr-FR`);return(0,F.jsxs)(`div`,{className:`oc-bridge-card oc-bridge-card--${s}`,children:[(0,F.jsx)(`div`,{className:`oc-bridge-card__icon`,"aria-hidden":!0,children:o?(0,F.jsx)(xm,{size:22}):a?(0,F.jsx)(Gee,{size:22}):(0,F.jsx)(Vm,{size:22})}),(0,F.jsxs)(`div`,{className:`oc-bridge-card__body`,children:[(0,F.jsx)(`div`,{className:`oc-bridge-card__title`,children:o?RHe():a?VHe():WHe({count:i.length})}),(0,F.jsxs)(`div`,{className:`oc-bridge-card__meta`,children:[(0,F.jsxs)(`span`,{children:[(0,F.jsx)(Vee,{size:12,"aria-hidden":!0}),` `,qHe({time:c})]}),l?(0,F.jsx)(`span`,{children:XHe({time:l})}):null,r]}),a?(0,F.jsx)(`p`,{className:`oc-bridge-card__hint`,children:I5(e.lastError===`not_configured`?`NOT_CONFIGURED`:`BRIDGE_UNREACHABLE`).hint}):null]}),(0,F.jsx)(`button`,{type:`button`,className:`oc-bridgebar__drill`,onClick:n,children:$He()})]})}function zyt({providerKey:e,connections:t,instances:n,manifest:r,compatStatus:i,compatReachable:a}){let o=r?V5(r,e):null,s=new Map;for(let e of n)s.set(e.name,e.displayName??e.name);let c=[],l=new Set;for(let n of t){if(!n.instanceName||l.has(n.instanceName))continue;l.add(n.instanceName);let t=n.gatewayVersion??null;c.push({instanceName:n.instanceName,displayName:s.get(n.instanceName)??n.instanceName,version:t,state:myt(t,e,r)})}let u=c.map(e=>e.state),d=u.includes(`beyond`)?`beyond`:u.length>0&&u.every(e=>e===`supported`)?`supported`:null,[f,p]=(0,M.useState)(!1),[m,h]=(0,M.useState)(null),g=m===null?null:n.find(e=>e.name===m)??null,_=new Set(n.map(e=>e.name));return(0,F.jsxs)(`section`,{className:`oc-bridge-provider`,children:[(0,F.jsxs)(`header`,{className:`oc-bridge-provider__head`,children:[(0,F.jsx)(Im,{size:15,"aria-hidden":!0,className:`oc-bridge-provider__icon`}),(0,F.jsx)(`span`,{className:`oc-bridge-provider__name`,children:xyt(e)}),d?(0,F.jsx)($,{variant:d===`beyond`?`destructive`:`secondary`,children:H5(d)}):null]}),(0,F.jsx)(`h4`,{className:`oc-bridge-provider__sub`,children:E9e()}),(0,F.jsx)(Byt,{support:o,compatStatus:i,compatReachable:a,manifest:r,instanceRows:c,canConfigure:e=>_.has(e),onConfigure:h}),(0,F.jsxs)(`button`,{type:`button`,className:`oc-bridge-provider__sub oc-bridge-provider__sub--toggle`,"aria-expanded":f,onClick:()=>p(e=>!e),children:[f?(0,F.jsx)(gm,{size:13,"aria-hidden":!0}):(0,F.jsx)(_m,{size:13,"aria-hidden":!0}),nUe({count:t.length})]}),f?(0,F.jsx)(Myt,{connections:t,displayByInstance:s}):null,g?(0,F.jsx)(u7,{instance:g,onClose:()=>h(null)},g._id):null]})}function Byt({support:e,compatStatus:t,compatReachable:n,manifest:r,instanceRows:i,canConfigure:a,onConfigure:o}){return t===`loading`?(0,F.jsx)(`p`,{className:`oc-admin__hint`,children:XK()}):t===`nodata`?(0,F.jsx)(`p`,{className:`oc-admin__hint`,children:k9e()}):(0,F.jsxs)(`div`,{className:`oc-compat`,children:[n?null:(0,F.jsx)(`p`,{className:`oc-admin__hint`,children:L9e()}),r===null?(0,F.jsx)(`p`,{className:`oc-admin__hint`,children:B9e()}):(0,F.jsxs)(`div`,{className:`oc-compat__support`,children:[(0,F.jsx)(`span`,{className:`oc-compat__label`,children:U9e()}),e&&e.range!==null?(0,F.jsx)(`span`,{children:K9e({min:e.range.min,max:e.range.maxValidated})}):(0,F.jsx)(`span`,{children:Nq()}),e?(0,F.jsx)(Uyt,{versions:e.validatedVersions}):null]}),i.length===0?(0,F.jsx)(`p`,{className:`oc-admin__hint`,children:iet()}):(0,F.jsx)(`div`,{className:`oc-compat__targets`,children:i.map(e=>(0,F.jsxs)(`div`,{className:`oc-compat__target`,children:[(0,F.jsx)(`span`,{className:`oc-compat__instance`,children:e.displayName}),(0,F.jsx)(`code`,{className:`oc-traces__mono`,children:U5(e.version)}),(0,F.jsx)($,{variant:e.state===`supported`?`secondary`:e.state===`beyond`?`destructive`:`outline`,children:H5(e.state)}),a(e.instanceName)?(0,F.jsxs)(EJ,{children:[(0,F.jsx)(DJ,{asChild:!0,children:(0,F.jsx)(H,{variant:`ghost`,size:`icon`,className:`oc-compat__target-menu`,"aria-label":YK(),children:(0,F.jsx)(wm,{size:16,"aria-hidden":!0})})}),(0,F.jsx)(OJ,{align:`end`,children:(0,F.jsx)(kJ,{onSelect:()=>o(e.instanceName),children:YK()})})]}):null]},e.instanceName))})]})}function u7({instance:e,onClose:t}){return(0,F.jsx)(YJ,{open:!0,onOpenChange:e=>!e&&t(),children:(0,F.jsxs)(XJ,{className:`oc-bridge-config-dialog`,onOpenAutoFocus:e=>e.preventDefault(),children:[(0,F.jsxs)(ZJ,{children:[(0,F.jsx)($J,{children:tVe({instance:e.displayName??e.name})}),(0,F.jsx)(eY,{children:oVe()})]}),(0,F.jsx)(Hyt,{instance:e,onClose:t})]})})}function Vyt({text:e}){return(0,F.jsx)(j5,{delayDuration:150,children:(0,F.jsxs)(M5,{children:[(0,F.jsx)(N5,{asChild:!0,children:(0,F.jsx)(`button`,{type:`button`,className:`oc-field__help`,"aria-label":e,onClick:e=>e.preventDefault(),children:(0,F.jsx)(xee,{"aria-hidden":!0})})}),(0,F.jsx)(P5,{className:`max-w-xs text-pretty`,children:e})]})})}function d7({label:e,help:t}){return(0,F.jsxs)(`span`,{className:`oc-field__label`,children:[e,(0,F.jsx)(Vyt,{text:t})]})}function f7({label:e,result:t}){return t?t.checked?(0,F.jsxs)(`p`,{className:`oc-bridge-config__check-row `+(t.ok?`oc-bridge-config__check-row--ok`:`oc-bridge-config__check-row--err`),children:[t.ok?(0,F.jsx)(xm,{"aria-hidden":!0}):(0,F.jsx)(Vm,{"aria-hidden":!0}),(0,F.jsxs)(`span`,{children:[e,` — `,t.ok?vHe():t.detail]})]}):(0,F.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--skip`,children:[e,` — `,xHe()]}):null}function Hyt({instance:e,onClose:t}){let n=P(L.admin.upsertInstanceConfig),r=er(L.bridge.validateMediaPaths),i=sY(),[a,o]=(0,M.useState)(()=>dyt(e.config??{})),[s,c]=(0,M.useState)(!1),[l,u]=(0,M.useState)(!1),[d,f]=(0,M.useState)(null),p=a.inboundMediaMode===`shared-fs`,m=a.mediaMode===`shared-fs`,h=p||m;async function g(){u(!0),f(null);try{f(await r({instanceName:e.name,inboundMediaMode:a.inboundMediaMode,mediaMode:a.mediaMode}))}catch(e){i.error(oHe(),e)}finally{u(!1)}}async function _(){c(!0);try{let r=e.config??{};await n({instanceId:e._id,config:fyt(a,r)}),t()}catch(e){i.error(DVe(),e)}finally{c(!1)}}return(0,F.jsx)(`div`,{className:`oc-bridge-config`,children:(0,F.jsxs)(`div`,{className:`oc-bridge-config__form`,children:[(0,F.jsxs)(`div`,{className:`oc-bridge-config__grid`,children:[(0,F.jsxs)(`label`,{className:`oc-field`,children:[(0,F.jsx)(d7,{label:fVe(),help:AVe()}),(0,F.jsxs)(C3,{value:a.mediaMode,onValueChange:e=>o({...a,mediaMode:e}),children:[(0,F.jsx)(T3,{size:`sm`,className:`w-full`,children:(0,F.jsx)(w3,{})}),(0,F.jsx)(E3,{children:lyt.map(e=>(0,F.jsx)(Q,{value:e,children:e},e))})]})]}),(0,F.jsxs)(`label`,{className:`oc-field`,children:[(0,F.jsx)(d7,{label:hVe(),help:NVe()}),(0,F.jsxs)(C3,{value:a.inboundMediaMode,onValueChange:e=>o({...a,inboundMediaMode:e}),children:[(0,F.jsx)(T3,{size:`sm`,className:`w-full`,children:(0,F.jsx)(w3,{})}),(0,F.jsx)(E3,{children:uyt.map(e=>(0,F.jsx)(Q,{value:e,children:e},e))})]})]}),(0,F.jsxs)(`label`,{className:`oc-field`,children:[(0,F.jsx)(d7,{label:vVe(),help:IVe()}),(0,F.jsx)(BJ,{type:`number`,min:1,max:4096,className:`w-full`,value:a.mediaMaxMb,onChange:e=>o({...a,mediaMaxMb:Math.trunc(Number(e.target.value)||0)})})]})]}),h&&(0,F.jsxs)(`div`,{className:`oc-bridge-config__grid`,children:[p&&(0,F.jsxs)(`label`,{className:`oc-field`,children:[(0,F.jsx)(d7,{label:HVe(),help:GVe()}),(0,F.jsx)(BJ,{className:`w-full`,spellCheck:!1,value:a.inboundAgentMount,onChange:e=>o({...a,inboundAgentMount:e.target.value})})]}),m&&(0,F.jsxs)(`label`,{className:`oc-field`,children:[(0,F.jsx)(d7,{label:JVe(),help:ZVe()}),(0,F.jsx)(BJ,{className:`w-full`,spellCheck:!1,value:a.outboundAgentMount,onChange:e=>o({...a,outboundAgentMount:e.target.value})})]})]}),(0,F.jsxs)(`label`,{className:`oc-field--row`,children:[(0,F.jsx)(uY,{checked:a.rehydration,onCheckedChange:e=>o({...a,rehydration:e===!0})}),(0,F.jsx)(d7,{label:xVe(),help:zVe()})]}),h&&d!==null&&(0,F.jsx)(`div`,{className:`oc-bridge-config__check`,children:d.reachable?!d.inbound&&!d.outbound?(0,F.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--err`,children:[(0,F.jsx)(Vm,{"aria-hidden":!0}),DHe({reason:d.reason??`?`})]}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(f7,{label:fHe(),result:d.inbound}),(0,F.jsx)(f7,{label:hHe(),result:d.outbound}),(0,F.jsx)(`p`,{className:`oc-admin__hint`,children:lHe()})]}):(0,F.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--err`,children:[(0,F.jsx)(Vm,{"aria-hidden":!0}),wHe()]})}),(0,F.jsxs)(`div`,{className:`oc-bridge-config__actions`,children:[h&&(0,F.jsxs)(H,{variant:`outline`,size:`sm`,onClick:()=>void g(),disabled:l,children:[l?(0,F.jsx)(Om,{className:`size-4 animate-spin`,"aria-hidden":!0}):null,l?rHe():eHe()]}),(0,F.jsx)(H,{size:`sm`,onClick:()=>void _(),disabled:s,children:wVe()})]})]})})}function Uyt({versions:e}){if(e.length===0)return null;let t=[...e].reverse();return(0,F.jsxs)(NJ,{children:[(0,F.jsx)(PJ,{asChild:!0,children:(0,F.jsxs)(`button`,{type:`button`,className:`oc-compat__versions-btn`,children:[e.length===1?Y9e():Q9e({count:e.length}),(0,F.jsx)(gm,{size:13,"aria-hidden":!0})]})}),(0,F.jsxs)(FJ,{className:`oc-compat__versions-pop`,align:`start`,children:[(0,F.jsx)(`p`,{className:`oc-compat__versions-title`,children:tet()}),(0,F.jsx)(`div`,{className:`oc-compat__versions-list`,children:t.map(e=>(0,F.jsx)($,{variant:`secondary`,children:e},e))})]})]})}var Wyt=[{value:`eq`,label:`=`},{value:`neq`,label:`≠`},{value:`contains`,label:$qe()},{value:`gt`,label:`>`},{value:`gte`,label:`≥`},{value:`lt`,label:`<`},{value:`lte`,label:`≤`}],p7=1;function Gyt(){return{id:p7++,field:``,op:`eq`,value:``}}function Kyt(e){return e.map(e=>({id:p7++,field:e.field,op:e.op,value:String(e.value)}))}function m7({fields:e,seed:t,onChange:n}){let r=(0,M.useRef)(t),i=!!(r.current&&r.current.length>0),[a,o]=(0,M.useState)(i),[s,c]=(0,M.useState)(()=>i?Kyt(r.current):[]);function l(e){n(e.filter(e=>e.field!==``&&e.value!==``).map(e=>({field:e.field,op:e.op,value:Cyt(e.value)})))}function u(e,t){let n=s.map(n=>n.id===e?{...n,...t}:n);c(n),l(n)}function d(){c(e=>[...e,Gyt()])}function f(e){let t=s.filter(t=>t.id!==e);c(t),l(t)}let p=s.filter(e=>e.field!==``&&e.value!==``).length;return(0,F.jsxs)(`div`,{className:`oc-advfilter`,children:[(0,F.jsxs)(`button`,{type:`button`,className:`oc-advfilter__toggle`,"aria-expanded":a,onClick:()=>o(e=>!e),children:[(0,F.jsx)(gm,{className:`oc-advfilter__chevron`+(a?` is-open`:``),"aria-hidden":!0}),nJe(),p>0?(0,F.jsx)(`span`,{className:`oc-advfilter__count`,children:p}):null]}),a?(0,F.jsxs)(`div`,{className:`oc-advfilter__body`,children:[s.length===0?(0,F.jsx)(`p`,{className:`oc-admin__hint`,children:aJe()}):(0,F.jsx)(`ul`,{className:`oc-advfilter__rows`,children:s.map(t=>(0,F.jsxs)(`li`,{className:`oc-advfilter__row`,children:[(0,F.jsxs)(C3,{value:t.field||void 0,onValueChange:e=>u(t.id,{field:e}),children:[(0,F.jsx)(T3,{size:`sm`,className:`w-40`,children:(0,F.jsx)(w3,{placeholder:cJe()})}),(0,F.jsx)(E3,{children:e.map(e=>(0,F.jsx)(Q,{value:e.value,children:e.label},e.value))})]}),(0,F.jsxs)(C3,{value:t.op,onValueChange:e=>u(t.id,{op:e}),children:[(0,F.jsx)(T3,{size:`sm`,className:`w-28`,children:(0,F.jsx)(w3,{})}),(0,F.jsx)(E3,{children:Wyt.map(e=>(0,F.jsx)(Q,{value:e.value,children:e.label},e.value))})]}),(0,F.jsx)(BJ,{className:`oc-advfilter__value`,value:t.value,onChange:e=>u(t.id,{value:e.target.value}),placeholder:dJe()}),(0,F.jsx)(H,{variant:`ghost`,size:`icon-sm`,"aria-label":mJe(),onClick:()=>f(t.id),children:(0,F.jsx)(Gm,{})})]},t.id))}),(0,F.jsxs)(H,{variant:`outline`,size:`sm`,className:`oc-advfilter__add`,onClick:d,children:[(0,F.jsx)(Nm,{}),_Je()]})]}):null]})}var qyt=[`eq`,`neq`,`contains`,`gt`,`gte`,`lt`,`lte`],h7=[50,100,200,500],g7=`now-30d`,Jyt=`now-24h`;function _7(e,t,n=g7,r=`now`){let i=e??n,a=t??r,o=Number(i),s=Number(a);return i!==``&&a!==``&&Number.isFinite(o)&&Number.isFinite(s)?{kind:`absolute`,from:o,to:s}:{kind:`relative`,from:i,to:a}}function v7(e){return e.kind===`absolute`?{from:String(e.from),to:String(e.to)}:{from:e.from,to:e.to}}function y7(e){if(e.length!==0)return JSON.stringify(e)}function b7(e){if(!e)return[];let t;try{t=JSON.parse(e)}catch{return[]}if(!Array.isArray(t))return[];let n=[];for(let e of t){if(typeof e!=`object`||!e)continue;let t=e,r=t.field,i=t.op,a=t.value;typeof r!=`string`||r===``||typeof i!=`string`||!qyt.includes(i)||typeof a!=`string`&&typeof a!=`number`&&typeof a!=`boolean`||n.push({field:r,op:i,value:a})}return n}var x7=up().optional(),S7=up().optional(),C7=up().optional(),w7=up().optional().catch(void 0),Yyt=Vp({q:x7,kind:up().default(`all`).catch(`all`),limit:fee().pipe(Up([Yp(h7[0]),Yp(h7[1]),Yp(h7[2]),Yp(h7[3])])).catch(100),statusClass:qp([`2xx`,`4xx`,`5xx`]).optional().catch(void 0),principalType:qp([`user`,`service`,`system`]).optional().catch(void 0),direction:qp([`inbound`,`outbound`,`internal`]).optional().catch(void 0),roleKey:w7,from:S7,to:S7,adv:C7}),Xyt=Vp({q:x7,action:w7,impersonated:qp([`yes`,`no`]).optional().catch(void 0),resource:w7,from:S7,to:S7,adv:C7}),Zyt=Vp({q:x7,status:qp([`open`,`acknowledged`,`resolved`,`all`]).default(`open`).catch(`open`),severity:qp([`info`,`warn`,`critical`]).optional().catch(void 0),kind:w7,from:S7,to:S7}),Qyt=Vp({from:S7,to:S7}),$yt=Vp({q:x7,status:qp([`active`,`disabled`]).optional().catch(void 0)}),ebt=Vp({q:x7,role:w7});Vp({q:x7,mode:qp([`per-user`,`shared`]).optional().catch(void 0)});var tbt={kind:`relative`,from:g7,to:`now`},T7=`__all__`,E7=[`users`,`groups`,`instances`,`bridge`,`serviceAccounts`,`roles`,`access`,`traces`,`kpi`,`anomalies`,`files`,`agentFiles`,`preferences`,`integrations`,`theme`,`chatDefaults`,`audit`,`feedbacks`],D7=[`groups`,`access`,`roles`,`integrations`,`instances`,`bridge`,`theme`,`feedbacks`,`files`,`agentFiles`,`preferences`,`chatDefaults`],O7={groups:`Groupes`,access:`Accès`,serviceAccounts:`Comptes de service`,roles:`Rôles`,traces:`Traces`,kpi:`KPI`,anomalies:`Anomalies`,integrations:`Intégrations`,feedbacks:`Feedbacks`,bridge:`Bridge`,files:`Fichiers`,agentFiles:`Fichiers d'agent`,theme:`Apparence`,preferences:`Préférences`},k7={users:`admin.manage`,groups:`groups.manage`,instances:`admin.manage`,bridge:`bridge.read`,serviceAccounts:`admin.manage`,roles:`admin.manage`,access:`admin.manage`,traces:`traces.read`,kpi:`kpi.read`,anomalies:`anomalies.read`,files:`chats.read`,agentFiles:`agents.files.read`,preferences:`chats.read`,integrations:`admin.manage`,theme:`chats.read`,chatDefaults:`admin.manage`,audit:`admin.manage`,feedbacks:`admin.manage`},A7=[`traces`,`kpi`,`anomalies`,`bridge`,`agentFiles`,`groups`];function j7(e){let t=new Set(e);return E7.filter(e=>t.has(k7[e]))}function M7(e){return`/settings/${e}`}function N7(e){let t=e.split(`/`)[2];return E7.includes(t)?t:void 0}var nbt={uiprefs:`preferences`};function rbt({granted:e,onToggle:t}){let n=new Set(e),r=A7.filter(e=>n.has(k7[e])).length;return(0,F.jsxs)(EJ,{children:[(0,F.jsx)(DJ,{asChild:!0,children:(0,F.jsx)(H,{variant:`outline`,size:`sm`,className:`h-8 w-36 justify-start font-normal`,children:r===0?uCe():pCe({count:r})})}),(0,F.jsxs)(OJ,{align:`start`,className:`w-52`,children:[(0,F.jsx)(AJ,{children:gCe()}),A7.map(e=>{let r=k7[e];return(0,F.jsxs)(kJ,{className:`gap-2`,onSelect:e=>{e.preventDefault(),t(r)},children:[(0,F.jsx)(uY,{checked:n.has(r),"aria-hidden":!0,tabIndex:-1,className:`pointer-events-none`}),(0,F.jsx)(`span`,{children:O7[e]??e})]},e)})]})]})}function ibt(){let e=ss({from:`/settings/users`}),t=cs({from:`/settings/users`}),n=e.q??``,r=e.role??T7,i=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),a=e=>void t({search:t=>({...t,role:e===T7?void 0:e})}),o=N(L.admin.listUsers,{filter:{q:n||void 0,role:r===T7?void 0:r},withAgents:!0}),s=N(L.me.getMe,{host:BO}),c=P(L.admin.setRole),l=P(L.admin.setUserPermissions),u=P(L.admin.startImpersonation),d=P(L.admin.deleteUser),f=P(L.admin.setUserName),p=rY(),m=iY(),h=sY(),[g,_]=(0,M.useState)(null),v=(0,M.useMemo)(()=>{let e=new Set([`pending`,`user`,`admin`]);for(let t of o??[])e.add(t.role);return[...e]},[o]),y=n!==``||r!==T7;function b(){t({search:{},replace:!0})}async function x(e){try{await c(e)}catch(e){h.error(yCe(),e)}}async function S(e){try{await l(e)}catch(e){h.error(SCe(),e)}}async function C(e){let t=e.email||e.name||e.canonical||e.userId.slice(0,8);if(await p({title:UCe(),description:KCe({user:t}),confirmWord:YCe(),confirmLabel:QCe(),destructive:!0}))try{await d({profileId:e._id}),h.success(iwe({user:t}))}catch(e){h.error(twe(),e)}}async function w(e){let t=e.email||e.name||e.userId.slice(0,8),n=await m({title:uwe(),label:pwe({user:t}),placeholder:gwe(),defaultValue:e.name??``,confirmLabel:OK()});if(n!==null)try{await f({profileId:e._id,name:n}),h.success(ywe())}catch(e){h.error(Swe(),e)}}return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(r7,{q:n,onQChange:i,searchPlaceholder:TCe(),onReset:b,canReset:y,children:(0,F.jsxs)(C3,{value:r,onValueChange:a,children:[(0,F.jsx)(T3,{size:`sm`,className:`w-36`,children:(0,F.jsx)(w3,{})}),(0,F.jsxs)(E3,{children:[(0,F.jsx)(Q,{value:T7,children:OCe()}),v.map(e=>(0,F.jsx)(Q,{value:e,children:e},e))]})]})}),(0,F.jsx)(k5,{title:jCe(),rows:o,emptyHint:PCe(),rowActions:e=>{let t=[{label:EK(),onSelect:()=>_({profileId:e._id,label:e.email||e.name||e.canonical||e.userId.slice(0,8)})},{label:swe(),onSelect:()=>void w(e)}];return e.userId!==s?.userId&&t.push({label:LCe(),onSelect:()=>void u({profileId:e._id})},{label:BCe(),variant:`destructive`,onSelect:()=>void C(e)}),t},columns:[{header:Twe(),cell:e=>{let t=e.email||e.name||e.canonical||e.userId.slice(0,8),n=e.email&&e.name&&e.name!==e.email?e.name:null;return(0,F.jsxs)(`div`,{className:`flex flex-col`,children:[(0,F.jsx)(`span`,{children:t}),n?(0,F.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:n}):null]})},sort:e=>e.email||e.name||e.canonical||e.userId},{header:Owe(),sort:e=>e.role===`admin`?2:+(e.role===`user`),cell:e=>(0,F.jsxs)(C3,{value:e.role,onValueChange:t=>void x({profileId:e._id,role:t}),children:[(0,F.jsx)(T3,{size:`sm`,className:`w-28`,children:(0,F.jsx)(w3,{})}),(0,F.jsxs)(E3,{children:[(0,F.jsx)(Q,{value:`pending`,children:`pending`}),(0,F.jsx)(Q,{value:`user`,children:`user`}),(0,F.jsx)(Q,{value:`admin`,children:`admin`})]})]})},{header:jwe(),sort:e=>e.role===`admin`?9999:e.extraPermissions?.length??0,cell:e=>e.role===`admin`?(0,F.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:Pwe()}):(0,F.jsx)(rbt,{granted:e.extraPermissions??[],onToggle:t=>{let n=new Set(e.extraPermissions??[]);n.has(t)?n.delete(t):n.add(t),S({profileId:e._id,permissions:[...n]})}})},{header:TK(),cell:e=>(0,F.jsx)(A5,{icon:(0,F.jsx)(Im,{size:12,"aria-hidden":!0}),total:e.agentCount??0,items:e.agents.map(e=>({label:e}))}),sort:e=>e.agentCount??0}]}),(0,F.jsx)(ayt,{profileId:g?.profileId??null,userLabel:g?.label??``,open:g!==null,onOpenChange:e=>{e||_(null)}})]})}var P7={name:``,gatewayUrl:``,bridgeUrl:``,displayName:``,kind:`openclaw`,gatewayVersion:``,gatewayHttpUrl:``},abt={openclaw:[`token`,`deviceIdentity`],hermes:[`apiKey`]};function obt(e){return{name:e.name,gatewayUrl:e.gatewayUrl,bridgeUrl:e.bridgeUrl??``,displayName:e.displayName??``,kind:e.kind??`openclaw`,gatewayVersion:e.gatewayVersion??``,gatewayHttpUrl:e.gatewayHttpUrl??``}}function sbt(){let e=N(L.admin.listInstances,{}),t=N(L.agents.listAllInstanceAgents,{}),n=P(L.admin.upsertInstance),r=P(L.admin.deleteInstance),i=sY(),[a,o]=(0,M.useState)(!1),[s,c]=(0,M.useState)(P7),[l,u]=(0,M.useState)(null),[d,f]=(0,M.useState)(null),[p,m]=(0,M.useState)(null),[h,g]=(0,M.useState)(null);async function _(){try{await n({instanceId:h??void 0,name:s.name,gatewayUrl:s.gatewayUrl,bridgeUrl:s.bridgeUrl||void 0,displayName:s.displayName||void 0,kind:s.kind,gatewayVersion:s.gatewayVersion||void 0,gatewayHttpUrl:s.gatewayHttpUrl||void 0}),c(P7),g(null),o(!1)}catch(e){i.error(Vwe(),e)}}return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`p`,{className:`oc-admin__hint`,children:[Wwe(),(0,F.jsx)(`strong`,{children:qwe()}),Xwe()]}),(0,F.jsx)(k5,{title:$we(),rows:e,addLabel:nTe(),onAdd:()=>{g(null),c(P7),o(!0)},emptyHint:aTe(),columns:[{header:cTe(),cell:e=>e.name,sort:e=>e.name},{header:dTe(),cell:e=>(0,F.jsx)($,{variant:`outline`,children:e.kind??`openclaw`}),sort:e=>e.kind??`openclaw`},{header:mTe(),cell:e=>e.gatewayUrl,sort:e=>e.gatewayUrl},{header:_Te(),cell:e=>e.displayName??`—`,sort:e=>e.displayName??null},{header:TK(),cell:e=>{let n=(t?.[e.name]??[]).filter(e=>e.presentInLastOk!==!1&&e.enabled);if(n.length===0)return(0,F.jsx)(`span`,{className:`text-muted-foreground`,children:`—`});let r=t=>e.defaultAgentId===t;return(0,F.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:[...n].sort((e,t)=>Number(r(t.agentId))-Number(r(e.agentId))).map(e=>(0,F.jsxs)($,{variant:r(e.agentId)?`default`:`outline`,title:r(e.agentId)?IK():void 0,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]},e.agentId))})}}],rowActions:e=>[{label:OTe(),onSelect:()=>{g(e._id),c(obt(e)),o(!0)}},{label:EK(),onSelect:()=>u(e.name)},{label:vEe(),onSelect:()=>m(e)},{label:bTe(),onSelect:()=>f(e)},{label:DK(),variant:`destructive`,onSelect:()=>void r({instanceId:e._id})}],bulkActions:[{label:DK(),variant:`destructive`,onSelect:e=>e.forEach(e=>void r({instanceId:e}))}]}),(0,F.jsx)(Q8,{open:a,onOpenChange:o,title:h?jTe():TTe(),description:LTe(),canSubmit:!!(s.name&&s.gatewayUrl),onSubmit:_,submitLabel:OK(),children:(0,F.jsxs)(`div`,{className:`oc-form`,children:[(0,F.jsxs)(L7,{label:HTe(),children:[(0,F.jsx)(BJ,{value:s.name,disabled:h!==null,onChange:e=>c({...s,name:e.target.value})}),h?(0,F.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:PTe()}):null]}),(0,F.jsx)(L7,{label:GTe(),children:(0,F.jsxs)(C3,{value:s.kind,onValueChange:e=>c({...s,kind:e}),children:[(0,F.jsx)(T3,{size:`sm`,className:`w-40`,children:(0,F.jsx)(w3,{})}),(0,F.jsxs)(E3,{children:[(0,F.jsx)(Q,{value:`openclaw`,children:`OpenClaw`}),(0,F.jsx)(Q,{value:`hermes`,children:`Hermes`})]})]})}),(0,F.jsx)(L7,{label:JTe(),children:(0,F.jsx)(BJ,{value:s.gatewayUrl,onChange:e=>c({...s,gatewayUrl:e.target.value})})}),(0,F.jsx)(L7,{label:ZTe(),children:(0,F.jsx)(BJ,{value:s.bridgeUrl,placeholder:eEe(),onChange:e=>c({...s,bridgeUrl:e.target.value})})}),(0,F.jsx)(L7,{label:rEe(),children:(0,F.jsx)(BJ,{value:s.displayName,onChange:e=>c({...s,displayName:e.target.value})})}),(0,F.jsx)(L7,{label:oEe(),children:(0,F.jsx)(BJ,{value:s.gatewayVersion,placeholder:lEe(),onChange:e=>c({...s,gatewayVersion:e.target.value})})}),(0,F.jsx)(L7,{label:fEe(),children:(0,F.jsx)(BJ,{value:s.gatewayHttpUrl,placeholder:hEe(),onChange:e=>c({...s,gatewayHttpUrl:e.target.value})})})]})}),(0,F.jsx)(hbt,{instanceName:l,open:l!==null,onOpenChange:e=>{e||u(null)}}),d?(0,F.jsx)(u7,{instance:d,onClose:()=>f(null)},d._id):null,p?(0,F.jsx)(cbt,{instance:p,onClose:()=>m(null)},p._id):null]})}function cbt({instance:e,onClose:t}){let n=N(L.instanceSecrets.listInstanceSecretStatus,{}),r=abt[e.kind??`openclaw`],i=(0,M.useMemo)(()=>{let t={};for(let r of n??[])r.instanceId===e._id&&(t[r.field]=r.updatedAt);return t},[n,e._id]);return(0,F.jsx)(YJ,{open:!0,onOpenChange:e=>!e&&t(),children:(0,F.jsxs)(XJ,{onOpenAutoFocus:e=>e.preventDefault(),children:[(0,F.jsxs)(ZJ,{children:[(0,F.jsx)($J,{children:xEe({instance:e.displayName??e.name})}),(0,F.jsx)(eY,{children:wEe()})]}),(0,F.jsx)(`div`,{className:`oc-form`,children:r.map(t=>(0,F.jsx)(dbt,{instanceId:e._id,field:t,updatedAt:i[t]??null},t))}),(0,F.jsx)(`div`,{className:`oc-bridgesecret`,children:(0,F.jsx)(ubt,{instance:e})}),(0,F.jsx)(lbt,{instance:e})]})})}function lbt({instance:e}){let t=er(L.instanceSync.forceInstanceSync),n=sY(),[r,i]=(0,M.useState)(!1);async function a(){if(!r){i(!0);try{switch((await t({instanceId:e._id})).status){case`synced`:n.success(EDe());break;case`no_agents`:n.success(MDe());break;case`no_bridge_url`:n.error(FDe());break;case`deploy_misconfigured`:n.error(RDe());break;case`unauthorized`:n.error(WDe());break;case`not_served`:n.error(qDe());break;default:n.error(VDe());break}}catch(e){n.error(kDe(),e)}finally{i(!1)}}}return(0,F.jsxs)(`div`,{className:`oc-form`,children:[(0,F.jsx)(`p`,{className:`oc-admin__hint`,children:XDe()}),(0,F.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,F.jsx)(H,{size:`sm`,variant:`outline`,onClick:()=>void a(),disabled:r,children:r?CDe():bDe()})})]})}function ubt({instance:e}){let t=N(L.bridgeAuth.listBridgeAuthStatus,{}),n=er(L.bridgeAuth.mintBridgeSecret),r=P(L.bridgeAuth.revokeBridgeSecret),i=sY(),[a,o]=(0,M.useState)(!1),[s,c]=(0,M.useState)(null),[l,u]=(0,M.useState)(!1),d=(t??[]).find(t=>t.instanceId===e._id),f=d!==void 0;async function p(){if(!a){o(!0);try{c((await n({instanceId:e._id})).plaintext),u(!1)}catch(e){i.error(NK(),e)}finally{o(!1)}}}async function m(){if(!a){o(!0);try{await r({instanceId:e._id}),c(null),i.success(mOe())}catch(e){i.error(NK(),e)}finally{o(!1)}}}async function h(){if(s)try{await navigator.clipboard.writeText(s),u(!0)}catch{}}return(0,F.jsxs)(L7,{label:$De(),children:[(0,F.jsx)(`p`,{className:`oc-admin__hint`,children:nOe()}),(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,F.jsx)($,{variant:f?`outline`:`secondary`,children:f?`${kK()} · ${d.prefix}…${d.lastFour}`:AK()}),(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(H,{size:`sm`,onClick:()=>void p(),disabled:a,children:f?cOe():aOe()}),f?(0,F.jsx)(H,{size:`sm`,variant:`destructive`,onClick:()=>void m(),disabled:a,children:dOe()}):null]})]}),s?(0,F.jsxs)(`div`,{className:`oc-bridgesecret__reveal`,children:[(0,F.jsx)(`p`,{className:`oc-sa__minted-warning`,children:yOe()}),(0,F.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,F.jsx)(`code`,{className:`oc-sa__minted-plain`,children:s}),(0,F.jsx)(H,{variant:`outline`,size:`sm`,onClick:()=>void h(),children:l?rz():oz()})]}),(0,F.jsx)(H,{size:`sm`,variant:`ghost`,onClick:()=>{c(null),u(!1)},children:PK()})]}):null]})}function dbt({instanceId:e,field:t,updatedAt:n}){let r=er(L.instanceSecrets.setInstanceSecret),i=P(L.instanceSecrets.clearInstanceSecret),a=er(L.deviceIdentity.generateDeviceIdentity),o=sY(),[s,c]=(0,M.useState)(``),[l,u]=(0,M.useState)(!1),[d,f]=(0,M.useState)(null),[p,m]=(0,M.useState)(!1),h=n!==null,g=t===`deviceIdentity`,_=t===`token`?DEe():t===`deviceIdentity`?AEe():NEe();async function v(){if(!(!s.trim()||l)){u(!0);try{await r({instanceId:e,field:t,plaintext:s}),c(``),f(null),m(!1),o.success(QEe())}catch(e){o.error(jK(),e)}finally{u(!1)}}}async function y(){if(!l){u(!0);try{await i({instanceId:e,field:t}),f(null),m(!1),o.success(rDe())}catch(e){o.error(jK(),e)}finally{u(!1)}}}async function b(){if(!l){u(!0);try{f(await a({instanceId:e})),m(!1),o.success(MK())}catch(e){o.error(_De(),e)}finally{u(!1)}}}let x=d?`openclaw devices approve ${d.id}`:``;async function S(){if(x)try{await navigator.clipboard.writeText(x),m(!0)}catch{}}return(0,F.jsxs)(L7,{label:_,children:[g?(0,F.jsx)(`p`,{className:`oc-admin__hint`,children:lDe()}):null,(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,F.jsx)($,{variant:h?`outline`:`secondary`,children:h?kK():AK()}),(0,F.jsx)(BJ,{type:`password`,autoComplete:`off`,className:`flex-1 min-w-32`,value:s,placeholder:h?UEe():BEe(),onChange:e=>c(e.target.value)}),(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(H,{size:`sm`,onClick:()=>void v(),disabled:l||s.trim().length===0,children:KEe()}),g?(0,F.jsx)(H,{size:`sm`,variant:`outline`,onClick:()=>void b(),disabled:l,children:oDe()}):null,h?(0,F.jsx)(H,{size:`sm`,variant:`destructive`,onClick:()=>void y(),disabled:l,children:YEe()}):null]})]}),d?(0,F.jsxs)(`div`,{className:`oc-bridgesecret__reveal`,children:[(0,F.jsx)(`p`,{className:`text-sm font-medium`,children:MK()}),(0,F.jsx)(`p`,{className:`oc-admin__hint`,children:mDe()}),(0,F.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,F.jsx)(`code`,{className:`oc-sa__minted-plain`,children:x}),(0,F.jsx)(H,{variant:`outline`,size:`sm`,onClick:()=>void S(),children:p?rz():oz()})]}),(0,F.jsx)(H,{size:`sm`,variant:`ghost`,onClick:()=>{f(null),m(!1)},children:PK()})]}):null]})}var fbt={conversational:WOe,documentary:XOe},pbt={conversational:qOe,documentary:$Oe},F7=e=>(fbt[e]??(()=>e))(),I7=e=>(pbt[e]??(()=>``))();function mbt({agentId:e,types:t,onToggle:n}){return(0,F.jsxs)(`div`,{className:`oc-agentcard__types`,children:[(0,F.jsx)(`span`,{className:`oc-agentcard__types-label`,children:MOe()}),t.map(e=>(0,F.jsx)($,{variant:`secondary`,className:`oc-agenttype__chip`,title:I7(e),children:F7(e)},e)),(0,F.jsxs)(NJ,{children:[(0,F.jsx)(PJ,{asChild:!0,children:(0,F.jsx)(H,{type:`button`,variant:`outline`,size:`sm`,className:`h-7`,children:FOe()})}),(0,F.jsxs)(FJ,{align:`start`,className:`oc-agenttypes-pop`,children:[(0,F.jsx)(`p`,{className:`oc-agenttypes-pop__title`,children:ROe()}),(0,F.jsx)(`p`,{className:`oc-agenttypes-pop__hint`,children:VOe()}),(0,F.jsx)(`div`,{className:`oc-agenttypes-pop__list`,children:S5.map(r=>{let i=`agtype-${e}-${r}`;return(0,F.jsxs)(`div`,{className:`oc-agenttypes-pop__item`,children:[(0,F.jsx)(uY,{id:i,checked:t.includes(r),onCheckedChange:()=>n(r)}),(0,F.jsxs)(`label`,{htmlFor:i,className:`oc-agenttypes-pop__text`,children:[(0,F.jsx)(`span`,{className:`oc-agenttypes-pop__name`,children:F7(r)}),(0,F.jsx)(`span`,{className:`oc-agenttypes-pop__desc`,children:I7(r)})]})]},r)})})]})]})]})}function hbt({instanceName:e,open:t,onOpenChange:n}){let r=N(L.agents.listAgentsForInstance,t&&e?{instanceName:e}:`skip`),i=P(L.agents.setAgentEnabled).withOptimisticUpdate((e,{instanceName:t,agentId:n,enabled:r})=>{let i=e.getQuery(L.agents.listAgentsForInstance,{instanceName:t});i&&e.setQuery(L.agents.listAgentsForInstance,{instanceName:t},{...i,agents:i.agents.map(e=>e.agentId===n?{...e,enabled:r}:e)})}),a=P(L.agents.setInstanceDefaultAgent).withOptimisticUpdate((e,{instanceName:t,agentId:n})=>{let r=e.getQuery(L.agents.listAgentsForInstance,{instanceName:t});r&&e.setQuery(L.agents.listAgentsForInstance,{instanceName:t},{...r,defaultAgentId:n})}),o=P(L.agents.setAgentTypes).withOptimisticUpdate((e,{instanceName:t,agentId:n,types:r})=>{let i=e.getQuery(L.agents.listAgentsForInstance,{instanceName:t});if(!i)return;let a=iyt(r);e.setQuery(L.agents.listAgentsForInstance,{instanceName:t},{...i,agents:i.agents.map(e=>e.agentId===n?{...e,types:a}:e)})}),s=P(L.agents.removeInstanceAgent),c=rY(),l=sY();async function u(t,n){if(e)try{await i({instanceName:e,agentId:t,enabled:n})}catch(e){l.error(FK(),e)}}async function d(t){if(e)try{await a({instanceName:e,agentId:t})}catch(e){l.error(FK(),e)}}async function f(t,n,r){if(!e)return;let i=r.includes(n)?r.filter(e=>e!==n):[...r,n];try{await o({instanceName:e,agentId:t,types:i})}catch(e){l.error(FK(),e)}}async function p(t,n){if(e&&await c({title:cke({name:n}),description:dke(),confirmLabel:mke(),destructive:!0}))try{await s({instanceName:e,agentId:t}),l.success(_ke())}catch(e){l.error(FK(),e)}}return(0,F.jsx)(YJ,{open:t,onOpenChange:n,children:(0,F.jsxs)(XJ,{className:`oc-access`,children:[(0,F.jsxs)(ZJ,{children:[(0,F.jsx)($J,{children:wOe({name:e??``})}),(0,F.jsx)(eY,{children:DOe()})]}),r===void 0?(0,F.jsx)(`p`,{className:`oc-access__hint`,children:bke()}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`div`,{className:`oc-access__poll`,children:r.discovery===null?Cke():r.discovery.lastPollOk?Eke():kke({error:r.discovery.error??`?`})}),r.agents.length===0?(0,F.jsx)(`p`,{className:`oc-access__hint`,children:Mke()}):(0,F.jsx)(`div`,{className:`oc-access__list`,children:r.agents.map(e=>{let t=e.presentInLastOk===!1,n=r.defaultAgentId===e.agentId,i=e.displayName??e.agentId,a=e.types??[];return(0,F.jsxs)(`div`,{className:`oc-agentcard`+(e.enabled?``:` oc-agentcard--off`),children:[(0,F.jsxs)(`div`,{className:`oc-agentcard__head`,children:[(0,F.jsx)(uY,{checked:e.enabled,disabled:t,"aria-label":i,onCheckedChange:t=>void u(e.agentId,t===!0)}),(0,F.jsxs)(`span`,{className:`oc-agentcard__name`,title:i,children:[e.emoji?`${e.emoji} `:``,i]}),e.model?(0,F.jsx)(`span`,{className:`oc-access__model`,children:e.model}):null,t?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)($,{variant:`outline`,className:`oc-access__gone`,children:Lke()}),(0,F.jsx)(H,{size:`sm`,variant:`ghost`,className:`h-7 text-destructive`,onClick:()=>void p(e.agentId,i),children:ake()})]}):n?(0,F.jsx)($,{variant:`default`,children:IK()}):(0,F.jsx)(H,{size:`sm`,variant:`outline`,className:`h-7`,disabled:!e.enabled,onClick:()=>void d(e.agentId),children:nke()})]}),e.enabled?(0,F.jsx)(mbt,{agentId:e.agentId,types:a,onToggle:t=>void f(e.agentId,t,a)}):null]},e.agentId)})})]})]})})}function L7({label:e,children:t}){return(0,F.jsxs)(`label`,{className:`oc-field`,children:[(0,F.jsx)(`span`,{className:`oc-field__label`,children:e}),t]})}var gbt=[{value:`action`,label:`action`},{value:`realLabel`,label:`acteur réel`},{value:`targetLabel`,label:`au nom de`},{value:`impersonated`,label:`usurpation`},{value:`resource`,label:`ressource`},{value:`resourceId`,label:`id ressource`}];function _bt(){let e=ss({from:`/settings/audit`}),t=cs({from:`/settings/audit`}),n=e.q??``,r=e.action??T7,i=e.impersonated??T7,a=e.resource??T7,o=_7(e.from,e.to),s=(0,M.useMemo)(()=>b7(e.adv),[e.adv]),{from:c,to:l}=e7(o),u=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),d=e=>void t({search:t=>({...t,action:e===T7?void 0:e})}),f=e=>void t({search:t=>({...t,impersonated:e===T7?void 0:e})}),p=e=>void t({search:t=>({...t,resource:e===T7?void 0:e})}),m=e=>void t({search:t=>({...t,...v7(e)})}),h=e=>void t({search:t=>({...t,adv:y7(e)}),replace:!0}),g=N(L.admin.listAudit,{filter:{q:n||void 0,from:c,to:l,action:r===T7?void 0:r,resource:a===T7?void 0:a,impersonated:i===T7?void 0:i===`yes`,advanced:s.length>0?s:void 0}}),_=(0,M.useMemo)(()=>{let e=new Set;for(let t of g??[])e.add(t.action);return[...e].sort()},[g]),v=(0,M.useMemo)(()=>{let e=new Set;for(let t of g??[])t.resource&&e.add(t.resource);return[...e].sort()},[g]),y=n!==``||r!==T7||i!==T7||a!==T7||s.length>0||o.kind!==`relative`||o.from!==tbt.from;function b(){t({search:{},replace:!0})}return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`p`,{className:`oc-admin__hint`,children:[Bke(),` `,(0,F.jsx)(`span`,{className:`oc-filter__window`,children:Uke()})]}),(0,F.jsxs)(r7,{q:n,onQChange:u,searchPlaceholder:Kke(),timeRange:o,onTimeRangeChange:m,onReset:b,canReset:y,children:[(0,F.jsxs)(C3,{value:r,onValueChange:d,children:[(0,F.jsx)(T3,{size:`sm`,className:`w-40`,children:(0,F.jsx)(w3,{placeholder:LK()})}),(0,F.jsxs)(E3,{children:[(0,F.jsx)(Q,{value:T7,children:Zke()}),_.map(e=>(0,F.jsx)(Q,{value:e,children:e},e))]})]}),(0,F.jsxs)(C3,{value:i,onValueChange:f,children:[(0,F.jsx)(T3,{size:`sm`,className:`w-40`,children:(0,F.jsx)(w3,{})}),(0,F.jsxs)(E3,{children:[(0,F.jsx)(Q,{value:T7,children:eAe()}),(0,F.jsx)(Q,{value:`yes`,children:rAe()}),(0,F.jsx)(Q,{value:`no`,children:oAe()})]})]}),(0,F.jsxs)(C3,{value:a,onValueChange:p,children:[(0,F.jsx)(T3,{size:`sm`,className:`w-40`,children:(0,F.jsx)(w3,{placeholder:RK()})}),(0,F.jsxs)(E3,{children:[(0,F.jsx)(Q,{value:T7,children:dAe()}),v.map(e=>(0,F.jsx)(Q,{value:e,children:e},e))]})]})]}),(0,F.jsx)(m7,{fields:gbt,seed:s,onChange:h}),(0,F.jsx)(k5,{title:mAe(),rows:g,emptyHint:_Ae(),columns:[{header:bAe(),cell:e=>new Date(e.at).toLocaleString(`fr-FR`),sort:e=>e.at},{header:LK(),cell:e=>e.action,sort:e=>e.action},{header:CAe(),cell:e=>e.realLabel,sort:e=>e.realLabel},{header:EAe(),cell:e=>e.targetLabel??`—`,sort:e=>e.targetLabel??null},{header:RK(),cell:e=>e.resource?e.resource+(e.resourceId?` · ${e.resourceId.slice(0,8)}`:``):`—`,sort:e=>e.resource??null}]})]})}var vbt={pending:lMe,user:fMe,admin:hMe,observer:vMe,agent:xMe};function R7(e){if(e.builtin){let t=vbt[e.key];if(t)return t()}return e.description}var z7=[{value:`never`,label:()=>fz(),days:null},{value:`30`,label:()=>hz(),days:30},{value:`90`,label:()=>vz(),days:90}],ybt=720*60*60*1e3,B7=`__all__`,V7={name:``,roleKey:``,description:``};function bbt(){let e=ss({from:`/settings/serviceAccounts`}),t=cs({from:`/settings/serviceAccounts`}),n=e.q??``,r=e.status??B7,[i,a]=(0,M.useState)(B7),o=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),s=e=>void t({search:t=>({...t,status:e===B7?void 0:e})}),c=N(L.apiKeys.listServiceAccounts,{filter:{q:n||void 0,role:i===B7?void 0:i,disabled:r===B7?void 0:r===`disabled`}}),l=N(L.apiKeys.listKeys,{}),u=N(L.apiKeys.listRoles,{}),d=P(L.apiKeys.createServiceAccount),f=P(L.apiKeys.updateServiceAccount),p=P(L.apiKeys.deleteServiceAccount),m=er(L.apiKeys.mintApiKey),h=P(L.apiKeys.revokeApiKey),g=rY(),_=sY(),v=n!==``||i!==B7||r!==B7;function y(){a(B7),t({search:{},replace:!0})}let[b,x]=(0,M.useState)(!1),[S,C]=(0,M.useState)(V7),[w,T]=(0,M.useState)(null),[E,D]=(0,M.useState)(new Set),[O,ee]=(0,M.useState)(null),te=(0,M.useRef)(!1),[k,A]=(0,M.useState)(new Set),[ne,re]=(0,M.useState)({}),[ie,j]=(0,M.useState)(null),ae=(0,M.useMemo)(()=>{let e=new Map;for(let t of l??[]){let n=e.get(t.serviceAccountId)??[];n.push(t),e.set(t.serviceAccountId,n)}return e},[l]);function oe(e){D(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}async function se(){try{w?(await f({serviceAccountId:w,name:S.name,roleKey:S.roleKey,description:S.description}),_.success(wL())):await d({name:S.name,roleKey:S.roleKey,description:S.description||void 0}),C(V7),T(null),x(!1)}catch(e){_.error(w?xL():vL(),e)}}function ce(e){C({name:e.name,roleKey:e.roleKey,description:e.description??``}),T(e._id),x(!0)}async function le(e){if(te.current)return;te.current=!0;let t=ne[e._id]??`never`,n=z7.find(e=>e.value===t)?.days??null,r=n?Date.now()+n*24*60*60*1e3:void 0;ee(e._id);try{let t=await m({serviceAccountId:e._id,expiresAt:r});j({accountName:e.name,plaintext:t.plaintext,prefix:t.prefix,lastFour:t.lastFour})}catch(e){_.error(DL(),e)}finally{te.current=!1,ee(null)}}async function ue(e){if(await g({title:AL(),description:(0,F.jsxs)(F.Fragment,{children:[NL(),` `,(0,F.jsx)(`span`,{className:`font-mono`,children:e.name}),` `,IL(),` `,(0,F.jsx)(`strong`,{children:zL()}),` `,HL()]}),confirmWord:e.name,confirmLabel:GL(),destructive:!0}))try{await p({serviceAccountId:e._id}),_.success(JL(),e.name)}catch(e){_.error(ZL(),e)}}async function de(e){if(await g({title:eR(),description:(0,F.jsxs)(F.Fragment,{children:[rR(),` `,(0,F.jsxs)(`span`,{className:`font-mono`,children:[e.prefix,`…`,e.lastFour]}),` `,oR()]}),confirmLabel:lR(),destructive:!0})&&!k.has(e._id)){A(t=>new Set(t).add(e._id));try{await h({keyId:e._id})}catch(e){_.error(fR(),e)}finally{A(t=>{let n=new Set(t);return n.delete(e._id),n})}}}return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`p`,{className:`oc-admin__hint`,children:wF()}),(0,F.jsxs)(r7,{q:n,onQChange:o,searchPlaceholder:DF(),onReset:y,canReset:v,children:[(0,F.jsxs)(C3,{value:i,onValueChange:a,children:[(0,F.jsx)(T3,{size:`sm`,className:`w-40`,children:(0,F.jsx)(w3,{placeholder:AF()})}),(0,F.jsxs)(E3,{children:[(0,F.jsx)(Q,{value:B7,children:NF()}),(u??[]).map(e=>(0,F.jsx)(Q,{value:e.key,children:e.key},e._id))]})]}),(0,F.jsxs)(C3,{value:r,onValueChange:s,children:[(0,F.jsx)(T3,{size:`sm`,className:`w-36`,children:(0,F.jsx)(w3,{})}),(0,F.jsxs)(E3,{children:[(0,F.jsx)(Q,{value:B7,children:IF()}),(0,F.jsx)(Q,{value:`active`,children:zF()}),(0,F.jsx)(Q,{value:`disabled`,children:HF()})]})]})]}),(0,F.jsx)(k5,{title:GF(),rows:c,addLabel:JF(),onAdd:()=>{C(V7),T(null),x(!0)},emptyHint:ZF(),isExpanded:e=>E.has(e._id),renderExpanded:e=>(0,F.jsx)(xbt,{account:e,keys:ae.get(e._id)??[],onRevoke:de,revoking:k}),rowActions:e=>[{label:lI(),onSelect:()=>ce(e)},{label:eI(),onSelect:()=>void le(e)},{label:E.has(e._id)?rI():oI(),onSelect:()=>oe(e._id)},{label:fI(),variant:`destructive`,onSelect:()=>void ue(e)}],columns:[{header:``,className:`w-8`,cell:e=>(0,F.jsx)(H,{variant:`ghost`,size:`icon-sm`,"aria-label":E.has(e._id)?hI():vI(),onClick:()=>oe(e._id),children:E.has(e._id)?(0,F.jsx)(gm,{}):(0,F.jsx)(_m,{})})},{header:xI(),sort:e=>e.name,cell:e=>(0,F.jsxs)(`div`,{className:`flex flex-col`,children:[(0,F.jsx)(`span`,{children:e.name}),e.description?(0,F.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:e.description}):null]})},{header:wI(),sort:e=>e.roleKey,cell:e=>(0,F.jsx)($,{variant:`secondary`,children:e.roleKey})},{header:DI(),sort:e=>+!!e.disabled,cell:e=>e.disabled?(0,F.jsx)($,{variant:`destructive`,children:HF()}):(0,F.jsx)($,{variant:`outline`,children:zF()})},{header:AI(),cell:e=>(0,F.jsxs)(C3,{value:ne[e._id]??`never`,onValueChange:t=>re(n=>({...n,[e._id]:t})),children:[(0,F.jsx)(T3,{size:`sm`,className:`w-32`,children:(0,F.jsx)(w3,{})}),(0,F.jsx)(E3,{children:z7.map(e=>(0,F.jsx)(Q,{value:e.value,children:e.label()},e.value))})]})},{header:NI(),sort:e=>(ae.get(e._id)??[]).filter(e=>!e.disabled).length,cell:e=>{let t=(ae.get(e._id)??[]).filter(e=>!e.disabled).length;return(0,F.jsx)(`span`,{className:`oc-sa__keycount`,children:O===e._id?II():zI({count:t})})}}]}),(0,F.jsx)(Q8,{open:b,onOpenChange:e=>{x(e),e||T(null)},title:w?HI():ZI(),description:w?GI():eL(),canSubmit:!!(S.name&&S.roleKey),onSubmit:se,submitLabel:w?JI():rL(),children:(0,F.jsxs)(`div`,{className:`oc-form`,children:[(0,F.jsxs)(`label`,{className:`oc-field`,children:[(0,F.jsx)(`span`,{className:`oc-field__label`,children:oL()}),(0,F.jsx)(BJ,{value:S.name,onChange:e=>C({...S,name:e.target.value})})]}),(0,F.jsxs)(`label`,{className:`oc-field`,children:[(0,F.jsx)(`span`,{className:`oc-field__label`,children:lL()}),(0,F.jsxs)(C3,{value:S.roleKey||void 0,onValueChange:e=>C({...S,roleKey:e}),children:[(0,F.jsx)(T3,{className:`w-full`,children:(0,F.jsx)(w3,{placeholder:fL()})}),(0,F.jsx)(E3,{children:(u??[]).map(e=>(0,F.jsxs)(Q,{value:e.key,children:[e.name,` (`,e.key,`)`]},e._id))})]}),(()=>{let e=(u??[]).find(e=>e.key===S.roleKey),t=e?R7(e):null;return t?(0,F.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:t}):null})()]}),(0,F.jsxs)(`label`,{className:`oc-field`,children:[(0,F.jsx)(`span`,{className:`oc-field__label`,children:hL()}),(0,F.jsx)(BJ,{value:S.description,onChange:e=>C({...S,description:e.target.value})})]})]})}),(0,F.jsx)(Sbt,{minted:ie,onClose:()=>j(null)})]})}function xbt({account:e,keys:t,onRevoke:n,revoking:r}){return(0,F.jsxs)(`div`,{className:`oc-sa__keys`,children:[(0,F.jsxs)(`div`,{className:`oc-sa__keys-head`,children:[hR(),` `,(0,F.jsx)(`span`,{className:`font-medium`,children:e.name})]}),t.length===0?(0,F.jsx)(`p`,{className:`oc-admin__hint`,children:vR()}):(0,F.jsxs)(`table`,{className:`oc-sa__keytable`,children:[(0,F.jsx)(`thead`,{children:(0,F.jsxs)(`tr`,{children:[(0,F.jsx)(`th`,{children:xR()}),(0,F.jsx)(`th`,{children:wR()}),(0,F.jsx)(`th`,{children:DR()}),(0,F.jsx)(`th`,{children:AR()}),(0,F.jsx)(`th`,{children:NR()}),(0,F.jsx)(`th`,{children:IR()}),(0,F.jsx)(`th`,{})]})}),(0,F.jsx)(`tbody`,{children:t.map(t=>(0,F.jsxs)(`tr`,{children:[(0,F.jsx)(`td`,{children:(0,F.jsxs)(`code`,{className:`oc-sa__keyid`,children:[t.prefix,`…`,t.lastFour]})}),(0,F.jsx)(`td`,{children:(0,F.jsx)($,{variant:`secondary`,children:e.roleKey})}),(0,F.jsx)(`td`,{children:Cbt(t.createdAt)}),(0,F.jsx)(`td`,{className:wbt(t.lastUsedAt)?`oc-sa__stale`:``,children:Tbt(t.lastUsedAt)}),(0,F.jsx)(`td`,{children:Ebt(t.expiresAt)}),(0,F.jsx)(`td`,{children:Dbt(t)}),(0,F.jsx)(`td`,{className:`text-right`,children:t.disabled?null:(0,F.jsx)(H,{variant:`destructive`,size:`sm`,disabled:r.has(t._id),onClick:()=>n(t),children:r.has(t._id)?zR():HR()})})]},t._id))})]})]})}function Sbt({minted:e,onClose:t}){let[n,r]=(0,M.useState)(!1);async function i(){if(e)try{await navigator.clipboard.writeText(e.plaintext),r(!0),window.setTimeout(()=>r(!1),2e3)}catch{}}return(0,F.jsx)(YJ,{open:e!==null,onOpenChange:e=>{e||(r(!1),t())},children:e?(0,F.jsxs)(XJ,{className:`max-w-lg`,showCloseButton:!1,onInteractOutside:e=>e.preventDefault(),onEscapeKeyDown:e=>e.preventDefault(),children:[(0,F.jsxs)(ZJ,{children:[(0,F.jsx)($J,{children:GR()}),(0,F.jsx)(eY,{children:JR({name:e.accountName})})]}),(0,F.jsx)(`div`,{className:`oc-sa__minted-warning`,children:ZR()}),(0,F.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,F.jsx)(`code`,{className:`oc-sa__minted-plain`,children:e.plaintext}),(0,F.jsxs)(H,{variant:`outline`,size:`sm`,onClick:()=>void i(),"aria-label":ez(),children:[n?(0,F.jsx)(hm,{}):(0,F.jsx)(Sm,{}),n?rz():oz()]})]}),(0,F.jsx)(QJ,{children:(0,F.jsx)(H,{onClick:()=>{r(!1),t()},children:lz()})})]}):null})}function Cbt(e){return new Date(e).toLocaleString(`fr-FR`)}function wbt(e){return e===null?!1:Date.now()-e>ybt}function Tbt(e){return e===null?xz():new Date(e).toLocaleString(`fr-FR`)}function Ebt(e){return e===null?`—`:new Date(e).toLocaleDateString(`fr-FR`)}function Dbt(e){return e.disabled?(0,F.jsx)($,{variant:`destructive`,children:wz()}):e.expiresAt!==null&&e.expiresAt<Date.now()?(0,F.jsx)($,{variant:`outline`,children:Dz()}):(0,F.jsx)($,{variant:`outline`,children:Az()})}var H7=[{group:()=>kAe(),keys:[{key:`traces.read`,label:()=>zK()},{key:`traces.read.content`,label:()=>KAe(),phi:!0},{key:`traces.write`,label:()=>BK()}]},{group:()=>MAe(),keys:[{key:`kpi.read`,label:()=>zK()},{key:`kpi.write`,label:()=>BK()}]},{group:()=>FAe(),keys:[{key:`openclaw.query`,label:()=>ZAe()},{key:`anomalies.read`,label:()=>eje()},{key:`anomalies.report`,label:()=>rje()}]},{group:()=>RAe(),keys:[{key:`chats.read`,label:()=>zK()},{key:`selfheal`,label:()=>lje()}]},{group:()=>VAe(),keys:[{key:`admin.manage`,label:()=>oje()}]}],Obt=H7.flatMap(e=>e.keys.map(e=>e.key));function U7(e){return e.includes(`*`)}var W7={key:``,name:``,description:``};function kbt(){let e=N(L.apiKeys.listRoles,{}),t=P(L.apiKeys.createRole),n=P(L.apiKeys.ensureRolesSeeded),r=P(L.apiKeys.updateRolePermissions).withOptimisticUpdate((e,{roleId:t,permissions:n})=>{let r=e.getQuery(L.apiKeys.listRoles,{});r&&e.setQuery(L.apiKeys.listRoles,{},r.map(e=>e._id===t?{...e,permissions:n}:e))}),i=rY(),a=sY(),[o,s]=(0,M.useState)(!1),[c,l]=(0,M.useState)(W7),[u,d]=(0,M.useState)(new Set);(0,M.useEffect)(()=>{n({}).catch(e=>{a.error(hje(),e)})},[n,a]);let f=e??[];async function p(e,t){if(U7(e.permissions)||u.has(e._id))return;let n=e.permissions.includes(t)?e.permissions.filter(e=>e!==t):[...e.permissions,t];if(!(e.builtin&&!await i({title:vje({name:e.name}),description:xje(),confirmLabel:wje()}))){d(t=>new Set(t).add(e._id));try{await r({roleId:e._id,permissions:n})}catch(e){a.error(Dje(),e)}finally{d(t=>{let n=new Set(t);return n.delete(e._id),n})}}}async function m(){try{await t({key:c.key,name:c.name,description:c.description||void 0,permissions:[]}),l(W7),s(!1)}catch(e){a.error(Aje(),e)}}let h=e===void 0,g=!h&&f.length===0;return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`p`,{className:`oc-admin__hint`,children:[Nje(),` `,(0,F.jsx)(`code`,{children:`admin`}),` `,Ije(),` `,(0,F.jsx)(`code`,{children:`traces.read.content`}),` `,zje()]}),(0,F.jsxs)(`div`,{className:`oc-dt`,children:[(0,F.jsxs)(`div`,{className:`oc-dt__bar`,children:[(0,F.jsx)(`h2`,{className:`oc-dt__title`,children:Hje()}),(0,F.jsx)(`div`,{className:`oc-dt__bar-actions`,children:(0,F.jsx)(H,{size:`sm`,onClick:()=>{l(W7),s(!0)},children:Gje()})})]}),h?(0,F.jsx)(`p`,{className:`oc-admin__hint`,children:Jje()}):g?(0,F.jsx)(`p`,{className:`oc-admin__hint`,children:Zje()}):(0,F.jsx)(`div`,{className:`oc-matrix__scroll`,children:(0,F.jsxs)(`table`,{className:`oc-matrix`,children:[(0,F.jsxs)(`thead`,{children:[(0,F.jsxs)(`tr`,{children:[(0,F.jsx)(`th`,{className:`oc-matrix__corner`,rowSpan:2,children:eMe()}),H7.map(e=>(0,F.jsx)(`th`,{className:`oc-matrix__group`,colSpan:e.keys.length,children:e.group()},e.group()))]}),(0,F.jsx)(`tr`,{children:H7.flatMap(e=>e.keys.map(e=>(0,F.jsxs)(`th`,{className:`oc-matrix__perm`,title:e.phi?fje({key:e.key}):e.key,children:[e.label(),e.phi?(0,F.jsx)(`span`,{className:`oc-matrix__phi`,children:` ⚠`}):null]},e.key)))})]}),(0,F.jsx)(`tbody`,{children:f.map(e=>{let t=U7(e.permissions),n=u.has(e._id);return(0,F.jsxs)(`tr`,{children:[(0,F.jsxs)(`th`,{className:`oc-matrix__rolecell`,children:[(0,F.jsxs)(`div`,{className:`oc-matrix__rolename`,children:[(0,F.jsx)(`span`,{children:e.name}),(0,F.jsx)(`code`,{className:`oc-matrix__rolekey`,children:e.key}),e.builtin?(0,F.jsxs)($,{variant:`outline`,className:`gap-1`,children:[(0,F.jsx)(km,{}),` `,rMe()]}):(0,F.jsx)($,{variant:`secondary`,children:oMe()})]}),R7(e)?(0,F.jsx)(`p`,{className:`oc-matrix__roledesc`,children:R7(e)}):null]}),Obt.map(r=>(0,F.jsx)(`td`,{className:`oc-matrix__cell`,children:(0,F.jsx)(uY,{checked:t||e.permissions.includes(r),disabled:t||n,"aria-label":`${e.key} · ${r}`,title:t?wMe():n?DMe():r,onCheckedChange:()=>void p(e,r)})},r))]},e.key)})})]})})]}),(0,F.jsx)(Q8,{open:o,onOpenChange:s,title:AMe(),description:NMe(),canSubmit:!!(c.key&&c.name),onSubmit:m,submitLabel:IMe(),children:(0,F.jsxs)(`div`,{className:`oc-form`,children:[(0,F.jsxs)(`label`,{className:`oc-field`,children:[(0,F.jsx)(`span`,{className:`oc-field__label`,children:zMe()}),(0,F.jsx)(BJ,{value:c.key,placeholder:HMe(),onChange:e=>l({...c,key:e.target.value})})]}),(0,F.jsxs)(`label`,{className:`oc-field`,children:[(0,F.jsx)(`span`,{className:`oc-field__label`,children:GMe()}),(0,F.jsx)(BJ,{value:c.name,onChange:e=>l({...c,name:e.target.value})})]}),(0,F.jsxs)(`label`,{className:`oc-field`,children:[(0,F.jsx)(`span`,{className:`oc-field__label`,children:JMe()}),(0,F.jsx)(BJ,{value:c.description,onChange:e=>l({...c,description:e.target.value})})]})]})})]})}function Abt(e,t,n){let r=t.trim().toLowerCase();return[...r?e.filter(e=>[e.email,e.name,e.canonical].some(e=>e!=null&&e.toLowerCase().includes(r))):e.slice()].sort((e,t)=>!n.has(e.userId)-+!n.has(t.userId))}function jbt(e,t){let n=e.filter(e=>e.source===`discovered`),r=t.trim().toLowerCase();return r?n.filter(e=>(e.displayName??e.agentId).toLowerCase().includes(r)||e.agentId.toLowerCase().includes(r)):n}function Mbt(e){let t=e.name?.trim()??``,n=e.email?.trim()??``,r=e.canonical?.trim()||`u-${e.userId.slice(0,8)}`;return t?{primary:t,secondary:n||`@${r}`}:n?{primary:n,secondary:null}:{primary:`@${r}`,secondary:null}}function Nbt(e){switch(e){case`admin`:return a4e();case`user`:return c4e();case`pending`:return d4e();default:return e}}function G7(e,t){if(e.length===0)return`none`;let n=0;for(let r of e)t(r)&&n++;return n===0?`none`:n===e.length?`all`:`some`}function K7(e,t,n){let r=Math.max(1,Math.ceil(e.length/n)),i=Math.min(Math.max(1,Math.floor(t)),r),a=(i-1)*n;return{pageItems:e.slice(a,a+n),page:i,pageCount:r}}function Pbt({className:e,orientation:t=`horizontal`,...n}){return(0,F.jsx)(Ude,{"data-slot":`tabs`,"data-orientation":t,className:TJ(`group/tabs flex gap-2 data-horizontal:flex-col`,e),...n})}var Fbt=RJ(`group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none`,{variants:{variant:{default:`bg-muted`,line:`gap-1 bg-transparent`}},defaultVariants:{variant:`default`}});function Ibt({className:e,variant:t=`default`,...n}){return(0,F.jsx)(Wde,{"data-slot":`tabs-list`,"data-variant":t,className:TJ(Fbt({variant:t}),e),...n})}function q7({className:e,...t}){return(0,F.jsx)(Gde,{"data-slot":`tabs-trigger`,className:TJ(`relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent`,`data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground`,`after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100`,e),...t})}function J7({className:e,...t}){return(0,F.jsx)(Kde,{"data-slot":`tabs-content`,className:TJ(`flex-1 text-sm outline-none`,e),...t})}var Y7={name:``,description:``};function Lbt(){let e=N(L.groups.listGroups,{}),t=N(L.me.getMe,{host:BO})?.role===`admin`,n=P(L.groups.createGroup),r=P(L.groups.updateGroup),i=P(L.groups.deleteGroup),a=rY(),o=sY(),[s,c]=(0,M.useState)(!1),[l,u]=(0,M.useState)(null),[d,f]=(0,M.useState)(Y7),[p,m]=(0,M.useState)(null),[h,g]=(0,M.useState)(``),_=(0,M.useMemo)(()=>{if(!e)return e;let t=h.trim().toLowerCase();return t?e.filter(e=>e.name.toLowerCase().includes(t)||(e.description??``).toLowerCase().includes(t)||e.members.some(e=>e.label.toLowerCase().includes(t))||e.agents.some(e=>e.toLowerCase().includes(t))||e.charts.some(e=>e.name.toLowerCase().includes(t))):e},[e,h]);function v(){u(null),f(Y7),c(!0)}function y(e){u(e),f({name:e.name,description:e.description??``}),c(!0)}async function b(){try{l?await r({groupId:l._id,name:d.name,description:d.description}):await n({name:d.name,description:d.description||void 0}),f(Y7),u(null),c(!1)}catch(e){o.error(w3e(),e)}}async function x(e){if(await a({title:v2e({name:e.name}),description:x2e(),confirmWord:e.name,confirmLabel:w2e(),cancelLabel:e2e(),destructive:!0}))try{await i({groupId:e._id})}catch(e){o.error(D3e(),e)}}return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`p`,{className:`oc-admin__hint`,children:v0e()}),(0,F.jsx)(r7,{q:h,onQChange:g,onReset:()=>g(``),canReset:h!==``,searchPlaceholder:z0e()}),(0,F.jsx)(k5,{title:h0e(),rows:_,addLabel:x0e(),onAdd:t?v:void 0,emptyHint:w0e(),columns:[{header:D0e(),cell:e=>e.name,sort:e=>e.name},{header:A0e(),cell:e=>(0,F.jsx)(A5,{icon:(0,F.jsx)(Um,{size:12,"aria-hidden":!0}),total:e.memberCount,items:e.members.map(e=>({label:e.label,marker:e.manager?(0,F.jsx)(Lm,{size:11,"aria-hidden":!0}):null,highlight:e.manager}))}),sort:e=>e.memberCount},{header:N0e(),cell:e=>(0,F.jsx)(A5,{icon:(0,F.jsx)(Im,{size:12,"aria-hidden":!0}),total:e.agentCount,items:e.agents.map(e=>({label:e}))}),sort:e=>e.agentCount},{header:I0e(),cell:e=>(0,F.jsx)(A5,{icon:(0,F.jsx)(Mm,{size:12,"aria-hidden":!0}),total:e.chartCount,items:e.charts.map(e=>({label:e.name,marker:e.isDefault?(0,F.jsx)(zm,{size:11,fill:`currentColor`,"aria-hidden":!0}):null,highlight:e.isDefault}))}),sort:e=>e.chartCount}],rowActions:e=>[{label:H0e(),onSelect:()=>m({groupId:e._id,name:e.name})},...t?[{label:G0e(),onSelect:()=>y(e)},{label:J0e(),variant:`destructive`,onSelect:()=>void x(e)}]:[]]}),(0,F.jsx)(Q8,{open:s,onOpenChange:c,title:l?o2e():r2e(),description:l2e(),canSubmit:!!d.name.trim(),onSubmit:b,submitLabel:Z0e(),children:(0,F.jsxs)(`div`,{className:`oc-form`,children:[(0,F.jsxs)(`label`,{className:`oc-field`,children:[(0,F.jsx)(`span`,{className:`oc-field__label`,children:f2e()}),(0,F.jsx)(BJ,{value:d.name,onChange:e=>f({...d,name:e.target.value})})]}),(0,F.jsxs)(`label`,{className:`oc-field`,children:[(0,F.jsx)(`span`,{className:`oc-field__label`,children:h2e()}),(0,F.jsx)(BJ,{value:d.description,onChange:e=>f({...d,description:e.target.value})})]})]})}),(0,F.jsx)(Rbt,{groupId:p?.groupId??null,groupName:p?.name??``,open:p!==null,onOpenChange:e=>{e||m(null)}})]})}var X7=8;function Z7({page:e,pageCount:t,onPage:n}){return t<=1?null:(0,F.jsxs)(`div`,{className:`oc-access__pager`,children:[(0,F.jsxs)(H,{type:`button`,variant:`ghost`,size:`sm`,disabled:e<=1,onClick:()=>n(e-1),children:[(0,F.jsx)(yee,{size:14,"aria-hidden":!0}),X2e()]}),(0,F.jsxs)(`span`,{className:`oc-access__pageinfo`,"aria-label":n4e({page:e,pages:t}),children:[e,` / `,t]}),(0,F.jsxs)(H,{type:`button`,variant:`ghost`,size:`sm`,disabled:e>=t,onClick:()=>n(e+1),children:[$2e(),(0,F.jsx)(_m,{size:14,"aria-hidden":!0})]})]})}function Rbt({groupId:e,groupName:t,open:n,onOpenChange:r}){let i=N(L.groups.getGroup,n&&e?{groupId:e}:`skip`),a=N(L.groups.listAssignableInstances,n?{}:`skip`),o=N(L.groups.listAssignableUsers,n?{}:`skip`),s=P(L.groups.addMember),c=P(L.groups.removeMember),l=P(L.groups.bulkSetMembers),u=P(L.groups.setGroupManager),d=sY(),[f,p]=(0,M.useState)(``),[m,h]=(0,M.useState)(``),[g,_]=(0,M.useState)(`members`),[v,y]=(0,M.useState)(1),[b,x]=(0,M.useState)(new Set),S=(0,M.useRef)(null),C=(0,M.useMemo)(()=>new Set((i?.members??[]).map(e=>e.userId)),[i]),w=(0,M.useMemo)(()=>new Set((i?.members??[]).filter(e=>e.manager).map(e=>e.userId)),[i]),T=i?.viewerIsAdmin===!0,E=(0,M.useMemo)(()=>new Set((i?.agents??[]).map(e=>`${e.instanceName}/${e.agentId}`)),[i]);(0,M.useEffect)(()=>{p(``),h(``),_(`members`),y(1),S.current=null},[n,e]),(0,M.useEffect)(()=>{y(1)},[f]),(0,M.useEffect)(()=>{n&&i&&e&&S.current!==e&&(S.current=e,x(new Set((i.members??[]).map(e=>e.userId))))},[n,i,e]);let D=(0,M.useMemo)(()=>o?Abt(o,f,b):[],[o,f,b]);async function O(t,n){if(e)try{n?await c({groupId:e,userId:t}):await s({groupId:e,userId:t})}catch(e){d.error(Cq(),e)}}async function ee(t,n){if(e)try{await u({groupId:e,userId:t,manager:!n})}catch(e){d.error(y3e(),e)}}let te=G7(D,e=>C.has(e.userId)),k=D.filter(e=>C.has(e.userId)).length,A=K7(D,v,X7);async function ne(){if(!e||D.length===0)return;let t=D.map(e=>e.userId);try{await l({groupId:e,userIds:t,member:te!==`all`})}catch(e){d.error(Cq(),e)}}return(0,F.jsx)(YJ,{open:n,onOpenChange:r,children:(0,F.jsxs)(XJ,{className:`oc-access`,children:[(0,F.jsxs)(ZJ,{children:[(0,F.jsx)($J,{children:D2e({name:t})}),(0,F.jsx)(eY,{children:A2e()})]}),(0,F.jsxs)(Pbt,{value:g,onValueChange:_,className:`oc-access__tabs`,children:[(0,F.jsxs)(Ibt,{className:`w-full`,children:[(0,F.jsxs)(q7,{value:`members`,className:`flex-1 gap-1.5`,children:[(0,F.jsx)(Um,{size:13,"aria-hidden":!0}),N2e(),i?(0,F.jsx)($,{variant:`secondary`,className:`oc-access__tabcount`,children:C.size}):null]}),(0,F.jsxs)(q7,{value:`agents`,className:`flex-1 gap-1.5`,children:[(0,F.jsx)(Im,{size:13,"aria-hidden":!0}),z2e(),i?(0,F.jsx)($,{variant:`secondary`,className:`oc-access__tabcount`,children:E.size}):null]}),(0,F.jsxs)(q7,{value:`charts`,className:`flex-1 gap-1.5`,children:[(0,F.jsx)(Mm,{size:13,"aria-hidden":!0}),G4e(),i?(0,F.jsx)($,{variant:`secondary`,className:`oc-access__tabcount`,children:i.chartCount}):null]})]}),(0,F.jsx)(J7,{value:`members`,children:o===void 0||i===void 0?(0,F.jsx)(`p`,{className:`oc-access__hint`,children:hq()}):o.length===0?(0,F.jsx)(`p`,{className:`oc-access__hint`,children:T4e()}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(BJ,{value:f,onChange:e=>p(e.target.value),placeholder:I2e(),className:`oc-access__search`}),D.length===0?(0,F.jsx)(`p`,{className:`oc-access__hint`,children:G2e()}):(0,F.jsxs)(F.Fragment,{children:[D.length>1?(0,F.jsxs)(`div`,{className:`oc-access__row oc-access__selectall`,children:[(0,F.jsx)(uY,{checked:te===`all`?!0:te===`some`?`indeterminate`:!1,onCheckedChange:()=>void ne(),"aria-label":mq()}),(0,F.jsx)(`span`,{className:`oc-access__label`,children:mq()}),(0,F.jsxs)($,{variant:`outline`,className:`oc-access__count`,children:[k,` / `,D.length]})]}):null,(0,F.jsx)(`div`,{className:`oc-access__list`,children:A.pageItems.map(e=>{let t=C.has(e.userId),n=Mbt(e),r=w.has(e.userId);return(0,F.jsxs)(`div`,{className:`oc-access__row`,children:[(0,F.jsx)(uY,{checked:t,onCheckedChange:()=>void O(e.userId,t),"aria-label":m4e({user:n.primary})}),(0,F.jsxs)(`span`,{className:`oc-access__who`,children:[(0,F.jsx)(`span`,{className:`oc-access__label`,title:n.primary,children:n.primary}),n.secondary?(0,F.jsx)(`span`,{className:`oc-access__sub`,title:n.secondary,children:n.secondary}):null]}),(0,F.jsx)($,{variant:`outline`,className:`oc-access__role`,children:Nbt(e.role)}),(0,F.jsx)(`span`,{className:`oc-access__mgrslot`,children:t&&T?(0,F.jsx)(H,{type:`button`,variant:`ghost`,size:`icon`,className:`shrink-0 oc-access__mgr${r?` oc-access__mgr--on`:``}`,"aria-pressed":r,"aria-label":r?xq():bq(),title:r?xq():bq(),onClick:()=>void ee(e.userId,r),children:(0,F.jsx)(Lm,{size:15,"aria-hidden":!0})}):t&&r?(0,F.jsx)(`span`,{className:`oc-access__mgr oc-access__mgr--on`,role:`img`,"aria-label":yq(),title:yq(),children:(0,F.jsx)(Lm,{size:15,"aria-hidden":!0})}):null})]},e._id)})}),(0,F.jsx)(Z7,{page:A.page,pageCount:A.pageCount,onPage:y})]})]})}),(0,F.jsx)(J7,{value:`agents`,children:a===void 0?(0,F.jsx)(`p`,{className:`oc-access__hint`,children:hq()}):a.length===0?(0,F.jsx)(`p`,{className:`oc-access__hint`,children:O4e()}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(BJ,{value:m,onChange:e=>h(e.target.value),placeholder:H2e(),className:`oc-access__search`}),(0,F.jsx)(`div`,{className:`oc-access__list`,children:a.map(t=>(0,F.jsx)(zbt,{groupId:e,instanceName:t.name,kind:t.kind??`openclaw`,assigned:E,query:m},`${e}-${t._id}`))})]})}),(0,F.jsx)(J7,{value:`charts`,children:(0,F.jsx)(Bbt,{groupId:e})})]})]})})}function zbt({groupId:e,instanceName:t,kind:n,assigned:r,query:i}){let a=N(L.groups.listAssignableAgents,{instanceName:t}),o=P(L.groups.assignAgentToGroup),s=P(L.groups.removeAgentFromGroup),c=P(L.groups.bulkSetGroupAgents),l=sY(),[u,d]=(0,M.useState)(1);if((0,M.useEffect)(()=>{d(1)},[i]),!e)return null;let f=jbt(a?.agents??[],i),p=a?.discovery&&!a.discovery.lastPollOk;if(i.trim()&&f.length===0)return null;let m=f.filter(e=>e.presentInLastOk!==!1),h=G7(m,e=>r.has(`${t}/${e.agentId}`)),g=K7(f,u,X7);async function _(n,r){try{r?await s({groupId:e,instanceName:t,agentId:n}):await o({groupId:e,instanceName:t,agentId:n})}catch(e){l.error(wq(),e)}}async function v(){if(m.length===0)return;let n=m.map(e=>e.agentId);try{await c({groupId:e,instanceName:t,agentIds:n,assigned:h!==`all`})}catch(e){l.error(wq(),e)}}return(0,F.jsxs)(`div`,{className:`oc-access__group`,children:[(0,F.jsxs)(`div`,{className:`oc-access__instance`,children:[(0,F.jsx)(Im,{size:13,"aria-hidden":!0}),(0,F.jsx)(`span`,{children:t}),(0,F.jsx)($,{variant:`outline`,className:`oc-access__kind`,children:n}),p?(0,F.jsx)($,{variant:`outline`,className:`oc-access__stale`,children:L4e()}):null]}),a===void 0?(0,F.jsx)(`p`,{className:`oc-access__hint`,children:S4e()}):f.length===0?(0,F.jsx)(`p`,{className:`oc-access__hint`,children:p?P4e():j4e()}):(0,F.jsxs)(F.Fragment,{children:[m.length>1?(0,F.jsxs)(`div`,{className:`oc-access__row oc-access__selectall`,children:[(0,F.jsx)(uY,{checked:h===`all`?!0:h===`some`?`indeterminate`:!1,onCheckedChange:()=>void v(),"aria-label":mq()}),(0,F.jsx)(`span`,{className:`oc-access__label`,children:mq()})]}):null,g.pageItems.map(e=>{let n=`${t}/${e.agentId}`,i=r.has(n),a=e.presentInLastOk===!1;return(0,F.jsxs)(`div`,{className:`oc-access__row`,children:[(0,F.jsx)(uY,{checked:i,disabled:a&&!i,onCheckedChange:()=>void _(e.agentId,i),"aria-label":_4e({name:e.displayName??e.agentId})}),(0,F.jsxs)(`span`,{className:`oc-access__label`,title:e.displayName??e.agentId,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]}),e.model?(0,F.jsx)(`span`,{className:`oc-access__model`,children:e.model}):null,e.isDefaultOnInstance?(0,F.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":gq(),title:gq(),children:(0,F.jsx)(zm,{size:14,fill:`currentColor`})}):null,a?(0,F.jsx)($,{variant:`outline`,className:`oc-access__gone`,children:B4e()}):null]},e.agentId)}),(0,F.jsx)(Z7,{page:g.page,pageCount:g.pageCount,onPage:d})]})]})}function Bbt({groupId:e}){let t=N(L.charts.listGroupChartSelection,e?{groupId:e}:`skip`),n=P(L.charts.assignChartToGroup),r=P(L.charts.removeChartFromGroup),i=P(L.charts.setGroupDefaultChart),a=P(L.charts.addChartToGroupPool),o=P(L.charts.removeChartFromGroupPool),s=sY();if(!e)return null;if(t===void 0)return(0,F.jsx)(`p`,{className:`oc-access__hint`,children:hq()});let{pool:c,addable:l,canManagePool:u}=t;if(c.length===0&&!u)return(0,F.jsx)(`p`,{className:`oc-access__hint`,children:J4e()});async function d(t,i){try{i?await r({groupId:e,chartKey:t}):await n({groupId:e,chartKey:t})}catch(e){s.error(Sq(),e)}}async function f(t){try{await i({groupId:e,chartKey:t})}catch(e){s.error(Sq(),e)}}async function p(t){try{await a({groupId:e,chartKey:t})}catch(e){s.error(Sq(),e)}}async function m(t){try{await o({groupId:e,chartKey:t})}catch(e){s.error(Sq(),e)}}return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`div`,{className:`oc-access__list`,children:c.map(e=>(0,F.jsxs)(`div`,{className:`oc-access__row`,children:[(0,F.jsx)(uY,{checked:e.selected,onCheckedChange:()=>void d(e.chartKey,e.selected),"aria-label":a3e({name:e.name})}),(0,F.jsx)(`span`,{className:`oc-access__label`,title:e.name,children:e.name}),e.selected?e.isDefault?(0,F.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":vq(),title:vq(),children:(0,F.jsx)(zm,{size:14,fill:`currentColor`})}):(0,F.jsx)(H,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>void f(e.chartKey),children:u3e()}):null,u?(0,F.jsx)(H,{type:`button`,variant:`ghost`,size:`sm`,"aria-label":_q({name:e.name}),title:_q({name:e.name}),onClick:()=>void m(e.chartKey),children:(0,F.jsx)(Gm,{size:14,"aria-hidden":!0})}):null]},e.chartKey))}),u?l.length>0?(0,F.jsxs)(C3,{value:``,onValueChange:e=>void p(e),children:[(0,F.jsx)(T3,{size:`sm`,className:`oc-access__search`,children:(0,F.jsx)(w3,{placeholder:e3e()})}),(0,F.jsx)(E3,{children:l.map(e=>(0,F.jsx)(Q,{value:e.chartKey,children:e.name},e.chartKey))})]}):c.length===0?(0,F.jsx)(`p`,{className:`oc-access__hint`,children:Z4e()}):null:null]})}var Vbt=[50,100,200,500],Q7=`all`,$7=`__all__`,Hbt=[`2xx`,`4xx`,`5xx`],Ubt=[`user`,`service`,`system`],Wbt=[`inbound`,`outbound`,`internal`],Gbt={kind:`relative`,from:`now-30d`,to:`now`},Kbt=[{value:`kind`,label:`kind`},{value:`status`,label:`status`},{value:`latencyMs`,label:`latence (ms)`},{value:`principalType`,label:`principal`},{value:`direction`,label:`direction`},{value:`roleKey`,label:`rôle`},{value:`route`,label:`route`},{value:`correlationId`,label:`correlationId`}];function qbt(){let e=ss({from:`/settings/traces`}),t=cs({from:`/settings/traces`}),n=e.limit,r=e.kind,i=e.statusClass??$7,a=e.principalType??$7,o=e.direction??$7,s=e.roleKey??$7,c=e.q??``,l=_7(e.from,e.to),u=(0,M.useMemo)(()=>b7(e.adv),[e.adv]),{from:d,to:f}=e7(l),[p,m]=(0,M.useState)(null),[h,g]=(0,M.useState)(null),_=e=>void t({search:t=>({...t,limit:e})}),v=e=>void t({search:t=>({...t,kind:e})}),y=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),b=e=>void t({search:t=>({...t,statusClass:e===$7?void 0:e})}),x=e=>void t({search:t=>({...t,principalType:e===$7?void 0:e})}),S=e=>void t({search:t=>({...t,direction:e===$7?void 0:e})}),C=e=>void t({search:t=>({...t,roleKey:e===$7?void 0:e})}),w=e=>void t({search:t=>({...t,...v7(e)})}),T=e=>void t({search:t=>({...t,adv:y7(e)}),replace:!0}),E=N(L.observability.listEvents,{limit:n}),D=N(L.observability.listEvents,{limit:n,kind:r===Q7?void 0:r,filter:{q:c||void 0,from:d,to:f,statusClass:i===$7?void 0:i,principalType:a===$7?void 0:a,direction:o===$7?void 0:o,roleKey:s===$7?void 0:s,advanced:u.length>0?u:void 0}}),O=(0,M.useMemo)(()=>{let e=new Set;for(let t of E??[])e.add(t.kind);return[...e].sort()},[E]),ee=(0,M.useMemo)(()=>{let e=new Set;for(let t of E??[])t.roleKey&&e.add(t.roleKey);return[...e].sort()},[E]),te=c!==``||i!==$7||a!==$7||o!==$7||s!==$7||u.length>0||l.kind!==`relative`||l.from!==Gbt.from;function k(){t({search:{limit:100,kind:`all`},replace:!0})}let A=p?E?.filter(e=>e.correlationId===p):D;return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`p`,{className:`oc-admin__hint`,children:[VIe(),(0,F.jsx)(`strong`,{children:WIe()}),qIe(),` `,(0,F.jsx)(`span`,{className:`oc-filter__window`,children:XIe()})]}),(0,F.jsxs)(r7,{q:c,onQChange:y,searchPlaceholder:$Ie(),timeRange:l,onTimeRangeChange:w,onReset:k,canReset:te,children:[(0,F.jsxs)(C3,{value:i,onValueChange:b,children:[(0,F.jsx)(T3,{size:`sm`,className:`w-32`,children:(0,F.jsx)(w3,{placeholder:nLe()})}),(0,F.jsxs)(E3,{children:[(0,F.jsx)(Q,{value:$7,children:aLe()}),Hbt.map(e=>(0,F.jsx)(Q,{value:e,children:e},e))]})]}),(0,F.jsxs)(C3,{value:a,onValueChange:x,children:[(0,F.jsx)(T3,{size:`sm`,className:`w-32`,children:(0,F.jsx)(w3,{placeholder:cLe()})}),(0,F.jsxs)(E3,{children:[(0,F.jsx)(Q,{value:$7,children:dLe()}),Ubt.map(e=>(0,F.jsx)(Q,{value:e,children:e},e))]})]}),(0,F.jsxs)(C3,{value:o,onValueChange:S,children:[(0,F.jsx)(T3,{size:`sm`,className:`w-32`,children:(0,F.jsx)(w3,{placeholder:mLe()})}),(0,F.jsxs)(E3,{children:[(0,F.jsx)(Q,{value:$7,children:_Le()}),Wbt.map(e=>(0,F.jsx)(Q,{value:e,children:e},e))]})]}),(0,F.jsxs)(C3,{value:s,onValueChange:C,children:[(0,F.jsx)(T3,{size:`sm`,className:`w-36`,children:(0,F.jsx)(w3,{placeholder:bLe()})}),(0,F.jsxs)(E3,{children:[(0,F.jsx)(Q,{value:$7,children:CLe()}),ee.map(e=>(0,F.jsx)(Q,{value:e,children:e},e))]})]}),(0,F.jsxs)(C3,{value:r,onValueChange:v,children:[(0,F.jsx)(T3,{size:`sm`,className:`w-44`,children:(0,F.jsx)(w3,{placeholder:ELe()})}),(0,F.jsxs)(E3,{children:[(0,F.jsx)(Q,{value:Q7,children:kLe()}),O.map(e=>(0,F.jsx)(Q,{value:e,children:e},e))]})]}),(0,F.jsxs)(C3,{value:String(n),onValueChange:e=>_(Number(e)),children:[(0,F.jsx)(T3,{size:`sm`,className:`w-28`,children:(0,F.jsx)(w3,{})}),(0,F.jsx)(E3,{children:Vbt.map(e=>(0,F.jsx)(Q,{value:String(e),children:MLe({count:e})},e))})]})]}),(0,F.jsx)(m7,{fields:Kbt,seed:u,onChange:T}),p?(0,F.jsx)(`div`,{className:`oc-traces__followline`,children:(0,F.jsxs)(`button`,{type:`button`,className:`oc-traces__chip`,onClick:()=>m(null),title:FLe(),children:[(0,F.jsxs)(`span`,{className:`oc-traces__chip-label`,children:[RLe(),(0,F.jsx)(`code`,{children:e9(p)})]}),(0,F.jsx)(Gm,{className:`oc-traces__chip-x`,"aria-hidden":!0}),(0,F.jsx)(`span`,{className:`sr-only`,children:VLe()})]})}):null,(0,F.jsx)(k5,{title:WLe(),rows:A,emptyHint:p?qLe():XLe(),columns:[{header:$Le(),sort:e=>e.at,cell:e=>(0,F.jsx)(`span`,{className:`oc-traces__time`,children:new Date(e.at).toLocaleString(`fr-FR`)})},{header:nRe(),sort:e=>e.kind,cell:e=>(0,F.jsx)($,{variant:`secondary`,children:e.kind})},{header:aRe(),sort:e=>t9(e)??null,cell:e=>{let t=t9(e);return t?(0,F.jsxs)(`span`,{className:`oc-traces__fail`,title:t,children:[`✕ `,t]}):(0,F.jsx)(`span`,{className:`oc-traces__ok`,"aria-label":cRe(),children:`✓`})}},{header:dRe(),sort:e=>e.direction,cell:e=>e.direction?(0,F.jsx)($,{variant:`outline`,children:e.direction}):(0,F.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:mRe(),sort:e=>e.principalType,cell:e=>(0,F.jsxs)(`span`,{className:`oc-traces__principal`,children:[(0,F.jsx)($,{variant:`outline`,children:e.principalType}),e.principalId?(0,F.jsx)(`code`,{className:`oc-traces__mono`,children:e9(e.principalId)}):null]})},{header:_Re(),sort:e=>e.roleKey,cell:e=>e.roleKey?(0,F.jsx)($,{variant:`secondary`,children:e.roleKey}):(0,F.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:bRe(),sort:e=>e.route,cell:e=>e.route?(0,F.jsxs)(`span`,{className:`oc-traces__route`,children:[e.method?(0,F.jsx)(`span`,{className:`oc-traces__method`,children:e.method}):null,(0,F.jsx)(`code`,{className:`oc-traces__mono`,children:e.route})]}):(0,F.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:CRe(),sort:e=>e.status,cell:e=>e.status===null?(0,F.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}):(0,F.jsx)(`span`,{className:`oc-traces__status ${Jbt(e.status)}`,children:e.status})},{header:ERe(),sort:e=>e.latencyMs,cell:e=>e.latencyMs===null?(0,F.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}):(0,F.jsxs)(`span`,{className:`oc-traces__mono`,children:[e.latencyMs,` ms`]})},{header:kRe(),sort:e=>e.correlationId,cell:e=>e.correlationId?(0,F.jsx)(`button`,{type:`button`,className:`oc-traces__corr`,title:MRe(),onClick:()=>m(e.correlationId),children:e9(e.correlationId)}):(0,F.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:FRe(),sort:e=>+!!e.meta,cell:e=>e.meta?(0,F.jsx)(H,{variant:`outline`,size:`sm`,onClick:()=>g(e),children:RRe()}):(0,F.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}]}),(0,F.jsx)(Ybt,{row:h,onClose:()=>g(null)})]})}function Jbt(e){return e>=500?`oc-traces__status--5xx`:e>=400?`oc-traces__status--4xx`:e>=200&&e<300?`oc-traces__status--2xx`:`oc-traces__status--other`}function e9(e){return e.length>8?e.slice(0,8):e}function t9(e){if(typeof e.status==`number`&&e.status>=400)return String(e.status);if(!e.meta)return null;try{let t=JSON.parse(e.meta);if(e.kind===`openclaw.dispatch`&&t.dispatchStatus===`failed`)return t.errorCode??`failed`;if(e.kind===`assistant.stream`&&t.phase===`finalize`&&(t.streamStatus===`error`||t.streamStatus===`aborted`))return t.streamStatus;if(e.kind===`openclaw.ingest.denied`)return`denied`}catch{}return null}function Ybt({row:e,onClose:t}){let n=(0,M.useMemo)(()=>{if(!e?.meta)return``;try{return JSON.stringify(JSON.parse(e.meta),null,2)}catch{return e.meta}},[e]);return(0,F.jsx)(YJ,{open:e!==null,onOpenChange:e=>{e||t()},children:e?(0,F.jsxs)(XJ,{className:`max-w-lg`,children:[(0,F.jsxs)(ZJ,{children:[(0,F.jsxs)($J,{className:`oc-traces__meta-title`,children:[VRe(),` `,(0,F.jsx)(`code`,{children:e.kind}),(0,F.jsx)($,{variant:`outline`,children:WRe()})]}),(0,F.jsx)(eY,{children:qRe()})]}),(0,F.jsx)(`pre`,{className:`oc-traces__meta-json`,children:n})]}):null})}function n9({className:e,size:t=`default`,...n}){return(0,F.jsx)(`div`,{"data-slot":`card`,"data-size":t,className:TJ(`group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl`,e),...n})}function r9({className:e,...t}){return(0,F.jsx)(`div`,{"data-slot":`card-header`,className:TJ(`group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3`,e),...t})}function i9({className:e,...t}){return(0,F.jsx)(`div`,{"data-slot":`card-title`,className:TJ(`font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm`,e),...t})}function a9({className:e,...t}){return(0,F.jsx)(`div`,{"data-slot":`card-description`,className:TJ(`text-sm text-muted-foreground`,e),...t})}function o9({className:e,...t}){return(0,F.jsx)(`div`,{"data-slot":`card-content`,className:TJ(`px-4 group-data-[size=sm]/card:px-3`,e),...t})}function Xbt({className:e,...t}){return(0,F.jsx)(`div`,{"data-slot":`card-footer`,className:TJ(`flex items-center rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/card:p-3`,e),...t})}var s9=[{metric:`api.calls`,label:BWe(),unit:`/h`,group:`API`,isError:!1},{metric:`api.errors`,label:UWe(),unit:`/h`,group:`API`,isError:!0},{metric:`api.latency.avg_ms`,label:KWe(),unit:`ms`,group:`API`,isError:!1},{metric:`openclaw.ingest`,label:YWe(),unit:`/h`,group:`OpenClaw`,isError:!1},{metric:`chat.send`,label:QWe(),unit:`/h`,group:`Chat`,isError:!1},{metric:`assistant.stream.errors`,label:tGe(),unit:`/h`,group:`Assistant`,isError:!0}],c9=s9.length,Zbt=[`API`,`OpenClaw`,`Chat`,`Assistant`],Qbt=1e3,$bt=36e5;function ext(e,t){let n=Math.max(1,Math.ceil((t-e)/$bt)),r=Math.min(n*c9,Qbt);return{rowLimit:r,buckets:Math.max(1,Math.floor(r/c9))}}function txt(){let e=ss({from:`/settings/kpi`}),t=cs({from:`/settings/kpi`}),n=_7(e.from,e.to,Jyt,`now`),r=e=>void t({search:t=>({...t,...v7(e)})}),{from:i,to:a}=e7(n),{rowLimit:o,buckets:s}=ext(i,a),c=N(L.kpi.listKpis,{limit:o,filter:{from:i,to:a}}),l=(0,M.useMemo)(()=>{let e=new Map;for(let t of c??[]){let n=e.get(t.metric)??[];n.push({bucket:t.bucket,value:t.value}),e.set(t.metric,n)}for(let[t,n]of e)n.sort((e,t)=>e.bucket<t.bucket?-1:+(e.bucket>t.bucket)),n.length>s&&e.set(t,n.slice(n.length-s));return e},[c,s]),u=(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`p`,{className:`oc-admin__hint`,children:[iGe(),` `,(0,F.jsx)(`span`,{className:`oc-filter__window`,children:sGe()})]}),(0,F.jsx)(nxt,{value:n,onChange:r})]});return c===void 0?(0,F.jsxs)(F.Fragment,{children:[u,(0,F.jsx)(`p`,{className:`oc-admin__hint`,children:uGe()})]}):c.length===0?(0,F.jsxs)(F.Fragment,{children:[u,(0,F.jsx)(`p`,{className:`oc-admin__hint`,children:pGe()})]}):(0,F.jsxs)(F.Fragment,{children:[u,Zbt.map(e=>{let t=s9.filter(t=>t.group===e);return t.some(e=>(l.get(e.metric)??[]).length>0)?(0,F.jsxs)(`section`,{className:`oc-kpi__group`,children:[(0,F.jsx)(`h2`,{className:`oc-kpi__group-title`,children:e}),(0,F.jsx)(`div`,{className:`oc-kpi__grid`,children:t.map(e=>(0,F.jsx)(rxt,{config:e,series:l.get(e.metric)??[]},e.metric))})]},e):null})]})}function nxt({value:e,onChange:t}){return(0,F.jsx)(`div`,{className:`oc-kpi__toolbar`,children:(0,F.jsx)(n7,{value:e,onChange:t})})}function rxt({config:e,series:t}){let n=t.length>0?t[t.length-1]:null,r=n?n.value:0;return(0,F.jsxs)(n9,{size:`sm`,className:`oc-kpi__card`,children:[(0,F.jsxs)(r9,{children:[(0,F.jsx)(i9,{className:`oc-kpi__card-title`,children:e.label}),(0,F.jsx)(a9,{className:`oc-kpi__card-metric`,children:(0,F.jsx)(`code`,{children:e.metric})})]}),(0,F.jsxs)(o9,{className:`oc-kpi__card-body`,children:[(0,F.jsxs)(`div`,{className:`oc-kpi__value-row`,children:[(0,F.jsx)(`span`,{className:`oc-kpi__value`+(e.isError&&r>0?` oc-kpi__value--error`:``),children:d9(r)}),(0,F.jsx)(`span`,{className:`oc-kpi__unit`,children:e.unit})]}),(0,F.jsx)(axt,{series:t,isError:e.isError,unit:e.unit}),(0,F.jsxs)(`div`,{className:`oc-kpi__axis`,children:[n?(0,F.jsx)(`span`,{className:`oc-kpi__axis-latest`,children:gGe({value:f9(n.bucket)})}):(0,F.jsx)(`span`,{className:`oc-kpi__muted`,children:yGe()}),(0,F.jsx)(`span`,{className:`oc-kpi__muted`,children:SGe({count:t.length})})]})]})]})}var l9=240,u9=48,ixt=1;function axt({series:e,isError:t,unit:n}){if(e.length===0)return(0,F.jsx)(`div`,{className:`oc-kpi__chart oc-kpi__chart--empty`,"aria-hidden":!0});let r=e.reduce((e,t)=>t.value>e?t.value:e,0),i=l9/e.length,a=Math.max(i-ixt,1);return(0,F.jsx)(`svg`,{className:`oc-kpi__chart`,viewBox:`0 0 ${l9} ${u9}`,preserveAspectRatio:`none`,role:`img`,"aria-label":TGe({max:d9(r),unit:n}),children:e.map((e,o)=>{let s=r>0?e.value/r*(u9-1):0,c=o*i,l=u9-s;return(0,F.jsx)(`rect`,{className:`oc-kpi__bar`+(t&&e.value>0?` oc-kpi__bar--error`:``),x:c,y:l,width:a,height:s,children:(0,F.jsxs)(`title`,{children:[f9(e.bucket),` · `,d9(e.value),` `,n]})},e.bucket)})})}function d9(e){return Number.isFinite(e)?Math.abs(e)>=1e3?(e/1e3).toFixed(e%1e3==0?0:1)+`k`:String(e):`0`}function f9(e){let t=new Date(`${e}:00:00Z`);return Number.isNaN(t.getTime())?e:`${String(t.getUTCDate()).padStart(2,`0`)}/${String(t.getUTCMonth()+1).padStart(2,`0`)} ${String(t.getUTCHours()).padStart(2,`0`)}h`}var p9=`__all__`,oxt=[{value:`open`},{value:`acknowledged`},{value:`resolved`}];function sxt(e){return e===`open`?ZMe():e===`acknowledged`?eNe():rNe()}var cxt=[`info`,`warn`,`critical`],lxt=[`detector`,`agent`],uxt={kind:`relative`,from:`now-30d`,to:`now`},dxt=200,m9=`all`;function fxt(){let e=ss({from:`/settings/anomalies`}),t=cs({from:`/settings/anomalies`}),n=e.q??``,r=e.status===m9?p9:e.status,i=e.severity??p9,a=e.kind??p9,[o,s]=(0,M.useState)(p9),c=_7(e.from,e.to),{from:l,to:u}=e7(c),d=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),f=e=>void t({search:t=>({...t,status:e===p9?m9:e})}),p=e=>void t({search:t=>({...t,severity:e===p9?void 0:e})}),m=e=>void t({search:t=>({...t,kind:e===p9?void 0:e})}),h=e=>void t({search:t=>({...t,...v7(e)})}),g=rY(),_=sY(),v=P(L.anomalies.resolveAnomaly),y=(N(L.me.getMe,{host:BO})?.permissions??[]).includes(`admin.manage`),b=N(L.anomalies.listAnomalies,{limit:dxt,filter:{q:n||void 0,from:l,to:u,anomalyStatus:r===p9?void 0:r,severity:i===p9?void 0:i,source:o===p9?void 0:o,kind:a===p9?void 0:a}}),x=(0,M.useMemo)(()=>{let e=new Set;for(let t of b??[])e.add(t.kind);return[...e].sort()},[b]),S=n!==``||r!==`open`||i!==p9||o!==p9||a!==p9||c.kind!==`relative`||c.from!==uxt.from;function C(){s(p9),t({search:{status:`open`},replace:!0})}async function w(e){if(await g({title:oNe(),description:(0,F.jsxs)(F.Fragment,{children:[lNe(),` `,(0,F.jsx)(`span`,{className:`font-mono`,children:e.kind}),` `,fNe(),` `,(0,F.jsx)(`strong`,{children:hNe()}),`.`,` `,vNe()]}),confirmLabel:xNe()}))try{await v({anomalyId:e._id,status:`resolved`}),_.success(wNe(),e.kind)}catch(e){_.error(DNe(),e)}}async function T(e){try{await v({anomalyId:e._id,status:`acknowledged`}),_.success(ANe(),e.kind)}catch(e){_.error(NNe(),e)}}return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`p`,{className:`oc-admin__hint`,children:[INe(),` `,(0,F.jsx)(`strong`,{children:zNe()}),` `,HNe(),` `,(0,F.jsx)(`strong`,{children:GNe()}),` `,JNe(),` `,(0,F.jsx)(`strong`,{children:ZNe()}),` `,ePe(),` `,(0,F.jsx)(`span`,{className:`oc-filter__window`,children:rPe()})]}),(0,F.jsxs)(r7,{q:n,onQChange:d,searchPlaceholder:oPe(),timeRange:c,onTimeRangeChange:h,onReset:C,canReset:S,children:[(0,F.jsxs)(C3,{value:r,onValueChange:f,children:[(0,F.jsx)(T3,{size:`sm`,className:`w-36`,children:(0,F.jsx)(w3,{})}),(0,F.jsxs)(E3,{children:[(0,F.jsx)(Q,{value:p9,children:lPe()}),oxt.map(e=>(0,F.jsx)(Q,{value:e.value,children:sxt(e.value)},e.value))]})]}),(0,F.jsxs)(C3,{value:i,onValueChange:p,children:[(0,F.jsx)(T3,{size:`sm`,className:`w-36`,children:(0,F.jsx)(w3,{placeholder:VK()})}),(0,F.jsxs)(E3,{children:[(0,F.jsx)(Q,{value:p9,children:mPe()}),cxt.map(e=>(0,F.jsx)(Q,{value:e,children:e},e))]})]}),(0,F.jsxs)(C3,{value:o,onValueChange:s,children:[(0,F.jsx)(T3,{size:`sm`,className:`w-32`,children:(0,F.jsx)(w3,{placeholder:HK()})}),(0,F.jsxs)(E3,{children:[(0,F.jsx)(Q,{value:p9,children:yPe()}),lxt.map(e=>(0,F.jsx)(Q,{value:e,children:e},e))]})]}),(0,F.jsxs)(C3,{value:a,onValueChange:m,children:[(0,F.jsx)(T3,{size:`sm`,className:`w-36`,children:(0,F.jsx)(w3,{placeholder:UK()})}),(0,F.jsxs)(E3,{children:[(0,F.jsx)(Q,{value:p9,children:wPe()}),x.map(e=>(0,F.jsx)(Q,{value:e,children:e},e))]})]})]}),(0,F.jsx)(k5,{title:DPe(),rows:b,emptyHint:r===`open`?APe():NPe(),rowActions:e=>y&&e.status===`open`?[{label:IPe(),onSelect:()=>void w(e)},{label:zPe(),onSelect:()=>void T(e)}]:[],columns:[{header:HPe(),cell:e=>(0,F.jsx)(`span`,{className:`oc-traces__time`,children:new Date(e.at).toLocaleString(`fr-FR`)}),sort:e=>e.at},{header:UK(),cell:e=>(0,F.jsx)(`code`,{className:`oc-traces__mono`,children:e.kind}),sort:e=>e.kind},{header:VK(),cell:e=>(0,F.jsx)(hxt,{severity:e.severity}),sort:e=>e.severity===`critical`?2:+(e.severity===`warn`)},{header:GPe(),cell:e=>(0,F.jsx)(gxt,{status:e.status}),sort:e=>e.status===`resolved`?2:+(e.status===`acknowledged`)},{header:HK(),cell:e=>(0,F.jsx)($,{variant:`outline`,children:e.source}),sort:e=>e.source},{header:JPe(),cell:e=>(0,F.jsx)(`span`,{className:`oc-anomaly__msg`,children:e.message}),sort:e=>e.message},{header:ZPe(),cell:e=>(0,F.jsx)(mxt,{row:e}),sort:e=>e.evidence??null},{header:eFe(),cell:e=>e.correlationId?(0,F.jsx)(`code`,{className:`oc-traces__mono`,children:_xt(e.correlationId)}):(0,F.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}),sort:e=>e.correlationId}]})]})}function pxt(e){if(e.kind!==`openclaw.dispatch_failures`||!e.evidence)return{};try{let t=JSON.parse(e.evidence);return{dominantCode:t.dominantCode,sampleCorrelationId:t.sampleCorrelationId}}catch{return{}}}function mxt({row:e}){let t=cs(),n=pxt(e);if(!n.dominantCode)return(0,F.jsx)(`span`,{className:`oc-traces__muted`,children:`—`});let r=I5(n.dominantCode),i=n.sampleCorrelationId;return(0,F.jsxs)(`div`,{className:`oc-anomaly__cause`,children:[(0,F.jsxs)(`div`,{className:`oc-anomaly__cause-head`,children:[(0,F.jsx)(`span`,{className:`oc-anomaly__cause-label`,children:r.label}),(0,F.jsx)(`code`,{className:`oc-traces__mono`,children:n.dominantCode})]}),(0,F.jsx)(`p`,{className:`oc-anomaly__cause-hint`,children:r.hint}),i?(0,F.jsxs)(`button`,{type:`button`,className:`oc-anomaly__drill`,onClick:()=>void t({to:`/settings/traces`,search:{q:i,limit:100}}),children:[`↗ `,rFe()]}):null]})}function hxt({severity:e}){return(0,F.jsx)(`span`,{className:`oc-anomaly__sev oc-anomaly__sev--${e}`,children:e})}function gxt({status:e}){return e===`open`?(0,F.jsx)($,{variant:`destructive`,children:oFe()}):e===`acknowledged`?(0,F.jsx)($,{variant:`secondary`,children:lFe()}):(0,F.jsx)($,{variant:`outline`,children:fFe()})}function _xt(e){return e.length>8?e.slice(0,8):e}function vxt(){let e=N(L.integrations.status.status,{}),t=P(L.admin.setIntegrationConfig),[n,r]=(0,M.useState)(null);if((0,M.useEffect)(()=>{e&&n===null&&r(e.config)},[e,n]),!e||!n)return(0,F.jsx)(`p`,{className:`oc-admin__hint`,children:rK()});let i=n,a=(e,t,n)=>r({...i,[e]:{...i[e],[t]:n}}),o=(e,n)=>void t({[e]:n});return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`p`,{className:`oc-admin__hint`,children:[oK(),` `,(0,F.jsx)(`strong`,{children:lK()}),` `,fK()]}),(0,F.jsxs)(h9,{title:`Langfuse`,status:e.langfuse.configured?e.langfuse.enabled?(0,F.jsx)($,{variant:`secondary`,children:hK()}):(0,F.jsx)($,{variant:`outline`,children:vK()}):(0,F.jsx)($,{variant:`outline`,children:bK()}),note:Q_e(),children:[(0,F.jsx)(g9,{label:ive(),children:(0,F.jsx)(BJ,{value:i.langfuse.host??``,placeholder:e.langfuse.effectiveHost,onChange:e=>a(`langfuse`,`host`,e.target.value),onBlur:()=>o(`langfuse`,{host:i.langfuse.host??``})})}),(0,F.jsx)(_9,{label:SK(),checked:i.langfuse.enabled??!0,onChange:e=>{a(`langfuse`,`enabled`,e),o(`langfuse`,{enabled:e})}})]}),(0,F.jsxs)(h9,{title:`Opik`,status:e.opik.configured?e.opik.enabled?(0,F.jsx)($,{variant:`secondary`,children:hK()}):(0,F.jsx)($,{variant:`outline`,children:vK()}):(0,F.jsx)($,{variant:`outline`,children:bK()}),note:tve(),children:[(0,F.jsx)(g9,{label:sve(),children:(0,F.jsx)(BJ,{value:i.opik.baseUrl??``,placeholder:e.opik.effectiveBaseUrl,onChange:e=>a(`opik`,`baseUrl`,e.target.value),onBlur:()=>o(`opik`,{baseUrl:i.opik.baseUrl??``})})}),(0,F.jsx)(g9,{label:uve(),children:(0,F.jsx)(BJ,{value:i.opik.workspace??``,placeholder:e.opik.effectiveWorkspace||pve(),onChange:e=>a(`opik`,`workspace`,e.target.value),onBlur:()=>o(`opik`,{workspace:i.opik.workspace??``})})}),(0,F.jsx)(_9,{label:SK(),checked:i.opik.enabled??!0,onChange:e=>{a(`opik`,`enabled`,e),o(`opik`,{enabled:e})}})]}),(0,F.jsxs)(h9,{title:vve(),status:(0,F.jsx)($,{variant:`outline`,children:xK()}),note:xve(),children:[(0,F.jsx)(g9,{label:wve(),children:(0,F.jsx)(v9,{value:i.tts.auto??`off`,options:[[`off`,Dve()],[`always`,Ave()],[`inbound`,Nve()],[`tagged`,Ive()]],onChange:e=>{a(`tts`,`auto`,e),o(`tts`,{auto:e})}})}),(0,F.jsx)(g9,{label:zve(),children:(0,F.jsx)(v9,{value:i.tts.provider??`openai`,options:[[`openai`,`OpenAI`],[`elevenlabs`,`ElevenLabs`],[`microsoft`,Hve()],[`azure`,`Azure Speech`],[`google`,`Google Gemini`]],onChange:e=>{a(`tts`,`provider`,e),o(`tts`,{provider:e})}})}),(0,F.jsx)(g9,{label:Gve(),children:(0,F.jsx)(BJ,{value:i.tts.model??``,placeholder:`eleven_multilingual_v2`,onChange:e=>a(`tts`,`model`,e.target.value),onBlur:()=>o(`tts`,{model:i.tts.model??``})})}),(0,F.jsx)(g9,{label:CK(),children:(0,F.jsx)(BJ,{value:i.tts.voice??``,placeholder:Xve(),onChange:e=>a(`tts`,`voice`,e.target.value),onBlur:()=>o(`tts`,{voice:i.tts.voice??``})})})]}),(0,F.jsxs)(h9,{title:$ve(),status:(0,F.jsx)($,{variant:`outline`,children:xK()}),note:e.secrets.openai?nye():aye(),children:[(0,F.jsx)(_9,{label:cye(),checked:i.talk.enabled??!1,onChange:e=>{a(`talk`,`enabled`,e),o(`talk`,{enabled:e})}}),(0,F.jsx)(g9,{label:dye(),children:(0,F.jsx)(v9,{value:i.talk.realtimeProvider??`openai`,options:[[`openai`,`OpenAI (gpt-realtime)`],[`google`,`Google`]],onChange:e=>{a(`talk`,`realtimeProvider`,e),o(`talk`,{realtimeProvider:e})}})}),(0,F.jsx)(g9,{label:mye(),children:(0,F.jsx)(BJ,{value:i.talk.realtimeModel??``,placeholder:`gpt-realtime-2`,onChange:e=>a(`talk`,`realtimeModel`,e.target.value),onBlur:()=>o(`talk`,{realtimeModel:i.talk.realtimeModel??``})})}),(0,F.jsx)(g9,{label:CK(),children:(0,F.jsx)(BJ,{value:i.talk.voice??``,placeholder:`cedar / marin`,onChange:e=>a(`talk`,`voice`,e.target.value),onBlur:()=>o(`talk`,{voice:i.talk.voice??``})})}),(0,F.jsx)(g9,{label:_ye(),children:(0,F.jsx)(v9,{value:i.talk.transport??`webrtc`,options:[[`webrtc`,bye()],[`provider-websocket`,`Provider WebSocket`],[`gateway-relay`,`Gateway relay`]],onChange:e=>{a(`talk`,`transport`,e),o(`talk`,{transport:e})}})}),(0,F.jsx)(g9,{label:Cye(),children:(0,F.jsx)(BJ,{value:i.talk.speechLocale??``,placeholder:`fr-CA`,onChange:e=>a(`talk`,`speechLocale`,e.target.value),onBlur:()=>o(`talk`,{speechLocale:i.talk.speechLocale??``})})}),(0,F.jsx)(_9,{label:Eye(),checked:i.talk.interruptOnSpeech??!0,onChange:e=>{a(`talk`,`interruptOnSpeech`,e),o(`talk`,{interruptOnSpeech:e})}})]}),(0,F.jsxs)(`section`,{className:`oc-int__section`,children:[(0,F.jsxs)(`div`,{className:`oc-int__section-head`,children:[(0,F.jsx)(`h3`,{className:`oc-uipa__h`,children:kye()}),(0,F.jsx)($,{variant:`outline`,children:Mye()})]}),(0,F.jsxs)(`p`,{className:`oc-uipa__note`,children:[Fye(),(0,F.jsx)(`code`,{children:` voicewake.get/set`}),`.`]})]}),(0,F.jsx)(k5,{title:Rye(),rows:e.cursors.map(e=>({...e,_id:e.vendor})),emptyHint:Vye(),columns:[{header:Wye(),cell:e=>(0,F.jsx)($,{variant:`secondary`,children:e.vendor}),sort:e=>e.vendor},{header:qye(),cell:e=>e.lastAt>0?new Date(e.lastAt).toLocaleString(`fr-FR`):`—`,sort:e=>e.lastAt>0?e.lastAt:null},{header:Xye(),cell:e=>String(e.failureCount),sort:e=>e.failureCount},{header:$ye(),cell:e=>e.lastErrorStatus??`—`,sort:e=>e.lastErrorStatus??null},{header:nbe(),cell:e=>e.lastError??`—`,sort:e=>e.lastError??null}]})]})}function h9({title:e,status:t,note:n,children:r}){return(0,F.jsxs)(`section`,{className:`oc-int__section`,children:[(0,F.jsxs)(`div`,{className:`oc-int__section-head`,children:[(0,F.jsx)(`h3`,{className:`oc-uipa__h`,children:e}),t]}),n?(0,F.jsx)(`p`,{className:`oc-uipa__note`,children:n}):null,(0,F.jsx)(`div`,{className:`oc-int__fields`,children:r})]})}function g9({label:e,children:t}){return(0,F.jsxs)(`label`,{className:`oc-int__field`,children:[(0,F.jsx)(`span`,{className:`oc-int__field-label`,children:e}),t]})}function _9({label:e,checked:t,onChange:n}){return(0,F.jsxs)(`label`,{className:`oc-int__toggle`,children:[(0,F.jsx)(uY,{checked:t,onCheckedChange:e=>n(e===!0)}),(0,F.jsx)(`span`,{children:e})]})}function v9({value:e,options:t,onChange:n}){return(0,F.jsxs)(C3,{value:e,onValueChange:n,children:[(0,F.jsx)(T3,{size:`sm`,className:`w-full`,children:(0,F.jsx)(w3,{})}),(0,F.jsx)(E3,{children:t.map(([e,t])=>(0,F.jsx)(Q,{value:e,children:t},e))})]})}var yxt={altered_words:()=>abe(),incorrect:()=>cbe(),incoherence:()=>dbe(),formatting:()=>mbe(),latency:()=>_be(),api_error:()=>bbe(),other:()=>Cbe()},y9=e=>yxt[e]?.()??e;function b9({matches:e,sourceWasOpen:t}){return t?e===!0?(0,F.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,children:kbe()}):e===!1?(0,F.jsx)(`span`,{className:`oc-fbadmin__pill is-warn`,children:Mbe()}):(0,F.jsx)(`span`,{className:`oc-fbadmin__pill`,children:`—`}):(0,F.jsx)(`span`,{className:`oc-fbadmin__pill`,children:Ebe()})}function bxt({data:e,closeReason:t}){let n=e.snapshot,r=P(L.feedback.respondToFeedback),[i,a]=(0,M.useState)(e.thread),[o,s]=(0,M.useState)(``),[c,l]=(0,M.useState)(!1);async function u(){let t=o.trim();if(!(!t||c)){l(!0);try{await r({feedbackId:e._id,text:t}),a(e=>[...e,{authorRole:`admin`,text:t,at:Date.now()}]),s(``)}finally{l(!1)}}}let d=[];try{d=n.contextJson?JSON.parse(n.contextJson):[]}catch{d=[]}return(0,F.jsxs)(`div`,{className:`oc-fbadmin__detail`,children:[(0,F.jsxs)(`div`,{className:`oc-fbadmin__row`,children:[(0,F.jsx)(b9,{matches:n.displayedMatchesStored,sourceWasOpen:n.clientInfo?.sourceWasOpen??!1}),(0,F.jsxs)(`span`,{className:`oc-fbadmin__meta`,children:[y9(e.category),` · `,n.messageRole,n.isRegeneration?` · ${Fbe()}`:``,n.openclawModel?` · ${n.openclawModel}`:``,n.openclawRuntime?` (${n.openclawRuntime})`:``]})]}),e.comment?(0,F.jsxs)(`section`,{children:[(0,F.jsx)(`h4`,{className:`oc-fbadmin__h`,children:Rbe()}),(0,F.jsx)(`p`,{className:`oc-fbadmin__comment`,children:e.comment})]}):null,t?(0,F.jsxs)(`section`,{children:[(0,F.jsx)(`h4`,{className:`oc-fbadmin__h`,children:USe()}),(0,F.jsx)(`p`,{className:`oc-fbadmin__comment`,children:t})]}):null,(0,F.jsxs)(`section`,{children:[(0,F.jsx)(`h4`,{className:`oc-fbadmin__h`,children:Vbe()}),i.length>0?(0,F.jsx)(`div`,{className:`oc-fbadmin__thread`,children:i.map((e,t)=>(0,F.jsxs)(`div`,{className:`oc-notif__msg oc-notif__msg--${e.authorRole}`,children:[(0,F.jsx)(`span`,{className:`oc-notif__msg-who`,children:e.authorRole===`admin`?Wbe():qbe()}),(0,F.jsx)(`span`,{className:`oc-notif__msg-text`,children:e.text})]},t))}):(0,F.jsx)(`p`,{className:`oc-fbadmin__meta`,children:Xbe()}),(0,F.jsx)(`textarea`,{className:`oc-feedback__textarea`,placeholder:$be(),value:o,maxLength:2e3,rows:3,onChange:e=>s(e.target.value.slice(0,2e3))}),(0,F.jsx)(`div`,{className:`oc-fbadmin__row`,style:{justifyContent:`flex-end`},children:(0,F.jsx)(H,{size:`sm`,onClick:()=>void u(),disabled:!o.trim()||c,children:c?nxe():axe()})})]}),(0,F.jsxs)(`section`,{children:[(0,F.jsx)(`h4`,{className:`oc-fbadmin__h`,children:cxe()}),(0,F.jsx)(`pre`,{className:`oc-msg__source-pre`,children:n.messageText||wK()})]}),n.clientInfo?.sourceWasOpen&&n.displayedText!==void 0?(0,F.jsxs)(`section`,{children:[(0,F.jsx)(`h4`,{className:`oc-fbadmin__h`,children:pxe()}),(0,F.jsx)(`pre`,{className:`oc-msg__source-pre`,children:n.displayedText||wK()})]}):null,n.promptText?(0,F.jsxs)(`section`,{children:[(0,F.jsx)(`h4`,{className:`oc-fbadmin__h`,children:gxe()}),(0,F.jsx)(`pre`,{className:`oc-msg__source-pre`,children:n.promptText})]}):null,d.length>0?(0,F.jsxs)(`section`,{children:[(0,F.jsx)(`h4`,{className:`oc-fbadmin__h`,children:yxe({count:n.contextCount??d.length,truncated:n.contextTruncated?Sxe():``})}),(0,F.jsx)(`div`,{className:`oc-fbadmin__ctx`,children:d.map((e,t)=>(0,F.jsxs)(`div`,{className:`oc-fbadmin__ctx-turn`,children:[(0,F.jsx)(`span`,{className:`oc-fbadmin__ctx-role`,children:e.role}),(0,F.jsx)(`span`,{className:`oc-fbadmin__ctx-text`,children:e.text})]},t))})]}):null,n.outboxAvailable?(0,F.jsxs)(`section`,{children:[(0,F.jsx)(`h4`,{className:`oc-fbadmin__h`,children:Txe()}),(0,F.jsxs)(`pre`,{className:`oc-msg__source-pre`,children:[n.outboxText??``,n.outboxStatus?`\n[status: ${n.outboxStatus}]`:``]})]}):null,n.clientInfo?.extensionsDetected&&n.clientInfo.extensionsDetected.length>0?(0,F.jsxs)(`section`,{children:[(0,F.jsx)(`h4`,{className:`oc-fbadmin__h`,children:Oxe()}),(0,F.jsx)(`div`,{className:`oc-fbadmin__row`,children:n.clientInfo.extensionsDetected.map(e=>(0,F.jsx)(`span`,{className:`oc-fbadmin__pill is-warn`,children:e},e))})]}):null,(0,F.jsxs)(`section`,{children:[(0,F.jsx)(`h4`,{className:`oc-fbadmin__h`,children:jxe()}),(0,F.jsxs)(`p`,{className:`oc-fbadmin__env`,children:[[n.clientInfo?.language,n.clientInfo?.timezone,n.clientInfo?.theme?Pxe({theme:n.clientInfo.theme}):null,n.runId?`run ${n.runId.slice(0,12)}…`:null].filter(Boolean).join(` · `)||`—`,n.clientInfo?.plugins&&n.clientInfo.plugins.length>0?(0,F.jsxs)(`span`,{className:`oc-fbadmin__plugins`,children:[Lxe(),` `,n.clientInfo.plugins.join(`, `),(0,F.jsxs)(`span`,{className:`oc-fbadmin__note`,children:[` `,Bxe()]})]}):null,n.clientInfo?.userAgent?(0,F.jsx)(`span`,{className:`oc-fbadmin__ua`,children:n.clientInfo.userAgent}):null]})]})]})}function xxt(){let e=N(L.feedback.listForAdmin,{}),t=P(L.feedback.readSnapshot),n=P(L.feedback.deleteFeedback),r=rY(),[i,a]=(0,M.useState)(null),[o,s]=(0,M.useState)({});async function c(e){if(i===e._id){a(null);return}if(!o[e._id]){let n=await t({feedbackId:e._id});s(t=>({...t,[e._id]:n}))}a(e._id)}async function l(e){await r({title:tCe(),description:iCe(),confirmLabel:sCe(),destructive:!0})&&(await n({feedbackId:e._id}),i===e._id&&a(null))}return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`p`,{className:`oc-admin__hint`,children:[Uxe(),` `,(0,F.jsx)(`strong`,{children:Kxe()}),` `,Yxe()]}),(0,F.jsx)(k5,{title:Qxe(),rows:e,emptyHint:tSe(),isExpanded:e=>i===e._id&&!!o[e._id],renderExpanded:e=>o[e._id]?(0,F.jsx)(bxt,{data:o[e._id],closeReason:e.userCloseReason}):null,columns:[{header:iSe(),cell:e=>new Date(e.at).toLocaleString(`fr-FR`),sort:e=>e.at},{header:sSe(),cell:e=>y9(e.category),sort:e=>y9(e.category)},{header:uSe(),cell:e=>e.messageRole===`user`?pSe():gSe(),sort:e=>e.messageRole},{header:ySe(),cell:e=>(e.reporterEmail||e.reporterName||`—`)+(e.impersonated&&e.realOperatorEmail?` ${SSe({operator:e.realOperatorEmail})}`:``),sort:e=>e.reporterEmail||e.reporterName||null},{header:TSe(),cell:e=>(0,F.jsx)(b9,{matches:e.displayedMatchesStored,sourceWasOpen:e.sourceWasOpen}),sort:e=>e.displayedMatchesStored===!1?0:e.displayedMatchesStored===!0?1:2},{header:OSe(),cell:e=>e.hasComment?`✎`:`—`,sort:e=>+!!e.hasComment},{header:jSe(),cell:e=>e.userClosedAt==null?e.answered?(0,F.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,children:PSe()}):(0,F.jsx)(`span`,{className:`oc-fbadmin__pill`,children:LSe()}):(0,F.jsx)(`span`,{className:`oc-fbadmin__pill is-closed`,children:BSe()}),sort:e=>e.userClosedAt==null?+!!e.answered:2}],rowActions:e=>[{label:i===e._id?KSe():YSe(),onSelect:()=>void c(e)},{label:QSe(),onSelect:()=>void l(e),variant:`destructive`}]})]})}var x9=`all`;function S9(e){switch(e){case`image`:return _ge();case`audio`:return bge();case`video`:return Cge();case`pdf`:return Ege();case`document`:return kge();case`archive`:return Mge();default:return Fge()}}function Sxt(){let[e,t]=(0,M.useState)(x9),[n,r]=(0,M.useState)(x9),[i,a]=(0,M.useState)(x9),[o,s]=(0,M.useState)(x9),[c,l]=(0,M.useState)(null),u=P(L.files.softDelete),d=sY();function f(){t(x9),r(x9),a(x9),s(x9)}async function p(){let e=c;if(l(null),e)try{await u({fileId:e.id}),d.success(p_e())}catch(e){d.error(g_e(),e)}}let m=N(L.files.listMine,{direction:e===x9?void 0:e,chatId:n===x9?void 0:n,instanceName:i===x9?void 0:i,category:o===x9?void 0:o}),h=(0,M.useMemo)(()=>new Intl.DateTimeFormat(V(),{dateStyle:`medium`,timeStyle:`short`}),[]);if(m===void 0)return(0,F.jsx)(`p`,{className:`oc-admin__hint`,children:dk()});let{files:g,facets:_,truncated:v,cap:y}=m,b=e!==x9||n!==x9||i!==x9||o!==x9;return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`p`,{className:`oc-admin__hint`,children:Bhe()}),(0,F.jsxs)(`div`,{className:`oc-files__filters`,style:{display:`flex`,flexWrap:`wrap`,gap:8,margin:`12px 0`},children:[(0,F.jsxs)(C3,{value:e,onValueChange:t,children:[(0,F.jsx)(T3,{size:`sm`,"aria-label":Uhe(),children:(0,F.jsx)(w3,{})}),(0,F.jsxs)(E3,{children:[(0,F.jsx)(Q,{value:x9,children:Khe()}),(0,F.jsx)(Q,{value:`inbound`,children:yk()}),(0,F.jsx)(Q,{value:`outbound`,children:bk()})]})]}),(0,F.jsxs)(C3,{value:n,onValueChange:r,children:[(0,F.jsx)(T3,{size:`sm`,"aria-label":$he(),children:(0,F.jsx)(w3,{})}),(0,F.jsxs)(E3,{children:[(0,F.jsx)(Q,{value:x9,children:nge()}),_.chats.map(e=>(0,F.jsx)(Q,{value:e.id,children:e.title},e.id))]})]}),_.multiProvider?(0,F.jsxs)(C3,{value:i,onValueChange:a,children:[(0,F.jsx)(T3,{size:`sm`,"aria-label":age(),children:(0,F.jsx)(w3,{})}),(0,F.jsxs)(E3,{children:[(0,F.jsx)(Q,{value:x9,children:cge()}),_.instances.map(e=>(0,F.jsx)(Q,{value:e,children:e},e))]})]}):null,(0,F.jsxs)(C3,{value:o,onValueChange:s,children:[(0,F.jsx)(T3,{size:`sm`,"aria-label":dge(),children:(0,F.jsx)(w3,{})}),(0,F.jsxs)(E3,{children:[(0,F.jsx)(Q,{value:x9,children:mge()}),_.categories.map(e=>(0,F.jsx)(Q,{value:e,children:S9(e)},e))]})]}),b?(0,F.jsxs)(H,{variant:`ghost`,size:`sm`,onClick:f,style:{display:`inline-flex`,alignItems:`center`,gap:4,marginLeft:`auto`},children:[(0,F.jsx)(Pm,{size:14,"aria-hidden":!0}),a_e()]}):null]}),g.length===0?(0,F.jsx)(`p`,{className:`oc-admin__hint`,children:b?j_e():O_e()}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(C5,{children:[(0,F.jsx)(w5,{children:(0,F.jsxs)(E5,{children:[(0,F.jsx)(D5,{children:Rge()}),(0,F.jsx)(D5,{children:Vge()}),(0,F.jsx)(D5,{children:Wge()}),(0,F.jsx)(D5,{children:qge()}),(0,F.jsx)(D5,{children:Xge()}),(0,F.jsx)(D5,{className:`text-right`,children:$ge()})]})}),(0,F.jsx)(T5,{children:g.map(e=>(0,F.jsxs)(E5,{children:[(0,F.jsx)(O5,{className:`font-medium`,style:{maxWidth:280,overflow:`hidden`,textOverflow:`ellipsis`},title:e.filename,children:e.filename}),(0,F.jsx)(O5,{title:e.mimeType,children:S9(e.category)}),(0,F.jsx)(O5,{children:(0,F.jsx)($,{variant:`secondary`,children:e.direction===`inbound`?yk():bk()})}),(0,F.jsx)(O5,{style:{maxWidth:220,overflow:`hidden`,textOverflow:`ellipsis`},title:e.chatTitle,children:e.chatTitle}),(0,F.jsx)(O5,{className:`whitespace-nowrap text-muted-foreground`,children:h.format(e.createdAt)}),(0,F.jsx)(O5,{className:`text-right`,children:(0,F.jsxs)(EJ,{children:[(0,F.jsx)(DJ,{asChild:!0,children:(0,F.jsx)(H,{variant:`ghost`,size:`icon`,"aria-label":c_e(),children:(0,F.jsx)(wm,{size:16})})}),(0,F.jsxs)(OJ,{align:`end`,children:[e.url?(0,F.jsx)(kJ,{asChild:!0,children:(0,F.jsxs)(`a`,{href:e.url,download:e.filename,target:`_blank`,rel:`noopener noreferrer`,children:[(0,F.jsx)(Cm,{size:14}),n_e()]})}):(0,F.jsxs)(kJ,{disabled:!0,children:[(0,F.jsx)(Cm,{size:14}),T_e()]}),(0,F.jsxs)(kJ,{variant:`destructive`,onSelect:()=>l({id:e._id,filename:e.filename}),children:[(0,F.jsx)(Bm,{size:14}),xk()]})]})]})})]},e._id))})]}),v?(0,F.jsx)(`p`,{className:`oc-admin__hint`,style:{marginTop:8},children:P_e({cap:y})}):null]}),(0,F.jsx)(VJ,{open:c!==null,onOpenChange:e=>!e&&l(null),children:(0,F.jsxs)(HJ,{children:[(0,F.jsxs)(UJ,{children:[(0,F.jsx)(GJ,{children:y_e()}),(0,F.jsx)(KJ,{children:S_e()})]}),(0,F.jsxs)(WJ,{children:[(0,F.jsx)(JJ,{children:xV()}),(0,F.jsx)(qJ,{onClick:()=>void p(),children:xk()})]})]})})]})}var C9=2e4,w9=6e4;function Cxt(e){return typeof e!=`number`||e<=0?0:Math.round(e/C9*100)}function wxt(e){return e<=0?0:Math.round(e/w9*100)}function T9(e,t){let n=(typeof e==`number`&&e>0?e:0)/1e3;return new Intl.NumberFormat(t,{minimumFractionDigits:1,maximumFractionDigits:1}).format(n)}function E9(e){return e.reduce((e,t)=>e+(typeof t.size==`number`&&t.size>0?t.size:0),0)}var D9=3;function Txt(e,t){let n=new Map;for(let t of e.split(`
|
|
267
|
+
`))n.set(t,(n.get(t)??0)+1);for(let e of t.split(`
|
|
268
|
+
`))n.set(e,(n.get(e)??0)-1);let r=0,i=0,a=[],o=[];for(let[e,t]of n)t<0?(r+=-t,a.length<D9&&a.push(e)):t>0&&(i+=t,o.length<D9&&o.push(e));return{added:r,removed:i,sampleAdded:a,sampleRemoved:o}}function Ext(e){return e instanceof Error?e.message.includes(`conflict:`):String(e).includes(`conflict:`)}var O9=e=>`${e.instanceName}::${e.agentId}`;function Dxt(){let e=N(L.me.getMe,{host:BO}),t=e?.role===`admin`,n=(e?.permissions??[]).includes(`bridge.read`),r=N(L.admin.listInstances,e!==void 0&&t?{}:`skip`),[i,a]=(0,M.useState)(null);(0,M.useEffect)(()=>{!t||!r||r.length===0||(!i||!r.some(e=>e.name===i))&&a(r[0].name)},[t,r,i]);let o=N(L.agents.listAgentsForInstance,t&&i?{instanceName:i}:`skip`),s=N(L.agents.listMyAgents,e!==void 0&&!t?{}:`skip`),c=(0,M.useMemo)(()=>{if(e!==void 0){if(t)return i===null||o===void 0?r!==void 0&&r.length===0?[]:void 0:o.agents.map(e=>({instanceName:i,agentId:e.agentId,label:`${e.emoji?`${e.emoji} `:``}${e.displayName??e.agentId}`}));if(s!==void 0)return s.map(e=>({instanceName:e.instanceName,agentId:e.agentId,label:`${e.emoji?`${e.emoji} `:``}${e.displayName??e.agentId}`}))}},[e,t,i,o,r,s]),[l,u]=(0,M.useState)(null);(0,M.useEffect)(()=>{!c||c.length===0||(!l||!c.some(e=>O9(e)===l))&&u(O9(c[0]))},[c,l]);let d=c?.find(e=>O9(e)===l)??null,f=er(L.agentFiles.listAgentFiles),[p,m]=(0,M.useState)({status:`idle`}),h=d?.instanceName??null,g=d?.agentId??null,_=N(L.compat.forInstance,n&&h!==null?{instanceName:h}:`skip`),v=n&&h!==null?F3(_,`agentFiles`):null,y=v===null?!1:v===`loading`?null:v.blocked,b=(0,M.useCallback)(async()=>{if(!(h===null||g===null)){m({status:`loading`});try{m({status:`done`,files:(await f({instanceName:h,agentId:g})).files})}catch{m({status:`error`})}}},[f,h,g]);(0,M.useEffect)(()=>{y===!1&&b()},[b,y]);let[x,S]=(0,M.useState)(null),C=V(),w=(0,M.useMemo)(()=>new Intl.NumberFormat(C,{maximumFractionDigits:0}),[C]);return e===void 0||c===void 0?(0,F.jsx)(`p`,{className:`oc-admin__hint`,children:dk()}):(0,F.jsxs)(`div`,{className:`oc-afiles`,children:[(0,F.jsx)(`p`,{className:`oc-admin__hint`,children:i5e()}),(0,F.jsxs)(`div`,{className:`oc-afiles__picker`,children:[t&&(r?.length??0)>1?(0,F.jsxs)(C3,{value:i??``,onValueChange:e=>a(e),children:[(0,F.jsx)(T3,{size:`sm`,"aria-label":jq(),children:(0,F.jsx)(w3,{})}),(0,F.jsx)(E3,{children:(r??[]).map(e=>(0,F.jsx)(Q,{value:e.name,children:e.name},e.name))})]}):null,c.length>0?(0,F.jsxs)(C3,{value:l??``,onValueChange:e=>u(e),children:[(0,F.jsx)(T3,{size:`sm`,"aria-label":l5e(),children:(0,F.jsx)(w3,{})}),(0,F.jsx)(E3,{children:c.map(e=>(0,F.jsx)(Q,{value:O9(e),children:e.label},O9(e)))})]}):(0,F.jsx)(`p`,{className:`oc-admin__hint`,children:f5e()})]}),d===null?null:v===`loading`?(0,F.jsx)(`p`,{className:`oc-admin__hint`,children:dk()}):v!==null&&v.blocked?(0,F.jsxs)(`p`,{className:`oc-compat__blocked`,role:`status`,children:[(0,F.jsx)(Vm,{size:14,"aria-hidden":!0}),` `,W5(v.gatewayVersion)]}):p.status===`loading`||p.status===`idle`?(0,F.jsx)(`p`,{className:`oc-admin__hint`,children:dk()}):p.status===`error`?(0,F.jsxs)(`p`,{className:`oc-afiles__error`,role:`alert`,children:[v5e(),` `,(0,F.jsx)(H,{variant:`outline`,size:`sm`,onClick:()=>void b(),children:Oq()})]}):p.files.length===0?(0,F.jsx)(`p`,{className:`oc-admin__hint`,children:h5e()}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`div`,{className:`oc-afiles__list`,children:p.files.map(e=>{let n=Cxt(e.size),r=n>=80;return(0,F.jsxs)(`div`,{className:`oc-afiles__row`,children:[(0,F.jsx)(`span`,{className:`oc-afiles__name`,title:e.name,children:e.name}),e.missing?(0,F.jsx)($,{variant:`outline`,children:x5e()}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`span`,{className:`oc-afiles__size`,children:w5e({size:T9(e.size,C)})}),(0,F.jsx)(`span`,{className:`oc-afiles__gauge${r?` is-warn`:``}`,"aria-hidden":!0,children:(0,F.jsx)(`span`,{className:`oc-afiles__gauge-fill`,style:{width:`${Math.min(n,100)}%`}})}),(0,F.jsx)(`span`,{className:`oc-afiles__pct`,children:D5e({pct:w.format(n)})}),r?(0,F.jsx)(Vm,{size:14,className:`oc-afiles__warn`,"aria-label":A5e()}):(0,F.jsx)(`span`,{className:`oc-afiles__warn-slot`,"aria-hidden":!0})]}),(0,F.jsx)(H,{variant:`outline`,size:`sm`,className:`oc-afiles__open`,onClick:()=>S(e),children:t?I5e():z5e()})]},e.name)})}),(0,F.jsx)(`p`,{className:`oc-afiles__budget`,children:N5e({used:T9(E9(p.files),C),total:T9(w9,C),pct:w.format(wxt(E9(p.files)))})})]}),x&&d?(0,F.jsx)(Oxt,{instanceName:d.instanceName,agentId:d.agentId,name:x.name,isAdmin:t,onClose:()=>S(null),onSaved:()=>void b()}):null]})}function Oxt({instanceName:e,agentId:t,name:n,isAdmin:r,onClose:i,onSaved:a}){let o=er(L.agentFiles.getAgentFile),s=er(L.agentFiles.setAgentFile),c=sY(),[l,u]=(0,M.useState)(null),[d,f]=(0,M.useState)(!1),[p,m]=(0,M.useState)(``),[h,g]=(0,M.useState)(!1),[_,v]=(0,M.useState)(!1),[y,b]=(0,M.useState)(!1),[x,S]=(0,M.useState)(!1),C=(0,M.useCallback)(async r=>{f(!1);try{let i=await o({instanceName:e,agentId:t,name:n});u({content:i.content,updatedAtMs:i.updatedAtMs}),r||m(i.content),b(!1)}catch{f(!0)}},[o,e,t,n]);(0,M.useEffect)(()=>{C(!1)},[C]);async function w(){if(l!==null){v(!0),S(!1);try{await s({instanceName:e,agentId:t,name:n,content:p,baseUpdatedAtMs:l.updatedAtMs??void 0}),c.success(a7e({name:n})),a(),await C(!1)}catch(e){Ext(e)?b(!0):S(!0)}finally{v(!1)}}}let T=l!==null&&p!==l.content,E=(0,M.useMemo)(()=>l===null?null:Txt(l.content,p),[l,p]),D=p.length>C9,O=V(),ee=(0,M.useMemo)(()=>new Intl.NumberFormat(O),[O]);return(0,F.jsx)(YJ,{open:!0,onOpenChange:e=>!e&&i(),children:(0,F.jsxs)(XJ,{className:`oc-afiles__editor`,children:[(0,F.jsxs)(ZJ,{children:[(0,F.jsx)($J,{children:Mq({name:n})}),(0,F.jsxs)(eY,{children:[W5e({agent:t,instance:e}),r?null:(0,F.jsxs)(F.Fragment,{children:[` · `,q5e()]})]})]}),d?(0,F.jsxs)(`p`,{className:`oc-afiles__error`,role:`alert`,children:[d7e(),` `,(0,F.jsx)(H,{variant:`outline`,size:`sm`,onClick:()=>void C(!1),children:Oq()})]}):l===null?(0,F.jsx)(`p`,{className:`oc-admin__hint`,children:dk()}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`textarea`,{className:`oc-afiles__source`,value:p,readOnly:!r,spellCheck:!1,onChange:e=>m(e.target.value),"aria-label":Mq({name:n})}),(0,F.jsx)(`p`,{className:`oc-afiles__hint`,children:X5e()}),y?(0,F.jsxs)(`p`,{className:`oc-afiles__error`,role:`alert`,children:[m7e(),` `,(0,F.jsx)(H,{variant:`outline`,size:`sm`,onClick:()=>void C(!0),children:_7e()})]}):null,x?(0,F.jsx)(`p`,{className:`oc-afiles__error`,role:`alert`,children:c7e()}):null,(0,F.jsxs)(`div`,{className:`oc-afiles__editor-foot`,children:[(0,F.jsx)(`span`,{className:`oc-afiles__count${D?` is-over`:``}`,children:$5e({count:ee.format(p.length),max:ee.format(C9)})}),r?(0,F.jsx)(H,{size:`sm`,disabled:!T||_||y,onClick:()=>g(!0),children:_?Dq():n7e()}):null]})]}),(0,F.jsx)(VJ,{open:h,onOpenChange:g,children:(0,F.jsxs)(HJ,{children:[(0,F.jsxs)(UJ,{children:[(0,F.jsx)(GJ,{children:b7e({name:n})}),(0,F.jsx)(KJ,{children:C7e({agent:t})})]}),E?(0,F.jsxs)(`div`,{className:`oc-afiles__diff`,children:[(0,F.jsx)(`p`,{className:`oc-afiles__diff-counts`,children:E7e({added:E.added,removed:E.removed})}),E.sampleAdded.length>0?(0,F.jsxs)(`div`,{className:`oc-afiles__diff-block`,children:[(0,F.jsx)(`span`,{className:`oc-afiles__diff-label`,children:k7e()}),E.sampleAdded.map((e,t)=>(0,F.jsx)(`code`,{className:`oc-afiles__diff-line is-add`,children:e||` `},t))]}):null,E.sampleRemoved.length>0?(0,F.jsxs)(`div`,{className:`oc-afiles__diff-block`,children:[(0,F.jsx)(`span`,{className:`oc-afiles__diff-label`,children:M7e()}),E.sampleRemoved.map((e,t)=>(0,F.jsx)(`code`,{className:`oc-afiles__diff-line is-del`,children:e||` `},t))]}):null]}):null,(0,F.jsxs)(WJ,{children:[(0,F.jsx)(JJ,{children:xV()}),(0,F.jsx)(qJ,{onClick:()=>void w(),children:F7e()})]})]})})]})})}var k9=[{id:`messages`,label:()=>AN()},{id:`composer`,label:()=>NN()},{id:`sidebar`,label:()=>IN()},{id:`other`,label:()=>zN()}],A9={showSource:{category:`messages`,label:()=>HN(),help:()=>GN()},showReport:{category:`messages`,label:()=>JN(),help:()=>ZN()},copyAssistant:{category:`messages`,label:()=>eP()},copyUser:{category:`messages`,label:()=>rP()},showDelete:{category:`messages`,label:()=>oP()},showTools:{category:`messages`,label:()=>lP(),help:()=>fP()},voiceInput:{category:`composer`,label:()=>hP(),help:()=>vP()},showChatAge:{category:`sidebar`,label:()=>xP(),help:()=>wP()},showChatProvider:{category:`sidebar`,label:()=>DP(),help:()=>AP()}};function j9(e){return e.toLowerCase().normalize(`NFD`).replace(/\p{Diacritic}/gu,``)}function kxt(e,t){let n=j9(t.trim()),r=new Map(k9.map(e=>[e.id,e.label()])),i=new Map(k9.map(e=>[e.id,[]]));for(let t of e){let e=A9[t],a=e?.category??`other`;n&&!j9(`${e?e.label():t} ${e?.help?e.help():``} ${t} ${r.get(a)??``}`).includes(n)||i.get(a).push(t)}return k9.map(e=>({id:e.id,label:r.get(e.id),keys:i.get(e.id)})).filter(e=>e.keys.length>0)}var Axt=[`showSource`,`showReport`,`copyAssistant`,`copyUser`,`showDelete`,`showTools`,`voiceInput`,`showChatAge`,`showChatProvider`],jxt={voiceInput:`voiceInput`};function Mxt(e){return Axt.includes(e)}function M9(e){return e===`admin`}function Nxt(e){return e===!0?`on`:e===!1?`off`:`inherit`}function Pxt(e){return e===`on`?!0:e===`off`?!1:null}function Fxt(e){return Mxt(e)?jxt[e]:void 0}var Ixt={voiceInput:()=>lF()};function Lxt({prefKey:e,ui:t}){let n=P(L.admin.setUiPrefDefault),r=P(L.admin.setFeatureEnabled),i=Fxt(e),a=i?Ixt[e]?.():void 0;return(0,F.jsxs)(`div`,{className:`oc-prefs__gov`,children:[(0,F.jsxs)(`div`,{className:`oc-prefs__gov-row`,children:[(0,F.jsx)(`span`,{className:`oc-prefs__gov-label`,children:ZP()}),(0,F.jsxs)(C3,{value:Nxt(t.defaults[e]),onValueChange:t=>void n({key:e,value:Pxt(t)}),children:[(0,F.jsx)(T3,{size:`sm`,className:`w-36`,children:(0,F.jsx)(w3,{})}),(0,F.jsxs)(E3,{children:[(0,F.jsx)(Q,{value:`on`,children:hF()}),(0,F.jsx)(Q,{value:`off`,children:vF()}),(0,F.jsx)(Q,{value:`inherit`,children:xF()})]})]}),i?(0,F.jsxs)(`span`,{className:`oc-prefs__gov-gate`,children:[(0,F.jsx)(uY,{checked:t.featuresEnabled[i]===!0,onCheckedChange:e=>void r({key:i,enabled:e===!0}),"aria-label":eF()}),eF()]}):null]}),a?(0,F.jsx)(`span`,{className:`oc-prefs__gov-help`,children:a}):null]})}function Rxt(){let[e,t]=(0,M.useState)(``),[n,r]=(0,M.useState)(!1),i=N(L.me.getMe,{host:BO}),a=i?.ui,o=M9(i?.role)&&n,s=P(L.me.setUiPref).withOptimisticUpdate(cY),c=(0,M.useMemo)(()=>a?kxt(Object.keys(a.effective),e):[],[a,e]);return a?(0,F.jsxs)(`div`,{className:`oc-prefs-panel`,children:[M9(i?.role)?(0,F.jsxs)(`label`,{className:`oc-prefs__gov-toggle`,children:[(0,F.jsx)(uY,{checked:n,onCheckedChange:e=>r(e===!0),"aria-label":JP()}),JP()]}):null,o?(0,F.jsxs)(`div`,{className:`oc-prefs__gov-head`,children:[(0,F.jsx)(`p`,{children:rF()}),(0,F.jsx)(`p`,{children:oF()}),(0,F.jsx)(`p`,{children:fF()})]}):null,(0,F.jsx)(BJ,{value:e,onChange:e=>t(e.target.value),placeholder:NP(),"aria-label":NP(),className:`mb-2`}),c.length===0?(0,F.jsx)(`div`,{className:`oc-prefs__empty`,children:IP()}):(0,F.jsx)(`div`,{className:`oc-prefs`,children:c.map(e=>(0,F.jsxs)(`div`,{className:`oc-prefs__group`,children:[(0,F.jsx)(`h4`,{className:`oc-prefs__cat`,children:e.label}),e.keys.map(e=>{let t=A9[e],n=t?t.label():e,r=t?.help?.(),i=a.locked[e],c=a.effective[e],l=a.userOverrides[e]!==void 0;return(0,F.jsxs)(`div`,{className:`oc-prefs__row${i?` is-locked`:``}${l&&!i?` is-overridden`:``}`,children:[(0,F.jsxs)(`div`,{className:`oc-prefs__info`,children:[(0,F.jsxs)(`span`,{className:`oc-prefs__label`,children:[n,i?(0,F.jsx)(`span`,{className:`oc-prefs__lock`,children:zP()}):l?null:(0,F.jsx)(`span`,{className:`oc-prefs__def`,children:HP()})]}),r?(0,F.jsx)(`span`,{className:`oc-prefs__help`,children:r}):null]}),(0,F.jsxs)(`div`,{className:`oc-prefs__ctl`,children:[!i&&l?(0,F.jsx)(`button`,{type:`button`,className:`oc-prefs__reset`,onClick:()=>void s({key:e,value:null}),children:GP()}):null,(0,F.jsx)(uY,{checked:c,disabled:i,onCheckedChange:t=>void s({key:e,value:t===!0}),"aria-label":n})]}),o?(0,F.jsx)(Lxt,{prefKey:e,ui:a}):null]},e)})]},e.id))})]}):(0,F.jsx)(`div`,{className:`oc-prefs__empty`,children:dk()})}function zxt(){let e=N(L.me.getMe,{host:BO}),t=P(L.me.setLocale),n=P(L.me.setMyName),r=sY(),i=e?.locale??`default`,a=e?.name??``,[o,s]=(0,M.useState)(null),c=o??a,l=c.trim()!==a.trim();async function u(){try{await n({name:c}),s(null),r.success(fhe())}catch(e){r.error(hhe(),e)}}return(0,F.jsxs)(`div`,{className:`oc-appearance`,children:[(0,F.jsxs)(`section`,{className:`oc-show__section`,children:[(0,F.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,F.jsx)(`h2`,{className:`oc-show__title`,children:ehe()}),(0,F.jsx)(`p`,{className:`oc-show__desc`,children:rhe()})]}),(0,F.jsxs)(`div`,{className:`oc-show__row`,children:[(0,F.jsx)(BJ,{className:`max-w-xs`,value:c,maxLength:120,placeholder:ohe(),onChange:e=>s(e.target.value),onKeyDown:e=>{e.key===`Enter`&&l&&(e.preventDefault(),u())}}),(0,F.jsx)(H,{size:`sm`,disabled:!l,onClick:()=>void u(),children:OK()})]}),(0,F.jsx)(`p`,{className:`oc-show__desc`,children:lhe()})]}),(0,F.jsxs)(`section`,{className:`oc-show__section`,children:[(0,F.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,F.jsx)(`h2`,{className:`oc-show__title`,children:vhe()}),(0,F.jsx)(`p`,{className:`oc-show__desc`,children:xhe()})]}),(0,F.jsx)(`div`,{className:`oc-show__row`,children:[`fr`,`en`,`default`].map(e=>(0,F.jsx)(H,{variant:i===e?`default`:`outline`,size:`sm`,onClick:()=>void t({locale:e==="default"?null:e}),children:e===`fr`?_k():e===`en`?vk():hk()},e))}),(0,F.jsx)(`p`,{className:`oc-show__desc`,children:whe()})]}),(0,F.jsxs)(`section`,{className:`oc-show__section`,children:[(0,F.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,F.jsx)(`h2`,{className:`oc-show__title`,children:Dhe()}),(0,F.jsx)(`p`,{className:`oc-show__desc`,children:Ahe()})]}),(0,F.jsx)(Rxt,{})]})]})}var Bxt=[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`];function Vxt(e){let t=typeof e==`object`&&e?e:{},n=t.defaults!==null&&typeof t.defaults==`object`?t.defaults:{},r=n.thinkingDefault??t.thinkingDefault,i=n.fastModeDefault??t.fastModeDefault;return{thinkingDefault:typeof r==`string`?r:null,fastModeDefault:typeof i==`boolean`?i:null}}function Hxt(){let e=er(L.agentFiles.getChatDefaults),t=er(L.agentFiles.setChatDefaults),n=sY(),[r,i]=(0,M.useState)({status:`loading`}),[a,o]=(0,M.useState)({thinkingDefault:null,fastModeDefault:null}),[s,c]=(0,M.useState)(!1),[l,u]=(0,M.useState)(!1),d=N(L.admin.listInstances,{}),[f,p]=(0,M.useState)(null);(0,M.useEffect)(()=>{!d||d.length===0||(!f||!d.some(e=>e.name===f))&&p(d[0].name)},[d,f]);let m=(d?.length??0)>1,h=d!==void 0&&d.length===0,g=N(L.compat.forInstance,f?{instanceName:f}:`skip`),_=f?F3(g,`configDefaults`):`loading`,v=_===`loading`?null:_.blocked,y=(0,M.useMemo)(()=>m&&f?{instanceName:f}:{},[m,f]),b=(0,M.useRef)(0),x=(0,M.useCallback)(async()=>{let t=++b.current;i({status:`loading`});try{let n=Vxt(await e(y));if(b.current!==t)return;i({status:`done`,current:n}),o(n)}catch{if(b.current!==t)return;i({status:`error`})}},[e,y]);(0,M.useEffect)(()=>{v===!1&&(m&&!f||x())},[x,v,m,f]);let S=r.status===`done`?r.current:null,C=S!==null&&a.thinkingDefault!==null&&a.thinkingDefault!==S.thinkingDefault,w=S!==null&&a.fastModeDefault!==null&&a.fastModeDefault!==S.fastModeDefault,T=C||w;async function E(){u(!0);try{await t({...y,...C?{thinkingDefault:a.thinkingDefault}:{},...w?{fastModeDefault:a.fastModeDefault}:{}}),n.success(c9e()),await x()}catch(e){n.error(d9e(),e)}finally{u(!1)}}let D=(0,M.useMemo)(()=>Bxt.map(e=>({id:e,label:M3(e)})),[]),O=(0,M.useMemo)(()=>[{id:`fast`,label:kq()},{id:`standard`,label:Aq()}],[]);return(0,F.jsxs)(`div`,{className:`oc-cdefaults`,children:[(0,F.jsx)(`p`,{className:`oc-admin__hint`,children:V7e()}),m&&f?(0,F.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,F.jsx)(`span`,{className:`oc-cdefaults__label`,children:jq()}),(0,F.jsxs)(C3,{value:f,onValueChange:e=>p(e),disabled:l,children:[(0,F.jsx)(T3,{size:`sm`,"aria-label":jq(),children:(0,F.jsx)(w3,{})}),(0,F.jsx)(E3,{children:(d??[]).map(e=>(0,F.jsx)(Q,{value:e.name,children:e.name},e.name))})]})]}):null,h?(0,F.jsx)(`p`,{className:`oc-admin__hint`,role:`status`,children:lVe()}):_===`loading`?(0,F.jsx)(`p`,{className:`oc-admin__hint`,children:dk()}):_.blocked?(0,F.jsxs)(`p`,{className:`oc-compat__blocked`,role:`status`,children:[(0,F.jsx)(Vm,{size:14,"aria-hidden":!0}),` `,W5(_.gatewayVersion)]}):r.status===`loading`?(0,F.jsx)(`p`,{className:`oc-admin__hint`,children:dk()}):r.status===`error`?(0,F.jsxs)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:[n9e(),` `,(0,F.jsx)(H,{variant:`outline`,size:`sm`,onClick:()=>void x(),children:Oq()})]}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,F.jsx)(`span`,{className:`oc-cdefaults__label`,children:W7e()}),(0,F.jsx)(R3,{options:D,value:a.thinkingDefault,onChange:e=>o({...a,thinkingDefault:e}),disabled:l}),(0,F.jsx)(`p`,{className:`oc-cdefaults__help`,children:q7e()})]}),(0,F.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,F.jsx)(`span`,{className:`oc-cdefaults__label`,children:X7e()}),(0,F.jsx)(R3,{options:O,value:a.fastModeDefault===null?null:a.fastModeDefault?`fast`:`standard`,onChange:e=>o({...a,fastModeDefault:e===`fast`}),disabled:l}),(0,F.jsx)(`p`,{className:`oc-cdefaults__help`,children:$7e()})]}),(0,F.jsx)(`div`,{className:`oc-cdefaults__actions`,children:(0,F.jsx)(H,{size:`sm`,disabled:!T||l,onClick:()=>c(!0),children:l?Dq():a9e()})}),(0,F.jsx)(`p`,{className:`oc-cdefaults__note`,children:m9e()})]}),(0,F.jsx)(VJ,{open:s,onOpenChange:c,children:(0,F.jsxs)(HJ,{children:[(0,F.jsxs)(UJ,{children:[(0,F.jsx)(GJ,{children:_9e()}),(0,F.jsx)(KJ,{children:b9e()})]}),(0,F.jsxs)(WJ,{children:[(0,F.jsx)(JJ,{children:xV()}),(0,F.jsx)(qJ,{onClick:()=>void E(),children:C9e()})]})]})})]})}function Uxt(e){return e===`user`?t0e():e===`all`?i0e():pq({group:e.group})}function Wxt(e){return e===`common`?l0e():e===`owner`?f0e():pq({group:e.group})}function Gxt(e){return e.name||e.email||e.userId.slice(0,8)}function Kxt(){let e=N(L.admin.listUsers,{}),[t,n]=(0,M.useState)(``),r=N(L.introspect.introspectUser,t?{userId:t}:`skip`);return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`p`,{className:`oc-admin__hint`,children:D1e()}),(0,F.jsxs)(C3,{value:t,onValueChange:n,children:[(0,F.jsx)(T3,{size:`sm`,"aria-label":dq(),children:(0,F.jsx)(w3,{placeholder:dq()})}),(0,F.jsx)(E3,{children:(e??[]).map(e=>(0,F.jsx)(Q,{value:e.userId,children:Gxt(e)},e._id))})]}),t===``?(0,F.jsx)(`p`,{className:`oc-admin__hint`,children:M1e()}):r===void 0?(0,F.jsx)(`p`,{className:`oc-admin__hint`,children:dk()}):(0,F.jsxs)(`div`,{className:`oc-introspect`,children:[(0,F.jsxs)(`section`,{className:`oc-introspect__section`,children:[(0,F.jsx)(`h3`,{className:`oc-introspect__title`,children:F1e()}),(0,F.jsxs)(`div`,{className:`oc-introspect__id`,children:[(0,F.jsx)(`strong`,{children:r.user.label}),(0,F.jsx)($,{variant:`secondary`,children:r.role})]})]}),(0,F.jsxs)(`section`,{className:`oc-introspect__section`,children:[(0,F.jsx)(`h3`,{className:`oc-introspect__title`,children:R1e()}),r.groups.length===0?(0,F.jsx)(`p`,{className:`oc-admin__hint`,children:fq()}):(0,F.jsx)(`div`,{className:`oc-introspect__chips`,children:r.groups.map(e=>(0,F.jsx)($,{variant:`secondary`,children:e.name},e.groupId))})]}),(0,F.jsxs)(`section`,{className:`oc-introspect__section`,children:[(0,F.jsx)(`h3`,{className:`oc-introspect__title`,children:V1e()}),r.agents.length===0?(0,F.jsx)(`p`,{className:`oc-admin__hint`,children:fq()}):(0,F.jsx)(`ul`,{className:`oc-introspect__list`,children:r.agents.map(e=>(0,F.jsxs)(`li`,{className:`oc-introspect__row`,children:[(0,F.jsx)(`span`,{className:`oc-introspect__name`,children:e.displayName||e.agentId}),e.isDefault?(0,F.jsx)($,{variant:`default`,children:Q1e()}):null,(0,F.jsx)($,{variant:`outline`,children:Uxt(e.via)}),(0,F.jsx)($,{variant:`secondary`,children:e.state})]},`${e.instanceName} ${e.agentId}`))})]}),(0,F.jsxs)(`section`,{className:`oc-introspect__section`,children:[(0,F.jsx)(`h3`,{className:`oc-introspect__title`,children:W1e()}),r.charts.length===0?(0,F.jsx)(`p`,{className:`oc-admin__hint`,children:fq()}):(0,F.jsx)(`ul`,{className:`oc-introspect__list`,children:r.charts.map(e=>(0,F.jsxs)(`li`,{className:`oc-introspect__row`,children:[(0,F.jsx)(`span`,{className:`oc-introspect__name`,children:e.name}),(0,F.jsx)($,{variant:`outline`,children:Wxt(e.via)})]},e.key))})]}),(0,F.jsxs)(`section`,{className:`oc-introspect__section`,children:[(0,F.jsx)(`h3`,{className:`oc-introspect__title`,children:q1e()}),r.permissions.length===0?(0,F.jsx)(`p`,{className:`oc-admin__hint`,children:fq()}):(0,F.jsx)(`div`,{className:`oc-introspect__chips`,children:r.permissions.map(e=>(0,F.jsx)($,{variant:`secondary`,children:e},e))})]})]})]})}var N9=[{id:`personal`,label:()=>K3e(),tabs:[`preferences`,`theme`,`files`]},{id:`agents`,label:()=>Y3e(),tabs:[`instances`,`agentFiles`,`chatDefaults`,`bridge`]},{id:`access`,label:()=>Q3e(),tabs:[`users`,`groups`,`access`,`roles`,`serviceAccounts`]},{id:`observability`,label:()=>t6e(),tabs:[`traces`,`kpi`,`anomalies`,`audit`,`feedbacks`,`integrations`]}],qxt=new Map(N9.flatMap(e=>e.tabs.map(t=>[t,e.id])));function P9(e){let t=qxt.get(e);if(!t)throw Error(`Settings tab "${e}" belongs to no group`);return t}function Jxt(e,t){return e.find(e=>P9(e)===t)}N9.flatMap(e=>[...e.tabs]);function Yxt(){let e=N(L.bridgeHealth.getBridgeAvailability,{});if(e===void 0)return null;let t=e.known?e.available?`ok`:`error`:`idle`,n=e.known?e.available?`${CJe()}${e.checkedAt?EJe({time:new Date(e.checkedAt).toLocaleTimeString(`fr-FR`)}):``}`:kJe({reason:e.reason??`?`}):bJe();return(0,F.jsx)(j5,{delayDuration:150,children:(0,F.jsxs)(M5,{children:[(0,F.jsx)(N5,{asChild:!0,children:(0,F.jsx)(`span`,{className:`oc-bridge-dot oc-bridge-dot--${t}`,role:`img`,"aria-label":n})}),(0,F.jsx)(P5,{children:n})]})})}var Xxt={users:()=>H$e(),groups:()=>x1e(),instances:()=>G$e(),bridge:()=>J$e(),serviceAccounts:()=>Z$e(),roles:()=>e1e(),traces:()=>r1e(),kpi:()=>o1e(),anomalies:()=>l1e(),files:()=>Lhe(),agentFiles:()=>t5e(),preferences:()=>Zme(),chatDefaults:()=>R7e(),access:()=>w1e(),integrations:()=>f1e(),theme:()=>L_e(),audit:()=>h1e(),feedbacks:()=>v1e()};function F9(e){let t=new Set(E7),n=new Set,r=[];for(let i of e??[])t.has(i)&&!n.has(i)&&(r.push(i),n.add(i));for(let e of E7)n.has(e)||r.push(e);return r}function Zxt(e,t){let n=new Set(t),r=[...t];return e.map(e=>n.has(e)?r.shift():e)}function Qxt({tab:e,active:t}){let n=Xxt[e]?.()??O7[e]??e,r=`oc-settings-tabs__tab`+(t?` is-active`:``),i=(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`span`,{className:`oc-settings-tabs__label`,children:n}),e===`bridge`?(0,F.jsx)(Yxt,{}):null]});return D7.includes(e)?(0,F.jsx)(Ss,{to:`/settings/$tab`,params:{tab:e},className:r,role:`tab`,"aria-selected":t,children:i}):(0,F.jsx)(Ss,{to:`/settings/${e}`,className:r,role:`tab`,"aria-selected":t,children:i})}function $xt({tab:e,active:t}){let{attributes:n,listeners:r,setNodeRef:i,transform:a,transition:o,isDragging:s}=J8({id:e});return(0,F.jsxs)(`div`,{ref:i,style:{transform:w6.Transform.toString(a),transition:o,opacity:s?.5:1},className:`oc-settings-tabs__item`,role:`presentation`,children:[(0,F.jsx)(`button`,{type:`button`,className:`oc-settings-tabs__grip`,"aria-label":P3e(),...n,...r,children:(0,F.jsx)(Dm,{size:14,"aria-hidden":!0})}),(0,F.jsx)(Qxt,{tab:e,active:t})]})}function eSt(){let e=N(L.me.getMe,{host:BO}),t=P(L.me.setSettingsTabOrder),n=N7(Ks({select:e=>e.pathname})),r=n===void 0?void 0:P9(n),i=(0,M.useMemo)(()=>F9(e?.settingsTabOrder??null),[e?.settingsTabOrder]),[a,o]=(0,M.useState)(i);(0,M.useEffect)(()=>o(i),[i]);let s=(0,M.useMemo)(()=>new Set(j7(e?.permissions??[])),[e?.permissions]),c=(0,M.useMemo)(()=>r===void 0?[]:a.filter(e=>s.has(e)&&P9(e)===r),[a,s,r]),l=A6(k6(u8,{activationConstraint:{distance:5}}),k6(o8,{coordinateGetter:X8}));if(r===void 0||c.length===0)return null;let u=N9.find(e=>e.id===r);function d(e){let{active:n,over:r}=e;if(!r||n.id===r.id)return;let i=c.indexOf(n.id),s=c.indexOf(r.id);if(i<0||s<0)return;let l=Zxt(a,z8(c,i,s));o(l),t({order:l})}return(0,F.jsx)(`div`,{className:`oc-settings-tabs`,role:`tablist`,"aria-label":u?.label(),children:(0,F.jsx)(P8,{sensors:l,collisionDetection:c_t,modifiers:[vvt],onDragEnd:d,children:(0,F.jsx)(K8,{items:c,strategy:Tvt,children:c.map(e=>(0,F.jsx)($xt,{tab:e,active:e===n},e))})})})}function tSt(){let e=N(L.me.getMe,{host:BO}),t=cs(),n=N7(Ks({select:e=>e.pathname})),r=n===void 0?void 0:P9(n),i=(0,M.useMemo)(()=>new Set(j7(e?.permissions??[])),[e?.permissions]),a=(0,M.useMemo)(()=>F9(e?.settingsTabOrder??null).filter(e=>i.has(e)),[e?.settingsTabOrder,i]),o=N9.filter(e=>e.tabs.some(e=>i.has(e)));function s(e){let n=Jxt(a,e.id);n&&t({to:M7(n)})}return(0,F.jsxs)(`nav`,{className:`oc-settings-nav`,"aria-label":L3e(),children:[(0,F.jsx)(Ss,{to:`/`,className:`oc-settings-nav__back`,children:B3e()}),(0,F.jsx)(`div`,{className:`oc-settings-nav__title`,children:U3e()}),(0,F.jsx)(`div`,{className:`oc-settings-nav__list`,children:o.map(e=>(0,F.jsx)(`button`,{type:`button`,className:`oc-settings-nav__group`+(e.id===r?` is-active`:``),"aria-current":e.id===r?`true`:void 0,onClick:()=>s(e),children:e.label()},e.id))})]})}var nSt=.1,rSt=[248,248,248],iSt=[24,24,24];function aSt(e,t,n){let r=t,i=n,a=-1,o=-1;for(let s=0;s<n;s++)for(let n=0;n<t;n++)e[(s*t+n)*4+3]>8&&(n<r&&(r=n),n>a&&(a=n),s<i&&(i=s),s>o&&(o=s));return a<0?null:{x:r,y:i,width:a-r+1,height:o-i+1}}function oSt(e,t,n){let r=t*n;if(r===0)return 0;let i=0;for(let t=3;t<e.length;t+=4)e[t]<=8&&i++;return i/r}function I9(e,t,n){return oSt(e,t,n)>=nSt}function sSt(e,t){for(let n=0;n<e.length;n+=4)e[n]=t[0],e[n+1]=t[1],e[n+2]=t[2]}function cSt(e){for(let t=0;t<e.length;t+=4)e[t]=255-e[t],e[t+1]=255-e[t+1],e[t+2]=255-e[t+2]}var lSt=12*1024*1024,uSt=480,dSt=160,fSt=.92;async function pSt(e,t={}){if(!e.type.startsWith(`image/`))throw Error(fM());if(e.size>lSt)throw Error(hM());let{source:n,width:r,height:i,cleanup:a}=await mSt(e);try{let a=e.type===`image/svg+xml`,o=Math.min(uSt/r,dSt/i,a?1/0:1),s=Math.max(1,Math.round(r*o)),c=Math.max(1,Math.round(i*o)),l=document.createElement(`canvas`);l.width=s,l.height=c;let u=l.getContext(`2d`);if(!u)throw Error(xM());u.imageSmoothingEnabled=!0,u.imageSmoothingQuality=`high`,u.drawImage(n,0,0,s,c);let d=aSt(u.getImageData(0,0,s,c).data,s,c)??{x:0,y:0,width:s,height:c},f=document.createElement(`canvas`);f.width=d.width,f.height=d.height;let p=f.getContext(`2d`);if(!p)throw Error(xM());if(p.drawImage(l,d.x,d.y,d.width,d.height,0,0,d.width,d.height),t.variantFor){let e=p.getImageData(0,0,d.width,d.height);I9(e.data,d.width,d.height)?sSt(e.data,t.variantFor===`dark`?rSt:iSt):cSt(e.data),p.putImageData(e,0,0)}let m=I9(p.getImageData(0,0,d.width,d.height).data,d.width,d.height),h=await R9(f,`image/webp`,fSt)??await R9(f,`image/png`);if(!h)throw Error(wM());return{blob:h,hasAlpha:m}}finally{a()}}async function mSt(e){if(e.type===`image/svg+xml`)return L9(e);if(typeof createImageBitmap==`function`)try{let t=await createImageBitmap(e);return{source:t,width:t.width,height:t.height,cleanup:()=>t.close()}}catch{}return L9(e)}async function L9(e){let t=URL.createObjectURL(e);try{let e=new Image;return e.decoding=`async`,await new Promise((n,r)=>{e.onload=()=>n(),e.onerror=()=>r(Error(vM())),e.src=t}),{source:e,width:e.naturalWidth||300,height:e.naturalHeight||150,cleanup:()=>URL.revokeObjectURL(t)}}catch(e){throw URL.revokeObjectURL(t),e}}function R9(e,t,n){return new Promise(r=>e.toBlob(e=>r(e),t,n))}var z9=`__all__`,B9={kind:`relative`,from:`now-24h`,to:`now`},hSt=[{value:`status`,label:`Statut`},{value:`latencyMs`,label:`Latence (ms)`},{value:`route`,label:`Route`},{value:`roleKey`,label:`Rôle`},{value:`correlationId`,label:`Corrélation`}];function V9({title:e,description:t,children:n}){return(0,F.jsxs)(`section`,{className:`oc-show__section`,children:[(0,F.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,F.jsx)(`h2`,{className:`oc-show__title`,children:e}),t?(0,F.jsx)(`p`,{className:`oc-show__desc`,children:t}):null]}),(0,F.jsx)(`div`,{className:`oc-show__demo`,children:n})]})}function gSt(e){return e===`light`?fk():e===`dark`?pk():mk()}var _St=[`primary`,`secondary`,`accent`,`muted`,`chart-1`,`chart-2`];function vSt({tokens:e,mode:t}){let n=e.colors[t];return(0,F.jsx)(`div`,{className:`oc-chart-swatches`,"aria-hidden":!0,children:_St.map(e=>{let t=n[e];return(0,F.jsx)(`span`,{className:`oc-chart-swatch`,style:t?{background:t}:void 0},e)})})}function H9({selected:e,title:t,subtitle:n,tokens:r,mode:i,onSelect:a}){return(0,F.jsxs)(`button`,{type:`button`,className:TJ(`oc-chart-card`,e&&`oc-chart-card--selected`),"aria-pressed":e,onClick:a,children:[(0,F.jsxs)(`div`,{className:`oc-chart-card__head`,children:[(0,F.jsx)(`span`,{className:`oc-chart-card__title`,children:t}),e?(0,F.jsx)(hm,{className:`size-4 text-primary`,"aria-hidden":!0}):null]}),r?(0,F.jsx)(vSt,{tokens:r,mode:i}):(0,F.jsx)(`div`,{className:`oc-chart-swatches oc-chart-swatches--native`,"aria-hidden":!0}),(0,F.jsx)(`div`,{className:`oc-chart-card__meta`,children:(0,F.jsx)(`span`,{className:`oc-chart-card__subtitle`,children:n})})]})}function ySt({selectedKey:e,resolvedMode:t}){let n=N(L.charts.listMyCharts),r=P(L.charts.setMyChart);async function i(e){try{await r({name:e})}catch{}}return(0,F.jsxs)(`section`,{className:`oc-show__section`,children:[(0,F.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,F.jsx)(`h2`,{className:`oc-show__title`,children:zk()}),(0,F.jsx)(`p`,{className:`oc-show__desc`,children:Hk()})]}),(0,F.jsxs)(`div`,{className:`oc-chart-grid`,children:[(0,F.jsx)(H9,{selected:e===null,title:Gk(),subtitle:Jk(),tokens:null,mode:t,onSelect:()=>void i(null)}),(n??[]).map(n=>{let r=n.via===`common`?Zk():n.via===`owner`?eA():rA({group:n.via.group});return(0,F.jsx)(H9,{selected:e===n.key,title:n.name,subtitle:r,tokens:n.tokens,mode:t,onSelect:()=>void i(n.key)},n.key)})]}),n!==void 0&&n.length===0?(0,F.jsx)(`p`,{className:`oc-show__desc`,children:oA()}):null]})}function bSt(){let e=P(L.charts.importChart),[t,n]=(0,M.useState)(``),[r,i]=(0,M.useState)(``),[a,o]=(0,M.useState)(null),[s,c]=(0,M.useState)(!1),[l,u]=(0,M.useState)(!1);async function d(e){let t=e.target.files?.[0];if(e.target.value=``,t){o(null),c(!1);try{i(await t.text())}catch{o(vj())}}}async function f(){if(o(null),c(!1),t.trim()===``){o(wj());return}let a;try{a=JSON.parse(r)}catch{o(vj());return}u(!0);try{await e({name:t.trim(),tokens:a}),c(!0),n(``),i(``)}catch(e){o(e instanceof Error?e.message:String(e))}finally{u(!1)}}return(0,F.jsxs)(`section`,{className:`oc-show__section`,children:[(0,F.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,F.jsx)(`h2`,{className:`oc-show__title`,children:JA()}),(0,F.jsx)(`p`,{className:`oc-show__desc`,children:ZA()})]}),(0,F.jsxs)(`div`,{className:`oc-chart-import`,children:[(0,F.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,F.jsx)(`span`,{className:`oc-chart-import__label`,children:ej()}),(0,F.jsx)(BJ,{value:t,onChange:e=>n(e.target.value),placeholder:rj(),maxLength:60})]}),(0,F.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,F.jsx)(`span`,{className:`oc-chart-import__label`,children:oj()}),(0,F.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:r,onChange:e=>i(e.target.value),placeholder:lj(),rows:8,spellCheck:!1})]}),(0,F.jsxs)(`div`,{className:`oc-show__row`,children:[(0,F.jsx)(H,{variant:`outline`,size:`sm`,asChild:!0,children:(0,F.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,F.jsx)(Hm,{className:`size-4`}),fj(),(0,F.jsx)(`input`,{type:`file`,accept:`application/json,.json`,className:`oc-chart-import__file-input`,onChange:e=>void d(e)})]})}),(0,F.jsx)(H,{size:`sm`,disabled:l,onClick:()=>void f(),children:hj()})]}),a?(0,F.jsx)(`p`,{className:`oc-chart-import__error`,children:a}):null,s?(0,F.jsx)(`p`,{className:`oc-chart-import__ok`,children:xj()}):null]})]})}function xSt({chart:e}){let t=er(L.charts.setChartLogo),n=P(L.charts.removeChartLogo),[r,i]=(0,M.useState)(!1),[a,o]=(0,M.useState)(null),s=t=>t===`light`?e.logoLightUrl:e.logoDarkUrl;async function c(n,r,a){if(e.chartId!==void 0){o(null),i(!0);try{let{blob:i,hasAlpha:o}=await pSt(r,a?{variantFor:a}:{}),s=await i.arrayBuffer();await t({chartId:e.chartId,bytes:s,mode:n,hasAlpha:o})}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}}async function l(e,t){let n=t.target.files?.[0];t.target.value=``,n&&await c(e,n)}async function u(t){if(e.chartId!==void 0){o(null),i(!0);try{await n({chartId:e.chartId,mode:t})}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}}async function d(e){let t=s(e===`light`?`dark`:`light`);if(t){o(null),i(!0);try{await c(e,await(await fetch(t)).blob(),e)}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}}function f({mode:e}){let t=s(e),n=s(e===`light`?`dark`:`light`);return(0,F.jsxs)(`div`,{className:`oc-chart-mine__logo-slot`,children:[(0,F.jsx)(`span`,{className:`oc-chart-mine__logo-mode`,children:e===`light`?Gj():Jj()}),(0,F.jsx)(`span`,{className:`oc-chart-mine__logo-preview`,"data-mode":e,"data-empty":t?void 0:`1`,children:t?(0,F.jsx)(`img`,{src:t,alt:``}):null}),(0,F.jsx)(H,{variant:`outline`,size:`sm`,asChild:!0,children:(0,F.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,F.jsx)(Hm,{className:`size-4`}),t?eM():Zj(),(0,F.jsx)(`input`,{type:`file`,accept:`image/*`,className:`oc-chart-import__file-input`,onChange:t=>void l(e,t)})]})}),!t&&n?(0,F.jsx)(H,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void d(e),children:oM()}):null,t?(0,F.jsx)(H,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void u(e),children:rM()}):null]})}return(0,F.jsxs)(`div`,{className:`oc-chart-mine__logo`,children:[(0,F.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:Hj()}),(0,F.jsxs)(`div`,{className:`oc-chart-mine__logo-slots`,children:[(0,F.jsx)(f,{mode:`light`}),(0,F.jsx)(f,{mode:`dark`})]}),r?(0,F.jsx)(`span`,{className:`oc-show__desc`,children:lM()}):null,a?(0,F.jsx)(`p`,{className:`oc-chart-import__error`,children:a}):null]})}function U9({chart:e}){let t=N(L.me.getMe,{host:BO}),n=P(L.charts.addChartDomain),r=P(L.charts.removeChartDomain),[i,a]=(0,M.useState)(``),[o,s]=(0,M.useState)(null),[c,l]=(0,M.useState)(!1);if(t?.role!==`admin`)return null;let u=e.domains??[];async function d(){let t=i.trim();if(t!==``){s(null),l(!0);try{await n({chartKey:e.key,domain:t}),a(``)}catch(e){s(e instanceof Error?e.message:String(e))}finally{l(!1)}}}async function f(t){s(null);try{await r({chartKey:e.key,domain:t})}catch{}}return(0,F.jsxs)(`div`,{className:`oc-chart-mine__domains`,children:[(0,F.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:DM()}),(0,F.jsxs)(`div`,{className:`oc-chart-mine__domains-body`,children:[(0,F.jsx)(`div`,{className:`oc-chart-avail__groups`,children:u.length===0?(0,F.jsx)(`span`,{className:`oc-show__desc`,children:zM()}):u.map(e=>(0,F.jsxs)($,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e,(0,F.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":HM({domain:e}),onClick:()=>void f(e),children:(0,F.jsx)(Gm,{className:`size-3`})})]},e))}),(0,F.jsxs)(`div`,{className:`oc-show__row`,children:[(0,F.jsx)(BJ,{value:i,onChange:e=>a(e.target.value),placeholder:NM(),className:`oc-chart-mine__domains-input`,onKeyDown:e=>{e.key===`Enter`&&d()}}),(0,F.jsx)(H,{variant:`outline`,size:`sm`,disabled:c,onClick:()=>void d(),children:IM()})]}),(0,F.jsx)(`span`,{className:`oc-show__desc`,children:AM()}),o?(0,F.jsx)(`p`,{className:`oc-chart-import__error`,children:o}):null]})]})}function SSt({chart:e}){let t=P(L.charts.updateChart),n=P(L.charts.deleteChart),[r,i]=(0,M.useState)(!1),[a,o]=(0,M.useState)(e.name),[s,c]=(0,M.useState)(()=>JSON.stringify(e.tokens,null,2)),[l,u]=(0,M.useState)(null),[d,f]=(0,M.useState)(!1);function p(){o(e.name),c(JSON.stringify(e.tokens,null,2)),u(null),i(!0)}async function m(){if(e.chartId===void 0)return;u(null);let n;try{n=JSON.parse(s)}catch{u(vj());return}f(!0);try{await t({chartId:e.chartId,name:a.trim(),tokens:n}),i(!1)}catch(e){u(e instanceof Error?e.message:String(e))}finally{f(!1)}}async function h(){if(e.chartId!==void 0&&window.confirm(rN()))try{await n({chartId:e.chartId})}catch{}}return(0,F.jsxs)(`div`,{className:`oc-chart-mine__row`,children:[(0,F.jsxs)(`div`,{className:`oc-chart-mine__head`,children:[(0,F.jsx)(`span`,{className:`oc-chart-mine__name`,children:e.name}),(0,F.jsx)(`div`,{className:`oc-show__row`,children:r?null:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(H,{variant:`outline`,size:`sm`,onClick:p,children:Ij()}),(0,F.jsx)(H,{variant:`ghost`,size:`sm`,onClick:()=>void h(),children:zj()})]})})]}),r?(0,F.jsxs)(`div`,{className:`oc-chart-mine__editor`,children:[(0,F.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,F.jsx)(`span`,{className:`oc-chart-import__label`,children:ZM()}),(0,F.jsx)(BJ,{value:a,onChange:e=>o(e.target.value),maxLength:60})]}),(0,F.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,F.jsx)(`span`,{className:`oc-chart-import__label`,children:eN()}),(0,F.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:s,onChange:e=>c(e.target.value),rows:10,spellCheck:!1})]}),l?(0,F.jsx)(`p`,{className:`oc-chart-import__error`,children:l}):null,(0,F.jsxs)(`div`,{className:`oc-show__row`,children:[(0,F.jsx)(H,{size:`sm`,disabled:d,onClick:()=>void m(),children:GM()}),(0,F.jsx)(H,{variant:`ghost`,size:`sm`,onClick:()=>i(!1),children:JM()})]})]}):null,(0,F.jsx)(xSt,{chart:e}),(0,F.jsx)(U9,{chart:e})]})}function CSt(){let e=N(L.charts.listMyCharts),t=(e??[]).filter(e=>e.via===`owner`);return(0,F.jsxs)(`section`,{className:`oc-show__section`,children:[(0,F.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,F.jsx)(`h2`,{className:`oc-show__title`,children:Dj()}),(0,F.jsx)(`p`,{className:`oc-show__desc`,children:Aj()})]}),e!==void 0&&t.length===0?(0,F.jsx)(`p`,{className:`oc-show__desc`,children:Nj()}):(0,F.jsx)(`div`,{className:`oc-chart-mine-list`,children:t.map(e=>(0,F.jsx)(SSt,{chart:e},e.key))})]})}function wSt({chart:e,groups:t}){let n=P(L.charts.addChartToGroupPool),r=P(L.charts.removeChartFromGroupPool),i=e.restrictedToGroups,a=e.poolGroups,o=new Set((a??[]).map(e=>e.groupId)),s=t.filter(e=>!o.has(e._id));async function c(t){try{await n({groupId:t,chartKey:e.key})}catch{}}async function l(t){try{await r({groupId:t,chartKey:e.key})}catch{}}return(0,F.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,F.jsxs)(`div`,{className:`oc-chart-avail__head`,children:[(0,F.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name}),(0,F.jsx)($,{variant:i?`secondary`:`outline`,className:`oc-chart-avail__state`,children:i?AA():e.kind===`custom`&&e.scope===`personal`?hN():DA()}),e.isGlobalDefault?(0,F.jsx)($,{variant:`default`,children:NA()}):null]}),(0,F.jsxs)(`div`,{className:`oc-chart-avail__groups`,children:[(0,F.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:zA()}),(a??[]).map(e=>(0,F.jsxs)($,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e.name,(0,F.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":GA({group:e.name}),onClick:()=>void l(e.groupId),children:(0,F.jsx)(Gm,{className:`size-3`})})]},e.groupId)),s.length>0?(0,F.jsxs)(C3,{value:``,onValueChange:e=>void c(e),children:[(0,F.jsx)(T3,{size:`sm`,className:`w-56`,children:(0,F.jsx)(w3,{placeholder:HA()})}),(0,F.jsx)(E3,{children:s.map(e=>(0,F.jsx)(Q,{value:e._id,children:e.name},e._id))})]}):t.length===0?(0,F.jsx)(`span`,{className:`oc-show__desc`,children:IA()}):null]})]})}function TSt({chart:e}){let t=P(L.charts.promoteChartToCommon),n=P(L.charts.deleteChart);async function r(){if(e.chartId!==void 0)try{await t({chartId:e.chartId})}catch{}}async function i(){if(e.chartId!==void 0&&window.confirm(rN()))try{await n({chartId:e.chartId})}catch{}}return(0,F.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,F.jsxs)(`div`,{className:`oc-chart-avail__head`,children:[(0,F.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name}),(0,F.jsx)($,{variant:e.scope===`common`?`outline`:`secondary`,children:e.scope===`common`?vN():hN()}),e.ownerLabel?(0,F.jsx)(`span`,{className:`oc-show__desc`,children:fN({owner:e.ownerLabel})}):null]}),(0,F.jsxs)(`div`,{className:`oc-show__row`,children:[e.scope===`personal`?(0,F.jsx)(H,{variant:`outline`,size:`sm`,onClick:()=>void r(),children:xN()}):null,(0,F.jsx)(H,{variant:`ghost`,size:`sm`,onClick:()=>void i(),children:wN()})]})]})}function ESt({defaultThemeMode:e,defaultLocale:t,defaultChartKey:n}){let r=P(L.admin.setDefaultThemeMode),i=P(L.admin.setDefaultLocale),a=P(L.charts.setDefaultChart),o=N(L.charts.listChartsAdmin),s=N(L.groups.listGroups,{}),c=e??`system`,l=t??`fr`;return(0,F.jsxs)(`div`,{className:`oc-appearance-admin`,children:[(0,F.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,F.jsx)(`h2`,{className:`oc-show__title`,children:Nk()}),(0,F.jsx)(`p`,{className:`oc-show__desc`,children:Ik()})]}),(0,F.jsxs)(`section`,{className:`oc-show__section`,children:[(0,F.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,F.jsx)(`h3`,{className:`oc-show__title`,children:lA()}),(0,F.jsx)(`p`,{className:`oc-show__desc`,children:fA()})]}),(0,F.jsxs)(`div`,{className:`oc-show__row`,children:[(0,F.jsx)(H,{variant:n===null?`default`:`outline`,size:`sm`,onClick:()=>void a({name:null}),children:Gk()}),HO.map(e=>(0,F.jsx)(H,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void a({name:e.key}),children:e.name},e.key)),(o??[]).filter(e=>e.kind===`custom`&&e.scope===`common`).map(e=>(0,F.jsx)(H,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void a({name:e.key}),children:e.name},e.key))]})]}),(0,F.jsxs)(`section`,{className:`oc-show__section`,children:[(0,F.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,F.jsx)(`h3`,{className:`oc-show__title`,children:hA()}),(0,F.jsx)(`p`,{className:`oc-show__desc`,children:vA()})]}),(0,F.jsx)(`div`,{className:`oc-chart-avail-list`,children:(o??[]).filter(e=>!(e.kind===`custom`&&e.scope===`common`)).map(e=>(0,F.jsx)(wSt,{chart:e,groups:s??[]},e.key))})]}),(0,F.jsxs)(`section`,{className:`oc-show__section`,children:[(0,F.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,F.jsx)(`h3`,{className:`oc-show__title`,children:xA()}),(0,F.jsx)(`p`,{className:`oc-show__desc`,children:wA()})]}),(0,F.jsx)(`div`,{className:`oc-chart-avail-list`,children:(o??[]).filter(e=>e.kind===`builtin`||e.scope===`common`).map(e=>(0,F.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,F.jsx)(`div`,{className:`oc-chart-avail__head`,children:(0,F.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name})}),(0,F.jsx)(U9,{chart:e})]},e.key))})]}),(0,F.jsxs)(`section`,{className:`oc-show__section`,children:[(0,F.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,F.jsx)(`h3`,{className:`oc-show__title`,children:oN()}),(0,F.jsx)(`p`,{className:`oc-show__desc`,children:lN()})]}),(()=>{let e=(o??[]).filter(e=>e.kind===`custom`);return e.length===0?(0,F.jsx)(`p`,{className:`oc-show__desc`,children:DN()}):(0,F.jsx)(`div`,{className:`oc-chart-avail-list`,children:e.map(e=>(0,F.jsx)(TSt,{chart:e},e.key))})})()]}),(0,F.jsxs)(`section`,{className:`oc-show__section`,children:[(0,F.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,F.jsx)(`h3`,{className:`oc-show__title`,children:B_e()}),(0,F.jsx)(`p`,{className:`oc-show__desc`,children:U_e()})]}),(0,F.jsx)(`div`,{className:`oc-show__row`,children:[`light`,`dark`,`system`].map(e=>(0,F.jsx)(H,{variant:c===e?`default`:`outline`,size:`sm`,onClick:()=>void r({mode:e}),children:gSt(e)},e))})]}),(0,F.jsxs)(`section`,{className:`oc-show__section`,children:[(0,F.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,F.jsx)(`h3`,{className:`oc-show__title`,children:K_e()}),(0,F.jsx)(`p`,{className:`oc-show__desc`,children:wk()})]}),(0,F.jsx)(`div`,{className:`oc-show__row`,children:[`fr`,`en`].map(e=>(0,F.jsx)(H,{variant:l===e?`default`:`outline`,size:`sm`,onClick:()=>void i({locale:e}),children:e===`fr`?_k():vk()},e))}),(0,F.jsx)(`p`,{className:`oc-show__desc`,children:Dk()})]})]})}function DSt(){let e=N(L.me.getMe,{host:BO}),t=UO(e?.resolvedThemeMode);return(0,F.jsxs)(`div`,{className:`oc-appearance`,children:[(0,F.jsx)(ySt,{selectedKey:e?.chartKey??null,resolvedMode:t}),(0,F.jsx)(bSt,{}),(0,F.jsx)(CSt,{}),e?.role===`admin`?(0,F.jsx)(ESt,{defaultThemeMode:e.defaultThemeMode,defaultLocale:e.defaultLocale,defaultChartKey:e.defaultChartKey}):null]})}function OSt(){let[e,t]=(0,M.useState)(!0),[n,r]=(0,M.useState)(`per-user`),[i,a]=(0,M.useState)(``),[o,s]=(0,M.useState)(z9),[c,l]=(0,M.useState)(z9),[u,d]=(0,M.useState)(B9),f=i!==``||o!==z9||c!==z9;function p(){a(``),s(z9),l(z9),d(B9)}return(0,F.jsxs)(`div`,{className:`oc-show`,children:[(0,F.jsx)(DSt,{}),(0,F.jsxs)(`details`,{className:`oc-show__ref`,children:[(0,F.jsx)(`summary`,{className:`oc-show__title`,children:Ak()}),(0,F.jsxs)(V9,{title:`Buttons`,description:`Variants`,children:[(0,F.jsxs)(`div`,{className:`oc-show__row`,children:[(0,F.jsx)(H,{children:`Default`}),(0,F.jsx)(H,{variant:`secondary`,children:`Secondary`}),(0,F.jsx)(H,{variant:`outline`,children:`Outline`}),(0,F.jsx)(H,{variant:`ghost`,children:`Ghost`}),(0,F.jsx)(H,{variant:`destructive`,children:`Destructive`}),(0,F.jsx)(H,{variant:`link`,children:`Link`})]}),(0,F.jsxs)(`div`,{className:`oc-show__row`,children:[(0,F.jsx)(H,{size:`sm`,children:`Small`}),(0,F.jsx)(H,{children:`Default`}),(0,F.jsx)(H,{size:`lg`,children:`Large`}),(0,F.jsx)(H,{size:`icon`,"aria-label":`more`,children:(0,F.jsx)(wm,{})}),(0,F.jsx)(H,{disabled:!0,children:`Disabled`})]})]}),(0,F.jsx)(V9,{title:`Badges`,children:(0,F.jsxs)(`div`,{className:`oc-show__row`,children:[(0,F.jsx)($,{children:`Default`}),(0,F.jsx)($,{variant:`secondary`,children:`Secondary`}),(0,F.jsx)($,{variant:`outline`,children:`Outline`}),(0,F.jsx)($,{variant:`destructive`,children:`Destructive`})]})}),(0,F.jsx)(V9,{title:`Inputs & selection`,children:(0,F.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,F.jsx)(BJ,{placeholder:`Text input…`}),(0,F.jsxs)(`div`,{className:`oc-show__row`,children:[(0,F.jsxs)(C3,{value:n,onValueChange:r,children:[(0,F.jsx)(T3,{className:`w-56`,children:(0,F.jsx)(w3,{placeholder:`Select…`})}),(0,F.jsxs)(E3,{children:[(0,F.jsx)(Q,{value:`per-user`,children:`per-user (chacun son agent)`}),(0,F.jsx)(Q,{value:`shared`,children:`shared (agent commun)`})]})]}),(0,F.jsxs)(`label`,{className:`oc-show__check`,children:[(0,F.jsx)(uY,{checked:e,onCheckedChange:e=>t(!!e)}),`Checkbox`]})]})]})}),(0,F.jsx)(V9,{title:`Filtres & plage temporelle`,description:`Barre réutilisable (recherche debouncée + selects rapides à largeur auto + plage façon Grafana) et constructeur de filtre avancé. Câblée dans Users, Groups, Comptes de service, Traces, Anomalies, Audit et KPI.`,children:(0,F.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,F.jsxs)(r7,{q:i,onQChange:a,searchPlaceholder:`Rechercher (kind, principal, rôle, route…)`,timeRange:u,onTimeRangeChange:d,onReset:p,canReset:f,children:[(0,F.jsxs)(C3,{value:o,onValueChange:s,children:[(0,F.jsx)(T3,{size:`sm`,children:(0,F.jsx)(w3,{})}),(0,F.jsxs)(E3,{children:[(0,F.jsx)(Q,{value:z9,children:`Toutes directions`}),(0,F.jsx)(Q,{value:`inbound`,children:`inbound`}),(0,F.jsx)(Q,{value:`outbound`,children:`outbound`}),(0,F.jsx)(Q,{value:`internal`,children:`internal`})]})]}),(0,F.jsxs)(C3,{value:c,onValueChange:l,children:[(0,F.jsx)(T3,{size:`sm`,children:(0,F.jsx)(w3,{})}),(0,F.jsxs)(E3,{children:[(0,F.jsx)(Q,{value:z9,children:`Toutes sévérités`}),(0,F.jsx)(Q,{value:`info`,children:`info`}),(0,F.jsx)(Q,{value:`warn`,children:`warn`}),(0,F.jsx)(Q,{value:`critical`,children:`critical`})]})]})]}),(0,F.jsx)(m7,{fields:hSt,onChange:()=>{}}),(0,F.jsxs)(`div`,{className:`oc-show__row`,children:[(0,F.jsx)(`span`,{className:`oc-show__desc`,children:`Sélecteur de plage seul :`}),(0,F.jsx)(n7,{value:u,onChange:d})]})]})}),(0,F.jsx)(V9,{title:`Dropdown menu`,description:`Row actions / kebab`,children:(0,F.jsxs)(EJ,{children:[(0,F.jsx)(DJ,{asChild:!0,children:(0,F.jsx)(H,{variant:`outline`,size:`icon`,"aria-label":`Open menu`,children:(0,F.jsx)(wm,{})})}),(0,F.jsxs)(OJ,{align:`start`,children:[(0,F.jsx)(AJ,{children:`Actions`}),(0,F.jsx)(jJ,{}),(0,F.jsx)(kJ,{children:`Edit`}),(0,F.jsx)(kJ,{children:`Duplicate`}),(0,F.jsx)(jJ,{}),(0,F.jsx)(kJ,{variant:`destructive`,children:`Delete`})]})]})}),(0,F.jsx)(V9,{title:`Card`,children:(0,F.jsxs)(n9,{className:`w-80`,children:[(0,F.jsxs)(r9,{children:[(0,F.jsx)(i9,{children:`Instance`}),(0,F.jsx)(a9,{children:`Non-secret metadata only.`})]}),(0,F.jsx)(o9,{className:`text-sm text-muted-foreground`,children:`ws://gateway.example.org:18789`}),(0,F.jsxs)(Xbt,{className:`gap-2`,children:[(0,F.jsx)(H,{size:`sm`,children:`Save`}),(0,F.jsx)(H,{size:`sm`,variant:`ghost`,children:`Cancel`})]})]})}),(0,F.jsx)(V9,{title:`Table`,children:(0,F.jsxs)(C5,{children:[(0,F.jsx)(w5,{children:(0,F.jsxs)(E5,{children:[(0,F.jsx)(D5,{className:`w-8`,children:(0,F.jsx)(uY,{"aria-label":`select all`})}),(0,F.jsx)(D5,{children:`Name`}),(0,F.jsx)(D5,{children:`Mode`}),(0,F.jsx)(D5,{className:`text-right`,children:`Status`}),(0,F.jsx)(D5,{className:`w-8`})]})}),(0,F.jsx)(T5,{children:[{n:`admins`,m:`per-user`,s:`active`},{n:`family`,m:`shared`,s:`active`}].map(e=>(0,F.jsxs)(E5,{children:[(0,F.jsx)(O5,{children:(0,F.jsx)(uY,{"aria-label":`select ${e.n}`})}),(0,F.jsx)(O5,{className:`font-medium`,children:e.n}),(0,F.jsx)(O5,{children:(0,F.jsx)($,{variant:`secondary`,children:e.m})}),(0,F.jsx)(O5,{className:`text-right`,children:(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-muted-foreground`,children:[(0,F.jsx)(hm,{className:`size-3.5`}),` `,e.s]})}),(0,F.jsx)(O5,{children:(0,F.jsx)(H,{variant:`ghost`,size:`icon`,"aria-label":`row actions`,children:(0,F.jsx)(wm,{})})})]},e.n))})]})}),(0,F.jsx)(V9,{title:`App fragments`,description:`Chat-specific components`,children:(0,F.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,F.jsx)(`div`,{className:`oc-msg oc-msg--assistant`,children:(0,F.jsx)(`div`,{className:`oc-msg__body`,children:`Assistant message bubble.`})}),(0,F.jsx)(`div`,{className:`oc-tool oc-tool--completed`,children:(0,F.jsxs)(`div`,{className:`oc-tool__header`,children:[(0,F.jsx)(`span`,{className:`oc-tool__icon`,children:`✓`}),(0,F.jsx)(`span`,{className:`oc-tool__name`,children:`write-file`}),(0,F.jsx)(`span`,{className:`oc-tool__phase`,children:`completed`})]})}),(0,F.jsxs)(`div`,{className:`oc-run-status oc-run-status--streaming`,children:[(0,F.jsx)(`span`,{className:`oc-run-status__dot`}),(0,F.jsx)(`span`,{className:`oc-run-status__label`,children:`Running`})]})]})})]})]})}var W9=`oc.theme`;function G9(e){let t=e===`dark`||e===`system`&&window.matchMedia(`(prefers-color-scheme: dark)`).matches;document.documentElement.classList.toggle(`dark`,t)}function K9(e){(0,M.useEffect)(()=>{let t=e??localStorage.getItem(W9)??`system`;if(localStorage.setItem(W9,t),G9(t),t===`system`){let e=window.matchMedia(`(prefers-color-scheme: dark)`),t=()=>G9(`system`);return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)}},[e])}function kSt(e){(0,M.useEffect)(()=>{if(!e)return;document.documentElement.lang=e;let t;try{t=V()}catch{t=void 0}t!==e&&sk(e)},[e])}function ASt(){return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(hr,{children:(0,F.jsx)(`div`,{className:`oc-boot`,children:GK()})}),(0,F.jsx)(mr,{children:(0,F.jsx)(MSt,{})}),(0,F.jsx)(pr,{children:(0,F.jsx)(Ott,{children:(0,F.jsx)(NSt,{})})})]})}function jSt(){return(0,F.jsxs)(`svg`,{className:`oc-provider__logo`,viewBox:`0 0 48 48`,"aria-hidden":`true`,children:[(0,F.jsx)(`path`,{fill:`#EA4335`,d:`M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z`}),(0,F.jsx)(`path`,{fill:`#4285F4`,d:`M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z`}),(0,F.jsx)(`path`,{fill:`#FBBC05`,d:`M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z`}),(0,F.jsx)(`path`,{fill:`#34A853`,d:`M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z`})]})}function MSt(){let{signIn:e}=Lr();K9(void 0);let t=N(L.charts.brandForHost,{host:BO}),n=vme(BO),r=t??n??null,i=UO(void 0);WO(r?.tokens??null,i),(0,M.useEffect)(()=>{t&&yme(BO,t)},[t]);let a=r?.brand,o=a&&!a.isDefault?XO(a,i):null,s=a?.label??`Atrium`,c=N(L.me.authProviders),[l,u]=(0,M.useState)(null);async function d(t){u(null);try{await e(t)}catch{u(QRe())}}let f=c!==void 0&&!c.google&&!c.microsoft&&!c.anonymous;return(0,F.jsxs)(`div`,{className:`oc-signin`,children:[(0,F.jsxs)(`svg`,{className:`oc-signin__motif`,viewBox:`0 0 1200 1000`,preserveAspectRatio:`none`,"aria-hidden":`true`,children:[(0,F.jsx)(`polyline`,{className:`oc-signin__line`,points:`0,860 470,860 522,790 574,940 626,810 678,860 1200,860`,vectorEffect:`non-scaling-stroke`}),(0,F.jsx)(`polyline`,{className:`oc-signin__pulse`,points:`0,860 470,860 522,790 574,940 626,810 678,860 1200,860`,pathLength:`100`,vectorEffect:`non-scaling-stroke`})]}),(0,F.jsxs)(`div`,{className:`oc-signin__brand`,children:[o?(0,F.jsx)(`img`,{className:`oc-signin__brandlogo`,src:o,alt:``}):null,(0,F.jsx)(`span`,{className:`oc-signin__wordmark`,children:s})]}),(0,F.jsxs)(`div`,{className:`oc-signin__card`,children:[(0,F.jsx)(`h1`,{className:`oc-signin__title`,children:tze()}),(0,F.jsx)(`p`,{className:`oc-signin__subtitle`,children:ize()}),(0,F.jsx)(`div`,{className:`oc-signin__providers`,children:c?.google?(0,F.jsxs)(`button`,{type:`button`,className:`oc-provider oc-provider--google`,onClick:()=>void d(`google`),children:[(0,F.jsx)(jSt,{}),(0,F.jsx)(`span`,{children:sze()})]}):null}),l?(0,F.jsx)(`p`,{className:`oc-signin__error`,children:l}):null,f?(0,F.jsx)(`p`,{className:`oc-signin__error`,children:uze()}):null,c?.anonymous?(0,F.jsx)(`button`,{type:`button`,className:`oc-signin__dev`,onClick:()=>void e(`anonymous`),children:pze()}):null]})]})}function NSt(){let e=N(L.me.getMe,{host:BO}),t=P(L.me.bootstrap),n=cs();(0,M.useEffect)(()=>{e&&!e.hasProfile&&t()},[e,t]),K9(e?.resolvedThemeMode);let r=UO(e?.resolvedThemeMode);WO(e?.resolvedChartTokens,r),kSt(e?.resolvedLocale);let i=(0,M.useRef)(null);if((0,M.useEffect)(()=>{e&&(i.current!==null&&i.current!==e.userId&&n({to:`/`}),i.current=e.userId)},[e,n]),e===void 0)return(0,F.jsx)(`div`,{className:`oc-boot`,children:GK()});let a=e.name||e.email||gze();return e.role===`pending`?(0,F.jsxs)(`div`,{className:`oc-shell`,children:[(0,F.jsx)(q9,{}),(0,F.jsx)(p5,{}),(0,F.jsxs)(`header`,{className:`oc-topbar`,children:[(0,F.jsx)(`span`,{className:`oc-topbar__brand`,children:(0,F.jsx)(J9,{brand:e.resolvedChartBrand,resolvedThemeMode:e.resolvedThemeMode})}),(0,F.jsx)(`div`,{className:`oc-topbar__actions`,children:(0,F.jsx)(m5,{label:a,mode:e.themeMode,minimal:!0})})]}),(0,F.jsxs)(`div`,{className:`oc-pending`,children:[(0,F.jsx)(`h1`,{className:`oc-pending__title`,children:yze()}),(0,F.jsx)(`p`,{className:`oc-pending__body`,children:Sze()})]})]}):(0,F.jsx)(FSt,{canOpenSettings:j7(e.permissions??[]).length>0,userLabel:a,themeMode:e.themeMode,resolvedThemeMode:e.resolvedThemeMode,brand:e.resolvedChartBrand},e.userId)}function q9(){let e=N(L.me.getImpersonation),t=P(L.admin.stopImpersonation);return!e||!e.impersonating?null:(0,F.jsxs)(`div`,{className:`oc-imp`,role:`alert`,children:[(0,F.jsx)(Eee,{className:`size-4 shrink-0`}),(0,F.jsxs)(`span`,{className:`oc-imp__text`,children:[Tze(),` `,(0,F.jsx)(`strong`,{children:e.targetLabel}),Oze(),(0,F.jsx)(`strong`,{children:e.realLabel}),jze()]}),(0,F.jsx)(H,{size:`sm`,variant:`outline`,className:`oc-imp__exit`,onClick:()=>void t(),children:Pze()})]})}function J9({brand:e,resolvedThemeMode:t}){let n=UO(t),r=e?.label??`Atrium`,i=e?.isDefault??!0,a=XO(e,n),[o,s]=(0,M.useState)(!1);return(0,M.useEffect)(()=>s(!1),[a]),(0,F.jsxs)(F.Fragment,{children:[a!==null&&!o?(0,F.jsx)(`img`,{className:`oc-brand__logo`,src:a,alt:``,"aria-hidden":`true`,onError:()=>s(!0)}):i?(0,F.jsx)(QO,{className:`oc-brand__logo`}):null,(0,F.jsx)(`span`,{className:`oc-brand__label`,children:r})]})}function PSt({userLabel:e,themeMode:t,resolvedThemeMode:n,brand:r,collapsed:i,onToggleSidebar:a}){return(0,F.jsxs)(`header`,{className:`oc-topbar`,children:[(0,F.jsxs)(`div`,{className:`oc-topbar__left`,children:[(0,F.jsx)(H,{variant:`ghost`,size:`icon-sm`,"aria-label":i?Lze():Bze(),onClick:a,children:i?(0,F.jsx)(Iee,{}):(0,F.jsx)(Fee,{})}),(0,F.jsx)(Ss,{to:`/`,className:`oc-topbar__brand`,children:(0,F.jsx)(J9,{brand:r,resolvedThemeMode:n})})]}),(0,F.jsx)(`div`,{className:`oc-topbar__search`,children:(0,F.jsx)(tyt,{})}),(0,F.jsxs)(`div`,{className:`oc-topbar__actions`,children:[(0,F.jsx)(Xvt,{}),(0,F.jsx)(m5,{label:e,mode:t})]})]})}function FSt({canOpenSettings:e,userLabel:t,themeMode:n,resolvedThemeMode:r,brand:i}){let{width:a,collapsed:o,toggleCollapsed:s,collapse:c,startResize:l,isMobile:u}=Tnt(),d=Bs(),f=os({strict:!1}),p=cs(),m=!!d({to:`/settings`,fuzzy:!0});(0,M.useEffect)(()=>{u&&c()},[Ks({select:e=>e.pathname}),u,c]);let h=(0,M.useCallback)(e=>{p({to:`/chat/$chatId`,params:{chatId:e}})},[p]),{startNewChat:g,picker:_}=Gvt(h),v=(0,M.useMemo)(()=>y5(g5,v5()),[]);return(0,M.useEffect)(()=>{let e=e=>{b5(e,g5)&&(e.preventDefault(),g())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[g]),(0,F.jsxs)(`div`,{className:`oc-shell`,children:[_,(0,F.jsx)(q9,{}),(0,F.jsx)(p5,{}),(0,F.jsx)(PSt,{userLabel:t,themeMode:n,resolvedThemeMode:r,brand:i,collapsed:o,onToggleSidebar:s}),(0,F.jsxs)(`div`,{className:u?`oc-workspace oc-workspace--mobile`:`oc-workspace`,children:[u&&!o?(0,F.jsx)(`div`,{className:`oc-sidebar-backdrop`,onClick:c,"aria-hidden":!0}):null,o?null:(0,F.jsxs)(`div`,{className:`oc-sidebar-col`,style:u?void 0:{width:a,flex:`0 0 ${a}px`},children:[m?(0,F.jsx)(tSt,{}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(Bvt,{activeChatId:f.chatId??null,onSelect:h,onNewChat:()=>void g(),newChatShortcut:v}),e?(0,F.jsx)(H,{variant:`ghost`,className:`m-2 justify-start`,asChild:!0,children:(0,F.jsx)(Ss,{to:`/settings`,children:Uze()})}):null]}),(0,F.jsx)(`div`,{className:`oc-sidebar-resizer`,onPointerDown:l,role:`separator`,"aria-orientation":`vertical`,"aria-label":Kze()})]}),(0,F.jsx)(`main`,{className:`oc-main`,children:(0,F.jsx)(Is,{})})]})]})}function ISt(){let e=N(L.me.getMe,{host:BO}),t=cs(),n=Ks({select:e=>e.pathname}),r=(0,M.useMemo)(()=>e?j7(e.permissions??[]):[],[e]),i=e!==void 0&&r.length===0;if((0,M.useEffect)(()=>{i&&t({to:`/`})},[i,t]),e===void 0)return(0,F.jsx)(`div`,{className:`oc-admin__hint`,style:{padding:16},children:GK()});if(i)return null;let a=N7(n),o=a!==void 0&&!r.includes(a);return(0,F.jsxs)(`div`,{className:`oc-admin`,children:[(0,F.jsx)(eSt,{}),(0,F.jsx)(`div`,{className:`oc-admin__body`,children:o?(0,F.jsx)(LSt,{}):(0,F.jsx)(Is,{})})]})}function LSt(){return(0,F.jsxs)(`div`,{className:`oc-route-error`,role:`alert`,children:[(0,F.jsx)(`div`,{className:`oc-route-error__icon`,"aria-hidden":!0,children:(0,F.jsx)(Vm,{size:28})}),(0,F.jsx)(`h2`,{className:`oc-route-error__title`,children:Yze()}),(0,F.jsx)(`p`,{className:`oc-route-error__body`,children:Qze()})]})}function RSt(){let e=N(L.me.getMe,{host:BO}),t=cs();return(0,M.useEffect)(()=>{if(e===void 0)return;let n=j7(e.permissions??[]);t({to:n.length>0?M7(n[0]):`/`,replace:!0})},[e,t]),(0,F.jsx)(`div`,{className:`oc-admin__hint`,style:{padding:16},children:GK()})}function zSt(){let{tab:e}=os({from:`/settings/$tab`});switch(e){case`groups`:return(0,F.jsx)(Lbt,{});case`integrations`:return(0,F.jsx)(vxt,{});case`instances`:return(0,F.jsx)(sbt,{});case`bridge`:return(0,F.jsx)(Lyt,{});case`theme`:return(0,F.jsx)(OSt,{});case`feedbacks`:return(0,F.jsx)(xxt,{});case`files`:return(0,F.jsx)(Sxt,{});case`agentFiles`:return(0,F.jsx)(Dxt,{});case`preferences`:return(0,F.jsx)(zxt,{});case`chatDefaults`:return(0,F.jsx)(Hxt,{});case`access`:return(0,F.jsx)(Kxt,{});default:return(0,F.jsx)(kbt,{})}}function BSt(){let{chatId:e}=os({from:`/chat/$chatId`}),{m:t}=ss({from:`/chat/$chatId`});return(0,F.jsx)(q3,{chatId:e,focusMessageId:t??null})}function VSt(){return(0,F.jsx)(q3,{chatId:null})}var Y9=Ds({component:ASt}),HSt=Ts({getParentRoute:()=>Y9,path:`/`,component:VSt}),USt=Ts({getParentRoute:()=>Y9,path:`chat/$chatId`,component:BSt,validateSearch:e=>({m:typeof e.m==`string`?e.m:void 0})}),X9=Ts({getParentRoute:()=>Y9,path:`settings`,component:ISt}),WSt=Ts({getParentRoute:()=>X9,path:`/`,component:RSt}),GSt=Ts({getParentRoute:()=>X9,path:`traces`,validateSearch:Yyt,component:qbt}),KSt=Ts({getParentRoute:()=>X9,path:`audit`,validateSearch:Xyt,component:_bt}),qSt=Ts({getParentRoute:()=>X9,path:`anomalies`,validateSearch:Zyt,component:fxt}),JSt=Ts({getParentRoute:()=>X9,path:`kpi`,validateSearch:Qyt,component:txt}),YSt=Ts({getParentRoute:()=>X9,path:`serviceAccounts`,validateSearch:$yt,component:bbt}),XSt=Ts({getParentRoute:()=>X9,path:`users`,validateSearch:ebt,component:ibt}),ZSt=Ts({getParentRoute:()=>X9,path:`uiprefs`,beforeLoad:()=>{throw aa({to:`/settings/$tab`,params:{tab:nbt.uiprefs},replace:!0})}}),QSt=Ts({getParentRoute:()=>X9,path:`$tab`,parseParams:e=>({tab:qp([...D7]).catch(`roles`).parse(e.tab)}),component:zSt});function $St({reset:e}){let t=cs();return(0,F.jsxs)(`div`,{className:`oc-route-error`,role:`alert`,children:[(0,F.jsx)(`div`,{className:`oc-route-error__icon`,"aria-hidden":!0,children:(0,F.jsx)(Vm,{size:28})}),(0,F.jsx)(`h2`,{className:`oc-route-error__title`,children:tBe()}),(0,F.jsx)(`p`,{className:`oc-route-error__body`,children:iBe()}),(0,F.jsxs)(`div`,{className:`oc-route-error__actions`,children:[(0,F.jsx)(`button`,{type:`button`,className:`oc-route-error__cta`,onClick:()=>e(),children:sBe()}),(0,F.jsx)(`button`,{type:`button`,className:`oc-route-error__cta oc-route-error__cta--ghost`,onClick:()=>void t({to:`/`}),children:KK()})]})]})}function eCt(){let e=cs();return(0,F.jsxs)(`div`,{className:`oc-route-error`,role:`status`,children:[(0,F.jsx)(`div`,{className:`oc-route-error__icon`,"aria-hidden":!0,children:(0,F.jsx)(Tee,{size:28})}),(0,F.jsx)(`h2`,{className:`oc-route-error__title`,children:fBe()}),(0,F.jsx)(`p`,{className:`oc-route-error__body`,children:hBe()}),(0,F.jsx)(`div`,{className:`oc-route-error__actions`,children:(0,F.jsx)(`button`,{type:`button`,className:`oc-route-error__cta`,onClick:()=>void e({to:`/`}),children:KK()})})]})}var Z9=Hs({routeTree:Y9.addChildren([HSt,USt,X9.addChildren([WSt,GSt,KSt,qSt,JSt,YSt,XSt,ZSt,QSt])]),defaultPreload:`intent`,defaultErrorComponent:$St,defaultNotFoundComponent:eCt});async function tCt(){try{let e=await fetch(`/config.json`,{cache:`no-store`});if(e.ok){let t=(await e.json())?.convexUrl;if(typeof t==`string`&&t.trim())return t.trim()}}catch{}throw Error(`No Convex URL configured: serve /config.json {"convexUrl":"…"} (production) or set VITE_CONVEX_URL (local dev).`)}var nCt=()=>null;function Q9({children:e}){return(0,F.jsx)(`div`,{style:{display:`flex`,minHeight:`100vh`,alignItems:`center`,justifyContent:`center`,padding:`2rem`,textAlign:`center`,font:`14px system-ui, sans-serif`,opacity:.6},children:e})}var $9=vr.createRoot(document.getElementById(`root`));$9.render((0,F.jsx)(M.StrictMode,{children:(0,F.jsx)(Q9,{children:`Chargement…`})})),tCt().then(e=>{let t=new Xn(e);$9.render((0,F.jsx)(M.StrictMode,{children:(0,F.jsx)(Rr,{client:t,children:(0,F.jsxs)(Ett,{children:[(0,F.jsx)(sgt,{children:(0,F.jsx)(Gs,{router:Z9})}),(0,F.jsx)(M.Suspense,{fallback:null,children:(0,F.jsx)(nCt,{router:Z9,position:`bottom-right`})})]})})}))}).catch(e=>{console.error(`Boot failed:`,e),$9.render((0,F.jsx)(M.StrictMode,{children:(0,F.jsxs)(Q9,{children:[`Configuration manquante\xA0:`,` `,e instanceof Error?e.message:String(e)]})}))});export{_r as a,x3 as i,nht as n,f as o,v3 as r,u as s,$2 as t};
|