pi-forge 1.2.3 → 1.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/README.md +1 -1
  2. package/dist/client/assets/{CodeMirrorEditor-1gu-DS9k.js → CodeMirrorEditor-DXmxwE2Z.js} +2 -2
  3. package/dist/client/assets/{CodeMirrorEditor-1gu-DS9k.js.map → CodeMirrorEditor-DXmxwE2Z.js.map} +1 -1
  4. package/dist/client/assets/index-CMSjnWtF.js +365 -0
  5. package/dist/client/assets/index-CMSjnWtF.js.map +1 -0
  6. package/dist/client/assets/index-Cp8qEy7Q.css +1 -0
  7. package/dist/client/index.html +2 -2
  8. package/dist/client/sw.js +1 -1
  9. package/dist/client/sw.js.map +1 -1
  10. package/dist/server/agent-extensions/compaction-continuation.js +65 -0
  11. package/dist/server/agent-extensions/compaction-continuation.js.map +1 -0
  12. package/dist/server/agent-resource-loader.js +10 -0
  13. package/dist/server/agent-resource-loader.js.map +1 -1
  14. package/dist/server/ask-user-question/envelope.js +56 -0
  15. package/dist/server/ask-user-question/envelope.js.map +1 -0
  16. package/dist/server/ask-user-question/prompt-strings.js +44 -0
  17. package/dist/server/ask-user-question/prompt-strings.js.map +1 -0
  18. package/dist/server/ask-user-question/registry.js +157 -0
  19. package/dist/server/ask-user-question/registry.js.map +1 -0
  20. package/dist/server/ask-user-question/tool.js +115 -0
  21. package/dist/server/ask-user-question/tool.js.map +1 -0
  22. package/dist/server/ask-user-question/types.js +27 -0
  23. package/dist/server/ask-user-question/types.js.map +1 -0
  24. package/dist/server/ask-user-question/validate.js +135 -0
  25. package/dist/server/ask-user-question/validate.js.map +1 -0
  26. package/dist/server/config.js +10 -0
  27. package/dist/server/config.js.map +1 -1
  28. package/dist/server/index.js +16 -0
  29. package/dist/server/index.js.map +1 -1
  30. package/dist/server/mcp/tool-bridge.js +14 -8
  31. package/dist/server/mcp/tool-bridge.js.map +1 -1
  32. package/dist/server/processes/envelope.js +60 -0
  33. package/dist/server/processes/envelope.js.map +1 -0
  34. package/dist/server/processes/log-store.js +132 -0
  35. package/dist/server/processes/log-store.js.map +1 -0
  36. package/dist/server/processes/manager.js +348 -0
  37. package/dist/server/processes/manager.js.map +1 -0
  38. package/dist/server/processes/prompt-strings.js +43 -0
  39. package/dist/server/processes/prompt-strings.js.map +1 -0
  40. package/dist/server/processes/tool.js +273 -0
  41. package/dist/server/processes/tool.js.map +1 -0
  42. package/dist/server/processes/types.js +21 -0
  43. package/dist/server/processes/types.js.map +1 -0
  44. package/dist/server/processes/watches.js +59 -0
  45. package/dist/server/processes/watches.js.map +1 -0
  46. package/dist/server/quick-actions.js +141 -0
  47. package/dist/server/quick-actions.js.map +1 -0
  48. package/dist/server/routes/ask-user-question.js +129 -0
  49. package/dist/server/routes/ask-user-question.js.map +1 -0
  50. package/dist/server/routes/config.js +12 -0
  51. package/dist/server/routes/config.js.map +1 -1
  52. package/dist/server/routes/processes.js +228 -0
  53. package/dist/server/routes/processes.js.map +1 -0
  54. package/dist/server/routes/quick-actions.js +384 -0
  55. package/dist/server/routes/quick-actions.js.map +1 -0
  56. package/dist/server/routes/todos.js +67 -0
  57. package/dist/server/routes/todos.js.map +1 -0
  58. package/dist/server/session-registry.js +72 -4
  59. package/dist/server/session-registry.js.map +1 -1
  60. package/dist/server/sse-bridge.js +225 -4
  61. package/dist/server/sse-bridge.js.map +1 -1
  62. package/dist/server/todo/envelope.js +87 -0
  63. package/dist/server/todo/envelope.js.map +1 -0
  64. package/dist/server/todo/invariants.js +21 -0
  65. package/dist/server/todo/invariants.js.map +1 -0
  66. package/dist/server/todo/prompt-strings.js +29 -0
  67. package/dist/server/todo/prompt-strings.js.map +1 -0
  68. package/dist/server/todo/reducer.js +189 -0
  69. package/dist/server/todo/reducer.js.map +1 -0
  70. package/dist/server/todo/replay.js +45 -0
  71. package/dist/server/todo/replay.js.map +1 -0
  72. package/dist/server/todo/store.js +92 -0
  73. package/dist/server/todo/store.js.map +1 -0
  74. package/dist/server/todo/task-graph.js +60 -0
  75. package/dist/server/todo/task-graph.js.map +1 -0
  76. package/dist/server/todo/tool.js +95 -0
  77. package/dist/server/todo/tool.js.map +1 -0
  78. package/dist/server/todo/types.js +23 -0
  79. package/dist/server/todo/types.js.map +1 -0
  80. package/package.json +1 -1
  81. package/dist/client/assets/index-BxZV6ddv.js +0 -359
  82. package/dist/client/assets/index-BxZV6ddv.js.map +0 -1
  83. package/dist/client/assets/index-KUhxvBxw.css +0 -1
@@ -0,0 +1,365 @@
1
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,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)}})();var u=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var ee=/\/+/g;function te(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function ne(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 re(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,re(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+te(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(ee,`$&/`)+`/`),re(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(ee,`$&/`)+`/`)+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+te(a,u),c+=re(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+te(a,u++),c+=re(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return re(ne(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 ie(e,t,n){if(e==null)return e;var r=[],i=0;return re(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ae(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 A=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)},oe={map:ie,forEach:function(e,t,n){ie(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ie(e,function(){t++}),t},toArray:function(e){return ie(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=oe,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:ae}},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,A)}catch(e){A(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.6`})),d=o(((e,t)=>{t.exports=u()})),f=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&te(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&&te(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 k=new MessageChannel,ee=k.port2;k.port1.onmessage=D,O=function(){ee.postMessage(null)}}else O=function(){_(D,0)};function te(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,te(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),p=o(((e,t)=>{t.exports=f()})),m=o((e=>{var t=d();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.6`})),h=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=m()})),g=o((e=>{var t=p(),n=d(),r=h();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}var m=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),E=Symbol.for(`react.suspense_list`),D=Symbol.for(`react.memo`),O=Symbol.for(`react.lazy`),k=Symbol.for(`react.activity`),ee=Symbol.for(`react.memo_cache_sentinel`),te=Symbol.iterator;function ne(e){return typeof e!=`object`||!e?null:(e=te&&e[te]||e[`@@iterator`],typeof e==`function`?e:null)}var re=Symbol.for(`react.client.reference`);function ie(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===re?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case E:return`SuspenseList`;case k:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case D:return t=e.displayName||null,t===null?ie(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return ie(e(t))}catch{}}return null}var ae=Array.isArray,A=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,j={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)?ef(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=ef(t),e=tf(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=tf(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),up._currentValue=j)}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=oe.p;return e===0?(e=window.event,e===void 0?32:Ep(e.type)):e}function dt(e,t){var n=oe.p;try{return oe.p=e,t()}finally{oe.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=wf(e);e!==null;){if(n=e[pt])return n;e=wf(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 M=/[\n"\\]/g;function Wt(e){return e.replace(M,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function N(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`):Gt(e,o,Rt(n)):Gt(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 P(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 Gt(e,t,n){t===`number`&&Ut(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Kt(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 qt(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 Jt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ae(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 Yt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Xt=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 Zt(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||Xt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Qt(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&&Zt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Zt(e,o,t[o])}function $t(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 en=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`]]),tn=/^[\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 nn(e){return tn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function rn(){}var an=null;function on(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var sn=null,cn=null;function ln(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(N(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="`+Wt(``+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));N(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`:qt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Kt(e,!!n.multiple,t,!1)}}}var un=!1;function dn(e,t,n){if(un)return e(t,n);un=!0;try{return e(t)}finally{if(un=!1,(sn!==null||cn!==null)&&(Au(),sn&&(t=sn,e=cn,cn=sn=null,ln(t),e)))for(t=0;t<e.length;t++)ln(e[t])}}function fn(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 pn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),mn=!1;if(pn)try{var hn={};Object.defineProperty(hn,`passive`,{get:function(){mn=!0}}),window.addEventListener(`test`,hn,hn),window.removeEventListener(`test`,hn,hn)}catch{mn=!1}var gn=null,_n=null,vn=null;function yn(){if(vn)return vn;var e,t=_n,n=t.length,r,i=`value`in gn?gn.value:gn.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 vn=i.slice(e,1<r?1-r:void 0)}function bn(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 xn(){return!0}function Sn(){return!1}function Cn(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)?xn:Sn,this.isPropagationStopped=Sn,this}return m(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=xn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=xn)},persist:function(){},isPersistent:xn}),t}var wn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Tn=Cn(wn),En=m({},wn,{view:0,detail:0}),Dn=Cn(En),On,kn,An,jn=m({},En,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Hn,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!==An&&(An&&e.type===`mousemove`?(On=e.screenX-An.screenX,kn=e.screenY-An.screenY):kn=On=0,An=e),On)},movementY:function(e){return`movementY`in e?e.movementY:kn}}),Mn=Cn(jn),Nn=Cn(m({},jn,{dataTransfer:0})),Pn=Cn(m({},En,{relatedTarget:0})),Fn=Cn(m({},wn,{animationName:0,elapsedTime:0,pseudoElement:0})),In=Cn(m({},wn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Ln=Cn(m({},wn,{data:0})),Rn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},zn={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`},Bn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Vn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Bn[e])?!!t[e]:!1}function Hn(){return Vn}var Un=Cn(m({},En,{key:function(e){if(e.key){var t=Rn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=bn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?zn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Hn,charCode:function(e){return e.type===`keypress`?bn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?bn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Wn=Cn(m({},jn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Gn=Cn(m({},En,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Hn})),Kn=Cn(m({},wn,{propertyName:0,elapsedTime:0,pseudoElement:0})),qn=Cn(m({},jn,{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})),Jn=Cn(m({},wn,{newState:0,oldState:0})),F=[9,13,27,32],I=pn&&`CompositionEvent`in window,Yn=null;pn&&`documentMode`in document&&(Yn=document.documentMode);var Xn=pn&&`TextEvent`in window&&!Yn,Zn=pn&&(!I||Yn&&8<Yn&&11>=Yn),Qn=` `,$n=!1;function er(e,t){switch(e){case`keyup`:return F.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function tr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var nr=!1;function rr(e,t){switch(e){case`compositionend`:return tr(t);case`keypress`:return t.which===32?($n=!0,Qn):null;case`textInput`:return e=t.data,e===Qn&&$n?null:e;default:return null}}function ir(e,t){if(nr)return e===`compositionend`||!I&&er(e,t)?(e=yn(),vn=_n=gn=null,nr=!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 Zn&&t.locale!==`ko`?null:t.data;default:return null}}var ar={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 or(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!ar[e.type]:t===`textarea`}function sr(e,t,n,r){sn?cn?cn.push(r):cn=[r]:sn=r,t=Rd(t,`onChange`),0<t.length&&(n=new Tn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var cr=null,lr=null;function ur(e){Ad(e,0)}function dr(e){if(Ht(wt(e)))return e}function fr(e,t){if(e===`change`)return t}var pr=!1;if(pn){var mr;if(pn){var hr=`oninput`in document;if(!hr){var gr=document.createElement(`div`);gr.setAttribute(`oninput`,`return;`),hr=typeof gr.oninput==`function`}mr=hr}else mr=!1;pr=mr&&(!document.documentMode||9<document.documentMode)}function _r(){cr&&(cr.detachEvent(`onpropertychange`,vr),lr=cr=null)}function vr(e){if(e.propertyName===`value`&&dr(lr)){var t=[];sr(t,lr,e,on(e)),dn(ur,t)}}function yr(e,t,n){e===`focusin`?(_r(),cr=t,lr=n,cr.attachEvent(`onpropertychange`,vr)):e===`focusout`&&_r()}function br(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return dr(lr)}function xr(e,t){if(e===`click`)return dr(t)}function Sr(e,t){if(e===`input`||e===`change`)return dr(t)}function Cr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var wr=typeof Object.is==`function`?Object.is:Cr;function Tr(e,t){if(wr(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)||!wr(e[i],t[i]))return!1}return!0}function Er(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Dr(e,t){var n=Er(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=Er(n)}}function Or(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Or(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function kr(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 Ar(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 jr=pn&&`documentMode`in document&&11>=document.documentMode,Mr=null,Nr=null,Pr=null,Fr=!1;function Ir(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Fr||Mr==null||Mr!==Ut(r)||(r=Mr,`selectionStart`in r&&Ar(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}),Pr&&Tr(Pr,r)||(Pr=r,r=Rd(Nr,`onSelect`),0<r.length&&(t=new Tn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Mr)))}function Lr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var L={animationend:Lr(`Animation`,`AnimationEnd`),animationiteration:Lr(`Animation`,`AnimationIteration`),animationstart:Lr(`Animation`,`AnimationStart`),transitionrun:Lr(`Transition`,`TransitionRun`),transitionstart:Lr(`Transition`,`TransitionStart`),transitioncancel:Lr(`Transition`,`TransitionCancel`),transitionend:Lr(`Transition`,`TransitionEnd`)},Rr={},zr={};pn&&(zr=document.createElement(`div`).style,`AnimationEvent`in window||(delete L.animationend.animation,delete L.animationiteration.animation,delete L.animationstart.animation),`TransitionEvent`in window||delete L.transitionend.transition);function Br(e){if(Rr[e])return Rr[e];if(!L[e])return e;var t=L[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in zr)return Rr[e]=t[n];return e}var Vr=Br(`animationend`),Hr=Br(`animationiteration`),Ur=Br(`animationstart`),Wr=Br(`transitionrun`),Gr=Br(`transitionstart`),Kr=Br(`transitioncancel`),qr=Br(`transitionend`),Jr=new Map,Yr=`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(` `);Yr.push(`scrollEnd`);function Xr(e,t){Jr.set(e,t),kt(t,[e])}var Zr=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Qr=[],$r=0,ei=0;function ti(){for(var e=$r,t=ei=$r=0;t<e;){var n=Qr[t];Qr[t++]=null;var r=Qr[t];Qr[t++]=null;var i=Qr[t];Qr[t++]=null;var a=Qr[t];if(Qr[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&ii(n,i,a)}}function R(e,t,n,r){Qr[$r++]=e,Qr[$r++]=t,Qr[$r++]=n,Qr[$r++]=r,ei|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function ni(e,t,n,r){return R(e,t,n,r),ai(e)}function ri(e,t){return R(e,null,null,t),ai(e)}function ii(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 ai(e){if(50<xu)throw xu=0,Su=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var oi={};function si(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 ci(e,t,n,r){return new si(e,t,n,r)}function li(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ui(e,t){var n=e.alternate;return n===null?(n=ci(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 di(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 fi(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)li(e)&&(s=1);else if(typeof e==`string`)s=np(e,n,fe.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case k:return e=ci(31,n,t,a),e.elementType=k,e.lanes=o,e;case y:return pi(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=ci(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=ci(13,n,t,a),e.elementType=T,e.lanes=o,e;case E:return e=ci(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=ci(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function pi(e,t,n,r){return e=ci(7,e,r,t),e.lanes=n,e}function mi(e,t,n){return e=ci(6,e,null,t),e.lanes=n,e}function hi(e){var t=ci(18,null,null,0);return t.stateNode=e,t}function gi(e,t,n){return t=ci(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var _i=new WeakMap;function vi(e,t){if(typeof e==`object`&&e){var n=_i.get(e);return n===void 0?(t={value:e,source:t,stack:Ee(t)},_i.set(e,t),t):n}return{value:e,source:t,stack:Ee(t)}}var yi=[],bi=0,xi=null,Si=0,Ci=[],wi=0,Ti=null,Ei=1,Di=``;function Oi(e,t){yi[bi++]=Si,yi[bi++]=xi,xi=e,Si=t}function ki(e,t,n){Ci[wi++]=Ei,Ci[wi++]=Di,Ci[wi++]=Ti,Ti=e;var r=Ei;e=Di;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,Ei=1<<32-We(t)+i|n<<i|r,Di=a+e}else Ei=1<<a|n<<i|r,Di=e}function Ai(e){e.return!==null&&(Oi(e,1),ki(e,1,0))}function ji(e){for(;e===xi;)xi=yi[--bi],yi[bi]=null,Si=yi[--bi],yi[bi]=null;for(;e===Ti;)Ti=Ci[--wi],Ci[wi]=null,Di=Ci[--wi],Ci[wi]=null,Ei=Ci[--wi],Ci[wi]=null}function Mi(e,t){Ci[wi++]=Ei,Ci[wi++]=Di,Ci[wi++]=Ti,Ei=t.id,Di=t.overflow,Ti=e}var Ni=null,Pi=null,Fi=!1,Ii=null,Li=!1,z=Error(i(519));function Ri(e){throw Wi(vi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),z}function zi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[pt]=e,t[mt]=r,n){case`dialog`:jd(`cancel`,t),jd(`close`,t);break;case`iframe`:case`object`:case`embed`:jd(`load`,t);break;case`video`:case`audio`:for(n=0;n<Od.length;n++)jd(Od[n],t);break;case`source`:jd(`error`,t);break;case`img`:case`image`:case`link`:jd(`error`,t),jd(`load`,t);break;case`details`:jd(`toggle`,t);break;case`input`:jd(`invalid`,t),P(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:jd(`invalid`,t);break;case`textarea`:jd(`invalid`,t),Jt(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||Wd(t.textContent,n)?(r.popover!=null&&(jd(`beforetoggle`,t),jd(`toggle`,t)),r.onScroll!=null&&jd(`scroll`,t),r.onScrollEnd!=null&&jd(`scrollend`,t),r.onClick!=null&&(t.onclick=rn),t=!0):t=!1,t||Ri(e,!0)}function Bi(e){for(Ni=e.return;Ni;)switch(Ni.tag){case 5:case 31:case 13:Li=!1;return;case 27:case 3:Li=!0;return;default:Ni=Ni.return}}function Vi(e){if(e!==Ni)return!1;if(!Fi)return Bi(e),Fi=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||nf(e.type,e.memoizedProps)),n=!n),n&&Pi&&Ri(e),Bi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Pi=Cf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Pi=Cf(e)}else t===27?(t=Pi,df(e.type)?(e=Sf,Sf=null,Pi=e):Pi=t):Pi=Ni?xf(e.stateNode.nextSibling):null;return!0}function Hi(){Pi=Ni=null,Fi=!1}function Ui(){var e=Ii;return e!==null&&(su===null?su=e:su.push.apply(su,e),Ii=null),e}function Wi(e){Ii===null?Ii=[e]:Ii.push(e)}var Gi=le(null),Ki=null,qi=null;function Ji(e,t,n){de(Gi,t._currentValue),t._currentValue=n}function Yi(e){e._currentValue=Gi.current,ue(Gi)}function Xi(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 Zi(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),Xi(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),Xi(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Qi(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;wr(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=[up]:e.push(up))}a=a.return}e!==null&&Zi(t,e,n,r),t.flags|=262144}function $i(e){for(e=e.firstContext;e!==null;){if(!wr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ea(e){Ki=e,qi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ta(e){return ra(Ki,e)}function na(e,t){return Ki===null&&ea(e),ra(e,t)}function ra(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},qi===null){if(e===null)throw Error(i(308));qi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else qi=qi.next=t;return n}var ia=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()})}},aa=t.unstable_scheduleCallback,oa=t.unstable_NormalPriority,sa={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ca(){return{controller:new ia,data:new Map,refCount:0}}function la(e){e.refCount--,e.refCount===0&&aa(oa,function(){e.controller.abort()})}var ua=null,da=0,fa=0,pa=null;function ma(e,t){if(ua===null){var n=ua=[];da=0,fa=Sd(),pa={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return da++,t.then(ha,ha),t}function ha(){if(--da===0&&ua!==null){pa!==null&&(pa.status=`fulfilled`);var e=ua;ua=null,fa=0,pa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ga(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 _a=A.S;A.S=function(e,t){uu=Me(),typeof t==`object`&&t&&typeof t.then==`function`&&ma(e,t),_a!==null&&_a(e,t)};var va=le(null);function ya(){var e=va.current;return e===null?Gl.pooledCache:e}function ba(e,t){t===null?de(va,va.current):de(va,t.pool)}function xa(){var e=ya();return e===null?null:{parent:sa._currentValue,pool:e}}var Sa=Error(i(460)),Ca=Error(i(474)),wa=Error(i(542)),Ta={then:function(){}};function Ea(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Da(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(rn,rn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ja(e),e;default:if(typeof t.status==`string`)t.then(rn,rn);else{if(e=Gl,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,ja(e),e}throw ka=t,Sa}}function Oa(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(ka=e,Sa):e}}var ka=null;function Aa(){if(ka===null)throw Error(i(459));var e=ka;return ka=null,e}function ja(e){if(e===Sa||e===wa)throw Error(i(483))}var Ma=null,Na=0;function B(e){var t=Na;return Na+=1,Ma===null&&(Ma=[]),Da(Ma,e,t)}function Pa(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Fa(e,t){throw t.$$typeof===g?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Ia(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=ui(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=mi(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&&Oa(i)===t.type)?(t=a(t,n.props),Pa(t,n),t.return=e,t):(t=fi(n.type,n.key,n.props,null,e.mode,r),Pa(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=gi(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=pi(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=mi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=fi(t.type,t.key,t.props,null,e.mode,n),Pa(n,t),n.return=e,n;case v:return t=gi(t,e.mode,n),t.return=e,t;case O:return t=Oa(t),f(e,t,n)}if(ae(t)||ne(t))return t=pi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,B(t),n);if(t.$$typeof===C)return f(e,na(e,t),n);Fa(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=Oa(n),p(e,t,n,r)}if(ae(n)||ne(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,B(n),r);if(n.$$typeof===C)return p(e,t,na(e,n),r);Fa(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=Oa(r),m(e,t,n,r,i)}if(ae(r)||ne(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,B(r),i);if(r.$$typeof===C)return m(e,t,n,na(t,r),i);Fa(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),Fi&&Oi(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 Fi&&Oi(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)}),Fi&&Oi(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),Fi&&Oi(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 Fi&&Oi(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)}),Fi&&Oi(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&&Oa(l)===r.type){n(e,r.sibling),c=a(r,o.props),Pa(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=pi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=fi(o.type,o.key,o.props,null,e.mode,c),Pa(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=gi(o,e.mode,c),c.return=e,e=c}return s(e);case O:return o=Oa(o),b(e,r,o,c)}if(ae(o))return h(e,r,o,c);if(ne(o)){if(l=ne(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,B(o),c);if(o.$$typeof===C)return b(e,r,na(e,o),c);Fa(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=mi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Na=0;var i=b(e,t,n,r);return Ma=null,i}catch(t){if(t===Sa||t===wa)throw t;var a=ci(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var La=Ia(!0),Ra=Ia(!1),za=!1;function Ba(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Va(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 Ha(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ua(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Wl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ai(e),ii(e,null,n),t}return R(e,r,t,n),ai(e)}function Wa(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 Ga(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 Ka=!1;function qa(){if(Ka){var e=pa;if(e!==null)throw e}}function Ja(e,t,n,r){Ka=!1;var i=e.updateQueue;za=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(ql&f)===f:(r&f)===f){f!==0&&f===fa&&(Ka=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,f);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,f=typeof h==`function`?h.call(_,d,f):h,f==null)break a;d=m({},d,f);break a;case 2:za=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),tu|=o,e.lanes=o,e.memoizedState=d}}function Ya(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Xa(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Ya(n[e],t)}var Za=le(null),Qa=le(0);function $a(e,t){e=$l,de(Qa,e),de(Za,t),$l=e|t.baseLanes}function eo(){de(Qa,$l),de(Za,Za.current)}function to(){$l=Qa.current,ue(Za),ue(Qa)}var no=le(null),ro=null;function io(e){var t=e.alternate;de(lo,lo.current&1),de(no,e),ro===null&&(t===null||Za.current!==null||t.memoizedState!==null)&&(ro=e)}function ao(e){de(lo,lo.current),de(no,e),ro===null&&(ro=e)}function oo(e){e.tag===22?(de(lo,lo.current),de(no,e),ro===null&&(ro=e)):so(e)}function so(){de(lo,lo.current),de(no,no.current)}function co(e){ue(no),ro===e&&(ro=null),ue(lo)}var lo=le(0);function uo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||vf(n)||yf(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 fo=0,po=null,mo=null,ho=null,go=!1,_o=!1,vo=!1,yo=0,bo=0,xo=null,So=0;function Co(){throw Error(i(321))}function wo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!wr(e[n],t[n]))return!1;return!0}function To(e,t,n,r,i,a){return fo=a,po=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,A.H=e===null||e.memoizedState===null?Hs:Us,vo=!1,a=n(r,i),vo=!1,_o&&(a=Do(t,n,r,i)),Eo(e),a}function Eo(e){A.H=Vs;var t=mo!==null&&mo.next!==null;if(fo=0,ho=mo=po=null,go=!1,bo=0,xo=null,t)throw Error(i(300));e===null||oc||(e=e.dependencies,e!==null&&$i(e)&&(oc=!0))}function Do(e,t,n,r){po=e;var a=0;do{if(_o&&(xo=null),bo=0,_o=!1,25<=a)throw Error(i(301));if(a+=1,ho=mo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}A.H=Ws,o=t(n,r)}while(_o);return o}function Oo(){var e=A.H,t=e.useState()[0];return t=typeof t.then==`function`?Fo(t):t,e=e.useState()[0],(mo===null?null:mo.memoizedState)!==e&&(po.flags|=1024),t}function ko(){var e=yo!==0;return yo=0,e}function Ao(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function jo(e){if(go){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}go=!1}fo=0,ho=mo=po=null,_o=!1,bo=yo=0,xo=null}function Mo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ho===null?po.memoizedState=ho=e:ho=ho.next=e,ho}function No(){if(mo===null){var e=po.alternate;e=e===null?null:e.memoizedState}else e=mo.next;var t=ho===null?po.memoizedState:ho.next;if(t!==null)ho=t,mo=e;else{if(e===null)throw po.alternate===null?Error(i(467)):Error(i(310));mo=e,e={memoizedState:mo.memoizedState,baseState:mo.baseState,baseQueue:mo.baseQueue,queue:mo.queue,next:null},ho===null?po.memoizedState=ho=e:ho=ho.next=e}return ho}function Po(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Fo(e){var t=bo;return bo+=1,xo===null&&(xo=[]),e=Da(xo,e,t),t=po,(ho===null?t.memoizedState:ho.next)===null&&(t=t.alternate,A.H=t===null||t.memoizedState===null?Hs:Us),e}function Io(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Fo(e);if(e.$$typeof===C)return ta(e)}throw Error(i(438,String(e)))}function Lo(e){var t=null,n=po.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=po.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=Po(),po.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]=ee;return t.index++,n}function Ro(e,t){return typeof t==`function`?t(e):t}function zo(e){return Bo(No(),mo,e)}function Bo(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?(fo&f)===f:(ql&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===fa&&(d=!0);else if((fo&p)===p){u=u.next,p===fa&&(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,po.lanes|=p,tu|=p;f=u.action,vo&&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,po.lanes|=f,tu|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!wr(o,e.memoizedState)&&(oc=!0,d&&(n=pa,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 Vo(e){var t=No(),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);wr(o,t.memoizedState)||(oc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Ho(e,t,n){var r=po,a=No(),o=Fi;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!wr((mo||a).memoizedState,n);if(s&&(a.memoizedState=n,oc=!0),a=a.queue,ps(Go.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||ho!==null&&ho.memoizedState.tag&1){if(r.flags|=2048,cs(9,{destroy:void 0},Wo.bind(null,r,a,n,t),null),Gl===null)throw Error(i(349));o||fo&127||Uo(r,t,n)}return n}function Uo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=po.updateQueue,t===null?(t=Po(),po.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Wo(e,t,n,r){t.value=n,t.getSnapshot=r,Ko(t)&&qo(e)}function Go(e,t,n){return n(function(){Ko(t)&&qo(e)})}function Ko(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!wr(e,n)}catch{return!0}}function qo(e){var t=ri(e,2);t!==null&&Tu(t,e,2)}function Jo(e){var t=Mo();if(typeof e==`function`){var n=e;if(e=n(),vo){Ue(!0);try{n()}finally{Ue(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ro,lastRenderedState:e},t}function Yo(e,t,n,r){return e.baseState=n,Bo(e,mo,typeof r==`function`?r:Ro)}function Xo(e,t,n,r,a){if(Rs(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)}};A.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Zo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Zo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=A.T,o={};A.T=o;try{var s=n(i,r),c=A.S;c!==null&&c(o,s),Qo(e,t,s)}catch(n){es(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),A.T=a}}else try{a=n(i,r),Qo(e,t,a)}catch(n){es(e,t,n)}}function Qo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){$o(e,t,n)},function(n){return es(e,t,n)}):$o(e,t,n)}function $o(e,t,n){t.status=`fulfilled`,t.value=n,ts(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Zo(e,n)))}function es(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,ts(t),t=t.next;while(t!==r)}e.action=null}function ts(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function ns(e,t){return t}function rs(e,t){if(Fi){var n=Gl.formState;if(n!==null){a:{var r=po;if(Fi){if(Pi){b:{for(var i=Pi,a=Li;i.nodeType!==8;){if(!a){i=null;break b}if(i=xf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Pi=xf(i.nextSibling),r=i.data===`F!`;break a}}Ri(r)}r=!1}r&&(t=n[0])}}return n=Mo(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ns,lastRenderedState:t},n.queue=r,n=Fs.bind(null,po,r),r.dispatch=n,r=Jo(!1),a=Ls.bind(null,po,!1,r.queue),r=Mo(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Xo.bind(null,po,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function is(e){return as(No(),mo,e)}function as(e,t,n){if(t=Bo(e,t,ns)[0],e=zo(Ro)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Fo(t)}catch(e){throw e===Sa?wa:e}else r=t;t=No();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(po.flags|=2048,cs(9,{destroy:void 0},os.bind(null,i,n),null)),[r,a,e]}function os(e,t){e.action=t}function ss(e){var t=No(),n=mo;if(n!==null)return as(t,n,e);No(),t=t.memoizedState,n=No();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function cs(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=po.updateQueue,t===null&&(t=Po(),po.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 ls(){return No().memoizedState}function us(e,t,n,r){var i=Mo();po.flags|=e,i.memoizedState=cs(1|t,{destroy:void 0},n,r===void 0?null:r)}function ds(e,t,n,r){var i=No();r=r===void 0?null:r;var a=i.memoizedState.inst;mo!==null&&r!==null&&wo(r,mo.memoizedState.deps)?i.memoizedState=cs(t,a,n,r):(po.flags|=e,i.memoizedState=cs(1|t,a,n,r))}function fs(e,t){us(8390656,8,e,t)}function ps(e,t){ds(2048,8,e,t)}function ms(e){po.flags|=4;var t=po.updateQueue;if(t===null)t=Po(),po.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function hs(e){var t=No().memoizedState;return ms({ref:t,nextImpl:e}),function(){if(Wl&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function gs(e,t){return ds(4,2,e,t)}function _s(e,t){return ds(4,4,e,t)}function vs(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 ys(e,t,n){n=n==null?null:n.concat([e]),ds(4,4,vs.bind(null,t,e),n)}function bs(){}function xs(e,t){var n=No();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&wo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Ss(e,t){var n=No();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&wo(t,r[1]))return r[0];if(r=e(),vo){Ue(!0);try{e()}finally{Ue(!1)}}return n.memoizedState=[r,t],r}function Cs(e,t,n){return n===void 0||fo&1073741824&&!(ql&261930)?e.memoizedState=t:(e.memoizedState=n,e=wu(),po.lanes|=e,tu|=e,n)}function ws(e,t,n,r){return wr(n,t)?n:Za.current===null?!(fo&42)||fo&1073741824&&!(ql&261930)?(oc=!0,e.memoizedState=n):(e=wu(),po.lanes|=e,tu|=e,t):(e=Cs(e,n,r),wr(e,t)||(oc=!0),e)}function Ts(e,t,n,r,i){var a=oe.p;oe.p=a!==0&&8>a?a:8;var o=A.T,s={};A.T=s,Ls(e,!1,t,n);try{var c=i(),l=A.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Is(e,t,ga(c,r),Cu(e)):Is(e,t,r,Cu(e))}catch(n){Is(e,t,{then:function(){},status:`rejected`,reason:n},Cu())}finally{oe.p=a,o!==null&&s.types!==null&&(o.types=s.types),A.T=o}}function Es(){}function Ds(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Os(e).queue;Ts(e,a,t,j,n===null?Es:function(){return ks(e),n(r)})}function Os(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:j,baseState:j,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ro,lastRenderedState:j},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ro,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ks(e){var t=Os(e);t.next===null&&(t=e.alternate.memoizedState),Is(e,t.next.queue,{},Cu())}function As(){return ta(up)}function js(){return No().memoizedState}function Ms(){return No().memoizedState}function Ns(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Cu();e=Ha(n);var r=Ua(t,e,n);r!==null&&(Tu(r,t,n),Wa(r,t,n)),t={cache:ca()},e.payload=t;return}t=t.return}}function Ps(e,t,n){var r=Cu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Rs(e)?zs(t,n):(n=ni(e,t,n,r),n!==null&&(Tu(n,e,r),Bs(n,t,r)))}function Fs(e,t,n){Is(e,t,n,Cu())}function Is(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Rs(e))zs(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,wr(s,o))return R(e,t,i,0),Gl===null&&ti(),!1}catch{}if(n=ni(e,t,i,r),n!==null)return Tu(n,e,r),Bs(n,t,r),!0}return!1}function Ls(e,t,n,r){if(r={lane:2,revertLane:Sd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Rs(e)){if(t)throw Error(i(479))}else t=ni(e,n,r,2),t!==null&&Tu(t,e,2)}function Rs(e){var t=e.alternate;return e===po||t!==null&&t===po}function zs(e,t){_o=go=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Bs(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ot(e,n)}}var Vs={readContext:ta,use:Io,useCallback:Co,useContext:Co,useEffect:Co,useImperativeHandle:Co,useLayoutEffect:Co,useInsertionEffect:Co,useMemo:Co,useReducer:Co,useRef:Co,useState:Co,useDebugValue:Co,useDeferredValue:Co,useTransition:Co,useSyncExternalStore:Co,useId:Co,useHostTransitionStatus:Co,useFormState:Co,useActionState:Co,useOptimistic:Co,useMemoCache:Co,useCacheRefresh:Co};Vs.useEffectEvent=Co;var Hs={readContext:ta,use:Io,useCallback:function(e,t){return Mo().memoizedState=[e,t===void 0?null:t],e},useContext:ta,useEffect:fs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),us(4194308,4,vs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return us(4194308,4,e,t)},useInsertionEffect:function(e,t){us(4,2,e,t)},useMemo:function(e,t){var n=Mo();t=t===void 0?null:t;var r=e();if(vo){Ue(!0);try{e()}finally{Ue(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Mo();if(n!==void 0){var i=n(t);if(vo){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=Ps.bind(null,po,e),[r.memoizedState,e]},useRef:function(e){var t=Mo();return e={current:e},t.memoizedState=e},useState:function(e){e=Jo(e);var t=e.queue,n=Fs.bind(null,po,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:bs,useDeferredValue:function(e,t){return Cs(Mo(),e,t)},useTransition:function(){var e=Jo(!1);return e=Ts.bind(null,po,e.queue,!0,!1),Mo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=po,a=Mo();if(Fi){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Gl===null)throw Error(i(349));ql&127||Uo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,fs(Go.bind(null,r,o,e),[e]),r.flags|=2048,cs(9,{destroy:void 0},Wo.bind(null,r,o,n,t),null),n},useId:function(){var e=Mo(),t=Gl.identifierPrefix;if(Fi){var n=Di,r=Ei;n=(r&~(1<<32-We(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=yo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=So++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:As,useFormState:rs,useActionState:rs,useOptimistic:function(e){var t=Mo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Ls.bind(null,po,!0,n),n.dispatch=t,[e,t]},useMemoCache:Lo,useCacheRefresh:function(){return Mo().memoizedState=Ns.bind(null,po)},useEffectEvent:function(e){var t=Mo(),n={impl:e};return t.memoizedState=n,function(){if(Wl&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Us={readContext:ta,use:Io,useCallback:xs,useContext:ta,useEffect:ps,useImperativeHandle:ys,useInsertionEffect:gs,useLayoutEffect:_s,useMemo:Ss,useReducer:zo,useRef:ls,useState:function(){return zo(Ro)},useDebugValue:bs,useDeferredValue:function(e,t){return ws(No(),mo.memoizedState,e,t)},useTransition:function(){var e=zo(Ro)[0],t=No().memoizedState;return[typeof e==`boolean`?e:Fo(e),t]},useSyncExternalStore:Ho,useId:js,useHostTransitionStatus:As,useFormState:is,useActionState:is,useOptimistic:function(e,t){return Yo(No(),mo,e,t)},useMemoCache:Lo,useCacheRefresh:Ms};Us.useEffectEvent=hs;var Ws={readContext:ta,use:Io,useCallback:xs,useContext:ta,useEffect:ps,useImperativeHandle:ys,useInsertionEffect:gs,useLayoutEffect:_s,useMemo:Ss,useReducer:Vo,useRef:ls,useState:function(){return Vo(Ro)},useDebugValue:bs,useDeferredValue:function(e,t){var n=No();return mo===null?Cs(n,e,t):ws(n,mo.memoizedState,e,t)},useTransition:function(){var e=Vo(Ro)[0],t=No().memoizedState;return[typeof e==`boolean`?e:Fo(e),t]},useSyncExternalStore:Ho,useId:js,useHostTransitionStatus:As,useFormState:ss,useActionState:ss,useOptimistic:function(e,t){var n=No();return mo===null?(n.baseState=e,[e,n.queue.dispatch]):Yo(n,mo,e,t)},useMemoCache:Lo,useCacheRefresh:Ms};Ws.useEffectEvent=hs;function Gs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:m({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Ks={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Cu(),i=Ha(r);i.payload=t,n!=null&&(i.callback=n),t=Ua(e,i,r),t!==null&&(Tu(t,e,r),Wa(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Cu(),i=Ha(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ua(e,i,r),t!==null&&(Tu(t,e,r),Wa(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Cu(),r=Ha(n);r.tag=2,t!=null&&(r.callback=t),t=Ua(e,r,n),t!==null&&(Tu(t,e,n),Wa(t,e,n))}};function qs(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?!Tr(n,r)||!Tr(i,a):!0}function Js(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&&Ks.enqueueReplaceState(t,t.state,null)}function Ys(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=m({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Xs(e){Zr(e)}function Zs(e){console.error(e)}function Qs(e){Zr(e)}function $s(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function ec(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 tc(e,t,n){return n=Ha(n),n.tag=3,n.payload={element:null},n.callback=function(){$s(e,t)},n}function nc(e){return e=Ha(e),e.tag=3,e}function rc(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(){ec(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){ec(t,n,r),typeof i!=`function`&&(pu===null?pu=new Set([this]):pu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function ic(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Qi(t,n,a,!0),n=no.current,n!==null){switch(n.tag){case 31:case 13:return ro===null?Lu():n.alternate===null&&eu===0&&(eu=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Ta?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),nd(e,r,a)),!1;case 22:return n.flags|=65536,r===Ta?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)),nd(e,r,a)),!1}throw Error(i(435,n.tag))}return nd(e,r,a),Lu(),!1}if(Fi)return t=no.current,t===null?(r!==z&&(t=Error(i(423),{cause:r}),Wi(vi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=vi(r,n),a=tc(e.stateNode,r,a),Ga(e,a),eu!==4&&(eu=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==z&&(e=Error(i(422),{cause:r}),Wi(vi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=vi(o,n),ou===null?ou=[o]:ou.push(o),eu!==4&&(eu=2),t===null)return!0;r=vi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=tc(n.stateNode,r,e),Ga(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`&&(pu===null||!pu.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=nc(a),rc(a,e,n,r),Ga(n,a),!1}n=n.return}while(n!==null);return!1}var ac=Error(i(461)),oc=!1;function sc(e,t,n,r){t.child=e===null?Ra(t,null,n,r):La(t,e.child,n,r)}function cc(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 ea(t),r=To(e,t,n,o,a,i),s=ko(),e!==null&&!oc?(Ao(e,t,i),Mc(e,t,i)):(Fi&&s&&Ai(t),t.flags|=1,sc(e,t,r,i),t.child)}function lc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!li(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,uc(e,t,a,r,i)):(e=fi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Nc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Tr:n,n(o,r)&&e.ref===t.ref)return Mc(e,t,i)}return t.flags|=1,e=ui(a,r),e.ref=t.ref,e.return=t,t.child=e}function uc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Tr(a,r)&&e.ref===t.ref)if(oc=!1,t.pendingProps=r=a,Nc(e,i))e.flags&131072&&(oc=!0);else return t.lanes=e.lanes,Mc(e,t,i)}return vc(e,t,n,r,i)}function dc(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 pc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ba(t,a===null?null:a.cachePool),a===null?eo():$a(t,a),oo(t);else return r=t.lanes=536870912,pc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&ba(t,null),eo(),so(t)):(ba(t,a.cachePool),$a(t,a),so(t),t.memoizedState=null);return sc(e,t,i,n),t.child}function fc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function pc(e,t,n,r,i){var a=ya();return a=a===null?null:{parent:sa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&ba(t,null),eo(),oo(t),e!==null&&Qi(e,t,r,!0),t.childLanes=i,null}function mc(e,t){return t=Dc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function hc(e,t,n){return La(t,e.child,null,n),e=mc(t,t.pendingProps),e.flags|=2,co(t),t.memoizedState=null,e}function gc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(Fi){if(r.mode===`hidden`)return e=mc(t,r),t.lanes=536870912,fc(null,e);if(ao(t),(e=Pi)?(e=_f(e,Li),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ti===null?null:{id:Ei,overflow:Di},retryLane:536870912,hydrationErrors:null},n=hi(e),n.return=t,t.child=n,Ni=t,Pi=null)):e=null,e===null)throw Ri(t);return t.lanes=536870912,null}return mc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(ao(t),a)if(t.flags&256)t.flags&=-257,t=hc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(oc||Qi(e,t,n,!1),a=(n&e.childLanes)!==0,oc||a){if(r=Gl,r!==null&&(s=st(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,ri(e,s),Tu(r,e,s),ac;Lu(),t=hc(e,t,n)}else e=o.treeContext,Pi=xf(s.nextSibling),Ni=t,Fi=!0,Ii=null,Li=!1,e!==null&&Mi(t,e),t=mc(t,r),t.flags|=4096;return t}return e=ui(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function _c(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 vc(e,t,n,r,i){return ea(t),n=To(e,t,n,r,void 0,i),r=ko(),e!==null&&!oc?(Ao(e,t,i),Mc(e,t,i)):(Fi&&r&&Ai(t),t.flags|=1,sc(e,t,n,i),t.child)}function yc(e,t,n,r,i,a){return ea(t),t.updateQueue=null,n=Do(t,r,n,i),Eo(e),r=ko(),e!==null&&!oc?(Ao(e,t,a),Mc(e,t,a)):(Fi&&r&&Ai(t),t.flags|=1,sc(e,t,n,a),t.child)}function bc(e,t,n,r,i){if(ea(t),t.stateNode===null){var a=oi,o=n.contextType;typeof o==`object`&&o&&(a=ta(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Ks,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Ba(t),o=n.contextType,a.context=typeof o==`object`&&o?ta(o):oi,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Gs(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&&Ks.enqueueReplaceState(a,a.state,null),Ja(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=Ys(n,s);a.props=c;var l=a.context,u=n.contextType;o=oi,typeof u==`object`&&u&&(o=ta(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)&&Js(t,a,r,o),za=!1;var f=t.memoizedState;a.state=f,Ja(t,r,a,i),qa(),l=t.memoizedState,s||f!==l||za?(typeof d==`function`&&(Gs(t,n,d,r),l=t.memoizedState),(c=za||qs(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,Va(e,t),o=t.memoizedProps,u=Ys(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=oi,typeof l==`object`&&l&&(c=ta(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)&&Js(t,a,r,c),za=!1,f=t.memoizedState,a.state=f,Ja(t,r,a,i),qa();var p=t.memoizedState;o!==d||f!==p||za||e!==null&&e.dependencies!==null&&$i(e.dependencies)?(typeof s==`function`&&(Gs(t,n,s,r),p=t.memoizedState),(u=za||qs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&$i(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,_c(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=La(t,e.child,null,i),t.child=La(t,null,n,i)):sc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Mc(e,t,i),e}function xc(e,t,n,r){return Hi(),t.flags|=256,sc(e,t,n,r),t.child}var Sc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Cc(e){return{baseLanes:e,cachePool:xa()}}function wc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=iu),e}function Tc(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:(lo.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(Fi){if(a?io(t):so(t),(e=Pi)?(e=_f(e,Li),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ti===null?null:{id:Ei,overflow:Di},retryLane:536870912,hydrationErrors:null},n=hi(e),n.return=t,t.child=n,Ni=t,Pi=null)):e=null,e===null)throw Ri(t);return yf(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(so(t),a=t.mode,c=Dc({mode:`hidden`,children:c},a),r=pi(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=Cc(n),r.childLanes=wc(e,s,n),t.memoizedState=Sc,fc(null,r)):(io(t),Ec(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(io(t),t.flags&=-257,t=Oc(e,t,n)):t.memoizedState===null?(so(t),c=r.fallback,a=t.mode,r=Dc({mode:`visible`,children:r.children},a),c=pi(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,La(t,e.child,null,n),r=t.child,r.memoizedState=Cc(n),r.childLanes=wc(e,s,n),t.memoizedState=Sc,t=fc(null,r)):(so(t),t.child=e.child,t.flags|=128,t=null);else if(io(t),yf(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Wi({value:r,source:null,stack:null}),t=Oc(e,t,n)}else if(oc||Qi(e,t,n,!1),s=(n&e.childLanes)!==0,oc||s){if(s=Gl,s!==null&&(r=st(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,ri(e,r),Tu(s,e,r),ac;vf(c)||Lu(),t=Oc(e,t,n)}else vf(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Pi=xf(c.nextSibling),Ni=t,Fi=!0,Ii=null,Li=!1,e!==null&&Mi(t,e),t=Ec(t,r.children),t.flags|=4096);return t}return a?(so(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=ui(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=pi(c,a,n,null),c.flags|=2):c=ui(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,fc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=Cc(n):(a=c.cachePool,a===null?a=xa():(l=sa._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=wc(e,s,n),t.memoizedState=Sc,fc(e.child,r)):(io(t),n=e.child,e=n.sibling,n=ui(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 Ec(e,t){return t=Dc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Dc(e,t){return e=ci(22,e,null,t),e.lanes=0,e}function Oc(e,t,n){return La(t,e.child,null,n),e=Ec(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function kc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Xi(e.return,t,n)}function Ac(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 jc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=lo.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,de(lo,o),sc(e,t,r,n),r=Fi?Si:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&kc(e,n,t);else if(e.tag===19)kc(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&&uo(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Ac(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&&uo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Ac(t,!0,n,null,a,r);break;case`together`:Ac(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Mc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),tu|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Qi(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=ui(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ui(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Nc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&$i(e))):!0}function Pc(e,t,n){switch(t.tag){case 3:ge(t,t.stateNode.containerInfo),Ji(t,sa,e.memoizedState.cache),Hi();break;case 27:case 5:ve(t);break;case 4:ge(t,t.stateNode.containerInfo);break;case 10:Ji(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,ao(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(io(t),e=Mc(e,t,n),e===null?null:e.sibling):Tc(e,t,n):(io(t),t.flags|=128,null);io(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(Qi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return jc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),de(lo,lo.current),r)break;return null;case 22:return t.lanes=0,dc(e,t,n,t.pendingProps);case 24:Ji(t,sa,e.memoizedState.cache)}return Mc(e,t,n)}function Fc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)oc=!0;else{if(!Nc(e,n)&&!(t.flags&128))return oc=!1,Pc(e,t,n);oc=!!(e.flags&131072)}else oc=!1,Fi&&t.flags&1048576&&ki(t,Si,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Oa(t.elementType),t.type=e,typeof e==`function`)li(e)?(r=Ys(e,r),t.tag=1,t=bc(null,t,e,r,n)):(t.tag=0,t=vc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=cc(null,t,e,r,n);break a}else if(a===D){t.tag=14,t=lc(null,t,e,r,n);break a}}throw t=ie(e)||e,Error(i(306,t,``))}}return t;case 0:return vc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Ys(r,t.pendingProps),bc(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,Va(e,t),Ja(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Ji(t,sa,r),r!==o.cache&&Zi(t,[sa],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=xc(e,t,r,n);break a}else if(r!==a){a=vi(Error(i(424)),t),Wi(a),t=xc(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(Pi=xf(e.firstChild),Ni=t,Fi=!0,Ii=null,Li=!0,n=Ra(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Hi(),r===a){t=Mc(e,t,n);break a}sc(e,t,r,n)}t=t.child}return t;case 26:return _c(e,t),e===null?(n=Hf(t.type,null,t.pendingProps,null))?t.memoizedState=n:Fi||(n=t.type,e=t.pendingProps,r=$d(me.current).createElement(n),r[pt]=t,r[mt]=e,qd(r,n,e),Et(r),t.stateNode=r):t.memoizedState=Hf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ve(t),e===null&&Fi&&(r=t.stateNode=Tf(t.type,t.pendingProps,me.current),Ni=t,Li=!0,a=Pi,df(t.type)?(Sf=a,Pi=xf(r.firstChild)):Pi=a),sc(e,t,t.pendingProps.children,n),_c(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Fi&&((a=r=Pi)&&(r=hf(r,t.type,t.pendingProps,Li),r===null?a=!1:(t.stateNode=r,Ni=t,Pi=xf(r.firstChild),Li=!1,a=!0)),a||Ri(t)),ve(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,nf(a,o)?r=null:s!==null&&nf(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=To(e,t,Oo,null,null,n),up._currentValue=a),_c(e,t),sc(e,t,r,n),t.child;case 6:return e===null&&Fi&&((e=n=Pi)&&(n=gf(n,t.pendingProps,Li),n===null?e=!1:(t.stateNode=n,Ni=t,Pi=null,e=!0)),e||Ri(t)),null;case 13:return Tc(e,t,n);case 4:return ge(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=La(t,null,r,n):sc(e,t,r,n),t.child;case 11:return cc(e,t,t.type,t.pendingProps,n);case 7:return sc(e,t,t.pendingProps,n),t.child;case 8:return sc(e,t,t.pendingProps.children,n),t.child;case 12:return sc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Ji(t,t.type,r.value),sc(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,ea(t),a=ta(a),r=r(a),t.flags|=1,sc(e,t,r,n),t.child;case 14:return lc(e,t,t.type,t.pendingProps,n);case 15:return uc(e,t,t.type,t.pendingProps,n);case 19:return jc(e,t,n);case 31:return gc(e,t,n);case 22:return dc(e,t,n,t.pendingProps);case 24:return ea(t),r=ta(sa),e===null?(a=ya(),a===null&&(a=Gl,o=ca(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Ba(t),Ji(t,sa,a)):((e.lanes&n)!==0&&(Va(e,t),Ja(t,null,null,n),qa()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Ji(t,sa,r),r!==a.cache&&Zi(t,[sa],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Ji(t,sa,r))),sc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Ic(e){e.flags|=4}function Lc(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(Pu())e.flags|=8192;else throw ka=Ta,Ca}else e.flags&=-16777217}function Rc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!rp(t))if(Pu())e.flags|=8192;else throw ka=Ta,Ca}function zc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:tt(),e.lanes|=t,au|=t)}function Bc(e,t){if(!Fi)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 Vc(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 Hc(e,t,n){var r=t.pendingProps;switch(ji(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Vc(t),null;case 1:return Vc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Yi(sa),_e(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Vi(t)?Ic(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ui())),Vc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Ic(t),o===null?(Vc(t),Lc(t,a,null,r,n)):(Vc(t),Rc(t,o))):o?o===e.memoizedState?(Vc(t),t.flags&=-16777217):(Ic(t),Vc(t),Rc(t,o)):(e=e.memoizedProps,e!==r&&Ic(t),Vc(t),Lc(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&&Ic(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Vc(t),null}e=fe.current,Vi(t)?zi(t,e):(e=Tf(a,r,n),t.stateNode=e,Ic(t))}return Vc(t),null;case 5:if(ye(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ic(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Vc(t),null}if(o=fe.current,Vi(t))zi(t,o);else{var s=$d(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(qd(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&&Ic(t)}}return Vc(t),Lc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Ic(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=me.current,Vi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Ni,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[pt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Wd(e.nodeValue,n)),e||Ri(t,!0)}else e=$d(e).createTextNode(r),e[pt]=t,t.stateNode=e}return Vc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Vi(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 Hi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Vc(t),e=!1}else n=Ui(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(co(t),t):(co(t),null);if(t.flags&128)throw Error(i(558))}return Vc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Vi(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 Hi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Vc(t),a=!1}else a=Ui(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(co(t),t):(co(t),null)}return co(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),zc(t,t.updateQueue),Vc(t),null);case 4:return _e(),e===null&&Pd(t.stateNode.containerInfo),Vc(t),null;case 10:return Yi(t.type),Vc(t),null;case 19:if(ue(lo),r=t.memoizedState,r===null)return Vc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Bc(r,!1);else{if(eu!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=uo(e),o!==null){for(t.flags|=128,Bc(r,!1),e=o.updateQueue,t.updateQueue=e,zc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)di(n,e),n=n.sibling;return de(lo,lo.current&1|2),Fi&&Oi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Me()>du&&(t.flags|=128,a=!0,Bc(r,!1),t.lanes=4194304)}else{if(!a)if(e=uo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,zc(t,e),Bc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Fi)return Vc(t),null}else 2*Me()-r.renderingStartTime>du&&n!==536870912&&(t.flags|=128,a=!0,Bc(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?(Vc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Me(),e.sibling=null,n=lo.current,de(lo,a?n&1|2:n&1),Fi&&Oi(t,r.treeForkCount),e);case 22:case 23:return co(t),to(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Vc(t),t.subtreeFlags&6&&(t.flags|=8192)):Vc(t),n=t.updateQueue,n!==null&&zc(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(va),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Yi(sa),Vc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Uc(e,t){switch(ji(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Yi(sa),_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(co(t),t.alternate===null)throw Error(i(340));Hi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(co(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Hi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ue(lo),null;case 4:return _e(),null;case 10:return Yi(t.type),null;case 22:case 23:return co(t),to(),e!==null&&ue(va),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Yi(sa),null;case 25:return null;default:return null}}function Wc(e,t){switch(ji(t),t.tag){case 3:Yi(sa),_e();break;case 26:case 27:case 5:ye(t);break;case 4:_e();break;case 31:t.memoizedState!==null&&co(t);break;case 13:co(t);break;case 19:ue(lo);break;case 10:Yi(t.type);break;case 22:case 23:co(t),to(),e!==null&&ue(va);break;case 24:Yi(sa)}}function Gc(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){td(t,t.return,e)}}function Kc(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){td(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){td(t,t.return,e)}}function qc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Xa(t,n)}catch(t){td(e,e.return,t)}}}function Jc(e,t,n){n.props=Ys(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){td(e,t,n)}}function Yc(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){td(e,t,n)}}function Xc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){td(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){td(e,t,n)}else n.current=null}function Zc(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){td(e,e.return,t)}}function Qc(e,t,n){try{var r=e.stateNode;Jd(r,e.type,n,t),r[mt]=t}catch(t){td(e,e.return,t)}}function $c(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&df(e.type)||e.tag===4}function el(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||$c(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&&df(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 tl(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=rn));else if(r!==4&&(r===27&&df(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(tl(e,t,n),e=e.sibling;e!==null;)tl(e,t,n),e=e.sibling}function nl(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&&df(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(nl(e,t,n),e=e.sibling;e!==null;)nl(e,t,n),e=e.sibling}function rl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);qd(t,r,n),t[pt]=e,t[mt]=n}catch(t){td(e,e.return,t)}}var il=!1,al=!1,ol=!1,sl=typeof WeakSet==`function`?WeakSet:Set,cl=null;function ll(e,t){if(e=e.containerInfo,Zd=yp,e=kr(e),Ar(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(Qd={focusedElem:e,selectionRange:n},yp=!1,cl=t;cl!==null;)if(t=cl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,cl=e;else for(;cl!==null;){switch(t=cl,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=Ys(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){td(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)mf(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:mf(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,cl=e;break}cl=t.return}}function ul(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Tl(e,n),r&4&&Gc(5,n);break;case 1:if(Tl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){td(n,n.return,e)}else{var i=Ys(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){td(n,n.return,e)}}r&64&&qc(n),r&512&&Yc(n,n.return);break;case 3:if(Tl(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{Xa(e,t)}catch(e){td(n,n.return,e)}}break;case 27:t===null&&r&4&&rl(n);case 26:case 5:Tl(e,n),t===null&&r&4&&Zc(n),r&512&&Yc(n,n.return);break;case 12:Tl(e,n);break;case 31:Tl(e,n),r&4&&gl(e,n);break;case 13:Tl(e,n),r&4&&_l(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=ad.bind(null,n),bf(e,n))));break;case 22:if(r=n.memoizedState!==null||il,!r){t=t!==null&&t.memoizedState!==null||al,i=il;var a=al;il=r,(al=t)&&!a?Dl(e,n,(n.subtreeFlags&8772)!=0):Tl(e,n),il=i,al=a}break;case 30:break;default:Tl(e,n)}}function dl(e){var t=e.alternate;t!==null&&(e.alternate=null,dl(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 fl=null,pl=!1;function ml(e,t,n){for(n=n.child;n!==null;)hl(e,t,n),n=n.sibling}function hl(e,t,n){if(He&&typeof He.onCommitFiberUnmount==`function`)try{He.onCommitFiberUnmount(Ve,n)}catch{}switch(n.tag){case 26:al||Xc(n,t),ml(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:al||Xc(n,t);var r=fl,i=pl;df(n.type)&&(fl=n.stateNode,pl=!1),ml(e,t,n),Ef(n.stateNode),fl=r,pl=i;break;case 5:al||Xc(n,t);case 6:if(r=fl,i=pl,fl=null,ml(e,t,n),fl=r,pl=i,fl!==null)if(pl)try{(fl.nodeType===9?fl.body:fl.nodeName===`HTML`?fl.ownerDocument.body:fl).removeChild(n.stateNode)}catch(e){td(n,t,e)}else try{fl.removeChild(n.stateNode)}catch(e){td(n,t,e)}break;case 18:fl!==null&&(pl?(e=fl,ff(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Gp(e)):ff(fl,n.stateNode));break;case 4:r=fl,i=pl,fl=n.stateNode.containerInfo,pl=!0,ml(e,t,n),fl=r,pl=i;break;case 0:case 11:case 14:case 15:Kc(2,n,t),al||Kc(4,n,t),ml(e,t,n);break;case 1:al||(Xc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Jc(n,t,r)),ml(e,t,n);break;case 21:ml(e,t,n);break;case 22:al=(r=al)||n.memoizedState!==null,ml(e,t,n),al=r;break;default:ml(e,t,n)}}function gl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Gp(e)}catch(e){td(t,t.return,e)}}}function _l(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Gp(e)}catch(e){td(t,t.return,e)}}function vl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new sl),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new sl),t;default:throw Error(i(435,e.tag))}}function yl(e,t){var n=vl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=od.bind(null,e,t);t.then(r,r)}})}function bl(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(df(c.type)){fl=c.stateNode,pl=!1;break a}break;case 5:fl=c.stateNode,pl=!1;break a;case 3:case 4:fl=c.stateNode.containerInfo,pl=!0;break a}c=c.return}if(fl===null)throw Error(i(160));hl(o,s,a),fl=null,pl=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Sl(t,e),t=t.sibling}var xl=null;function Sl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:bl(t,e),Cl(e),r&4&&(Kc(3,e,e.return),Gc(3,e),Kc(5,e,e.return));break;case 1:bl(t,e),Cl(e),r&512&&(al||n===null||Xc(n,n.return)),r&64&&il&&(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=xl;if(bl(t,e),Cl(e),r&512&&(al||n===null||Xc(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`))),qd(o,r,n),o[pt]=e,Et(o),r=o;break a;case`link`:var s=ep(`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),qd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=ep(`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),qd(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 tp(a,e.type,e.stateNode);else e.stateNode=Yf(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&Qc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?tp(a,e.type,e.stateNode):Yf(a,r,e.memoizedProps))}break;case 27:bl(t,e),Cl(e),r&512&&(al||n===null||Xc(n,n.return)),n!==null&&r&4&&Qc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(bl(t,e),Cl(e),r&512&&(al||n===null||Xc(n,n.return)),e.flags&32){a=e.stateNode;try{Yt(a,``)}catch(t){td(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Qc(e,a,n===null?a:n.memoizedProps)),r&1024&&(ol=!0);break;case 6:if(bl(t,e),Cl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){td(e,e.return,t)}}break;case 3:if($f=null,a=xl,xl=kf(t.containerInfo),bl(t,e),xl=a,Cl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Gp(t.containerInfo)}catch(t){td(e,e.return,t)}ol&&(ol=!1,wl(e));break;case 4:r=xl,xl=kf(e.stateNode.containerInfo),bl(t,e),Cl(e),xl=r;break;case 12:bl(t,e),Cl(e);break;case 31:bl(t,e),Cl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,yl(e,r)));break;case 13:bl(t,e),Cl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(lu=Me()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,yl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=il,d=al;if(il=u||a,al=d||l,bl(t,e),al=d,il=u,Cl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||il||al||El(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){td(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){td(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?pf(m,!0):pf(l.stateNode,!1)}catch(e){td(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,yl(e,n))));break;case 19:bl(t,e),Cl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,yl(e,r)));break;case 30:break;case 21:break;default:bl(t,e),Cl(e)}}function Cl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if($c(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;nl(e,el(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Yt(o,``),n.flags&=-33),nl(e,el(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;tl(e,el(e),s);break;default:throw Error(i(161))}}catch(t){td(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function wl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;wl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Tl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)ul(e,t.alternate,t),t=t.sibling}function El(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Kc(4,t,t.return),El(t);break;case 1:Xc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Jc(t,t.return,n),El(t);break;case 27:Ef(t.stateNode);case 26:case 5:Xc(t,t.return),El(t);break;case 22:t.memoizedState===null&&El(t);break;case 30:El(t);break;default:El(t)}e=e.sibling}}function Dl(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:Dl(i,a,n),Gc(4,a);break;case 1:if(Dl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){td(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++)Ya(c[i],s)}catch(e){td(r,r.return,e)}}n&&o&64&&qc(a),Yc(a,a.return);break;case 27:rl(a);case 26:case 5:Dl(i,a,n),n&&r===null&&o&4&&Zc(a),Yc(a,a.return);break;case 12:Dl(i,a,n);break;case 31:Dl(i,a,n),n&&o&4&&gl(i,a);break;case 13:Dl(i,a,n),n&&o&4&&_l(i,a);break;case 22:a.memoizedState===null&&Dl(i,a,n),Yc(a,a.return);break;case 30:break;default:Dl(i,a,n)}t=t.sibling}}function Ol(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&&la(n))}function kl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&la(e))}function Al(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)jl(e,t,n,r),t=t.sibling}function jl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Al(e,t,n,r),i&2048&&Gc(9,t);break;case 1:Al(e,t,n,r);break;case 3:Al(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&&la(e)));break;case 12:if(i&2048){Al(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){td(t,t.return,e)}}else Al(e,t,n,r);break;case 31:Al(e,t,n,r);break;case 13:Al(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Al(e,t,n,r):(a._visibility|=2,Ml(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?Al(e,t,n,r):Nl(e,t),i&2048&&Ol(o,t);break;case 24:Al(e,t,n,r),i&2048&&kl(t.alternate,t);break;default:Al(e,t,n,r)}}function Ml(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:Ml(a,o,s,c,i),Gc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Ml(a,o,s,c,i)):u._visibility&2?Ml(a,o,s,c,i):Nl(a,o),i&&l&2048&&Ol(o.alternate,o);break;case 24:Ml(a,o,s,c,i),i&&l&2048&&kl(o.alternate,o);break;default:Ml(a,o,s,c,i)}t=t.sibling}}function Nl(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:Nl(n,r),i&2048&&Ol(r.alternate,r);break;case 24:Nl(n,r),i&2048&&kl(r.alternate,r);break;default:Nl(n,r)}t=t.sibling}}var Pl=8192;function Fl(e,t,n){if(e.subtreeFlags&Pl)for(e=e.child;e!==null;)Il(e,t,n),e=e.sibling}function Il(e,t,n){switch(e.tag){case 26:Fl(e,t,n),e.flags&Pl&&e.memoizedState!==null&&V(n,xl,e.memoizedState,e.memoizedProps);break;case 5:Fl(e,t,n);break;case 3:case 4:var r=xl;xl=kf(e.stateNode.containerInfo),Fl(e,t,n),xl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Pl,Pl=16777216,Fl(e,t,n),Pl=r):Fl(e,t,n));break;default:Fl(e,t,n)}}function Ll(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 Rl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];cl=r,Vl(r,e)}Ll(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)zl(e),e=e.sibling}function zl(e){switch(e.tag){case 0:case 11:case 15:Rl(e),e.flags&2048&&Kc(9,e,e.return);break;case 3:Rl(e);break;case 12:Rl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Bl(e)):Rl(e);break;default:Rl(e)}}function Bl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];cl=r,Vl(r,e)}Ll(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Kc(8,t,t.return),Bl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Bl(t));break;default:Bl(t)}e=e.sibling}}function Vl(e,t){for(;cl!==null;){var n=cl;switch(n.tag){case 0:case 11:case 15:Kc(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:la(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,cl=r;else a:for(n=e;cl!==null;){r=cl;var i=r.sibling,a=r.return;if(dl(r),r===n){cl=null;break a}if(i!==null){i.return=a,cl=i;break a}cl=a}}}var Hl={getCacheForType:function(e){var t=ta(sa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ta(sa).controller.signal}},Ul=typeof WeakMap==`function`?WeakMap:Map,Wl=0,Gl=null,Kl=null,ql=0,Jl=0,Yl=null,Xl=!1,Zl=!1,Ql=!1,$l=0,eu=0,tu=0,nu=0,ru=0,iu=0,au=0,ou=null,su=null,cu=!1,lu=0,uu=0,du=1/0,fu=null,pu=null,mu=0,hu=null,gu=null,_u=0,vu=0,yu=null,bu=null,xu=0,Su=null;function Cu(){return Wl&2&&ql!==0?ql&-ql:A.T===null?ut():Sd()}function wu(){if(iu===0)if(!(ql&536870912)||Fi){var e=Ye;Ye<<=1,!(Ye&3932160)&&(Ye=262144),iu=e}else iu=536870912;return e=no.current,e!==null&&(e.flags|=32),iu}function Tu(e,t,n){(e===Gl&&(Jl===2||Jl===9)||e.cancelPendingCommit!==null)&&(Mu(e,0),ku(e,ql,iu,!1)),rt(e,n),(!(Wl&2)||e!==Gl)&&(e===Gl&&(!(Wl&2)&&(nu|=n),eu===4&&ku(e,ql,iu,!1)),md(e))}function Eu(e,t,n){if(Wl&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||$e(e,t),a=r?Bu(e,t):Ru(e,t,!0),o=r;do{if(a===0){Zl&&!r&&ku(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!Ou(n)){a=Ru(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=ou;var l=c.current.memoizedState.isDehydrated;if(l&&(Mu(c,s).flags|=256),s=Ru(c,s,!1),s!==2){if(Ql&&!l){c.errorRecoveryDisabledLanes|=o,nu|=o,a=4;break a}o=su,su=a,o!==null&&(su===null?su=o:su.push.apply(su,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Mu(e,0),ku(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:ku(r,t,iu,!Xl);break a;case 2:su=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=lu+300-Me(),10<a)){if(ku(r,t,iu,!Xl),Qe(r,0,!0)!==0)break a;_u=t,r.timeoutHandle=of(Du.bind(null,r,n,su,fu,cu,t,iu,nu,au,Xl,o,`Throttled`,-0,0),a);break a}Du(r,n,su,fu,cu,t,iu,nu,au,Xl,o,null,-0,0)}}break}while(1);md(e)}function Du(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:rn},Il(t,a,d);var m=(a&62914560)===a?lu-Me():(a&4194048)===a?uu-Me():0;if(m=ap(d,m),m!==null){_u=a,e.cancelPendingCommit=m(qu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),ku(e,a,o,!l);return}}qu(e,t,a,n,r,i,o,s,c)}function Ou(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(!wr(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 ku(e,t,n,r){t&=~ru,t&=~nu,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 Au(){return Wl&6?!0:(hd(0,!1),!1)}function ju(){if(Kl!==null){if(Jl===0)var e=Kl.return;else e=Kl,qi=Ki=null,jo(e),Ma=null,Na=0,e=Kl;for(;e!==null;)Wc(e.alternate,e),e=e.return;Kl=null}}function Mu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,sf(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),_u=0,ju(),Gl=e,Kl=n=ui(e.current,null),ql=t,Jl=0,Yl=null,Xl=!1,Zl=$e(e,t),Ql=!1,au=iu=ru=nu=tu=eu=0,su=ou=null,cu=!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 $l=t,ti(),n}function Nu(e,t){po=null,A.H=Vs,t===Sa||t===wa?(t=Aa(),Jl=3):t===Ca?(t=Aa(),Jl=4):Jl=t===ac?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Yl=t,Kl===null&&(eu=1,$s(e,vi(t,e.current)))}function Pu(){var e=no.current;return e===null?!0:(ql&4194048)===ql?ro===null:(ql&62914560)===ql||ql&536870912?e===ro:!1}function Fu(){var e=A.H;return A.H=Vs,e===null?Vs:e}function Iu(){var e=A.A;return A.A=Hl,e}function Lu(){eu=4,Xl||(ql&4194048)!==ql&&no.current!==null||(Zl=!0),!(tu&134217727)&&!(nu&134217727)||Gl===null||ku(Gl,ql,iu,!1)}function Ru(e,t,n){var r=Wl;Wl|=2;var i=Fu(),a=Iu();(Gl!==e||ql!==t)&&(fu=null,Mu(e,t)),t=!1;var o=eu;a:do try{if(Jl!==0&&Kl!==null){var s=Kl,c=Yl;switch(Jl){case 8:ju(),o=6;break a;case 3:case 2:case 9:case 6:no.current===null&&(t=!0);var l=Jl;if(Jl=0,Yl=null,Wu(e,s,c,l),n&&Zl){o=0;break a}break;default:l=Jl,Jl=0,Yl=null,Wu(e,s,c,l)}}zu(),o=eu;break}catch(t){Nu(e,t)}while(1);return t&&e.shellSuspendCounter++,qi=Ki=null,Wl=r,A.H=i,A.A=a,Kl===null&&(Gl=null,ql=0,ti()),o}function zu(){for(;Kl!==null;)Hu(Kl)}function Bu(e,t){var n=Wl;Wl|=2;var r=Fu(),a=Iu();Gl!==e||ql!==t?(fu=null,du=Me()+500,Mu(e,t)):Zl=$e(e,t);a:do try{if(Jl!==0&&Kl!==null){t=Kl;var o=Yl;b:switch(Jl){case 1:Jl=0,Yl=null,Wu(e,t,o,1);break;case 2:case 9:if(Ea(o)){Jl=0,Yl=null,Uu(t);break}t=function(){Jl!==2&&Jl!==9||Gl!==e||(Jl=7),md(e)},o.then(t,t);break a;case 3:Jl=7;break a;case 4:Jl=5;break a;case 7:Ea(o)?(Jl=0,Yl=null,Uu(t)):(Jl=0,Yl=null,Wu(e,t,o,7));break;case 5:var s=null;switch(Kl.tag){case 26:s=Kl.memoizedState;case 5:case 27:var c=Kl;if(s?rp(s):c.stateNode.complete){Jl=0,Yl=null;var l=c.sibling;if(l!==null)Kl=l;else{var u=c.return;u===null?Kl=null:(Kl=u,Gu(u))}break b}}Jl=0,Yl=null,Wu(e,t,o,5);break;case 6:Jl=0,Yl=null,Wu(e,t,o,6);break;case 8:ju(),eu=6;break a;default:throw Error(i(462))}}Vu();break}catch(t){Nu(e,t)}while(1);return qi=Ki=null,A.H=r,A.A=a,Wl=n,Kl===null?(Gl=null,ql=0,ti(),eu):0}function Vu(){for(;Kl!==null&&!Ae();)Hu(Kl)}function Hu(e){var t=Fc(e.alternate,e,$l);e.memoizedProps=e.pendingProps,t===null?Gu(e):Kl=t}function Uu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=yc(n,t,t.pendingProps,t.type,void 0,ql);break;case 11:t=yc(n,t,t.pendingProps,t.type.render,t.ref,ql);break;case 5:jo(t);default:Wc(n,t),t=Kl=di(t,$l),t=Fc(n,t,$l)}e.memoizedProps=e.pendingProps,t===null?Gu(e):Kl=t}function Wu(e,t,n,r){qi=Ki=null,jo(t),Ma=null,Na=0;var i=t.return;try{if(ic(e,i,t,n,ql)){eu=1,$s(e,vi(n,e.current)),Kl=null;return}}catch(t){if(i!==null)throw Kl=i,t;eu=1,$s(e,vi(n,e.current)),Kl=null;return}t.flags&32768?(Fi||r===1?e=!0:Zl||ql&536870912?e=!1:(Xl=e=!0,(r===2||r===9||r===3||r===6)&&(r=no.current,r!==null&&r.tag===13&&(r.flags|=16384))),Ku(t,e)):Gu(t)}function Gu(e){var t=e;do{if(t.flags&32768){Ku(t,Xl);return}e=t.return;var n=Hc(t.alternate,t,$l);if(n!==null){Kl=n;return}if(t=t.sibling,t!==null){Kl=t;return}Kl=t=e}while(t!==null);eu===0&&(eu=5)}function Ku(e,t){do{var n=Uc(e.alternate,e);if(n!==null){n.flags&=32767,Kl=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Kl=e;return}Kl=e=n}while(e!==null);eu=6,Kl=null}function qu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Qu();while(mu!==0);if(Wl&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=ei,it(e,n,o,s,c,l),e===Gl&&(Kl=Gl=null,ql=0),gu=t,hu=e,_u=n,vu=o,yu=a,bu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,sd(Ie,function(){return $u(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=A.T,A.T=null,a=oe.p,oe.p=2,s=Wl,Wl|=4;try{ll(e,t,n)}finally{Wl=s,oe.p=a,A.T=r}}mu=1,Ju(),Yu(),Xu()}}function Ju(){if(mu===1){mu=0;var e=hu,t=gu,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=A.T,A.T=null;var r=oe.p;oe.p=2;var i=Wl;Wl|=4;try{Sl(t,e);var a=Qd,o=kr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&Or(s.ownerDocument.documentElement,s)){if(c!==null&&Ar(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 _=Dr(s,h),v=Dr(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}}yp=!!Zd,Qd=Zd=null}finally{Wl=i,oe.p=r,A.T=n}}e.current=t,mu=2}}function Yu(){if(mu===2){mu=0;var e=hu,t=gu,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=A.T,A.T=null;var r=oe.p;oe.p=2;var i=Wl;Wl|=4;try{ul(e,t.alternate,t)}finally{Wl=i,oe.p=r,A.T=n}}mu=3}}function Xu(){if(mu===4||mu===3){mu=0,je();var e=hu,t=gu,n=_u,r=bu;t.subtreeFlags&10256||t.flags&10256?mu=5:(mu=0,gu=hu=null,Zu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(pu=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=A.T,i=oe.p,oe.p=2,A.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{A.T=t,oe.p=i}}_u&3&&Qu(),md(e),i=e.pendingLanes,n&261930&&i&42?e===Su?xu++:(xu=0,Su=e):xu=0,hd(0,!1)}}function Zu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,la(t)))}function Qu(){return Ju(),Yu(),Xu(),$u()}function $u(){if(mu!==5)return!1;var e=hu,t=vu;vu=0;var n=lt(_u),r=A.T,a=oe.p;try{oe.p=32>n?32:n,A.T=null,n=yu,yu=null;var o=hu,s=_u;if(mu=0,gu=hu=null,_u=0,Wl&6)throw Error(i(331));var c=Wl;if(Wl|=4,zl(o.current),jl(o,o.current,s,n),Wl=c,hd(0,!1),He&&typeof He.onPostCommitFiberRoot==`function`)try{He.onPostCommitFiberRoot(Ve,o)}catch{}return!0}finally{oe.p=a,A.T=r,Zu(e,t)}}function ed(e,t,n){t=vi(n,t),t=tc(e.stateNode,t,2),e=Ua(e,t,2),e!==null&&(rt(e,2),md(e))}function td(e,t,n){if(e.tag===3)ed(e,e,n);else for(;t!==null;){if(t.tag===3){ed(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(pu===null||!pu.has(r))){e=vi(n,e),n=nc(2),r=Ua(t,n,2),r!==null&&(rc(n,r,t,e),rt(r,2),md(r));break}}t=t.return}}function nd(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Ul;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)||(Ql=!0,i.add(n),e=rd.bind(null,e,t,n),t.then(e,e))}function rd(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Gl===e&&(ql&n)===n&&(eu===4||eu===3&&(ql&62914560)===ql&&300>Me()-lu?!(Wl&2)&&Mu(e,0):ru|=n,au===ql&&(au=0)),md(e)}function id(e,t){t===0&&(t=tt()),e=ri(e,t),e!==null&&(rt(e,t),md(e))}function ad(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),id(e,n)}function od(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),id(e,n)}function sd(e,t){return Oe(e,t)}var cd=null,ld=null,ud=!1,dd=!1,fd=!1,pd=0;function md(e){e!==ld&&e.next===null&&(ld===null?cd=ld=e:ld=ld.next=e),dd=!0,ud||(ud=!0,xd())}function hd(e,t){if(!fd&&dd){fd=!0;do for(var n=!1,r=cd;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,bd(r,a))}else a=ql,a=Qe(r,r===Gl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||$e(r,a)||(n=!0,bd(r,a));r=r.next}while(n);fd=!1}}function gd(){_d()}function _d(){dd=ud=!1;var e=0;pd!==0&&af()&&(e=pd);for(var t=Me(),n=null,r=cd;r!==null;){var i=r.next,a=vd(r,t);a===0?(r.next=null,n===null?cd=i:n.next=i,i===null&&(ld=n)):(n=r,(e!==0||a&3)&&(dd=!0)),r=i}mu!==0&&mu!==5||hd(e,!1),pd!==0&&(pd=0)}function vd(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=Gl,n=ql,n=Qe(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Jl===2||Jl===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=yd.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 yd(e,t){if(mu!==0&&mu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Qu()&&e.callbackNode!==n)return null;var r=ql;return r=Qe(e,e===Gl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Eu(e,r,t),vd(e,Me()),e.callbackNode!=null&&e.callbackNode===n?yd.bind(null,e):null)}function bd(e,t){if(Qu())return null;Eu(e,t,!0)}function xd(){lf(function(){Wl&6?Oe(Pe,gd):_d()})}function Sd(){if(pd===0){var e=fa;e===0&&(e=Je,Je<<=1,!(Je&261888)&&(Je=256)),pd=e}return pd}function Cd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:nn(``+e)}function wd(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 Td(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Cd((i[mt]||null).action),o=r.submitter;o&&(t=(t=o[mt]||null)?Cd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Tn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(pd!==0){var e=o?wd(i,o):new FormData(i);Ds(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?wd(i,o):new FormData(i),Ds(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Ed=0;Ed<Yr.length;Ed++){var Dd=Yr[Ed];Xr(Dd.toLowerCase(),`on`+(Dd[0].toUpperCase()+Dd.slice(1)))}Xr(Vr,`onAnimationEnd`),Xr(Hr,`onAnimationIteration`),Xr(Ur,`onAnimationStart`),Xr(`dblclick`,`onDoubleClick`),Xr(`focusin`,`onFocus`),Xr(`focusout`,`onBlur`),Xr(Wr,`onTransitionRun`),Xr(Gr,`onTransitionStart`),Xr(Kr,`onTransitionCancel`),Xr(qr,`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 Od=`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(` `),kd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Od));function Ad(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){Zr(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){Zr(e)}i.currentTarget=null,a=c}}}}function jd(e,t){var n=t[gt];n===void 0&&(n=t[gt]=new Set);var r=e+`__bubble`;n.has(r)||(Fd(t,e,2,!1),n.add(r))}function Md(e,t,n){var r=0;t&&(r|=4),Fd(n,e,r,t)}var Nd=`_reactListening`+Math.random().toString(36).slice(2);function Pd(e){if(!e[Nd]){e[Nd]=!0,Dt.forEach(function(t){t!==`selectionchange`&&(kd.has(t)||Md(t,!1,e),Md(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Nd]||(t[Nd]=!0,Md(`selectionchange`,!1,t))}}function Fd(e,t,n,r){switch(Ep(t)){case 2:var i=bp;break;case 8:i=xp;break;default:i=Sp}n=i.bind(null,t,n,e),i=void 0,!mn||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 Id(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}dn(function(){var r=a,i=on(n),s=[];a:{var c=Jr.get(e);if(c!==void 0){var l=Tn,u=e;switch(e){case`keypress`:if(bn(n)===0)break a;case`keydown`:case`keyup`:l=Un;break;case`focusin`:u=`focus`,l=Pn;break;case`focusout`:u=`blur`,l=Pn;break;case`beforeblur`:case`afterblur`:l=Pn;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=Mn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Nn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Gn;break;case Vr:case Hr:case Ur:l=Fn;break;case qr:l=Kn;break;case`scroll`:case`scrollend`:l=Dn;break;case`wheel`:l=qn;break;case`copy`:case`cut`:case`paste`:l=In;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Wn;break;case`toggle`:case`beforetoggle`:l=Jn}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=fn(m,p),g!=null&&d.push(Ld(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!==an&&(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=Mn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Wn,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=zd,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&&Bd(s,c,l,d,!1),u!==null&&f!==null&&Bd(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=fr;else if(or(c))if(pr)v=Sr;else{v=br;var y=yr}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&$t(r.elementType)&&(v=fr):v=xr;if(v&&=v(e,r)){sr(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Gt(c,`number`,c.value)}switch(y=r?wt(r):window,e){case`focusin`:(or(y)||y.contentEditable===`true`)&&(Mr=y,Nr=r,Pr=null);break;case`focusout`:Pr=Nr=Mr=null;break;case`mousedown`:Fr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Fr=!1,Ir(s,n,i);break;case`selectionchange`:if(jr)break;case`keydown`:case`keyup`:Ir(s,n,i)}var b;if(I)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 nr?er(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Zn&&n.locale!==`ko`&&(nr||x!==`onCompositionStart`?x===`onCompositionEnd`&&nr&&(b=yn()):(gn=i,_n=`value`in gn?gn.value:gn.textContent,nr=!0)),y=Rd(r,x),0<y.length&&(x=new Ln(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=tr(n),b!==null&&(x.data=b)))),(b=Xn?rr(e,n):ir(e,n))&&(x=Rd(r,`onBeforeInput`),0<x.length&&(y=new Ln(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),Td(s,e,r,n,i)}Ad(s,t)})}function Ld(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Rd(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=fn(e,n),i!=null&&r.unshift(Ld(e,i,a)),i=fn(e,t),i!=null&&r.push(Ld(e,i,a))),e.tag===3)return r;e=e.return}return[]}function zd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Bd(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=fn(n,a),l!=null&&o.unshift(Ld(n,l,c))):i||(l=fn(n,a),l!=null&&o.push(Ld(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Vd=/\r\n?/g,Hd=/\u0000|\uFFFD/g;function Ud(e){return(typeof e==`string`?e:``+e).replace(Vd,`
9
+ `).replace(Hd,``)}function Wd(e,t){return t=Ud(t),Ud(e)===t}function Gd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Yt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Yt(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`:Qt(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=nn(``+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`&&Gd(e,t,`name`,a.name,a,null),Gd(e,t,`formEncType`,a.formEncType,a,null),Gd(e,t,`formMethod`,a.formMethod,a,null),Gd(e,t,`formTarget`,a.formTarget,a,null)):(Gd(e,t,`encType`,a.encType,a,null),Gd(e,t,`method`,a.method,a,null),Gd(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=nn(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=rn);break;case`onScroll`:r!=null&&jd(`scroll`,e);break;case`onScrollEnd`:r!=null&&jd(`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=nn(``+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`:jd(`beforetoggle`,e),jd(`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=en.get(n)||n,Ft(e,n,r))}}function Kd(e,t,n,r,a,o){switch(n){case`style`:Qt(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`?Yt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Yt(e,``+r);break;case`onScroll`:r!=null&&jd(`scroll`,e);break;case`onScrollEnd`:r!=null&&jd(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=rn);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 qd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:jd(`error`,e),jd(`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:Gd(e,t,o,s,n,null)}}a&&Gd(e,t,`srcSet`,n.srcSet,n,null),r&&Gd(e,t,`src`,n.src,n,null);return;case`input`:jd(`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:Gd(e,t,r,d,n,null)}}P(e,o,c,l,u,s,a,!1);return;case`select`:for(a in jd(`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:Gd(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Kt(e,!!r,n,!0):Kt(e,!!r,t,!1);return;case`textarea`:for(s in jd(`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:Gd(e,t,s,c,n,null)}Jt(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:Gd(e,t,l,r,n,null)}return;case`dialog`:jd(`beforetoggle`,e),jd(`toggle`,e),jd(`cancel`,e),jd(`close`,e);break;case`iframe`:case`object`:jd(`load`,e);break;case`video`:case`audio`:for(r=0;r<Od.length;r++)jd(Od[r],e);break;case`image`:jd(`error`,e),jd(`load`,e);break;case`details`:jd(`toggle`,e);break;case`embed`:case`source`:case`link`:jd(`error`,e),jd(`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:Gd(e,t,u,r,n,null)}return;default:if($t(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Kd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Gd(e,t,c,r,n,null))}function Jd(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)||Gd(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&&Gd(e,t,p,m,r,f)}}N(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)||Gd(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&&Gd(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Kt(e,!!n,n?[]:``,!1):Kt(e,!!n,t,!0)):Kt(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:Gd(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&&Gd(e,t,s,a,r,o)}qt(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:Gd(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:Gd(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)&&Gd(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:Gd(e,t,u,p,r,m)}return;default:if($t(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Kd(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||Kd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Gd(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||Gd(e,t,f,p,r,m)}function Yd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Xd(){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&&Yd(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&&Yd(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 Zd=null,Qd=null;function $d(e){return e.nodeType===9?e:e.ownerDocument}function ef(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 tf(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 nf(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 rf=null;function af(){var e=window.event;return e&&e.type===`popstate`?e===rf?!1:(rf=e,!0):(rf=null,!1)}var of=typeof setTimeout==`function`?setTimeout:void 0,sf=typeof clearTimeout==`function`?clearTimeout:void 0,cf=typeof Promise==`function`?Promise:void 0,lf=typeof queueMicrotask==`function`?queueMicrotask:cf===void 0?of:function(e){return cf.resolve(null).then(e).catch(uf)};function uf(e){setTimeout(function(){throw e})}function df(e){return e===`head`}function ff(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),Gp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Ef(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Ef(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`&&Ef(e.ownerDocument.body);n=i}while(n);Gp(t)}function pf(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 mf(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`:mf(n),xt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function hf(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=xf(e.nextSibling),e===null)break}return null}function gf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=xf(e.nextSibling),e===null))return null;return e}function _f(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=xf(e.nextSibling),e===null))return null;return e}function vf(e){return e.data===`$?`||e.data===`$~`}function yf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function bf(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 xf(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 Sf=null;function Cf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return xf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function wf(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 Tf(e,t,n){switch(t=$d(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 Ef(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);xt(e)}var Df=new Map,Of=new Set;function kf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Af=oe.d;oe.d={f:jf,r:Mf,D:Ff,C:If,L:Lf,m:Rf,X:Bf,S:zf,M:Vf};function jf(){var e=Af.f(),t=Au();return e||t}function Mf(e){var t=Ct(e);t!==null&&t.tag===5&&t.type===`form`?ks(t):Af.r(e)}var Nf=typeof document>`u`?null:document;function Pf(e,t,n){var r=Nf;if(r&&typeof t==`string`&&t){var i=Wt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Of.has(i)||(Of.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),qd(t,`link`,e),Et(t),r.head.appendChild(t)))}}function Ff(e){Af.D(e),Pf(`dns-prefetch`,e,null)}function If(e,t){Af.C(e,t),Pf(`preconnect`,e,t)}function Lf(e,t,n){Af.L(e,t,n);var r=Nf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Wt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Wt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Wt(n.imageSizes)+`"]`)):i+=`[href="`+Wt(e)+`"]`;var a=i;switch(t){case`style`:a=Uf(e);break;case`script`:a=qf(e)}Df.has(a)||(e=m({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Df.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Wf(a))||t===`script`&&r.querySelector(Jf(a))||(t=r.createElement(`link`),qd(t,`link`,e),Et(t),r.head.appendChild(t)))}}function Rf(e,t){Af.m(e,t);var n=Nf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Wt(r)+`"][href="`+Wt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=qf(e)}if(!Df.has(a)&&(e=m({rel:`modulepreload`,href:e},t),Df.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Jf(a)))return}r=n.createElement(`link`),qd(r,`link`,e),Et(r),n.head.appendChild(r)}}}function zf(e,t,n){Af.S(e,t,n);var r=Nf;if(r&&e){var i=Tt(r).hoistableStyles,a=Uf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Wf(a)))s.loading=5;else{e=m({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Df.get(a))&&Zf(e,n);var c=o=r.createElement(`link`);Et(c),qd(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,Xf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Bf(e,t){Af.X(e,t);var n=Nf;if(n&&e){var r=Tt(n).hoistableScripts,i=qf(e),a=r.get(i);a||(a=n.querySelector(Jf(i)),a||(e=m({src:e,async:!0},t),(t=Df.get(i))&&Qf(e,t),a=n.createElement(`script`),Et(a),qd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Vf(e,t){Af.M(e,t);var n=Nf;if(n&&e){var r=Tt(n).hoistableScripts,i=qf(e),a=r.get(i);a||(a=n.querySelector(Jf(i)),a||(e=m({src:e,async:!0,type:`module`},t),(t=Df.get(i))&&Qf(e,t),a=n.createElement(`script`),Et(a),qd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Hf(e,t,n,r){var a=(a=me.current)?kf(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=Uf(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=Uf(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(Wf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),Df.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},Df.set(e,n),o||Kf(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=qf(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 Uf(e){return`href="`+Wt(e)+`"`}function Wf(e){return`link[rel="stylesheet"][`+e+`]`}function Gf(e){return m({},e,{"data-precedence":e.precedence,precedence:null})}function Kf(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}),qd(t,`link`,n),Et(t),e.head.appendChild(t))}function qf(e){return`[src="`+Wt(e)+`"]`}function Jf(e){return`script[async]`+e}function Yf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Wt(n.href)+`"]`);if(r)return t.instance=r,Et(r),r;var a=m({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Et(r),qd(r,`style`,a),Xf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Uf(n.href);var o=e.querySelector(Wf(a));if(o)return t.state.loading|=4,t.instance=o,Et(o),o;r=Gf(n),(a=Df.get(a))&&Zf(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}),qd(o,`link`,r),t.state.loading|=4,Xf(o,n.precedence,e),t.instance=o;case`script`:return o=qf(n.src),(a=e.querySelector(Jf(o)))?(t.instance=a,Et(a),a):(r=n,(a=Df.get(o))&&(r=m({},n),Qf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Et(a),qd(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,Xf(r,n.precedence,e));return t.instance}function Xf(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 Zf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Qf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var $f=null;function ep(e,t,n){if($f===null){var r=new Map,i=$f=new Map;i.set(n,r)}else i=$f,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 tp(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function np(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 rp(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function V(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=Uf(r.href),a=t.querySelector(Wf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=op.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Et(a);return}a=t.ownerDocument||t,r=Gf(r),(i=Df.get(i))&&Zf(r,i),a=a.createElement(`link`),Et(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),qd(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=op.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var ip=0;function ap(e,t){return e.stylesheets&&e.count===0&&cp(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&cp(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&ip===0&&(ip=62500*Xd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&cp(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>ip?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function op(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)cp(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var sp=null;function cp(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,sp=new Map,t.forEach(lp,e),sp=null,op.call(e))}function lp(e,t){if(!(t.state.loading&4)){var n=sp.get(e);if(n)var r=n.get(null);else{n=new Map,sp.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=op.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 up={$$typeof:C,Provider:null,Consumer:null,_currentValue:j,_currentValue2:j,_threadCount:0};function dp(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 fp(e,t,n,r,i,a,o,s,c,l,u,d){return e=new dp(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ci(3,null,null,t),e.current=a,a.stateNode=e,t=ca(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Ba(a),e}function pp(e){return e?(e=oi,e):oi}function mp(e,t,n,r,i,a){i=pp(i),r.context===null?r.context=i:r.pendingContext=i,r=Ha(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ua(e,r,t),n!==null&&(Tu(n,e,t),Wa(n,e,t))}function hp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function gp(e,t){hp(e,t),(e=e.alternate)&&hp(e,t)}function _p(e){if(e.tag===13||e.tag===31){var t=ri(e,67108864);t!==null&&Tu(t,e,67108864),gp(e,67108864)}}function vp(e){if(e.tag===13||e.tag===31){var t=Cu();t=ct(t);var n=ri(e,t);n!==null&&Tu(n,e,t),gp(e,t)}}var yp=!0;function bp(e,t,n,r){var i=A.T;A.T=null;var a=oe.p;try{oe.p=2,Sp(e,t,n,r)}finally{oe.p=a,A.T=i}}function xp(e,t,n,r){var i=A.T;A.T=null;var a=oe.p;try{oe.p=8,Sp(e,t,n,r)}finally{oe.p=a,A.T=i}}function Sp(e,t,n,r){if(yp){var i=Cp(r);if(i===null)Id(e,t,r,wp,n),Fp(e,r);else if(Lp(i,e,t,n,r))r.stopPropagation();else if(Fp(e,r),t&4&&-1<Pp.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}md(a),!(Wl&6)&&(du=Me()+500,hd(0,!1))}}break;case 31:case 13:s=ri(a,2),s!==null&&Tu(s,a,2),Au(),gp(a,2)}if(a=Cp(r),a===null&&Id(e,t,r,wp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Id(e,t,r,null,n)}}function Cp(e){return e=on(e),Tp(e)}var wp=null;function Tp(e){if(wp=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 wp=e,null}function Ep(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 Dp=!1,Op=null,kp=null,Ap=null,jp=new Map,Mp=new Map,Np=[],Pp=`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 Fp(e,t){switch(e){case`focusin`:case`focusout`:Op=null;break;case`dragenter`:case`dragleave`:kp=null;break;case`mouseover`:case`mouseout`:Ap=null;break;case`pointerover`:case`pointerout`:jp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Mp.delete(t.pointerId)}}function Ip(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&&_p(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Lp(e,t,n,r,i){switch(t){case`focusin`:return Op=Ip(Op,e,t,n,r,i),!0;case`dragenter`:return kp=Ip(kp,e,t,n,r,i),!0;case`mouseover`:return Ap=Ip(Ap,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return jp.set(a,Ip(jp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Mp.set(a,Ip(Mp.get(a)||null,e,t,n,r,i)),!0}return!1}function Rp(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(){vp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,dt(e.priority,function(){vp(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 zp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Cp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);an=r,n.target.dispatchEvent(r),an=null}else return t=Ct(n),t!==null&&_p(t),e.blockedOn=n,!1;t.shift()}return!0}function Bp(e,t,n){zp(e)&&n.delete(t)}function Vp(){Dp=!1,Op!==null&&zp(Op)&&(Op=null),kp!==null&&zp(kp)&&(kp=null),Ap!==null&&zp(Ap)&&(Ap=null),jp.forEach(Bp),Mp.forEach(Bp)}function Hp(e,n){e.blockedOn===n&&(e.blockedOn=null,Dp||(Dp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Vp)))}var Up=null;function Wp(e){Up!==e&&(Up=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Up===e&&(Up=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(Tp(r||n)===null)continue;break}var a=Ct(n);a!==null&&(e.splice(t,3),t-=3,Ds(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Gp(e){function t(t){return Hp(t,e)}Op!==null&&Hp(Op,e),kp!==null&&Hp(kp,e),Ap!==null&&Hp(Ap,e),jp.forEach(t),Mp.forEach(t);for(var n=0;n<Np.length;n++){var r=Np[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Np.length&&(n=Np[0],n.blockedOn===null);)Rp(n),n.blockedOn===null&&Np.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||Wp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[mt]||null)s=o.formAction;else if(Tp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Wp(n)}}}function Kp(){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}Jp.prototype.render=qp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;mp(n,Cu(),e,t,null,null)},Jp.prototype.unmount=qp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;mp(e.current,2,null,e,null,null),Au(),t[ht]=null}};function Jp(e){this._internalRoot=e}Jp.prototype.unstable_scheduleHydration=function(e){if(e){var t=ut();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Np.length&&t!==0&&t<Np[n].priority;n++);Np.splice(n,0,e),n===0&&Rp(e)}};var Yp=n.version;if(Yp!==`19.2.6`)throw Error(i(527,Yp,`19.2.6`));oe.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var Xp={bundleType:0,version:`19.2.6`,rendererPackageName:`react-dom`,currentDispatcherRef:A,reconcilerVersion:`19.2.6`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Zp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Zp.isDisabled&&Zp.supportsFiber)try{Ve=Zp.inject(Xp),He=Zp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Xs,s=Zs,c=Qs;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=fp(e,1,!1,null,null,n,r,null,o,s,c,Kp),e[ht]=t.current,Pd(e),new qp(t)}})),_=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=g()})),v=l(d(),1),y=_(),b=`modulepreload`,x=function(e){return`/`+e},S={},C=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=x(t,n),t in S)return;S[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`:b,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)})},w=`true`,T=`false`,E=w===`true`,D=T===`true`;function O(e={}){let{immediate:t=!1,onNeedReload:n,onNeedRefresh:r,onOfflineReady:i,onRegistered:a,onRegisteredSW:o,onRegisterError:s}=e,c,l,u,d=async(e=!0)=>{await l,E||u?.()};async function f(){if(`serviceWorker`in navigator){if(c=await C(async()=>{let{Workbox:e}=await import(`./workbox-window.prod.es5-Cch4wiA5.js`);return{Workbox:e}},[]).then(({Workbox:e})=>new e(`/sw.js`,{scope:`/`,type:`classic`})).catch(e=>{s?.(e)}),!c)return;if(u=()=>{c?.messageSkipWaiting()},!D)if(E)c.addEventListener(`activated`,e=>{(e.isUpdate||e.isExternal)&&(n?n():window.location.reload())}),c.addEventListener(`installed`,e=>{e.isUpdate||i?.()});else{let e=!1,t=()=>{e=!0,c?.addEventListener(`controlling`,e=>{e.isUpdate&&(n?n():window.location.reload())}),r?.()};c.addEventListener(`installed`,n=>{n.isUpdate===void 0?n.isExternal===void 0?!e&&i?.():n.isExternal?t():!e&&i?.():n.isUpdate||i?.()}),c.addEventListener(`waiting`,t)}c.register({immediate:t}).then(e=>{o?o(`/sw.js`,e):a?.(e)}).catch(e=>{s?.(e)})}}return l=f(),d}var k=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),ee=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),te=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),ne=e=>{let t=te(e);return t.charAt(0).toUpperCase()+t.slice(1)},re={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`},ie=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},ae=(0,v.createContext)({}),A=()=>(0,v.useContext)(ae),oe=(0,v.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=A()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,v.createElement)(`svg`,{ref:c,...re,width:t??l??re.width,height:t??l??re.height,stroke:e??f,strokeWidth:m,className:k(`lucide`,p,i),...!a&&!ie(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,v.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),j=(e,t)=>{let n=(0,v.forwardRef)(({className:n,...r},i)=>(0,v.createElement)(oe,{ref:i,iconNode:t,className:k(`lucide-${ee(ne(e))}`,`lucide-${e}`,n),...r}));return n.displayName=ne(e),n},se=j(`activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),ce=j(`at-sign`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8`,key:`7n84p3`}]]),le=j(`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`}]]),ue=j(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),de=j(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),fe=j(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),pe=j(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),me=j(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),he=j(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),ge=j(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),_e=j(`code-xml`,[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]]),ve=j(`columns-2`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M12 3v18`,key:`108xh3`}]]),ye=j(`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`}]]),be=j(`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`}]]),xe=j(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),Se=j(`file-code`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 12.5 8 15l2 2.5`,key:`1tg20x`}],[`path`,{d:`m14 12.5 2 2.5-2 2.5`,key:`yinavb`}]]),Ce=j(`file-diff`,[[`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:`M9 10h6`,key:`9gxzsh`}],[`path`,{d:`M12 13V7`,key:`h0r20n`}],[`path`,{d:`M9 17h6`,key:`r8uit2`}]]),we=j(`file-plus-corner`,[[`path`,{d:`M11.35 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v5.35`,key:`17jvcc`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M14 19h6`,key:`bvotb8`}],[`path`,{d:`M17 16v6`,key:`18yu1i`}]]),Te=j(`file-search`,[[`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`}],[`circle`,{cx:`11.5`,cy:`14.5`,r:`2.5`,key:`1bq0ko`}],[`path`,{d:`M13.3 16.3 15 18`,key:`2quom7`}]]),Ee=j(`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`}]]),De=j(`folder-tree`,[[`path`,{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`hod4my`}],[`path`,{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`w4yl2u`}],[`path`,{d:`M3 5a2 2 0 0 0 2 2h3`,key:`f2jnh7`}],[`path`,{d:`M3 3v13a2 2 0 0 0 2 2h3`,key:`k8epm1`}]]),Oe=j(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),ke=j(`git-commit-horizontal`,[[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`line`,{x1:`3`,x2:`9`,y1:`12`,y2:`12`,key:`1dyftd`}],[`line`,{x1:`15`,x2:`21`,y1:`12`,y2:`12`,key:`oup4p8`}]]),Ae=j(`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`}]]),je=j(`layers`,[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]]),Me=j(`list-checks`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]),Ne=j(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),Pe=j(`menu`,[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]),Fe=j(`message-circle`,[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}]]),Ie=j(`message-square-plus`,[[`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`}],[`path`,{d:`M12 8v6`,key:`1ib9pf`}],[`path`,{d:`M9 11h6`,key:`1fldmi`}]]),Le=j(`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`}]]),Re=j(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),ze=j(`navigation`,[[`polygon`,{points:`3 11 22 2 13 21 11 13 3 11`,key:`1ltx0t`}]]),Be=j(`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`}]]),Ve=j(`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`}]]),He=j(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),Ue=j(`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`}]]),We=j(`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`}]]),Ge=j(`rows-2`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}]]),Ke=j(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),qe=j(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),Je=j(`share`,[[`path`,{d:`M12 2v13`,key:`1km8f5`}],[`path`,{d:`m16 6-4-4-4 4`,key:`13yo43`}],[`path`,{d:`M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8`,key:`1b2hhj`}]]),Ye=j(`square-x`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),Xe=j(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),Ze=j(`text-wrap`,[[`path`,{d:`m16 16-3 3 3 3`,key:`117b85`}],[`path`,{d:`M3 12h14.5a1 1 0 0 1 0 7H13`,key:`18xa6z`}],[`path`,{d:`M3 19h6`,key:`1ygdsz`}],[`path`,{d:`M3 5h18`,key:`1u36vt`}]]),Qe=j(`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`}]]),$e=j(`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`}]]),et=j(`undo-2`,[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]),tt=j(`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`}]]),nt=j(`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`}]]),rt=j(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),it=j(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]),at=`(max-width: 767px)`;function ot(){let[e,t]=(0,v.useState)(()=>typeof window>`u`?!1:window.matchMedia(at).matches);return(0,v.useEffect)(()=>{if(typeof window>`u`)return;let e=window.matchMedia(at),n=e=>t(e.matches);return t(e.matches),e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),e}var st=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},ct=(e=>e?st(e):st),lt=e=>e;function ut(e,t=lt){let n=v.useSyncExternalStore(e.subscribe,v.useCallback(()=>t(e.getState()),[e,t]),v.useCallback(()=>t(e.getInitialState()),[e,t]));return v.useDebugValue(n),n}var dt=e=>{let t=ct(e),n=e=>ut(t,e);return Object.assign(n,t),n},ft=(e=>e?dt(e):dt);function pt(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}var mt=class{constructor(){this.mutex=Promise.resolve()}lock(){let e=()=>{};return this.mutex=this.mutex.then(()=>new Promise(e)),new Promise(t=>{e=t})}dispatch(e){return pt(this,void 0,void 0,function*(){let t=yield this.lock();try{return yield Promise.resolve(e())}finally{t()}})}};function ht(){return typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:global}var gt=ht(),_t=gt.Buffer??null,vt=gt.TextEncoder?new gt.TextEncoder:null;function yt(e,t){return(e&15)+(e>>6|e>>3&8)<<4|(t&15)+(t>>6|t>>3&8)}function bt(e,t){let n=t.length>>1;for(let r=0;r<n;r++){let n=r<<1;e[r]=yt(t.charCodeAt(n),t.charCodeAt(n+1))}}function xt(e,t){if(e.length!==t.length*2)return!1;for(let n=0;n<t.length;n++){let r=n<<1;if(t[n]!==yt(e.charCodeAt(r),e.charCodeAt(r+1)))return!1}return!0}var St=87,Ct=48;function wt(e,t,n){let r=0;for(let i=0;i<n;i++){let n=t[i]>>>4;e[r++]=n>9?n+St:n+Ct,n=t[i]&15,e[r++]=n>9?n+St:n+Ct}return String.fromCharCode.apply(null,e)}var Tt=_t===null?e=>{if(typeof e==`string`)return vt.encode(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw Error(`Invalid data type!`)}:e=>{if(typeof e==`string`){let t=_t.from(e,`utf8`);return new Uint8Array(t.buffer,t.byteOffset,t.length)}if(_t.isBuffer(e))return new Uint8Array(e.buffer,e.byteOffset,e.length);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw Error(`Invalid data type!`)},Et=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,Dt=new Uint8Array(256);for(let e=0;e<64;e++)Dt[Et.charCodeAt(e)]=e;function Ot(e){let t=Math.floor(e.length*.75),n=e.length;return e[n-1]===`=`&&(--t,e[n-2]===`=`&&--t),t}function kt(e){let t=Ot(e),n=e.length,r=new Uint8Array(t),i=0;for(let t=0;t<n;t+=4){let n=Dt[e.charCodeAt(t)],a=Dt[e.charCodeAt(t+1)],o=Dt[e.charCodeAt(t+2)],s=Dt[e.charCodeAt(t+3)];r[i]=n<<2|a>>4,i+=1,r[i]=(a&15)<<4|o>>2,i+=1,r[i]=(o&3)<<6|s&63,i+=1}return r}var At=16*1024,jt=4,Mt=new mt,Nt=new Map;function Pt(e,t){return pt(this,void 0,void 0,function*(){let n=null,r=null,i=!1;if(typeof WebAssembly>`u`)throw Error(`WebAssembly is not supported in this environment!`);let a=(e,t=0)=>{r.set(e,t)},o=()=>r,s=()=>n.exports,c=e=>{n.exports.Hash_SetMemorySize(e);let t=n.exports.Hash_GetBuffer(),i=n.exports.memory.buffer;r=new Uint8Array(i,t,e)},l=()=>new DataView(n.exports.memory.buffer).getUint32(n.exports.STATE_SIZE,!0),u=Mt.dispatch(()=>pt(this,void 0,void 0,function*(){if(!Nt.has(e.name)){let t=kt(e.data),n=WebAssembly.compile(t);Nt.set(e.name,n)}let t=yield Nt.get(e.name);n=yield WebAssembly.instantiate(t,{})})),d=()=>pt(this,void 0,void 0,function*(){n||(yield u);let e=n.exports.Hash_GetBuffer(),t=n.exports.memory.buffer;r=new Uint8Array(t,e,At)}),f=(e=null)=>{i=!0,n.exports.Hash_Init(e)},p=e=>{let t=0;for(;t<e.length;){let i=e.subarray(t,t+At);t+=i.length,r.set(i),n.exports.Hash_Update(i.length)}},m=e=>{if(!i)throw Error(`update() called before init()`);p(Tt(e))},h=new Uint8Array(t*2),g=(e,a=null)=>{if(!i)throw Error(`digest() called before init()`);return i=!1,n.exports.Hash_Final(a),e===`binary`?r.slice(0,t):wt(h,r,t)},_=()=>{if(!i)throw Error(`save() can only be called after init() and before digest()`);let t=n.exports.Hash_GetState(),r=l(),a=n.exports.memory.buffer,o=new Uint8Array(a,t,r),s=new Uint8Array(jt+r);return bt(s,e.hash),s.set(o,jt),s},v=t=>{if(!(t instanceof Uint8Array))throw Error(`load() expects an Uint8Array generated by save()`);let r=n.exports.Hash_GetState(),a=l(),o=jt+a,s=n.exports.memory.buffer;if(t.length!==o)throw Error(`Bad state length (expected ${o} bytes, got ${t.length})`);if(!xt(e.hash,t.subarray(0,jt)))throw Error(`This state was written by an incompatible hash implementation`);let c=t.subarray(jt);new Uint8Array(s,r,a).set(c),i=!0},y=e=>typeof e==`string`?e.length<At/4:e.byteLength<At,b=y;switch(e.name){case`argon2`:case`scrypt`:b=()=>!0;break;case`blake2b`:case`blake2s`:b=(e,t)=>t<=512&&y(e);break;case`blake3`:b=(e,t)=>t===0&&y(e);break;case`xxhash64`:case`xxhash3`:case`xxhash128`:case`crc64`:b=()=>!1;break}return yield d(),{getMemory:o,writeMemory:a,getExports:s,setMemorySize:c,init:f,update:m,digest:g,save:_,load:v,calculate:(e,i=null,a=null)=>{if(!b(e,i))return f(i),m(e),g(`hex`,a);let o=Tt(e);return r.set(o),n.exports.Hash_Calculate(o.length,i,a),wt(h,r,t)},hashLength:t}})}new mt,new mt,new mt,new mt,new mt,new mt,new mt,new mt,new mt,new mt,new mt;var Ft={name:`sha256`,data:`AGFzbQEAAAABEQRgAAF/YAF/AGAAAGACf38AAwgHAAEBAQIAAwUEAQECAgYOAn8BQfCJBQt/AEGACAsHcAgGbWVtb3J5AgAOSGFzaF9HZXRCdWZmZXIAAAlIYXNoX0luaXQAAQtIYXNoX1VwZGF0ZQACCkhhc2hfRmluYWwABA1IYXNoX0dldFN0YXRlAAUOSGFzaF9DYWxjdWxhdGUABgpTVEFURV9TSVpFAwEKnEoHBQBBgAkLnQEAQQBCADcDwIkBQQBBHEEgIABB4AFGIgAbNgLoiQFBAEKnn+anxvST/b5/Qquzj/yRo7Pw2wAgABs3A+CJAUEAQrGWgP6fooWs6ABC/6S5iMWR2oKbfyAAGzcD2IkBQQBCl7rDg5Onlod3QvLmu+Ojp/2npX8gABs3A9CJAUEAQti9loj8oLW+NkLnzKfQ1tDrs7t/IAAbNwPIiQEL7wICAX4Gf0EAQQApA8CJASIBIACtfDcDwIkBAkACQAJAIAGnQT9xIgINAEGACSEDDAELAkBBwAAgAmsiBCAAIAQgAEkbIgNFDQAgA0EDcSEFIAJBgIkBaiEGQQAhAgJAIANBBEkNACADQfwAcSEHQQAhAgNAIAYgAmoiAyACQYAJai0AADoAACADQQFqIAJBgQlqLQAAOgAAIANBAmogAkGCCWotAAA6AAAgA0EDaiACQYMJai0AADoAACAHIAJBBGoiAkcNAAsLIAVFDQADQCAGIAJqIAJBgAlqLQAAOgAAIAJBAWohAiAFQX9qIgUNAAsLIAAgBEkNAUGAiQEQAyAAIARrIQAgBEGACWohAwsCQCAAQcAASQ0AA0AgAxADIANBwABqIQMgAEFAaiIAQT9LDQALCyAARQ0AQQAhAkEAIQUDQCACQYCJAWogAyACai0AADoAACACQQFqIQIgACAFQQFqIgVB/wFxSw0ACwsLoz4BRX9BACAAKAI8IgFBGHQgAUGA/gNxQQh0ciABQQh2QYD+A3EgAUEYdnJyIgFBGXcgAUEOd3MgAUEDdnMgACgCOCICQRh0IAJBgP4DcUEIdHIgAkEIdkGA/gNxIAJBGHZyciICaiAAKAIgIgNBGHQgA0GA/gNxQQh0ciADQQh2QYD+A3EgA0EYdnJyIgRBGXcgBEEOd3MgBEEDdnMgACgCHCIDQRh0IANBgP4DcUEIdHIgA0EIdkGA/gNxIANBGHZyciIFaiAAKAIEIgNBGHQgA0GA/gNxQQh0ciADQQh2QYD+A3EgA0EYdnJyIgZBGXcgBkEOd3MgBkEDdnMgACgCACIDQRh0IANBgP4DcUEIdHIgA0EIdkGA/gNxIANBGHZyciIHaiAAKAIkIgNBGHQgA0GA/gNxQQh0ciADQQh2QYD+A3EgA0EYdnJyIghqIAJBD3cgAkENd3MgAkEKdnNqIgNqIAAoAhgiCUEYdCAJQYD+A3FBCHRyIAlBCHZBgP4DcSAJQRh2cnIiCkEZdyAKQQ53cyAKQQN2cyAAKAIUIglBGHQgCUGA/gNxQQh0ciAJQQh2QYD+A3EgCUEYdnJyIgtqIAJqIAAoAhAiCUEYdCAJQYD+A3FBCHRyIAlBCHZBgP4DcSAJQRh2cnIiDEEZdyAMQQ53cyAMQQN2cyAAKAIMIglBGHQgCUGA/gNxQQh0ciAJQQh2QYD+A3EgCUEYdnJyIg1qIAAoAjAiCUEYdCAJQYD+A3FBCHRyIAlBCHZBgP4DcSAJQRh2cnIiDmogACgCCCIJQRh0IAlBgP4DcUEIdHIgCUEIdkGA/gNxIAlBGHZyciIPQRl3IA9BDndzIA9BA3ZzIAZqIAAoAigiCUEYdCAJQYD+A3FBCHRyIAlBCHZBgP4DcSAJQRh2cnIiEGogAUEPdyABQQ13cyABQQp2c2oiCUEPdyAJQQ13cyAJQQp2c2oiEUEPdyARQQ13cyARQQp2c2oiEkEPdyASQQ13cyASQQp2c2oiE2ogACgCNCIUQRh0IBRBgP4DcUEIdHIgFEEIdkGA/gNxIBRBGHZyciIVQRl3IBVBDndzIBVBA3ZzIA5qIBJqIAAoAiwiAEEYdCAAQYD+A3FBCHRyIABBCHZBgP4DcSAAQRh2cnIiFkEZdyAWQQ53cyAWQQN2cyAQaiARaiAIQRl3IAhBDndzIAhBA3ZzIARqIAlqIAVBGXcgBUEOd3MgBUEDdnMgCmogAWogC0EZdyALQQ53cyALQQN2cyAMaiAVaiANQRl3IA1BDndzIA1BA3ZzIA9qIBZqIANBD3cgA0ENd3MgA0EKdnNqIhRBD3cgFEENd3MgFEEKdnNqIhdBD3cgF0ENd3MgF0EKdnNqIhhBD3cgGEENd3MgGEEKdnNqIhlBD3cgGUENd3MgGUEKdnNqIhpBD3cgGkENd3MgGkEKdnNqIhtBD3cgG0ENd3MgG0EKdnNqIhxBGXcgHEEOd3MgHEEDdnMgAkEZdyACQQ53cyACQQN2cyAVaiAYaiAOQRl3IA5BDndzIA5BA3ZzIBZqIBdqIBBBGXcgEEEOd3MgEEEDdnMgCGogFGogE0EPdyATQQ13cyATQQp2c2oiHUEPdyAdQQ13cyAdQQp2c2oiHkEPdyAeQQ13cyAeQQp2c2oiH2ogE0EZdyATQQ53cyATQQN2cyAYaiADQRl3IANBDndzIANBA3ZzIAFqIBlqIB9BD3cgH0ENd3MgH0EKdnNqIiBqIBJBGXcgEkEOd3MgEkEDdnMgF2ogH2ogEUEZdyARQQ53cyARQQN2cyAUaiAeaiAJQRl3IAlBDndzIAlBA3ZzIANqIB1qIBxBD3cgHEENd3MgHEEKdnNqIiFBD3cgIUENd3MgIUEKdnNqIiJBD3cgIkENd3MgIkEKdnNqIiNBD3cgI0ENd3MgI0EKdnNqIiRqIBtBGXcgG0EOd3MgG0EDdnMgHmogI2ogGkEZdyAaQQ53cyAaQQN2cyAdaiAiaiAZQRl3IBlBDndzIBlBA3ZzIBNqICFqIBhBGXcgGEEOd3MgGEEDdnMgEmogHGogF0EZdyAXQQ53cyAXQQN2cyARaiAbaiAUQRl3IBRBDndzIBRBA3ZzIAlqIBpqICBBD3cgIEENd3MgIEEKdnNqIiVBD3cgJUENd3MgJUEKdnNqIiZBD3cgJkENd3MgJkEKdnNqIidBD3cgJ0ENd3MgJ0EKdnNqIihBD3cgKEENd3MgKEEKdnNqIilBD3cgKUENd3MgKUEKdnNqIipBD3cgKkENd3MgKkEKdnNqIitBGXcgK0EOd3MgK0EDdnMgH0EZdyAfQQ53cyAfQQN2cyAbaiAnaiAeQRl3IB5BDndzIB5BA3ZzIBpqICZqIB1BGXcgHUEOd3MgHUEDdnMgGWogJWogJEEPdyAkQQ13cyAkQQp2c2oiLEEPdyAsQQ13cyAsQQp2c2oiLUEPdyAtQQ13cyAtQQp2c2oiLmogJEEZdyAkQQ53cyAkQQN2cyAnaiAgQRl3ICBBDndzICBBA3ZzIBxqIChqIC5BD3cgLkENd3MgLkEKdnNqIi9qICNBGXcgI0EOd3MgI0EDdnMgJmogLmogIkEZdyAiQQ53cyAiQQN2cyAlaiAtaiAhQRl3ICFBDndzICFBA3ZzICBqICxqICtBD3cgK0ENd3MgK0EKdnNqIjBBD3cgMEENd3MgMEEKdnNqIjFBD3cgMUENd3MgMUEKdnNqIjJBD3cgMkENd3MgMkEKdnNqIjNqICpBGXcgKkEOd3MgKkEDdnMgLWogMmogKUEZdyApQQ53cyApQQN2cyAsaiAxaiAoQRl3IChBDndzIChBA3ZzICRqIDBqICdBGXcgJ0EOd3MgJ0EDdnMgI2ogK2ogJkEZdyAmQQ53cyAmQQN2cyAiaiAqaiAlQRl3ICVBDndzICVBA3ZzICFqIClqIC9BD3cgL0ENd3MgL0EKdnNqIjRBD3cgNEENd3MgNEEKdnNqIjVBD3cgNUENd3MgNUEKdnNqIjZBD3cgNkENd3MgNkEKdnNqIjdBD3cgN0ENd3MgN0EKdnNqIjhBD3cgOEENd3MgOEEKdnNqIjlBD3cgOUENd3MgOUEKdnNqIjogOCA0IC4gLCAhIBsgGSADIA4gBEEAKALYiQEiO0EadyA7QRV3cyA7QQd3c0EAKALkiQEiPGpBACgC4IkBIj1BACgC3IkBIj5zIDtxID1zaiAHakGY36iUBGoiB0EAKALUiQEiP2oiACAMaiA7IA1qID4gD2ogPSAGaiAAID4gO3NxID5zaiAAQRp3IABBFXdzIABBB3dzakGRid2JB2oiQEEAKALQiQEiQWoiDCAAIDtzcSA7c2ogDEEadyAMQRV3cyAMQQd3c2pBz/eDrntqIkJBACgCzIkBIkNqIg0gDCAAc3EgAHNqIA1BGncgDUEVd3MgDUEHd3NqQaW3181+aiJEQQAoAsiJASIAaiIPIA0gDHNxIAxzaiAPQRp3IA9BFXdzIA9BB3dzakHbhNvKA2oiRSBBIEMgAHNxIEMgAHFzIABBHncgAEETd3MgAEEKd3NqIAdqIgZqIgdqIAUgD2ogCiANaiALIAxqIAcgDyANc3EgDXNqIAdBGncgB0EVd3MgB0EHd3NqQfGjxM8FaiIKIAYgAHMgQ3EgBiAAcXMgBkEedyAGQRN3cyAGQQp3c2ogQGoiDGoiBCAHIA9zcSAPc2ogBEEadyAEQRV3cyAEQQd3c2pBpIX+kXlqIgsgDCAGcyAAcSAMIAZxcyAMQR53IAxBE3dzIAxBCndzaiBCaiINaiIPIAQgB3NxIAdzaiAPQRp3IA9BFXdzIA9BB3dzakHVvfHYemoiQCANIAxzIAZxIA0gDHFzIA1BHncgDUETd3MgDUEKd3NqIERqIgZqIgcgDyAEc3EgBHNqIAdBGncgB0EVd3MgB0EHd3NqQZjVnsB9aiJCIAYgDXMgDHEgBiANcXMgBkEedyAGQRN3cyAGQQp3c2ogRWoiDGoiBWogFiAHaiAQIA9qIAggBGogBSAHIA9zcSAPc2ogBUEadyAFQRV3cyAFQQd3c2pBgbaNlAFqIgggDCAGcyANcSAMIAZxcyAMQR53IAxBE3dzIAxBCndzaiAKaiINaiIPIAUgB3NxIAdzaiAPQRp3IA9BFXdzIA9BB3dzakG+i8ahAmoiDiANIAxzIAZxIA0gDHFzIA1BHncgDUETd3MgDUEKd3NqIAtqIgZqIgcgDyAFc3EgBXNqIAdBGncgB0EVd3MgB0EHd3NqQcP7sagFaiIQIAYgDXMgDHEgBiANcXMgBkEedyAGQRN3cyAGQQp3c2ogQGoiDGoiBCAHIA9zcSAPc2ogBEEadyAEQRV3cyAEQQd3c2pB9Lr5lQdqIhYgDCAGcyANcSAMIAZxcyAMQR53IAxBE3dzIAxBCndzaiBCaiINaiIFaiABIARqIAIgB2ogFSAPaiAFIAQgB3NxIAdzaiAFQRp3IAVBFXdzIAVBB3dzakH+4/qGeGoiByANIAxzIAZxIA0gDHFzIA1BHncgDUETd3MgDUEKd3NqIAhqIgFqIgYgBSAEc3EgBHNqIAZBGncgBkEVd3MgBkEHd3NqQaeN8N55aiIEIAEgDXMgDHEgASANcXMgAUEedyABQRN3cyABQQp3c2ogDmoiAmoiDCAGIAVzcSAFc2ogDEEadyAMQRV3cyAMQQd3c2pB9OLvjHxqIgUgAiABcyANcSACIAFxcyACQR53IAJBE3dzIAJBCndzaiAQaiIDaiINIAwgBnNxIAZzaiANQRp3IA1BFXdzIA1BB3dzakHB0+2kfmoiCCADIAJzIAFxIAMgAnFzIANBHncgA0ETd3MgA0EKd3NqIBZqIgFqIg8gF2ogESANaiAUIAxqIAkgBmogDyANIAxzcSAMc2ogD0EadyAPQRV3cyAPQQd3c2pBho/5/X5qIgYgASADcyACcSABIANxcyABQR53IAFBE3dzIAFBCndzaiAHaiICaiIJIA8gDXNxIA1zaiAJQRp3IAlBFXdzIAlBB3dzakHGu4b+AGoiDCACIAFzIANxIAIgAXFzIAJBHncgAkETd3MgAkEKd3NqIARqIgNqIhEgCSAPc3EgD3NqIBFBGncgEUEVd3MgEUEHd3NqQczDsqACaiINIAMgAnMgAXEgAyACcXMgA0EedyADQRN3cyADQQp3c2ogBWoiAWoiFCARIAlzcSAJc2ogFEEadyAUQRV3cyAUQQd3c2pB79ik7wJqIg8gASADcyACcSABIANxcyABQR53IAFBE3dzIAFBCndzaiAIaiICaiIXaiATIBRqIBggEWogEiAJaiAXIBQgEXNxIBFzaiAXQRp3IBdBFXdzIBdBB3dzakGqidLTBGoiGCACIAFzIANxIAIgAXFzIAJBHncgAkETd3MgAkEKd3NqIAZqIgNqIgkgFyAUc3EgFHNqIAlBGncgCUEVd3MgCUEHd3NqQdzTwuUFaiIUIAMgAnMgAXEgAyACcXMgA0EedyADQRN3cyADQQp3c2ogDGoiAWoiESAJIBdzcSAXc2ogEUEadyARQRV3cyARQQd3c2pB2pHmtwdqIhcgASADcyACcSABIANxcyABQR53IAFBE3dzIAFBCndzaiANaiICaiISIBEgCXNxIAlzaiASQRp3IBJBFXdzIBJBB3dzakHSovnBeWoiGSACIAFzIANxIAIgAXFzIAJBHncgAkETd3MgAkEKd3NqIA9qIgNqIhNqIB4gEmogGiARaiAdIAlqIBMgEiARc3EgEXNqIBNBGncgE0EVd3MgE0EHd3NqQe2Mx8F6aiIaIAMgAnMgAXEgAyACcXMgA0EedyADQRN3cyADQQp3c2ogGGoiAWoiCSATIBJzcSASc2ogCUEadyAJQRV3cyAJQQd3c2pByM+MgHtqIhggASADcyACcSABIANxcyABQR53IAFBE3dzIAFBCndzaiAUaiICaiIRIAkgE3NxIBNzaiARQRp3IBFBFXdzIBFBB3dzakHH/+X6e2oiFCACIAFzIANxIAIgAXFzIAJBHncgAkETd3MgAkEKd3NqIBdqIgNqIhIgESAJc3EgCXNqIBJBGncgEkEVd3MgEkEHd3NqQfOXgLd8aiIXIAMgAnMgAXEgAyACcXMgA0EedyADQRN3cyADQQp3c2ogGWoiAWoiE2ogICASaiAcIBFqIB8gCWogEyASIBFzcSARc2ogE0EadyATQRV3cyATQQd3c2pBx6KerX1qIhkgASADcyACcSABIANxcyABQR53IAFBE3dzIAFBCndzaiAaaiICaiIJIBMgEnNxIBJzaiAJQRp3IAlBFXdzIAlBB3dzakHRxqk2aiIaIAIgAXMgA3EgAiABcXMgAkEedyACQRN3cyACQQp3c2ogGGoiA2oiESAJIBNzcSATc2ogEUEadyARQRV3cyARQQd3c2pB59KkoQFqIhggAyACcyABcSADIAJxcyADQR53IANBE3dzIANBCndzaiAUaiIBaiISIBEgCXNxIAlzaiASQRp3IBJBFXdzIBJBB3dzakGFldy9AmoiFCABIANzIAJxIAEgA3FzIAFBHncgAUETd3MgAUEKd3NqIBdqIgJqIhMgI2ogJiASaiAiIBFqICUgCWogEyASIBFzcSARc2ogE0EadyATQRV3cyATQQd3c2pBuMLs8AJqIhcgAiABcyADcSACIAFxcyACQR53IAJBE3dzIAJBCndzaiAZaiIDaiIJIBMgEnNxIBJzaiAJQRp3IAlBFXdzIAlBB3dzakH827HpBGoiGSADIAJzIAFxIAMgAnFzIANBHncgA0ETd3MgA0EKd3NqIBpqIgFqIhEgCSATc3EgE3NqIBFBGncgEUEVd3MgEUEHd3NqQZOa4JkFaiIaIAEgA3MgAnEgASADcXMgAUEedyABQRN3cyABQQp3c2ogGGoiAmoiEiARIAlzcSAJc2ogEkEadyASQRV3cyASQQd3c2pB1OapqAZqIhggAiABcyADcSACIAFxcyACQR53IAJBE3dzIAJBCndzaiAUaiIDaiITaiAoIBJqICQgEWogJyAJaiATIBIgEXNxIBFzaiATQRp3IBNBFXdzIBNBB3dzakG7laizB2oiFCADIAJzIAFxIAMgAnFzIANBHncgA0ETd3MgA0EKd3NqIBdqIgFqIgkgEyASc3EgEnNqIAlBGncgCUEVd3MgCUEHd3NqQa6Si454aiIXIAEgA3MgAnEgASADcXMgAUEedyABQRN3cyABQQp3c2ogGWoiAmoiESAJIBNzcSATc2ogEUEadyARQRV3cyARQQd3c2pBhdnIk3lqIhkgAiABcyADcSACIAFxcyACQR53IAJBE3dzIAJBCndzaiAaaiIDaiISIBEgCXNxIAlzaiASQRp3IBJBFXdzIBJBB3dzakGh0f+VemoiGiADIAJzIAFxIAMgAnFzIANBHncgA0ETd3MgA0EKd3NqIBhqIgFqIhNqICogEmogLSARaiApIAlqIBMgEiARc3EgEXNqIBNBGncgE0EVd3MgE0EHd3NqQcvM6cB6aiIYIAEgA3MgAnEgASADcXMgAUEedyABQRN3cyABQQp3c2ogFGoiAmoiCSATIBJzcSASc2ogCUEadyAJQRV3cyAJQQd3c2pB8JauknxqIhQgAiABcyADcSACIAFxcyACQR53IAJBE3dzIAJBCndzaiAXaiIDaiIRIAkgE3NxIBNzaiARQRp3IBFBFXdzIBFBB3dzakGjo7G7fGoiFyADIAJzIAFxIAMgAnFzIANBHncgA0ETd3MgA0EKd3NqIBlqIgFqIhIgESAJc3EgCXNqIBJBGncgEkEVd3MgEkEHd3NqQZnQy4x9aiIZIAEgA3MgAnEgASADcXMgAUEedyABQRN3cyABQQp3c2ogGmoiAmoiE2ogMCASaiAvIBFqICsgCWogEyASIBFzcSARc2ogE0EadyATQRV3cyATQQd3c2pBpIzktH1qIhogAiABcyADcSACIAFxcyACQR53IAJBE3dzIAJBCndzaiAYaiIDaiIJIBMgEnNxIBJzaiAJQRp3IAlBFXdzIAlBB3dzakGF67igf2oiGCADIAJzIAFxIAMgAnFzIANBHncgA0ETd3MgA0EKd3NqIBRqIgFqIhEgCSATc3EgE3NqIBFBGncgEUEVd3MgEUEHd3NqQfDAqoMBaiIUIAEgA3MgAnEgASADcXMgAUEedyABQRN3cyABQQp3c2ogF2oiAmoiEiARIAlzcSAJc2ogEkEadyASQRV3cyASQQd3c2pBloKTzQFqIhcgAiABcyADcSACIAFxcyACQR53IAJBE3dzIAJBCndzaiAZaiIDaiITIDZqIDIgEmogNSARaiAxIAlqIBMgEiARc3EgEXNqIBNBGncgE0EVd3MgE0EHd3NqQYjY3fEBaiIZIAMgAnMgAXEgAyACcXMgA0EedyADQRN3cyADQQp3c2ogGmoiAWoiCSATIBJzcSASc2ogCUEadyAJQRV3cyAJQQd3c2pBzO6hugJqIhogASADcyACcSABIANxcyABQR53IAFBE3dzIAFBCndzaiAYaiICaiIRIAkgE3NxIBNzaiARQRp3IBFBFXdzIBFBB3dzakG1+cKlA2oiGCACIAFzIANxIAIgAXFzIAJBHncgAkETd3MgAkEKd3NqIBRqIgNqIhIgESAJc3EgCXNqIBJBGncgEkEVd3MgEkEHd3NqQbOZ8MgDaiIUIAMgAnMgAXEgAyACcXMgA0EedyADQRN3cyADQQp3c2ogF2oiAWoiE2ogLEEZdyAsQQ53cyAsQQN2cyAoaiA0aiAzQQ93IDNBDXdzIDNBCnZzaiIXIBJqIDcgEWogMyAJaiATIBIgEXNxIBFzaiATQRp3IBNBFXdzIBNBB3dzakHK1OL2BGoiGyABIANzIAJxIAEgA3FzIAFBHncgAUETd3MgAUEKd3NqIBlqIgJqIgkgEyASc3EgEnNqIAlBGncgCUEVd3MgCUEHd3NqQc+U89wFaiIZIAIgAXMgA3EgAiABcXMgAkEedyACQRN3cyACQQp3c2ogGmoiA2oiESAJIBNzcSATc2ogEUEadyARQRV3cyARQQd3c2pB89+5wQZqIhogAyACcyABcSADIAJxcyADQR53IANBE3dzIANBCndzaiAYaiIBaiISIBEgCXNxIAlzaiASQRp3IBJBFXdzIBJBB3dzakHuhb6kB2oiHCABIANzIAJxIAEgA3FzIAFBHncgAUETd3MgAUEKd3NqIBRqIgJqIhNqIC5BGXcgLkEOd3MgLkEDdnMgKmogNmogLUEZdyAtQQ53cyAtQQN2cyApaiA1aiAXQQ93IBdBDXdzIBdBCnZzaiIUQQ93IBRBDXdzIBRBCnZzaiIYIBJqIDkgEWogFCAJaiATIBIgEXNxIBFzaiATQRp3IBNBFXdzIBNBB3dzakHvxpXFB2oiCSACIAFzIANxIAIgAXFzIAJBHncgAkETd3MgAkEKd3NqIBtqIgNqIhEgEyASc3EgEnNqIBFBGncgEUEVd3MgEUEHd3NqQZTwoaZ4aiIbIAMgAnMgAXEgAyACcXMgA0EedyADQRN3cyADQQp3c2ogGWoiAWoiEiARIBNzcSATc2ogEkEadyASQRV3cyASQQd3c2pBiISc5nhqIhkgASADcyACcSABIANxcyABQR53IAFBE3dzIAFBCndzaiAaaiICaiITIBIgEXNxIBFzaiATQRp3IBNBFXdzIBNBB3dzakH6//uFeWoiGiACIAFzIANxIAIgAXFzIAJBHncgAkETd3MgAkEKd3NqIBxqIgNqIhQgPGo2AuSJAUEAID8gAyACcyABcSADIAJxcyADQR53IANBE3dzIANBCndzaiAJaiIBIANzIAJxIAEgA3FzIAFBHncgAUETd3MgAUEKd3NqIBtqIgIgAXMgA3EgAiABcXMgAkEedyACQRN3cyACQQp3c2ogGWoiAyACcyABcSADIAJxcyADQR53IANBE3dzIANBCndzaiAaaiIJajYC1IkBQQAgPSAvQRl3IC9BDndzIC9BA3ZzICtqIDdqIBhBD3cgGEENd3MgGEEKdnNqIhggEWogFCATIBJzcSASc2ogFEEadyAUQRV3cyAUQQd3c2pB69nBonpqIhkgAWoiEWo2AuCJAUEAIEEgCSADcyACcSAJIANxcyAJQR53IAlBE3dzIAlBCndzaiAZaiIBajYC0IkBQQAgPiAwQRl3IDBBDndzIDBBA3ZzIC9qIBdqIDpBD3cgOkENd3MgOkEKdnNqIBJqIBEgFCATc3EgE3NqIBFBGncgEUEVd3MgEUEHd3NqQffH5vd7aiIXIAJqIhJqNgLciQFBACBDIAEgCXMgA3EgASAJcXMgAUEedyABQRN3cyABQQp3c2ogF2oiAmo2AsyJAUEAIDsgNEEZdyA0QQ53cyA0QQN2cyAwaiA4aiAYQQ93IBhBDXdzIBhBCnZzaiATaiASIBEgFHNxIBRzaiASQRp3IBJBFXdzIBJBB3dzakHy8cWzfGoiESADamo2AtiJAUEAIAAgAiABcyAJcSACIAFxcyACQR53IAJBE3dzIAJBCndzaiARamo2AsiJAQuyBgIEfwF+QQAoAsCJASIAQQJ2QQ9xIgFBAnRBgIkBaiICIAIoAgBBfyAAQQN0IgB0QX9zcUGAASAAdHM2AgACQAJAAkAgAUEOSQ0AAkAgAUEORw0AQQBBADYCvIkBC0GAiQEQA0EAIQIMAQsgAUENRg0BIAFBAWohAgsgAiEDAkBBBiACa0EHcSIARQ0AIAIgAGohAyACQQJ0QYCJAWohAQNAIAFBADYCACABQQRqIQEgAEF/aiIADQALCyACQXlqQQdJDQAgA0ECdCEBA0AgAUGYiQFqQgA3AgAgAUGQiQFqQgA3AgAgAUGIiQFqQgA3AgAgAUGAiQFqQgA3AgAgAUEgaiIBQThHDQALC0EAIQFBAEEAKQPAiQEiBKciAEEbdCAAQQt0QYCA/AdxciAAQQV2QYD+A3EgAEEDdEEYdnJyNgK8iQFBACAEQh2IpyIAQRh0IABBgP4DcUEIdHIgAEEIdkGA/gNxIABBGHZycjYCuIkBQYCJARADQQBBACgC5IkBIgBBGHQgAEGA/gNxQQh0ciAAQQh2QYD+A3EgAEEYdnJyNgLkiQFBAEEAKALgiQEiAEEYdCAAQYD+A3FBCHRyIABBCHZBgP4DcSAAQRh2cnI2AuCJAUEAQQAoAtyJASIAQRh0IABBgP4DcUEIdHIgAEEIdkGA/gNxIABBGHZycjYC3IkBQQBBACgC2IkBIgBBGHQgAEGA/gNxQQh0ciAAQQh2QYD+A3EgAEEYdnJyNgLYiQFBAEEAKALUiQEiAEEYdCAAQYD+A3FBCHRyIABBCHZBgP4DcSAAQRh2cnI2AtSJAUEAQQAoAtCJASIAQRh0IABBgP4DcUEIdHIgAEEIdkGA/gNxIABBGHZycjYC0IkBQQBBACgCzIkBIgBBGHQgAEGA/gNxQQh0ciAAQQh2QYD+A3EgAEEYdnJyNgLMiQFBAEEAKALIiQEiAEEYdCAAQYD+A3FBCHRyIABBCHZBgP4DcSAAQRh2cnI2AsiJAQJAQQAoAuiJASICRQ0AQQAhAANAIAFBgAlqIAFByIkBai0AADoAACABQQFqIQEgAiAAQQFqIgBB/wFxSw0ACwsLBgBBgIkBC6MBAEEAQgA3A8CJAUEAQRxBICABQeABRiIBGzYC6IkBQQBCp5/mp8b0k/2+f0Krs4/8kaOz8NsAIAEbNwPgiQFBAEKxloD+n6KFrOgAQv+kuYjFkdqCm38gARs3A9iJAUEAQpe6w4OTp5aHd0Ly5rvjo6f9p6V/IAEbNwPQiQFBAELYvZaI/KC1vjZC58yn0NbQ67O7fyABGzcDyIkBIAAQAhAECwsLAQBBgAgLBHAAAAA=`,hash:`8c18dd94`};new mt,new mt;function It(){return Pt(Ft,32).then(e=>{e.init(256);let t={init:()=>(e.init(256),t),update:n=>(e.update(n),t),digest:t=>e.digest(t),save:()=>e.save(),load:n=>(e.load(n),t),blockSize:64,digestSize:32};return t})}new mt,new mt,new mt,new mt,new mt,new mt,new mt,new mt,new mt;var Lt=`pi-forge/auth-token`,Rt=`pi-forge/auth-expires-at`,zt=`pi-forge/auth-must-change-password`;function Bt(){let e=localStorage.getItem(Lt),t=localStorage.getItem(Rt);if(!(!e||!t)){if(new Date(t).getTime()<=Date.now()){Ht();return}return{token:e,expiresAt:t,mustChangePassword:localStorage.getItem(zt)===`true`}}}function Vt(e){localStorage.setItem(Lt,e.token),localStorage.setItem(Rt,e.expiresAt),localStorage.setItem(zt,e.mustChangePassword?`true`:`false`)}function Ht(){localStorage.removeItem(Lt),localStorage.removeItem(Rt),localStorage.removeItem(zt)}var Ut=`pi-forge:unauthorized`,M=class extends Error{status;code;constructor(e,t,n){super(n??`${e} ${t}`),this.status=e,this.code=t}};function Wt(e){let t=()=>e();return window.addEventListener(Ut,t),()=>window.removeEventListener(Ut,t)}function N(e,t){throw new M(e,`invalid_response_body`,t)}function P(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var Gt=(e,t)=>{e!==void 0&&N(t,`expected empty body`)};function Kt(e,t){return(!P(e)||typeof e.authEnabled!=`boolean`)&&N(t,`expected { authEnabled: boolean }`),{authEnabled:e.authEnabled}}function qt(e,t){return(!P(e)||typeof e.token!=`string`||typeof e.expiresAt!=`string`||typeof e.mustChangePassword!=`boolean`)&&N(t,`expected { token, expiresAt, mustChangePassword }`),{token:e.token,expiresAt:e.expiresAt,mustChangePassword:e.mustChangePassword}}function Jt(e,t){return qt(e,t)}function Yt(e,t){(!P(e)||typeof e.minimal!=`boolean`||typeof e.workspaceRoot!=`string`)&&N(t,`expected { minimal: boolean, workspaceRoot: string }`);let n=typeof e.version==`string`?e.version:`unknown`,r=typeof e.passwordAuthEnabled==`boolean`?e.passwordAuthEnabled:!0;return{minimal:e.minimal,workspaceRoot:e.workspaceRoot,version:n,passwordAuthEnabled:r}}function Xt(e,t){return(!P(e)||e.status!==`ok`||typeof e.activeSessions!=`number`||typeof e.activePtys!=`number`)&&N(t,`expected { status: 'ok', activeSessions, activePtys }`),{status:`ok`,activeSessions:e.activeSessions,activePtys:e.activePtys}}function Zt(e,t){return(!P(e)||typeof e.id!=`string`||typeof e.name!=`string`||typeof e.path!=`string`||typeof e.createdAt!=`string`)&&N(t,`expected Project`),{id:e.id,name:e.name,path:e.path,createdAt:e.createdAt}}function Qt(e,t){return(!P(e)||!Array.isArray(e.projects))&&N(t,`expected { projects: Project[] }`),{projects:e.projects.map(e=>Zt(e,t))}}function $t(e,t){return(!P(e)||typeof e.name!=`string`||typeof e.path!=`string`||typeof e.isGitRepo!=`boolean`)&&N(t,`expected BrowseEntry`),{name:e.name,path:e.path,isGitRepo:e.isGitRepo}}function en(e,t){return(!P(e)||typeof e.path!=`string`||!(e.parentPath===null||e.parentPath===void 0||typeof e.parentPath==`string`)||!Array.isArray(e.entries))&&N(t,`expected BrowseResponse`),{path:e.path,parentPath:typeof e.parentPath==`string`?e.parentPath:null,entries:e.entries.map(e=>$t(e,t))}}function tn(e,t){return(!P(e)||typeof e.path!=`string`)&&N(t,`expected { path }`),{path:e.path}}function nn(e,t){(!P(e)||typeof e.sessionId!=`string`||typeof e.projectId!=`string`||typeof e.isLive!=`boolean`||typeof e.workspacePath!=`string`||typeof e.lastActivityAt!=`string`||typeof e.createdAt!=`string`||typeof e.messageCount!=`number`||typeof e.firstMessage!=`string`)&&N(t,`expected UnifiedSession`);let n={sessionId:e.sessionId,projectId:e.projectId,isLive:e.isLive,workspacePath:e.workspacePath,lastActivityAt:e.lastActivityAt,createdAt:e.createdAt,messageCount:e.messageCount,firstMessage:e.firstMessage};return typeof e.name==`string`&&(n.name=e.name),typeof e.parentSessionId==`string`&&(n.parentSessionId=e.parentSessionId),typeof e.runId==`string`&&(n.runId=e.runId),typeof e.path==`string`&&(n.path=e.path),n}function rn(e,t){return(!P(e)||!Array.isArray(e.sessions))&&N(t,`expected { sessions: UnifiedSession[] }`),{sessions:e.sessions.map(e=>nn(e,t))}}function an(e,t){(!P(e)||typeof e.sessionId!=`string`||typeof e.projectId!=`string`||typeof e.workspacePath!=`string`||typeof e.createdAt!=`string`||typeof e.lastActivityAt!=`string`||typeof e.isLive!=`boolean`||typeof e.messageCount!=`number`||typeof e.isStreaming!=`boolean`)&&N(t,`expected SessionSummary`);let n={sessionId:e.sessionId,projectId:e.projectId,workspacePath:e.workspacePath,createdAt:e.createdAt,lastActivityAt:e.lastActivityAt,isLive:e.isLive,messageCount:e.messageCount,isStreaming:e.isStreaming};return typeof e.name==`string`&&(n.name=e.name),n}function on(e,t){return(!P(e)||e.accepted!==!0)&&N(t,`expected { accepted: true }`),{accepted:!0}}function sn(e,t){(!P(e)||typeof e.name!=`string`||typeof e.description!=`string`||e.source!==`global`&&e.source!==`project`&&e.source!==`extension`||typeof e.filePath!=`string`||typeof e.enabled!=`boolean`||typeof e.effective!=`boolean`||typeof e.disableModelInvocation!=`boolean`)&&N(t,`expected SkillSummary`);let n={name:e.name,description:e.description,source:e.source,filePath:e.filePath,enabled:e.enabled,effective:e.effective,disableModelInvocation:e.disableModelInvocation};return typeof e.extensionPath==`string`&&(n.extensionPath=e.extensionPath),(e.projectOverride===`enabled`||e.projectOverride===`disabled`)&&(n.projectOverride=e.projectOverride),n}function cn(e,t){return(!P(e)||!Array.isArray(e.skills))&&N(t,`expected { skills: SkillSummary[] }`),{skills:e.skills.map(e=>sn(e,t))}}function ln(e,t){(!P(e)||!Array.isArray(e.skills)||!Array.isArray(e.diagnostics))&&N(t,`expected { skills: SkillSummary[], diagnostics: SkillDiagnostic[] }`);let n=[];for(let t of e.diagnostics){if(!P(t)||t.type!==`warning`&&t.type!==`error`&&t.type!==`collision`||typeof t.message!=`string`)continue;let e={type:t.type,message:t.message};typeof t.path==`string`&&(e.path=t.path),P(t.collision)&&typeof t.collision.resourceType==`string`&&typeof t.collision.name==`string`&&typeof t.collision.winnerPath==`string`&&typeof t.collision.loserPath==`string`&&(e.collision={resourceType:t.collision.resourceType,name:t.collision.name,winnerPath:t.collision.winnerPath,loserPath:t.collision.loserPath}),n.push(e)}return{skills:e.skills.map(e=>sn(e,t)),diagnostics:n}}function un(e,t){(!P(e)||!P(e.projects))&&N(t,`expected { projects: { ... } }`);let n={};for(let[t,r]of Object.entries(e.projects))P(r)&&(n[t]={enable:Array.isArray(r.enable)?r.enable.filter(e=>typeof e==`string`):[],disable:Array.isArray(r.disable)?r.disable.filter(e=>typeof e==`string`):[]});return{projects:n}}function dn(e,t){(!P(e)||typeof e.name!=`string`||typeof e.description!=`string`||e.source!==`global`&&e.source!==`project`||typeof e.filePath!=`string`||typeof e.enabled!=`boolean`||typeof e.effective!=`boolean`)&&N(t,`expected PromptSummary`);let n={name:e.name,description:e.description,source:e.source,filePath:e.filePath,enabled:e.enabled,effective:e.effective};return typeof e.argumentHint==`string`&&(n.argumentHint=e.argumentHint),(e.projectOverride===`enabled`||e.projectOverride===`disabled`)&&(n.projectOverride=e.projectOverride),n}function fn(e,t){return(!P(e)||!Array.isArray(e.prompts))&&N(t,`expected { prompts: PromptSummary[] }`),{prompts:e.prompts.map(e=>dn(e,t))}}function pn(e,t){(!P(e)||!Array.isArray(e.prompts)||!Array.isArray(e.diagnostics))&&N(t,`expected { prompts: PromptSummary[], diagnostics: SkillDiagnostic[] }`);let n=[];for(let t of e.diagnostics){if(!P(t)||t.type!==`warning`&&t.type!==`error`&&t.type!==`collision`||typeof t.message!=`string`)continue;let e={type:t.type,message:t.message};typeof t.path==`string`&&(e.path=t.path),P(t.collision)&&typeof t.collision.resourceType==`string`&&typeof t.collision.name==`string`&&typeof t.collision.winnerPath==`string`&&typeof t.collision.loserPath==`string`&&(e.collision={resourceType:t.collision.resourceType,name:t.collision.name,winnerPath:t.collision.winnerPath,loserPath:t.collision.loserPath}),n.push(e)}return{prompts:e.prompts.map(e=>dn(e,t)),diagnostics:n}}var mn=un;function hn(e,t){return(!P(e)||!Array.isArray(e.providers))&&N(t,`expected { providers: [...] }`),{providers:e.providers}}function gn(e,t){return(!P(e)||!P(e.servers)||!Array.isArray(e.status))&&N(t,`expected { servers, status[] }`),e}function _n(e,t){return(!P(e)||typeof e.enabled!=`boolean`||typeof e.connected!=`number`||typeof e.total!=`number`)&&N(t,`expected { enabled, connected, total }`),{enabled:e.enabled,connected:e.connected,total:e.total}}function vn(e,t){return(!P(e)||!P(e.status))&&N(t,`expected { status: {...} }`),{status:e.status}}function yn(e,t){return(!P(e)||!Array.isArray(e.tools))&&N(t,`expected { tools: [...] }`),{tools:e.tools}}function bn(e,t){return(!P(e)||e.ok!==!0)&&N(t,`expected { ok: true }`),{ok:!0}}function xn(e,t){return(!P(e)||typeof e.removed!=`boolean`)&&N(t,`expected { removed: boolean }`),{removed:e.removed}}function Sn(e,t){return(!P(e)||typeof e.id!=`string`||typeof e.name!=`string`)&&N(t,`expected QuickAction shape`),e}function Cn(e,t){return(!P(e)||!Array.isArray(e.actions))&&N(t,`expected { actions: [...] }`),{actions:e.actions}}function wn(e,t){(!P(e)||typeof e.success!=`boolean`||typeof e.stdout!=`string`||typeof e.stderr!=`string`||typeof e.durationMs!=`number`||typeof e.timedOut!=`boolean`||typeof e.truncated!=`boolean`)&&N(t,`expected QuickActionRunResult shape`);let n=e.exitCode;return{success:e.success,exitCode:typeof n==`number`?n:null,stdout:e.stdout,stderr:e.stderr,durationMs:e.durationMs,timedOut:e.timedOut,truncated:e.truncated}}function Tn(e,t){return(!P(e)||!Array.isArray(e.processes))&&N(t,`expected { processes: [...] }`),{processes:e.processes}}function En(e,t){return(!P(e)||!Array.isArray(e.stdout)||!Array.isArray(e.stderr)||typeof e.status!=`string`)&&N(t,`expected { stdout, stderr, status }`),{stdout:e.stdout,stderr:e.stderr,status:e.status}}function Dn(e,t){(!P(e)||typeof e.ok!=`boolean`)&&N(t,`expected { ok: boolean }`);let n={ok:e.ok};return typeof e.reason==`string`&&(n.reason=e.reason),n}function On(e,t){return(!P(e)||!Array.isArray(e.tasks)||typeof e.nextId!=`number`)&&N(t,`expected { tasks: [...], nextId: number }`),{tasks:e.tasks,nextId:e.nextId}}function kn(e,t){return(!P(e)||!P(e.providers))&&N(t,`expected { providers: { ... } }`),e}function An(e,t){return P(e)||N(t,`expected settings object`),e}function jn(e,t){return(!P(e)||!P(e.providers))&&N(t,`expected { providers: {...} }`),e}function Mn(e,t){P(e)||N(t,`expected FileTreeNode`);let n=e.type;(typeof e.name!=`string`||typeof e.path!=`string`||n!==`file`&&n!==`directory`)&&N(t,`expected FileTreeNode`);let r={name:e.name,path:e.path,type:n};return Array.isArray(e.children)&&(r.children=e.children.map(e=>Mn(e,t))),typeof e.truncated==`boolean`&&(r.truncated=e.truncated),r}function Nn(e,t){return(!P(e)||typeof e.path!=`string`||typeof e.content!=`string`||typeof e.size!=`number`||typeof e.language!=`string`||typeof e.binary!=`boolean`)&&N(t,`expected FileReadResponse`),{path:e.path,content:e.content,size:e.size,language:e.language,binary:e.binary}}function Pn(e,t){return(!P(e)||!Array.isArray(e.entries))&&N(t,`expected { entries: TurnDiffEntry[] }`),{entries:e.entries.map(e=>((!P(e)||typeof e.file!=`string`||e.tool!==`write`&&e.tool!==`edit`||typeof e.diff!=`string`||typeof e.additions!=`number`||typeof e.deletions!=`number`||typeof e.isPureAddition!=`boolean`)&&N(t,`expected TurnDiffEntry`),{file:e.file,tool:e.tool,diff:e.diff,additions:e.additions,deletions:e.deletions,isPureAddition:e.isPureAddition}))}}function Fn(e,t){(!P(e)||typeof e.isGitRepo!=`boolean`||!Array.isArray(e.files))&&N(t,`expected GitStatus`);let n={isGitRepo:e.isGitRepo,files:e.files.map(e=>{(!P(e)||typeof e.path!=`string`||typeof e.staged!=`boolean`||typeof e.unstaged!=`boolean`||typeof e.kind!=`string`||typeof e.code!=`string`)&&N(t,`expected GitFileStatus`);let n={path:e.path,staged:e.staged,unstaged:e.unstaged,kind:e.kind,code:e.code};return typeof e.originalPath==`string`&&(n.originalPath=e.originalPath),n})};return typeof e.branch==`string`&&(n.branch=e.branch),n}function In(e,t){return(!P(e)||typeof e.isGitRepo!=`boolean`||typeof e.diff!=`string`)&&N(t,`expected GitDiffResponse`),{isGitRepo:e.isGitRepo,diff:e.diff}}function Ln(e,t){return(!P(e)||typeof e.isGitRepo!=`boolean`||!Array.isArray(e.commits))&&N(t,`expected GitLogResponse`),{isGitRepo:e.isGitRepo,commits:e.commits.map(e=>((!P(e)||typeof e.hash!=`string`||typeof e.message!=`string`||typeof e.author!=`string`||typeof e.date!=`string`||!Array.isArray(e.parents)||!Array.isArray(e.refs))&&N(t,`expected GitLogEntry`),{hash:e.hash,message:e.message,author:e.author,date:e.date,parents:e.parents.filter(e=>typeof e==`string`),refs:e.refs.filter(e=>typeof e==`string`)}))}}function Rn(e,t){(!P(e)||typeof e.isGitRepo!=`boolean`||!Array.isArray(e.branches))&&N(t,`expected GitBranchesResponse`);let n={isGitRepo:e.isGitRepo,branches:e.branches.map(e=>((!P(e)||typeof e.name!=`string`||typeof e.current!=`boolean`||typeof e.remote!=`boolean`)&&N(t,`expected GitBranch`),{name:e.name,current:e.current,remote:e.remote}))};return typeof e.current==`string`&&(n.current=e.current),n}function zn(e,t){(!P(e)||!Array.isArray(e.messages)||typeof e.totalInputTokens!=`number`||typeof e.totalOutputTokens!=`number`||typeof e.totalCacheReadTokens!=`number`||typeof e.totalCacheWriteTokens!=`number`||typeof e.totalTokens!=`number`||typeof e.totalCost!=`number`||!Array.isArray(e.turns)||!P(e.contextUsage))&&N(t,`expected SessionContextResponse`);let n=e.turns.map(e=>{(!P(e)||typeof e.index!=`number`||typeof e.inputTokens!=`number`||typeof e.outputTokens!=`number`||typeof e.cacheReadTokens!=`number`||typeof e.cacheWriteTokens!=`number`||typeof e.totalTokens!=`number`||typeof e.cost!=`number`||typeof e.model!=`string`||typeof e.provider!=`string`||typeof e.timestamp!=`number`)&&N(t,`expected ContextTurn`);let n={index:e.index,inputTokens:e.inputTokens,outputTokens:e.outputTokens,cacheReadTokens:e.cacheReadTokens,cacheWriteTokens:e.cacheWriteTokens,totalTokens:e.totalTokens,cost:e.cost,model:e.model,provider:e.provider,timestamp:e.timestamp};return typeof e.stopReason==`string`&&(n.stopReason=e.stopReason),n}),r=e.contextUsage,i={contextWindow:typeof r.contextWindow==`number`?r.contextWindow:0};return typeof r.tokens==`number`&&(i.tokens=r.tokens),typeof r.percent==`number`&&(i.percent=r.percent),{messages:e.messages.filter(e=>P(e)),totalInputTokens:e.totalInputTokens,totalOutputTokens:e.totalOutputTokens,totalCacheReadTokens:e.totalCacheReadTokens,totalCacheWriteTokens:e.totalCacheWriteTokens,totalTokens:e.totalTokens,totalCost:e.totalCost,turns:n,contextUsage:i}}function Bn(e,t){(!P(e)||!(e.leafId===null||typeof e.leafId==`string`)||!Array.isArray(e.branchIds)||!Array.isArray(e.entries))&&N(t,`expected SessionTreeResponse`);let n=e.branchIds.filter(e=>typeof e==`string`),r=e.entries.map(e=>{(!P(e)||typeof e.id!=`string`||!(e.parentId===null||typeof e.parentId==`string`)||typeof e.type!=`string`||typeof e.timestamp!=`string`)&&N(t,`expected SessionTreeEntry`);let n={id:e.id,parentId:e.parentId,type:e.type,timestamp:e.timestamp};return typeof e.role==`string`&&(n.role=e.role),typeof e.preview==`string`&&(n.preview=e.preview),typeof e.label==`string`&&(n.label=e.label),n});return{leafId:e.leafId,branchIds:n,entries:r}}function Vn(e,t){return(!P(e)||!Array.isArray(e.files))&&N(t,`expected { files: UploadedFile[] }`),{files:e.files.map(e=>((!P(e)||typeof e.path!=`string`||typeof e.size!=`number`||typeof e.sha256!=`string`)&&N(t,`expected UploadedFile`),{path:e.path,size:e.size,sha256:e.sha256}))}}function Hn(e,t){return(!P(e)||e.engine!==`ripgrep`&&e.engine!==`node`||typeof e.truncated!=`boolean`||!Array.isArray(e.matches))&&N(t,`expected SearchResponse`),{engine:e.engine,truncated:e.truncated,matches:e.matches.map(e=>((!P(e)||typeof e.path!=`string`||typeof e.line!=`number`||typeof e.column!=`number`||typeof e.length!=`number`||typeof e.lineSnippet!=`string`)&&N(t,`expected SearchMatch`),{path:e.path,line:e.line,column:e.column,length:e.length,lineSnippet:e.lineSnippet}))}}function Un(e,t){return(!P(e)||e.engine!==`ripgrep`&&e.engine!==`node`||typeof e.truncated!=`boolean`||!Array.isArray(e.results))&&N(t,`expected SessionSearchResponse`),{engine:e.engine,truncated:e.truncated,results:e.results.map(e=>{(!P(e)||typeof e.sessionId!=`string`||typeof e.projectId!=`string`||typeof e.projectName!=`string`||typeof e.modifiedAt!=`string`||!Array.isArray(e.matches))&&N(t,`expected SessionSearchGroup`);let n={sessionId:e.sessionId,projectId:e.projectId,projectName:e.projectName,modifiedAt:e.modifiedAt,matches:e.matches.map(e=>{(!P(e)||typeof e.messageIndex!=`number`||e.kind!==`user`&&e.kind!==`assistant`&&e.kind!==`tool_call`||typeof e.snippet!=`string`||typeof e.matchOffset!=`number`||typeof e.matchLength!=`number`)&&N(t,`expected SessionSearchMatch`);let n={messageIndex:e.messageIndex,kind:e.kind,snippet:e.snippet,matchOffset:e.matchOffset,matchLength:e.matchLength};return typeof e.messageEnvelopeId==`string`&&(n.messageEnvelopeId=e.messageEnvelopeId),n})};return typeof e.sessionName==`string`&&(n.sessionName=e.sessionName),n})}}function Wn(e,t){return(!P(e)||typeof e.isGitRepo!=`boolean`||!Array.isArray(e.remotes))&&N(t,`expected GitRemotesResponse`),{isGitRepo:e.isGitRepo,remotes:e.remotes.map(e=>((!P(e)||typeof e.name!=`string`||typeof e.fetchUrl!=`string`||typeof e.pushUrl!=`string`)&&N(t,`expected GitRemote`),{name:e.name,fetchUrl:e.fetchUrl,pushUrl:e.pushUrl}))}}function Gn(e,t){return(!P(e)||typeof e.path!=`string`)&&N(t,`expected { path: string }`),{path:e.path}}async function Kn(e,t){let n=await It();n.init();let r=e.stream().getReader(),i=!1;try{for(;;){let{value:e,done:i}=await r.read();if(i)break;n.update(e),t?.(e.byteLength)}}catch(e){throw i=!0,await r.cancel().catch(()=>void 0),e}finally{i||r.releaseLock()}return n.digest(`hex`)}function qn(e){let t=/filename\*=UTF-8''([^;\r\n]+)/i.exec(e);if(t!==null)try{return decodeURIComponent(t[1])}catch{}let n=/filename="([^"]+)"/i.exec(e)??/filename=([^;\r\n]+)/i.exec(e);if(n!==null)return n[1]}function Jn(e){if(e===``)return{ok:!0,value:void 0};try{return{ok:!0,value:JSON.parse(e)}}catch{return{ok:!1}}}async function F(e,t,n={}){let r={Accept:`application/json`};if(!n.skipAuth){let e=Bt();e&&(r.Authorization=`Bearer ${e.token}`)}let i=n.body instanceof FormData;n.body!==void 0&&!i&&(r[`Content-Type`]=`application/json`);let a={method:n.method??`GET`,headers:r};n.body!==void 0&&(a.body=i?n.body:JSON.stringify(n.body)),n.signal!==void 0&&(a.signal=n.signal);let o;try{o=await fetch(e,a)}catch(e){throw e instanceof Error&&e.name===`AbortError`?e:new M(0,`network_error`,e.message)}o.status===401&&!n.skipAuth&&(Ht(),window.dispatchEvent(new Event(Ut)));let s=Jn(await o.text());if(!o.ok){let e;throw e=s.ok&&P(s.value)&&`error`in s.value?String(s.value.error):s.ok?`request_failed`:`invalid_error_body`,new M(o.status,e,s.ok?void 0:`non-JSON ${o.status} body`)}if(!s.ok)throw new M(o.status,`invalid_response_body`,`server returned non-JSON 2xx body`);return t(s.value,o.status)}var I={authStatus:()=>F(`/api/v1/auth/status`,Kt,{skipAuth:!0}),login:e=>F(`/api/v1/auth/login`,qt,{method:`POST`,body:{password:e},skipAuth:!0}),changePassword:(e,t)=>F(`/api/v1/auth/change-password`,Jt,{method:`POST`,body:{currentPassword:e,newPassword:t}}),health:()=>F(`/api/v1/health`,Xt,{skipAuth:!0}),uiConfig:()=>F(`/api/v1/ui-config`,Yt,{skipAuth:!0}),listProjects:()=>F(`/api/v1/projects`,Qt),createProject:(e,t)=>F(`/api/v1/projects`,Zt,{method:`POST`,body:{name:e,path:t}}),renameProject:(e,t)=>F(`/api/v1/projects/${encodeURIComponent(e)}`,Zt,{method:`PATCH`,body:{name:t}}),deleteProject:(e,t)=>{let n=t?.cascade===!0?`?cascade=1`:``;return F(`/api/v1/projects/${encodeURIComponent(e)}${n}`,(e,t)=>((!P(e)||typeof e.cascaded!=`boolean`)&&N(t,`expected { cascaded }`),{cascaded:e.cascaded}),{method:`DELETE`})},browse:e=>F(`/api/v1/projects/browse${e===void 0?``:`?path=${encodeURIComponent(e)}`}`,en),getProjectSystemPrompt:e=>F(`/api/v1/projects/${encodeURIComponent(e)}/system-prompt`,(e,t)=>((!P(e)||typeof e.addendum!=`string`||typeof e.maxBytes!=`number`)&&N(t,`expected { addendum: string, maxBytes: number }`),{addendum:e.addendum,maxBytes:e.maxBytes})),setProjectSystemPrompt:(e,t)=>F(`/api/v1/projects/${encodeURIComponent(e)}/system-prompt`,(e,t)=>((!P(e)||typeof e.addendum!=`string`||typeof e.maxBytes!=`number`)&&N(t,`expected { addendum: string, maxBytes: number }`),{addendum:e.addendum,maxBytes:e.maxBytes}),{method:`PUT`,body:{addendum:t}}),mkdir:(e,t)=>F(`/api/v1/projects/browse/mkdir`,tn,{method:`POST`,body:{parentPath:e,name:t}}),listSessions:e=>F(`/api/v1/sessions${e===void 0?``:`?projectId=${encodeURIComponent(e)}`}`,rn),createSession:e=>F(`/api/v1/sessions`,an,{method:`POST`,body:{projectId:e}}),getSession:e=>F(`/api/v1/sessions/${encodeURIComponent(e)}`,an),getMessages:e=>F(`/api/v1/sessions/${encodeURIComponent(e)}/messages`,(e,t)=>((!P(e)||!Array.isArray(e.messages))&&N(t,`expected { messages: [...] }`),{messages:e.messages})),getCompactions:e=>F(`/api/v1/sessions/${encodeURIComponent(e)}/compactions`,(e,t)=>((!P(e)||!Array.isArray(e.compactions))&&N(t,`expected { compactions: [...] }`),{compactions:e.compactions})),disposeSession:(e,t)=>{let n=t?.hard===!0?`?hard=1`:``;return F(`/api/v1/sessions/${encodeURIComponent(e)}${n}`,Gt,{method:`DELETE`})},renameSession:(e,t)=>F(`/api/v1/sessions/${encodeURIComponent(e)}/name`,an,{method:`POST`,body:{name:t}}),getSessionContext:(e,t)=>F(`/api/v1/sessions/${encodeURIComponent(e)}/context`,zn,t===void 0?{}:{signal:t}),getSessionTree:e=>F(`/api/v1/sessions/${encodeURIComponent(e)}/tree`,Bn),navigateSession:(e,t,n)=>{let r={entryId:t};return n?.summarize!==void 0&&(r.summarize=n.summarize),n?.customInstructions!==void 0&&(r.customInstructions=n.customInstructions),n?.label!==void 0&&(r.label=n.label),F(`/api/v1/sessions/${encodeURIComponent(e)}/navigate`,(e,t)=>(P(e)||N(t,`expected navigate result`),e),{method:`POST`,body:r})},forkSession:(e,t)=>F(`/api/v1/sessions/${encodeURIComponent(e)}/fork`,an,{method:`POST`,body:{entryId:t}}),getTurnDiff:e=>F(`/api/v1/sessions/${encodeURIComponent(e)}/turn-diff`,Pn),prompt:(e,t,n)=>{let r=`/api/v1/sessions/${encodeURIComponent(e)}/prompt`;if(n?.attachments!==void 0&&n.attachments.length>0){let e=new FormData;e.append(`text`,t),n.streamingBehavior!==void 0&&e.append(`streamingBehavior`,n.streamingBehavior);for(let t of n.attachments)e.append(`attachments`,t,t.name);return F(r,on,{method:`POST`,body:e})}let i={text:t};return n?.streamingBehavior!==void 0&&(i.streamingBehavior=n.streamingBehavior),F(r,on,{method:`POST`,body:i})},steer:(e,t,n)=>{let r={text:t};return n!==void 0&&(r.mode=n),F(`/api/v1/sessions/${encodeURIComponent(e)}/steer`,on,{method:`POST`,body:r})},abort:e=>F(`/api/v1/sessions/${encodeURIComponent(e)}/abort`,Gt,{method:`POST`}),compact:e=>F(`/api/v1/sessions/${encodeURIComponent(e)}/compact`,(e,t)=>(P(e)||N(t,`expected compact result object`),{summary:typeof e.summary==`string`?e.summary:void 0,tokensBefore:typeof e.tokensBefore==`number`?e.tokensBefore:void 0,tokensAfter:typeof e.tokensAfter==`number`?e.tokensAfter:void 0}),{method:`POST`,body:{}}),exec:(e,t,n)=>F(`/api/v1/sessions/${encodeURIComponent(e)}/exec`,(e,t)=>((!P(e)||!(`exitCode`in e)||typeof e.output!=`string`||typeof e.durationMs!=`number`||typeof e.truncated!=`boolean`||typeof e.cancelled!=`boolean`)&&N(t,`expected { exitCode, output, durationMs, truncated, cancelled }`),{exitCode:typeof e.exitCode==`number`?e.exitCode:null,output:e.output,durationMs:e.durationMs,truncated:e.truncated,cancelled:e.cancelled}),{method:`POST`,body:{command:t,excludeFromContext:n?.excludeFromContext===!0}}),setModel:(e,t,n)=>F(`/api/v1/sessions/${encodeURIComponent(e)}/model`,(e,t)=>((!P(e)||typeof e.provider!=`string`||typeof e.modelId!=`string`)&&N(t,`expected { provider, modelId }`),{provider:e.provider,modelId:e.modelId}),{method:`POST`,body:{provider:t,modelId:n}}),getModelsJson:()=>F(`/api/v1/config/models`,jn),setModelsJson:e=>F(`/api/v1/config/models`,jn,{method:`PUT`,body:e}),getProviders:()=>F(`/api/v1/config/providers`,hn),getSettings:()=>F(`/api/v1/config/settings`,An),updateSettings:e=>F(`/api/v1/config/settings`,An,{method:`PUT`,body:e}),getAuthSummary:()=>F(`/api/v1/config/auth`,kn),setApiKey:(e,t)=>F(`/api/v1/config/auth/${encodeURIComponent(e)}`,(e,t)=>((!P(e)||typeof e.provider!=`string`||e.configured!==!0)&&N(t,`expected { provider, configured: true }`),{provider:e.provider,configured:!0}),{method:`PUT`,body:{apiKey:t}}),removeApiKey:e=>F(`/api/v1/config/auth/${encodeURIComponent(e)}`,Gt,{method:`DELETE`}),getMcpSettings:()=>F(`/api/v1/mcp/settings`,_n),setMcpEnabled:e=>F(`/api/v1/mcp/settings`,_n,{method:`PUT`,body:{enabled:e}}),listMcpServers:e=>F(`/api/v1/mcp/servers${e===void 0?``:`?projectId=${encodeURIComponent(e)}`}`,gn),upsertMcpServer:(e,t)=>F(`/api/v1/mcp/servers/${encodeURIComponent(e)}`,bn,{method:`PUT`,body:t}),deleteMcpServer:e=>F(`/api/v1/mcp/servers/${encodeURIComponent(e)}`,xn,{method:`DELETE`}),probeMcpServer:(e,t)=>{let n=t===void 0?``:`?projectId=${encodeURIComponent(t)}`;return F(`/api/v1/mcp/servers/${encodeURIComponent(e)}/probe${n}`,vn,{method:`POST`,body:{}})},listMcpTools:e=>F(`/api/v1/mcp/tools?projectId=${encodeURIComponent(e)}`,yn),grantStdioMcpTrust:e=>F(`/api/v1/mcp/trust/${encodeURIComponent(e)}`,(e,t)=>((!P(e)||typeof e.trusted!=`boolean`||!Array.isArray(e.status))&&N(t,`expected { trusted, status }`),{trusted:e.trusted,status:e.status}),{method:`POST`,body:{}}),revokeStdioMcpTrust:e=>F(`/api/v1/mcp/trust/${encodeURIComponent(e)}`,(e,t)=>((!P(e)||typeof e.trusted!=`boolean`)&&N(t,`expected { trusted }`),{trusted:e.trusted}),{method:`DELETE`}),listQuickActions:()=>F(`/api/v1/quick-actions`,Cn),createQuickAction:e=>F(`/api/v1/quick-actions`,Sn,{method:`POST`,body:e}),updateQuickAction:(e,t)=>F(`/api/v1/quick-actions/${encodeURIComponent(e)}`,Sn,{method:`PUT`,body:t}),deleteQuickAction:e=>F(`/api/v1/quick-actions/${encodeURIComponent(e)}`,Gt,{method:`DELETE`}),runQuickAction:(e,t)=>F(`/api/v1/quick-actions/${encodeURIComponent(e)}/run`,wn,{method:`POST`,body:{projectId:t}}),submitAskUserQuestionAnswer:(e,t)=>F(`/api/v1/sessions/${encodeURIComponent(e)}/ask-user-question/answer`,Gt,{method:`POST`,body:t}),cancelAskUserQuestion:(e,t)=>F(`/api/v1/sessions/${encodeURIComponent(e)}/ask-user-question/answer`,Gt,{method:`POST`,body:{requestId:t,cancelled:!0,answers:[]}}),listTodos:e=>F(`/api/v1/sessions/${encodeURIComponent(e)}/todos`,On),listProcesses:e=>F(`/api/v1/sessions/${encodeURIComponent(e)}/processes`,Tn),getProcessOutput:(e,t,n)=>{let r=n===void 0?``:`?tail=${n}`;return F(`/api/v1/sessions/${encodeURIComponent(e)}/processes/${encodeURIComponent(t)}/output${r}`,En)},processLogFileUrl:(e,t,n)=>`/api/v1/sessions/${encodeURIComponent(e)}/processes/${encodeURIComponent(t)}/logs/file?stream=${n}`,killProcess:(e,t)=>F(`/api/v1/sessions/${encodeURIComponent(e)}/processes/${encodeURIComponent(t)}/kill`,Dn,{method:`POST`,body:{}}),clearProcesses:e=>F(`/api/v1/sessions/${encodeURIComponent(e)}/processes`,(e,t)=>((!P(e)||typeof e.cleared!=`number`)&&N(t,`expected { cleared: number }`),{cleared:e.cleared}),{method:`DELETE`}),writeProcessStdin:(e,t,n)=>F(`/api/v1/sessions/${encodeURIComponent(e)}/processes/${encodeURIComponent(t)}/stdin`,Dn,{method:`POST`,body:n}),listSkills:e=>F(`/api/v1/config/skills?projectId=${encodeURIComponent(e)}`,ln),listSkillOverrides:()=>F(`/api/v1/config/skills/overrides`,un),setSkillEnabled:(e,t,n,r=`global`)=>F(`/api/v1/config/skills/${encodeURIComponent(t)}/enabled?projectId=${encodeURIComponent(e)}`,cn,{method:`PUT`,body:{enabled:n,scope:r}}),clearSkillProjectOverride:(e,t)=>F(`/api/v1/config/skills/${encodeURIComponent(t)}/enabled?projectId=${encodeURIComponent(e)}`,cn,{method:`DELETE`}),listPrompts:e=>F(`/api/v1/config/prompts?projectId=${encodeURIComponent(e)}`,pn),listPromptOverrides:()=>F(`/api/v1/config/prompts/overrides`,mn),setPromptEnabled:(e,t,n,r=`global`)=>F(`/api/v1/config/prompts/${encodeURIComponent(t)}/enabled?projectId=${encodeURIComponent(e)}`,fn,{method:`PUT`,body:{enabled:n,scope:r}}),clearPromptProjectOverride:(e,t)=>F(`/api/v1/config/prompts/${encodeURIComponent(t)}/enabled?projectId=${encodeURIComponent(e)}`,fn,{method:`DELETE`}),listTools:e=>F(`/api/v1/config/tools${e!==void 0&&e.length>0?`?projectId=${encodeURIComponent(e)}`:``}`,e=>{if(!P(e)||!Array.isArray(e.builtin)||!Array.isArray(e.mcp)||e.extension!==void 0&&!Array.isArray(e.extension))throw new M(0,`invalid_response_body`);let t=e;return t.extension===void 0&&(t.extension=[]),t}),setToolEnabled:(e,t,n,r=`global`,i)=>{let a=r===`project`&&i!==void 0?`?projectId=${encodeURIComponent(i)}`:``;return F(`/api/v1/config/tools/${e}/${encodeURIComponent(t)}/enabled${a}`,e=>{if(!P(e)||typeof e.family!=`string`||typeof e.name!=`string`||typeof e.enabled!=`boolean`||typeof e.scope!=`string`)throw new M(0,`invalid_response_body`);return{family:e.family,name:e.name,enabled:e.enabled,scope:e.scope}},{method:`PUT`,body:{enabled:n,scope:r}})},listToolOverrides:()=>F(`/api/v1/config/tools/overrides`,e=>{if(!P(e)||typeof e.projects!=`object`||e.projects===null)throw new M(0,`invalid_response_body`);let t=e.projects;for(let e of Object.values(t))(e.extension===void 0||e.extension===null)&&(e.extension={enable:[],disable:[]});return e}),clearToolProjectOverride:(e,t,n)=>F(`/api/v1/config/tools/${e}/${encodeURIComponent(t)}/enabled?projectId=${encodeURIComponent(n)}`,e=>{if(!P(e)||typeof e.family!=`string`||typeof e.name!=`string`||typeof e.projectId!=`string`)throw new M(0,`invalid_response_body`);return{family:e.family,name:e.name,projectId:e.projectId}},{method:`DELETE`}),exportConfig:async()=>{let e={},t=Bt();t!==void 0&&(e.Authorization=`Bearer ${t.token}`);let n=await fetch(`/api/v1/config/export`,{headers:e});if(n.status===401)throw Ht(),window.dispatchEvent(new Event(Ut)),new M(401,`unauthorized`);if(!n.ok){let e=`request_failed`;try{let t=await n.json();typeof t.error==`string`&&(e=t.error)}catch{}throw new M(n.status,e)}return{blob:await n.blob(),filename:qn(n.headers.get(`Content-Disposition`)??``)??`pi-forge-config.tar.gz`,files:(n.headers.get(`X-Pi-Forge-Files`)??``).split(`,`).filter(e=>e.length>0)}},importConfig:e=>{let t=new FormData;return t.append(`file`,e,e.name),F(`/api/v1/config/import`,e=>{if(!P(e)||!Array.isArray(e.imported)||!Array.isArray(e.skipped)||!Array.isArray(e.errors))throw new M(0,`invalid_response_body`);return e},{method:`POST`,body:t})},exportSkills:async()=>{let e={},t=Bt();t!==void 0&&(e.Authorization=`Bearer ${t.token}`);let n=await fetch(`/api/v1/config/skills/export`,{headers:e});if(n.status===401)throw Ht(),window.dispatchEvent(new Event(Ut)),new M(401,`unauthorized`);if(!n.ok){let e=`request_failed`;try{let t=await n.json();typeof t.error==`string`&&(e=t.error)}catch{}throw new M(n.status,e)}let r=await n.blob(),i=qn(n.headers.get(`Content-Disposition`)??``)??`pi-forge-skills.tar.gz`,a=n.headers.get(`X-Pi-Forge-File-Count`)??`0`;return{blob:r,filename:i,fileCount:Number.parseInt(a,10)||0}},exportSession:async(e,t)=>{let n={},r=Bt();r!==void 0&&(n.Authorization=`Bearer ${r.token}`);let i=await fetch(`/api/v1/sessions/${encodeURIComponent(e)}/export?format=${t}`,{headers:n});if(i.status===401)throw Ht(),window.dispatchEvent(new Event(Ut)),new M(401,`unauthorized`);if(!i.ok){let e=`request_failed`;try{let t=await i.json();typeof t.error==`string`&&(e=t.error)}catch{}throw new M(i.status,e)}let a=await i.blob(),o=i.headers.get(`Content-Disposition`)??``,s=t===`markdown`?`session.md`:`session.jsonl`;return{blob:a,filename:qn(o)??s}},importSkills:e=>{let t=new FormData;for(let n of e){let e=n.webkitRelativePath,r=e!==void 0&&e.length>0?e:n.name;t.append(`file`,n,r)}return F(`/api/v1/config/skills/import`,e=>{if(!P(e)||!Array.isArray(e.imported)||!Array.isArray(e.skipped))throw new M(0,`invalid_response_body`);return e},{method:`POST`,body:t})},filesTree:(e,t)=>{let n=new URLSearchParams({projectId:e});return t!==void 0&&n.set(`maxDepth`,String(t)),F(`/api/v1/files/tree?${n.toString()}`,Mn)},filesRead:(e,t)=>F(`/api/v1/files/read?${new URLSearchParams({projectId:e,path:t}).toString()}`,Nn),filesWrite:(e,t,n)=>F(`/api/v1/files/write`,Gn,{method:`PUT`,body:{projectId:e,path:t,content:n}}),filesMkdir:(e,t,n)=>F(`/api/v1/files/mkdir`,Gn,{method:`POST`,body:{projectId:e,parentPath:t,name:n}}),filesRename:(e,t,n)=>F(`/api/v1/files/rename`,Gn,{method:`POST`,body:{projectId:e,path:t,name:n}}),filesMove:(e,t,n)=>F(`/api/v1/files/move`,Gn,{method:`POST`,body:{projectId:e,src:t,dest:n}}),filesDelete:(e,t,n)=>{let r=new URLSearchParams({projectId:e,path:t});return n?.recursive===!0&&r.set(`recursive`,`true`),F(`/api/v1/files/delete?${r.toString()}`,Gt,{method:`DELETE`})},filesDownload:async(e,t)=>{let n=new URLSearchParams({projectId:e});t!==void 0&&t.length>0&&n.set(`path`,t);let r={},i=Bt();i!==void 0&&(r.Authorization=`Bearer ${i.token}`);let a=await fetch(`/api/v1/files/download?${n.toString()}`,{headers:r});if(a.status===401)throw Ht(),window.dispatchEvent(new Event(Ut)),new M(401,`unauthorized`);if(!a.ok){let e=`request_failed`;try{let t=await a.json();typeof t.error==`string`&&(e=t.error)}catch{}throw new M(a.status,e)}return{blob:await a.blob(),filename:qn(a.headers.get(`Content-Disposition`)??``)??`download`}},uploadFiles:async(e,t,n,r)=>{let i=new FormData;i.append(`projectId`,e),i.append(`parentPath`,t),r?.overwrite===!0&&i.append(`overwrite`,`1`);let a=n.reduce((e,t)=>e+t.size,0),o=0;for(let e of n){let t=await Kn(e,e=>{o+=e,r?.onHashProgress?.(o,a)});i.append(`sha256:${e.name}`,t)}for(let e of n)i.append(`files`,e,e.name);return F(`/api/v1/files/upload`,Vn,{method:`POST`,body:i,...r?.signal===void 0?{}:{signal:r.signal}})},completeFiles:(e,t,n)=>{let r=new URLSearchParams({projectId:e,query:t});return n?.limit!==void 0&&r.set(`limit`,String(n.limit)),F(`/api/v1/files/complete?${r.toString()}`,(e,t)=>((!P(e)||!Array.isArray(e.paths))&&N(t,`expected { paths: string[] }`),{paths:e.paths.filter(e=>typeof e==`string`)}),n?.signal===void 0?{}:{signal:n.signal})},searchFiles:(e,t,n)=>{let r=new URLSearchParams({projectId:e,q:t.query});return t.regex===!0&&r.set(`regex`,`1`),t.caseSensitive===!0&&r.set(`caseSensitive`,`1`),t.includeGitignored===!0&&r.set(`includeGitignored`,`1`),t.include!==void 0&&t.include.length>0&&r.set(`include`,t.include),t.exclude!==void 0&&t.exclude.length>0&&r.set(`exclude`,t.exclude),t.limit!==void 0&&r.set(`limit`,String(t.limit)),F(`/api/v1/files/search?${r.toString()}`,Hn,n===void 0?{}:{signal:n})},searchSessions:(e,t)=>{let n=new URLSearchParams({q:e});return t?.sessionLimit!==void 0&&n.set(`sessionLimit`,String(t.sessionLimit)),t?.matchesPerSession!==void 0&&n.set(`matchesPerSession`,String(t.matchesPerSession)),F(`/api/v1/search/sessions?${n.toString()}`,Un,t?.signal===void 0?{}:{signal:t.signal})},gitInit:e=>F(`/api/v1/git/init`,(e,t)=>((!P(e)||typeof e.alreadyInitialised!=`boolean`||typeof e.isGitRepo!=`boolean`)&&N(t,`expected { alreadyInitialised, isGitRepo }`),{alreadyInitialised:e.alreadyInitialised,isGitRepo:e.isGitRepo}),{method:`POST`,body:{projectId:e}}),gitStatus:e=>F(`/api/v1/git/status?projectId=${encodeURIComponent(e)}`,Fn),gitDiff:e=>F(`/api/v1/git/diff?projectId=${encodeURIComponent(e)}`,In),gitDiffStaged:e=>F(`/api/v1/git/diff/staged?projectId=${encodeURIComponent(e)}`,In),gitDiffFile:(e,t,n)=>{let r=new URLSearchParams({projectId:e,path:t});return n&&r.set(`staged`,`1`),F(`/api/v1/git/diff/file?${r.toString()}`,In)},gitLog:(e,t)=>{let n=new URLSearchParams({projectId:e});return t!==void 0&&n.set(`limit`,String(t)),F(`/api/v1/git/log?${n.toString()}`,Ln)},gitBranches:e=>F(`/api/v1/git/branches?projectId=${encodeURIComponent(e)}`,Rn),gitRemotes:e=>F(`/api/v1/git/remotes?projectId=${encodeURIComponent(e)}`,Wn),gitRemoteAdd:(e,t,n)=>F(`/api/v1/git/remote/add`,(e,t)=>((!P(e)||e.ok!==!0)&&N(t,`expected { ok: true }`),{ok:!0}),{method:`POST`,body:{projectId:e,name:t,url:n}}),gitRemoteRemove:(e,t)=>F(`/api/v1/git/remote/${encodeURIComponent(t)}?projectId=${encodeURIComponent(e)}`,(e,t)=>((!P(e)||e.ok!==!0)&&N(t,`expected { ok: true }`),{ok:!0}),{method:`DELETE`}),gitCheckout:(e,t)=>F(`/api/v1/git/checkout`,(e,t)=>((!P(e)||e.ok!==!0)&&N(t,`expected { ok: true }`),{ok:!0}),{method:`POST`,body:{projectId:e,branch:t}}),gitBranchCreate:(e,t,n)=>{let r={projectId:e,name:t};return n?.startPoint!==void 0&&(r.startPoint=n.startPoint),n?.checkout!==void 0&&(r.checkout=n.checkout),F(`/api/v1/git/branch/create`,(e,t)=>((!P(e)||e.ok!==!0)&&N(t,`expected { ok: true }`),{ok:!0}),{method:`POST`,body:r})},gitBranchDelete:(e,t,n)=>{let r=new URLSearchParams({projectId:e});return n===!0&&r.set(`force`,`1`),F(`/api/v1/git/branch/${encodeURIComponent(t)}?${r.toString()}`,(e,t)=>((!P(e)||e.ok!==!0)&&N(t,`expected { ok: true }`),{ok:!0}),{method:`DELETE`})},gitStage:(e,t)=>F(`/api/v1/git/stage`,(e,t)=>((!P(e)||e.ok!==!0)&&N(t,`expected { ok: true }`),{ok:!0}),{method:`POST`,body:{projectId:e,paths:t}}),gitUnstage:(e,t)=>F(`/api/v1/git/unstage`,(e,t)=>((!P(e)||e.ok!==!0)&&N(t,`expected { ok: true }`),{ok:!0}),{method:`POST`,body:{projectId:e,paths:t}}),gitApplyHunks:(e,t,n,r)=>F(`/api/v1/git/apply-hunks`,(e,t)=>{(!P(e)||typeof e.ok!=`boolean`)&&N(t,`expected { ok: boolean }`);let n={ok:e.ok};return typeof e.error==`string`&&(n.error=e.error),typeof e.totalHunks==`number`&&(n.totalHunks=e.totalHunks),n},{method:`POST`,body:{projectId:e,path:t,mode:n,hunkIndices:r}}),gitRevert:(e,t)=>F(`/api/v1/git/revert`,(e,t)=>((!P(e)||e.ok!==!0)&&N(t,`expected { ok: true }`),{ok:!0}),{method:`POST`,body:{projectId:e,paths:t}}),gitCommit:(e,t)=>F(`/api/v1/git/commit`,(e,t)=>((!P(e)||typeof e.hash!=`string`)&&N(t,`expected { hash }`),{hash:e.hash}),{method:`POST`,body:{projectId:e,message:t}}),gitFetch:(e,t)=>{let n={projectId:e};return t?.remote!==void 0&&(n.remote=t.remote),t?.prune!==void 0&&(n.prune=t.prune),F(`/api/v1/git/fetch`,(e,t)=>((!P(e)||typeof e.output!=`string`)&&N(t,`expected { output }`),{output:e.output}),{method:`POST`,body:n})},gitPull:(e,t)=>{let n={projectId:e};return t?.remote!==void 0&&(n.remote=t.remote),t?.branch!==void 0&&(n.branch=t.branch),t?.rebase!==void 0&&(n.rebase=t.rebase),F(`/api/v1/git/pull`,(e,t)=>((!P(e)||typeof e.output!=`string`)&&N(t,`expected { output }`),{output:e.output}),{method:`POST`,body:n})},gitPush:(e,t)=>{let n={projectId:e};return t?.remote!==void 0&&(n.remote=t.remote),t?.branch!==void 0&&(n.branch=t.branch),t?.setUpstream!==void 0&&(n.setUpstream=t.setUpstream),F(`/api/v1/git/push`,(e,t)=>((!P(e)||typeof e.output!=`string`)&&N(t,`expected { output }`),{output:e.output}),{method:`POST`,body:n})}},Yn=ft((e,t)=>({ready:!1,authRequired:!1,isAuthenticated:!1,mustChangePassword:!1,loginError:void 0,loginPending:!1,changePasswordError:void 0,changePasswordPending:!1,bootstrap:async()=>{try{let{authEnabled:t}=await I.authStatus();if(!t){e({ready:!0,authRequired:!1,isAuthenticated:!0,mustChangePassword:!1});return}let n=Bt();e({ready:!0,authRequired:!0,isAuthenticated:n!==void 0,mustChangePassword:n?.mustChangePassword??!1})}catch(t){e({ready:!0,authRequired:!0,isAuthenticated:!1,mustChangePassword:!1,loginError:t instanceof Error?t.message:`bootstrap_failed`})}},login:async n=>{if(!t().loginPending){e({loginPending:!0,loginError:void 0});try{let t=await I.login(n);Vt({token:t.token,expiresAt:t.expiresAt,mustChangePassword:t.mustChangePassword}),e({isAuthenticated:!0,mustChangePassword:t.mustChangePassword,loginPending:!1})}catch(t){e({loginPending:!1,loginError:t instanceof M?t.code:`login_failed`})}}},changePassword:async(n,r)=>{if(!t().changePasswordPending){e({changePasswordPending:!0,changePasswordError:void 0});try{let t=await I.changePassword(n,r);Vt({token:t.token,expiresAt:t.expiresAt,mustChangePassword:t.mustChangePassword}),e({isAuthenticated:!0,mustChangePassword:t.mustChangePassword,changePasswordPending:!1})}catch(t){e({changePasswordPending:!1,changePasswordError:t instanceof M?t.code:`change_password_failed`})}}},logout:()=>{Ht(),e({isAuthenticated:!1,mustChangePassword:!1,loginError:void 0})}}));globalThis.__piForgeAuthListenerRegistered||(globalThis.__piForgeAuthListenerCleanup=Wt(()=>Yn.setState({isAuthenticated:!1})),globalThis.__piForgeAuthListenerRegistered=!0);var Xn=`pi-forge/active-project-id`,Zn=`pi-forge/collapsed-projects`;function Qn(){try{let e=localStorage.getItem(Zn);if(!e)return{};let t=JSON.parse(e);if(typeof t!=`object`||!t)return{};let n={};for(let[e,r]of Object.entries(t))typeof r==`boolean`&&(n[e]=r);return n}catch{return{}}}function $n(e){localStorage.setItem(Zn,JSON.stringify(e))}var er=ft((e,t)=>({projects:[],activeProjectId:localStorage.getItem(Xn)??void 0,collapsed:Qn(),loading:!1,error:void 0,load:async()=>{e({loading:!0,error:void 0});try{let{projects:n}=await I.listProjects(),r=t().activeProjectId,i=r!==void 0&&n.some(e=>e.id===r)?r:n[0]?.id;i!==r&&(i?localStorage.setItem(Xn,i):localStorage.removeItem(Xn)),e({projects:n,activeProjectId:i,loading:!1})}catch(t){e({loading:!1,error:t instanceof M?t.code:t.message})}},create:async(t,n)=>{e({error:void 0});try{let r=await I.createProject(t,n);return e(e=>({projects:[...e.projects,r],activeProjectId:r.id})),localStorage.setItem(Xn,r.id),r}catch(t){throw e({error:t instanceof M?t.code:t.message}),t}},rename:async(t,n)=>{try{let r=await I.renameProject(t,n);e(e=>({projects:e.projects.map(e=>e.id===t?r:e)}))}catch(t){throw e({error:t instanceof M?t.code:t.message}),t}},remove:async(t,n)=>{try{await I.deleteProject(t,n),e(e=>{let n=e.projects.filter(e=>e.id!==t),r=e.activeProjectId===t?n[0]?.id:e.activeProjectId;return r?localStorage.setItem(Xn,r):localStorage.removeItem(Xn),{projects:n,activeProjectId:r}})}catch(t){throw e({error:t instanceof M?t.code:t.message}),t}},setActive:t=>{t?localStorage.setItem(Xn,t):localStorage.removeItem(Xn),e({activeProjectId:t})},toggleCollapsed:t=>{e(e=>{let n={...e.collapsed,[t]:!e.collapsed[t]};return $n(n),{collapsed:n}})}}));function tr(){return er(e=>e.activeProjectId===void 0?void 0:e.projects.find(t=>t.id===e.activeProjectId))}var nr=new Set([401,404]),rr=3e4;function ir(e){return Math.min(2**e*1e3,rr)}function ar(e,t){return new Promise((n,r)=>{if(t?.aborted===!0){r(new DOMException(`Aborted`,`AbortError`));return}let i=setTimeout(()=>{t?.removeEventListener(`abort`,a),n()},e),a=()=>{clearTimeout(i),r(new DOMException(`Aborted`,`AbortError`))};t?.addEventListener(`abort`,a,{once:!0})})}async function or(e,t){let n={Accept:`text/event-stream`},r=Bt();r&&(n.Authorization=`Bearer ${r.token}`);let i={method:`GET`,headers:n};t.signal!==void 0&&(i.signal=t.signal);let a;try{a=await fetch(e,i)}catch(e){if(e instanceof Error&&e.name===`AbortError`)return`aborted`;throw new M(0,`network_error`,e.message)}if(a.status===401&&(Ht(),window.dispatchEvent(new Event(Ut))),!a.ok||a.body===null)throw new M(a.status,`stream_open_failed`);let o=a.body.pipeThrough(new TextDecoderStream).getReader(),s=``;try{for(;;){let{value:e,done:n}=await o.read();if(n)return`eof`;s+=e.replace(/\r\n/g,`
10
+ `);let r=s.indexOf(`
11
+
12
+ `);for(;r!==-1;){let e=s.slice(0,r);s=s.slice(r+2);let n=[];for(let t of e.split(`
13
+ `))t.startsWith(`:`)||t.startsWith(`data:`)&&n.push(t.slice(5).trimStart());if(n.length>0){let e=n.join(`
14
+ `);try{let n=JSON.parse(e);await t.onEvent(n)}catch{}}r=s.indexOf(`
15
+
16
+ `)}}}catch(e){if(e instanceof Error&&e.name===`AbortError`)return`aborted`;throw e instanceof Error?e:Error(String(e))}finally{try{o.releaseLock()}catch{}}}async function sr(e,t){let n=0;for(;;){let r;try{r=await or(e,t)}catch(e){if(e instanceof M&&nr.has(e.status)||(n+=1,t.maxReconnects!==void 0&&t.maxReconnects>0&&n>t.maxReconnects))throw e;let r=ir(n),i=e instanceof Error?e.message:String(e);t.onReconnect?.({attempt:n,delayMs:r,reason:i});try{await ar(r,t.signal)}catch{return}continue}if(r===`aborted`)return;if(n+=1,t.maxReconnects!==void 0&&t.maxReconnects>0&&n>t.maxReconnects){t.onClose?.();return}let i=ir(n);t.onReconnect?.({attempt:n,delayMs:i,reason:`server closed stream`});try{await ar(i,t.signal)}catch{return}}}var cr=`pi-forge`,lr=`tab-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`,ur;function dr(){if(ur!==void 0)return ur;if(!(typeof BroadcastChannel>`u`))return ur=new BroadcastChannel(cr),ur}function fr(e){let t=dr();if(t===void 0)return;let n={from:lr,msg:e};try{t.postMessage(n)}catch{}}function pr(e){let t=dr();if(t===void 0)return()=>void 0;let n=t=>{let n=t.data;typeof n!=`object`||!n||n.from!==lr&&(typeof n.msg!=`object`||n.msg===null||e(n.msg))};return t.addEventListener(`message`,n),()=>t.removeEventListener(`message`,n)}var mr=ft((e,t)=>({pendingBySession:{},setPending:t=>e(e=>({pendingBySession:{...e.pendingBySession,[t.sessionId]:t}})),clearPending:(n,r)=>{let i=t().pendingBySession[n];i!==void 0&&(r!==void 0&&i.requestId!==r||e(e=>({pendingBySession:{...e.pendingBySession,[n]:void 0}})))}})),hr={tasks:[],nextId:1},gr=ft(e=>({byId:{},set:(t,n)=>e(e=>({byId:{...e.byId,[t]:n}})),clear:t=>e(e=>{let n={...e.byId};return delete n[t],{byId:n}})}));function _r(e,t){return t===void 0?hr:e.byId[t]??hr}function vr(e){let t=0,n=0,r=0;for(let i of e.tasks)i.status===`pending`?t+=1:i.status===`in_progress`?n+=1:i.status===`completed`&&(r+=1);return{pending:t,inProgress:n,completed:r,total:t+n+r}}var yr=new Set([`running`,`terminating`,`terminate_timeout`]),br=50,xr=[],Sr=[],Cr=ft(e=>({bySession:{},watchesBySession:{},setProcesses:(t,n)=>e(e=>({bySession:{...e.bySession,[t]:n}})),pushWatch:(t,n)=>e(e=>{let r=[...e.watchesBySession[t]??[],n];return r.length>br&&r.splice(0,r.length-br),{watchesBySession:{...e.watchesBySession,[t]:r}}}),clearWatches:t=>e(e=>{let n={...e.watchesBySession};return delete n[t],{watchesBySession:n}})}));function wr(e,t){return t===void 0?xr:e.bySession[t]??xr}function Tr(e,t){return t===void 0?Sr:e.watchesBySession[t]??Sr}function Er(e){let t=0;for(let n of e)yr.has(n.status)&&(t+=1);return t}var Dr=`pi-forge/active-session-id`,Or=[],kr=[],Ar=[],jr=new Map,Mr=new Map,Nr=new Map,Pr=new Map;function Fr(e){for(let t of e)if(t.role===`user`&&Array.isArray(t.content))for(let e of t.content){let t=e;if(t.type===`image`&&t.__blobUrl===!0&&typeof t.data==`string`)try{URL.revokeObjectURL(t.data)}catch{}}}function Ir(e,t){for(let[n,r]of Object.entries(e.byProject))if(r.some(e=>e.sessionId===t))return n}function Lr(e,t){let n=e.messagesBySession[t];n!==void 0&&Fr(n);let r={...e.messagesBySession};delete r[t];let i={...e.streamingBySession};delete i[t];let a={...e.bannerBySession};delete a[t];let o={...e.streamingTextBySession};delete o[t];let s={...e.activeToolBySession};delete s[t];let c={...e.agentEndCountBySession};delete c[t];let l={...e.queuedBySession};delete l[t];let u={};for(let[n,r]of Object.entries(e.byProject))u[n]=r.filter(e=>e.sessionId!==t);return{messagesBySession:r,streamingBySession:i,bannerBySession:a,streamingTextBySession:o,activeToolBySession:s,agentEndCountBySession:c,queuedBySession:l,byProject:u,activeSessionId:e.activeSessionId===t?void 0:e.activeSessionId}}var L=ft((e,t)=>({byProject:{},activeSessionId:localStorage.getItem(Dr)??void 0,messagesBySession:{},compactionsBySession:{},pendingDraftBySession:{},streamingBySession:{},bannerBySession:{},streamingTextBySession:{},activeToolBySession:{},agentEndCountBySession:{},compactionEndCountBySession:{},queuedBySession:{},pendingScrollByMessageIndex:{},error:void 0,loadingList:!1,loadSessionsForProject:async t=>{e({loadingList:!0,error:void 0});try{let{sessions:n}=await I.listSessions(t);e(e=>({byProject:{...e.byProject,[t]:n},loadingList:!1}))}catch(t){e({loadingList:!1,error:t instanceof M?t.code:t.message})}},createSession:async t=>{e({error:void 0});try{let n=await I.createSession(t),r={sessionId:n.sessionId,projectId:n.projectId,isLive:!0,workspacePath:n.workspacePath,lastActivityAt:n.lastActivityAt,createdAt:n.createdAt,messageCount:n.messageCount,firstMessage:``};return n.name!==void 0&&(r.name=n.name),e(e=>{let i=e.byProject[t]??[];return{byProject:{...e.byProject,[t]:[r,...i]},activeSessionId:n.sessionId}}),localStorage.setItem(Dr,n.sessionId),fr({type:`session_created`,projectId:t,session:r}),n}catch(t){throw e({error:t instanceof M?t.code:t.message}),t}},renameSession:async(t,n)=>{e({error:void 0});try{let r=await I.renameSession(t,n);e(e=>{let n={};for(let[i,a]of Object.entries(e.byProject))n[i]=a.map(e=>{if(e.sessionId!==t)return e;let n={...e};return r.name===void 0?delete n.name:n.name=r.name,n});return{byProject:n}}),fr({type:`session_renamed`,sessionId:t,name:r.name})}catch(t){throw e({error:t instanceof M?t.code:t.message}),t}},reloadMessages:t=>{zr(e,t)},loadCompactions:async t=>{try{let n=await I.getCompactions(t);e(e=>({compactionsBySession:{...e.compactionsBySession,[t]:n.compactions}}))}catch{}},setPendingDraft:(t,n)=>e(e=>({pendingDraftBySession:{...e.pendingDraftBySession,[t]:n}})),consumePendingDraft:t=>e(e=>{if(e.pendingDraftBySession[t]===void 0)return{};let n={...e.pendingDraftBySession};return delete n[t],{pendingDraftBySession:n}}),requestScrollToMessage:(t,n)=>e(e=>({pendingScrollByMessageIndex:{...e.pendingScrollByMessageIndex,[t]:n}})),consumePendingScroll:n=>{let r=t().pendingScrollByMessageIndex[n];if(r!==void 0)return e(e=>{let t={...e.pendingScrollByMessageIndex};return delete t[n],{pendingScrollByMessageIndex:t}}),r},setActiveSession:t=>{t===void 0?localStorage.removeItem(Dr):localStorage.setItem(Dr,t),e({activeSessionId:t})},openStream:n=>{if(Pr.get(n)!==void 0)return;let r=new AbortController;Pr.set(n,r),t().loadCompactions(n);let i=()=>{Pr.get(n)===r&&Pr.delete(n)};sr(`/api/v1/sessions/${encodeURIComponent(n)}/stream`,{signal:r.signal,onEvent:r=>Rr(e,t,n,r),onClose:i,onReconnect:({attempt:t,delayMs:r,reason:i})=>{e(e=>({bannerBySession:{...e.bannerBySession,[n]:`Reconnecting (attempt ${t}, ${Math.round(r/1e3)}s) — ${i}`}}))}}).catch(r=>{if(r instanceof M&&r.status===404){e(e=>Lr(e,n)),t().activeSessionId===void 0&&localStorage.removeItem(Dr),i();return}let a=r instanceof M?r.code:r.message;e(e=>({bannerBySession:{...e.bannerBySession,[n]:`stream error: ${a}`}})),i()})},closeStream:e=>{let t=Pr.get(e);t!==void 0&&(t.abort(),Pr.get(e)===t&&Pr.delete(e))},sendPrompt:async(t,n,r)=>{e({error:void 0});let i=[{type:`text`,text:n}];if(r!==void 0)for(let e of r)e.type.startsWith(`image/`)?i.push({type:`image`,mimeType:e.type,data:URL.createObjectURL(e),__blobUrl:!0}):i.push({type:`file`,filename:e.name,size:e.size});let a={role:`user`,content:i,timestamp:Date.now()};e(e=>({messagesBySession:{...e.messagesBySession,[t]:[...e.messagesBySession[t]??[],a]}}));try{let e={};r!==void 0&&r.length>0&&(e.attachments=r),await I.prompt(t,n,e)}catch(n){throw Fr([a]),e(e=>{let r=e.messagesBySession[t]??[];return{messagesBySession:{...e.messagesBySession,[t]:r.filter(e=>e!==a)},error:n instanceof M?n.code:n.message,bannerBySession:{...e.bannerBySession,[t]:n instanceof M?`prompt rejected: ${n.code}${n.message===`${n.status} ${n.code}`?``:` — ${n.message}`}`:`prompt rejected: ${n.message}`}}}),n}},sendSteer:async(t,n,r)=>{e({error:void 0});try{await I.steer(t,n,r)}catch(t){throw e({error:t instanceof M?t.code:t.message}),t}},abortSession:async t=>{e({error:void 0});try{await I.abort(t)}catch(t){e({error:t instanceof M?t.code:t.message})}},disposeSession:async(n,r)=>{e({error:void 0});try{t().closeStream(n);let i=Ir(t(),n);await I.disposeSession(n,r),e(e=>Lr(e,n)),t().activeSessionId===void 0&&localStorage.removeItem(Dr),i!==void 0&&(fr({type:`session_deleted`,projectId:i,sessionId:n}),t().loadSessionsForProject(i))}catch(t){e({error:t instanceof M?t.code:t.message})}}}));function Rr(e,t,n,r){if(r.type===`snapshot`){e(e=>({messagesBySession:{...e.messagesBySession,[n]:r.messages??[]},streamingBySession:{...e.streamingBySession,[n]:r.isStreaming??!1},bannerBySession:{...e.bannerBySession,[n]:void 0},activeToolBySession:{...e.activeToolBySession,[n]:void 0}}));return}if(r.type===`agent_start`){let t=Mr.get(n);t!==void 0&&cancelAnimationFrame(t),Mr.delete(n),jr.delete(n),e(e=>({streamingBySession:{...e.streamingBySession,[n]:!0},streamingTextBySession:{...e.streamingTextBySession,[n]:``},bannerBySession:{...e.bannerBySession,[n]:void 0}}));return}if(r.type===`agent_end`){let t=Mr.get(n);t!==void 0&&cancelAnimationFrame(t),Mr.delete(n),jr.delete(n);let i=r.errorMessage,a=typeof i==`string`&&i.length>0?`Agent error: ${i}`:void 0;I.getMessages(n).then(({messages:t})=>{e(e=>{let r=e.messagesBySession[n];r!==void 0&&Fr(r);let i=e.bannerBySession[n],o=a??i;return{messagesBySession:{...e.messagesBySession,[n]:t},streamingBySession:{...e.streamingBySession,[n]:!1},streamingTextBySession:{...e.streamingTextBySession,[n]:``},activeToolBySession:{...e.activeToolBySession,[n]:void 0},bannerBySession:{...e.bannerBySession,[n]:o},agentEndCountBySession:{...e.agentEndCountBySession,[n]:(e.agentEndCountBySession[n]??0)+1}}})}).catch(()=>{e(e=>({streamingBySession:{...e.streamingBySession,[n]:!1},activeToolBySession:{...e.activeToolBySession,[n]:void 0},bannerBySession:{...e.bannerBySession,[n]:a??`Couldn't refresh messages after the agent finished — reload to sync`},agentEndCountBySession:{...e.agentEndCountBySession,[n]:(e.agentEndCountBySession[n]??0)+1}}))});return}if(r.type===`queue_update`){let t=r,i=Array.isArray(t.steering)?t.steering.filter(e=>typeof e==`string`):[],a=Array.isArray(t.followUp)?t.followUp.filter(e=>typeof e==`string`):[];e(e=>({queuedBySession:{...e.queuedBySession,[n]:i.length===0&&a.length===0?void 0:{steering:i,followUp:a}}}));return}if(r.type===`tool_execution_start`){let t=typeof r.toolName==`string`?r.toolName:`tool`,i=Br(t,r.input??{}),a=i===void 0?{name:t}:{name:t,summary:i};e(e=>({activeToolBySession:{...e.activeToolBySession,[n]:a}})),zr(e,n);return}if(r.type===`tool_execution_end`){if(e(e=>({activeToolBySession:{...e.activeToolBySession,[n]:void 0}})),zr(e,n),r.toolName===`subagent`){let e=Ir(t(),n);e!==void 0&&t().loadSessionsForProject(e)}return}if(r.type===`message_end`||r.type===`tool_result`){zr(e,n);return}if(r.type===`ask_user_question`){let e=typeof r.requestId==`string`?r.requestId:void 0,t=Array.isArray(r.questions)?r.questions:void 0;if(e===void 0||t===void 0)return;mr.getState().setPending({requestId:e,sessionId:n,questions:t});return}if(r.type===`ask_user_question_cancelled`){let e=typeof r.requestId==`string`?r.requestId:void 0;mr.getState().clearPending(n,e);return}if(r.type===`todo_update`){let e=Array.isArray(r.tasks)?r.tasks:[],t=typeof r.nextId==`number`?r.nextId:1;gr.getState().set(n,{tasks:e,nextId:t});return}if(r.type===`process_update`){let e=Array.isArray(r.processes)?r.processes:[];Cr.getState().setProcesses(n,e);return}if(r.type===`process_watch`){let e=r.match;e!==void 0&&typeof e.processId==`string`&&typeof e.processName==`string`&&(e.source===`stdout`||e.source===`stderr`)&&typeof e.line==`string`&&typeof e.watch?.pattern==`string`&&Cr.getState().pushWatch(n,{processId:e.processId,processName:e.processName,source:e.source,line:e.line,pattern:e.watch.pattern,at:Date.now()});return}if(r.type!==`process_output`){if(r.type===`user_bash_result`){zr(e,n);return}if(r.type===`message_update`){let t=r.assistantMessageEvent;if(typeof t==`object`&&t&&t.type===`text_delta`&&typeof t.delta==`string`){let r=t.delta;if(jr.set(n,(jr.get(n)??``)+r),!Mr.has(n)){let t=requestAnimationFrame(()=>{Mr.delete(n);let t=jr.get(n)??``;t.length!==0&&(jr.delete(n),e(e=>({streamingTextBySession:{...e.streamingTextBySession,[n]:(e.streamingTextBySession[n]??``)+t}})))});Mr.set(n,t)}}return}if(r.type===`compaction_start`){e(e=>({bannerBySession:{...e.bannerBySession,[n]:`Compacting context…`}}));return}if(r.type===`compaction_end`){let t=r.errorMessage,i=typeof t==`string`&&t.length>0?`Agent error: ${t}`:void 0;e(e=>({bannerBySession:{...e.bannerBySession,[n]:i},compactionEndCountBySession:{...e.compactionEndCountBySession,[n]:(e.compactionEndCountBySession[n]??0)+1}})),L.getState().loadCompactions(n),zr(e,n);return}if(r.type===`auto_retry_start`){let t=typeof r.attempt==`number`?r.attempt:`?`,i=typeof r.maxAttempts==`number`?r.maxAttempts:`?`;e(e=>({bannerBySession:{...e.bannerBySession,[n]:`Retrying (${t}/${i})…`}}));return}if(r.type===`auto_retry_end`){let t=r.success!==!1,i=r.finalError,a=!t&&typeof i==`string`&&i.length>0?`Agent error: ${i}`:void 0;e(e=>({bannerBySession:{...e.bannerBySession,[n]:a}}));return}if(r.type===`message_end`){let t=r.message;if(t?.stopReason===`error`){let r=typeof t.errorMessage==`string`?t.errorMessage:``;r.length>0&&e(e=>({bannerBySession:{...e.bannerBySession,[n]:`Agent error: ${r}`}}))}return}}}function zr(e,t){let n=Nr.get(t)??{inflight:!1,queued:!1};if(n.inflight){n.queued=!0,Nr.set(t,n);return}n.inflight=!0,Nr.set(t,n),I.getMessages(t).then(({messages:n})=>{e(e=>({messagesBySession:{...e.messagesBySession,[t]:n}}))}).catch(()=>{}).finally(()=>{let n=Nr.get(t);n!==void 0&&(n.queued?(n.queued=!1,n.inflight=!1,Nr.set(t,n),zr(e,t)):Nr.delete(t))})}function Br(e,t){let n=e=>{let n=t[e];return typeof n==`string`&&n.length>0?n:void 0};switch(e){case`bash`:return n(`command`);case`read`:case`write`:case`edit`:return n(`filePath`)??n(`path`)??n(`file`);case`grep`:return n(`pattern`);case`glob`:return n(`pattern`)??n(`path`);default:for(let e of[`path`,`file`,`filePath`,`command`,`pattern`,`query`,`url`]){let t=n(e);if(t!==void 0)return t}return}}globalThis.__piForgeSessionCrossTabRegistered||(globalThis.__piForgeSessionCrossTabCleanup=pr(e=>{if(e.type===`session_created`){let t=e.session,n=typeof t.sessionId==`string`?t.sessionId:void 0;if(n===void 0)return;let r={sessionId:n,projectId:e.projectId,isLive:t.isLive===!0,workspacePath:typeof t.workspacePath==`string`?t.workspacePath:``,lastActivityAt:typeof t.lastActivityAt==`string`?t.lastActivityAt:new Date().toISOString(),createdAt:typeof t.createdAt==`string`?t.createdAt:new Date().toISOString(),messageCount:typeof t.messageCount==`number`?t.messageCount:0,firstMessage:typeof t.firstMessage==`string`?t.firstMessage:``};typeof t.name==`string`&&(r.name=t.name),L.setState(t=>{let i=t.byProject[e.projectId]??[];return i.some(e=>e.sessionId===n)?{}:{byProject:{...t.byProject,[e.projectId]:[r,...i]}}});return}if(e.type===`session_deleted`){if(L.setState(t=>Lr(t,e.sessionId)),L.getState().activeSessionId===void 0)try{localStorage.removeItem(Dr)}catch{}L.getState().loadSessionsForProject(e.projectId);return}if(e.type===`session_renamed`){L.setState(t=>{let n={};for(let[r,i]of Object.entries(t.byProject))n[r]=i.map(t=>{if(t.sessionId!==e.sessionId)return t;let n={...t};return e.name===void 0?delete n.name:n.name=e.name,n});return{byProject:n}});return}}),globalThis.__piForgeSessionCrossTabRegistered=!0);var Vr=/^@@ -\d+(?:,\d+)? \+(\d+)(?:,(\d+))? @@/;function Hr(e){if(e.length===0)return[];let t=0,n=0,r=new Map,i=(e,t)=>{let n=r.get(e);n!==`modified`&&(n===`added`&&t===`deletedAbove`||r.set(e,t))},a=()=>{n!==0&&(i(t,`deletedAbove`),n=0)};for(let r of e.split(`
17
+ `)){if(r.startsWith(`@@`)){a();let e=Vr.exec(r);if(e===null)continue;t=Number.parseInt(e[1]??`0`,10),n=0;continue}if(r.startsWith(`\\`)||t===0)continue;let e=r.charAt(0);e===` `?(a(),t+=1):e===`-`?n+=1:e===`+`&&(n>0?(i(t,`modified`),--n):i(t,`added`),t+=1)}return a(),Array.from(r.entries()).map(([e,t])=>({line:e,kind:t})).sort((e,t)=>e.line-t.line)}var Ur=`forge.editor.tabs.v1:`;function Wr(e){try{let t=sessionStorage.getItem(Ur+e);if(t===null)return{paths:[],activePath:null};let n=JSON.parse(t);if(typeof n!=`object`||!n)return{paths:[],activePath:null};let r=n,i=Array.isArray(r.paths)?r.paths.filter(e=>typeof e==`string`):[],a=typeof r.activePath==`string`?r.activePath:null;return{paths:i,activePath:i.includes(a??``)?a:i[0]??null}}catch{return{paths:[],activePath:null}}}function Gr(e,t,n){try{sessionStorage.setItem(Ur+e,JSON.stringify({paths:t,activePath:n??null}))}catch{}}var Kr;function qr(e,t){e!==void 0&&Gr(e,t.openFiles.map(e=>e.path),t.activePath)}var Jr=ft((e,t)=>({treeByProject:{},treeLoading:{},openFiles:[],activePath:void 0,error:void 0,externallyChanged:{},gitDiffByPath:{},loadGitDiff:async(t,n)=>{try{let r=Hr((await I.gitDiffFile(t,n,!1)).diff);e(e=>({gitDiffByPath:{...e.gitDiffByPath,[n]:r}}))}catch{e(e=>{if(!(n in e.gitDiffByPath))return{};let t={...e.gitDiffByPath};return delete t[n],{gitDiffByPath:t}})}},loadTree:async t=>{e(e=>({treeLoading:{...e.treeLoading,[t]:!0},error:void 0}));try{let n=await I.filesTree(t);e(e=>({treeByProject:{...e.treeByProject,[t]:n},treeLoading:{...e.treeLoading,[t]:!1}}))}catch(n){e(e=>({treeLoading:{...e.treeLoading,[t]:!1},error:n instanceof M?n.code:n.message}))}},restoreTabs:async n=>{if(Kr===n&&t().openFiles.length>0)return;Kr!==n&&e({openFiles:[],activePath:void 0,externallyChanged:{},gitDiffByPath:{}}),Kr=n;let r=Wr(n);if(r.paths.length!==0){for(let e of r.paths)try{await t().openFile(n,e)}catch{}r.activePath!==null&&t().setActiveFile(r.activePath)}},openFile:async(n,r,i)=>{if(Kr=n,t().openFiles.find(e=>e.path===r)!==void 0){e(i===void 0?e=>(qr(Kr,{openFiles:e.openFiles,activePath:r}),{activePath:r}):e=>{let t={openFiles:e.openFiles.map(e=>e.path===r?{...e,pendingNav:i}:e),activePath:r};return qr(Kr,t),t});return}e({error:void 0});try{let a=await I.filesRead(n,r),o={tabId:Yr(),path:r,saved:a.content,draft:a.content,dirty:!1,language:a.language,binary:a.binary,saving:!1,savedAt:void 0,saveError:void 0,loadingError:a.binary?`Binary file — open externally to edit.`:void 0};i!==void 0&&(o.pendingNav=i),e(e=>{let t={openFiles:[...e.openFiles,o],activePath:r};return qr(Kr,t),t}),t().loadGitDiff(n,r)}catch(t){e({error:t instanceof M?t.code:t.message})}},closeFile:t=>{e(e=>{let n=e.openFiles.findIndex(e=>e.path===t);if(n===-1)return{};let r=e.openFiles.slice(0,n).concat(e.openFiles.slice(n+1)),i=e.activePath===t?(r[n]??r[n-1]??r[0])?.path:e.activePath,a={...e.externallyChanged};delete a[t];let o={...e.gitDiffByPath};delete o[t];let s={openFiles:r,activePath:i,externallyChanged:a,gitDiffByPath:o};return qr(Kr,s),s})},closeAllFiles:()=>{e(()=>{let e={openFiles:[],activePath:void 0,externallyChanged:{},gitDiffByPath:{}};return qr(Kr,e),e})},setActiveFile:t=>e(e=>(qr(Kr,{openFiles:e.openFiles,activePath:t}),{activePath:t})),consumePendingNav:t=>{e(e=>({openFiles:e.openFiles.map(e=>{if(e.path!==t||e.pendingNav===void 0)return e;let n={...e};return delete n.pendingNav,n})}))},updateDraft:(t,n)=>{e(e=>({openFiles:e.openFiles.map(e=>e.path===t?{...e,draft:n,dirty:n!==e.saved}:e)}))},saveFile:async(n,r)=>{let i=t().openFiles.find(e=>e.path===r);if(!(i===void 0||i.binary)){e(e=>({openFiles:e.openFiles.map(e=>e.path===r?{...e,saving:!0,saveError:void 0}:e),error:void 0}));try{await I.filesWrite(n,r,i.draft),e(e=>({openFiles:e.openFiles.map(e=>e.path===r?{...e,saving:!1,saved:e.draft,dirty:!1,savedAt:Date.now(),saveError:void 0}:e),externallyChanged:Xr(e.externallyChanged,r)})),t().loadGitDiff(n,r)}catch(t){let n=t instanceof M?t.code:t.message;throw e(e=>({openFiles:e.openFiles.map(e=>e.path===r?{...e,saving:!1,saveError:n}:e),error:n})),t}}},reloadFile:async(n,r)=>{e({error:void 0});try{let i=await I.filesRead(n,r);e(e=>({openFiles:e.openFiles.map(e=>e.path===r?{...e,saved:i.content,draft:i.content,dirty:!1,language:i.language,binary:i.binary,loadingError:i.binary?`Binary file — open externally to edit.`:void 0}:e),externallyChanged:Xr(e.externallyChanged,r)})),t().loadGitDiff(n,r)}catch(t){e({error:t instanceof M?t.code:t.message})}},refreshOpenFiles:async n=>{let r=t().openFiles.map(e=>({path:e.path,saved:e.saved,dirty:e.dirty}));if(r.length===0)return;let i=await Promise.allSettled(r.map(e=>I.filesRead(n,e.path)));e(e=>{let t=e.openFiles,n=e.externallyChanged;for(let e=0;e<r.length;e++){let a=i[e],o=r[e];if(a===void 0||o===void 0||a.status!==`fulfilled`)continue;let s=a.value;s.content===o.saved&&!o.dirty||s.content!==o.saved&&(o.dirty?n={...n,[o.path]:!0}:(t=t.map(e=>e.path===o.path?{...e,saved:s.content,draft:s.content,dirty:!1,language:s.language,binary:s.binary,loadingError:s.binary?`Binary file — open externally to edit.`:void 0}:e),n=Xr(n,o.path)))}return{openFiles:t,externallyChanged:n}}),await Promise.allSettled(r.map(e=>t().loadGitDiff(n,e.path)))},markExternallyChanged:t=>{e(e=>({externallyChanged:{...e.externallyChanged,[t]:!0}}))},dismissExternallyChanged:t=>{e(e=>({externallyChanged:Xr(e.externallyChanged,t)}))},createFile:async(n,r,i)=>{e({error:void 0});try{let e=`${r}/${i}`;return await I.filesWrite(n,e,``),await t().loadTree(n),e}catch(t){throw e({error:t instanceof M?t.code:t.message}),t}},createFolder:async(n,r,i)=>{e({error:void 0});try{await I.filesMkdir(n,r,i),await t().loadTree(n)}catch(t){throw e({error:t instanceof M?t.code:t.message}),t}},renameEntry:async(n,r,i)=>{e({error:void 0});try{let{path:a}=await I.filesRename(n,r,i);return e(e=>({openFiles:e.openFiles.map(e=>e.path===r?{...e,path:a}:e),activePath:e.activePath===r?a:e.activePath})),await t().loadTree(n),a}catch(t){throw e({error:t instanceof M?t.code:t.message}),t}},moveEntry:async(n,r,i)=>{e({error:void 0});try{let{path:a}=await I.filesMove(n,r,i);return e(e=>({openFiles:e.openFiles.map(e=>{if(e.path===r)return{...e,path:a};let t=`${r}/`;return e.path.startsWith(t)?{...e,path:`${a}/${e.path.slice(t.length)}`}:e}),activePath:e.activePath===r?a:e.activePath!==void 0&&e.activePath.startsWith(`${r}/`)?`${a}/${e.activePath.slice(r.length+1)}`:e.activePath})),await t().loadTree(n),a}catch(t){throw e({error:t instanceof M?t.code:t.message}),t}},deleteEntry:async(n,r,i)=>{e({error:void 0});try{await I.filesDelete(n,r,i?.recursive===!0?{recursive:!0}:void 0),t().openFiles.find(e=>e.path===r)!==void 0&&t().closeFile(r),await t().loadTree(n)}catch(t){throw e({error:t instanceof M?t.code:t.message}),t}},uploadFiles:async(n,r,i,a)=>{e({error:void 0});try{let e=await I.uploadFiles(n,r,i,{...a?.overwrite===void 0?{}:{overwrite:a.overwrite},...a?.onHashProgress===void 0?{}:{onHashProgress:a.onHashProgress}});return await t().loadTree(n),e.files}catch(t){throw e({error:t instanceof M?t.code:t.message}),t}}}));function Yr(){return typeof crypto<`u`&&typeof crypto.randomUUID==`function`?crypto.randomUUID():`tab-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}function Xr(e,t){if(e[t]===void 0)return e;let n={...e};return delete n[t],n}var Zr=ft(e=>({loaded:!1,minimal:!1,workspaceRoot:``,version:``,passwordAuthEnabled:!0,error:void 0,load:async()=>{try{let t=await I.uiConfig();e({loaded:!0,minimal:t.minimal,workspaceRoot:t.workspaceRoot,version:t.version,passwordAuthEnabled:t.passwordAuthEnabled,error:void 0})}catch(t){let n=t instanceof M?t.code:t.message;typeof console<`u`&&console.warn(`[ui-config] load failed:`,n),e({loaded:!0,error:n})}}})),Qr=ft((e,t)=>({loaded:!1,actions:[],error:void 0,load:async()=>{try{let{actions:t}=await I.listQuickActions();e({loaded:!0,actions:t,error:void 0})}catch(t){let n=t instanceof M?t.code:t.message;typeof console<`u`&&console.warn(`[quick-actions] load failed:`,n),e({error:n})}},create:async n=>{let r=await I.createQuickAction(n);return e({actions:[...t().actions,r]}),r},update:async(n,r)=>{let i=await I.updateQuickAction(n,r);return e({actions:t().actions.map(e=>e.id===n?i:e)}),i},remove:async n=>{await I.deleteQuickAction(n),e({actions:t().actions.filter(e=>e.id!==n)})}})),$r=ft((e,t)=>({runs:[],addRun:n=>e({runs:[...t().runs,n]}),updateRun:(n,r)=>e({runs:t().runs.map(e=>e.runId===n?{...e,...r}:e)}),removeRun:n=>e({runs:t().runs.filter(e=>e.runId!==n)}),runsForSession:e=>t().runs.filter(t=>t.sessionId===e)})),ei=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})),ti=o(((e,t)=>{t.exports=ei()})),R=ti();function ni(){let[e,t]=(0,v.useState)(``),n=Yn(e=>e.login),r=Yn(e=>e.loginPending),i=Yn(e=>e.loginError);return(0,R.jsx)(`main`,{className:`flex min-h-screen items-center justify-center px-4`,children:(0,R.jsxs)(`form`,{onSubmit:t=>{t.preventDefault(),e.length!==0&&n(e)},className:`w-full max-w-sm space-y-4 rounded-lg border border-neutral-800 bg-neutral-900 p-6 shadow-lg`,children:[(0,R.jsxs)(`header`,{className:`space-y-1`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(`img`,{src:`/icons/icon.svg`,alt:``,className:`h-6 w-6`,"aria-hidden":`true`}),(0,R.jsx)(`h1`,{className:`text-xl font-semibold tracking-tight`,children:`pi-forge`})]}),(0,R.jsx)(`p`,{className:`text-sm text-neutral-400`,children:`Enter the pi-forge password to continue.`})]}),(0,R.jsxs)(`label`,{className:`block space-y-1.5`,children:[(0,R.jsx)(`span`,{className:`text-sm font-medium text-neutral-300`,children:`Password`}),(0,R.jsx)(`input`,{type:`password`,value:e,onChange:e=>t(e.target.value),autoFocus:!0,autoComplete:`current-password`,className:`w-full rounded-md border border-neutral-700 bg-neutral-950 px-3 py-2 text-sm outline-none focus:border-neutral-500`})]}),i!==void 0&&(0,R.jsx)(`p`,{role:`alert`,className:`text-sm text-red-400`,children:i===`invalid_password`?`Incorrect password.`:`Login failed: ${i}`}),(0,R.jsx)(`button`,{type:`submit`,disabled:r||e.length===0,className:`w-full rounded-md bg-neutral-100 px-3 py-2 text-sm font-medium text-neutral-900 transition hover:bg-white disabled:cursor-not-allowed disabled:opacity-50`,children:r?`Signing in…`:`Sign in`})]})})}var ri=8;function ii(){let[e,t]=(0,v.useState)(``),[n,r]=(0,v.useState)(``),[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(void 0),c=Yn(e=>e.changePassword),l=Yn(e=>e.changePasswordPending),u=Yn(e=>e.changePasswordError),d=Yn(e=>e.logout),f=t=>{if(t.preventDefault(),s(void 0),n.length<ri){s(`new password must be at least ${ri} characters`);return}if(n!==i){s(`new password and confirmation do not match`);return}if(n===e){s(`new password must differ from the current one`);return}c(e,n)},p=o??ai(u);return(0,R.jsx)(`main`,{className:`flex min-h-screen items-center justify-center px-4`,children:(0,R.jsxs)(`form`,{onSubmit:f,className:`w-full max-w-sm space-y-4 rounded-lg border border-neutral-800 bg-neutral-900 p-6 shadow-lg`,children:[(0,R.jsxs)(`header`,{className:`space-y-1`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(`img`,{src:`/icons/icon.svg`,alt:``,className:`h-6 w-6`,"aria-hidden":`true`}),(0,R.jsx)(`h1`,{className:`text-xl font-semibold tracking-tight`,children:`Set a new password`})]}),(0,R.jsx)(`p`,{className:`text-sm text-neutral-400`,children:`You signed in with the deployment-supplied initial password. Pick a new one before continuing — it will be stored as a hash on the pi-forge data volume.`})]}),(0,R.jsxs)(`label`,{className:`block space-y-1.5`,children:[(0,R.jsx)(`span`,{className:`text-sm font-medium text-neutral-300`,children:`Current password`}),(0,R.jsx)(`input`,{type:`password`,value:e,onChange:e=>t(e.target.value),autoFocus:!0,autoComplete:`current-password`,className:`w-full rounded-md border border-neutral-700 bg-neutral-950 px-3 py-2 text-sm outline-none focus:border-neutral-500`})]}),(0,R.jsxs)(`label`,{className:`block space-y-1.5`,children:[(0,R.jsx)(`span`,{className:`text-sm font-medium text-neutral-300`,children:`New password`}),(0,R.jsx)(`input`,{type:`password`,value:n,onChange:e=>r(e.target.value),autoComplete:`new-password`,minLength:ri,className:`w-full rounded-md border border-neutral-700 bg-neutral-950 px-3 py-2 text-sm outline-none focus:border-neutral-500`})]}),(0,R.jsxs)(`label`,{className:`block space-y-1.5`,children:[(0,R.jsx)(`span`,{className:`text-sm font-medium text-neutral-300`,children:`Confirm new password`}),(0,R.jsx)(`input`,{type:`password`,value:i,onChange:e=>a(e.target.value),autoComplete:`new-password`,minLength:ri,className:`w-full rounded-md border border-neutral-700 bg-neutral-950 px-3 py-2 text-sm outline-none focus:border-neutral-500`})]}),p!==void 0&&(0,R.jsx)(`p`,{role:`alert`,className:`text-sm text-red-400 light:text-red-700`,children:p}),(0,R.jsx)(`button`,{type:`submit`,disabled:l||e.length===0||n.length===0,className:`w-full rounded-md bg-neutral-100 px-3 py-2 text-sm font-medium text-neutral-900 transition hover:bg-white disabled:cursor-not-allowed disabled:opacity-50`,children:l?`Saving…`:`Set new password`}),(0,R.jsx)(`button`,{type:`button`,onClick:d,className:`w-full rounded-md border border-neutral-700 px-3 py-2 text-xs text-neutral-400 hover:border-neutral-500 hover:text-neutral-200`,children:`Sign out`})]})})}function ai(e){if(e!==void 0)switch(e){case`invalid_password`:return`Current password is incorrect.`;case`password_unchanged`:return`New password must differ from the current one.`;case`ui_password_not_configured`:return`Password auth is not configured on this server.`;case`auth_required`:return`Session expired — sign in again.`;default:return`Could not change password: ${e}`}}var oi=`pi-forge/install-prompt-dismissed`;function si(){return typeof window>`u`?!1:window.navigator.standalone===!0?!0:window.matchMedia?.(`(display-mode: standalone)`).matches??!1}function ci(){return typeof navigator>`u`?!1:/iphone|ipad|ipod/i.test(navigator.userAgent)}function li(){let e=ot(),[t,n]=(0,v.useState)(void 0),[r,i]=(0,v.useState)(()=>typeof localStorage>`u`?!1:localStorage.getItem(oi)===`true`),[a,o]=(0,v.useState)(!1);(0,v.useEffect)(()=>{if(typeof window>`u`||si()||r)return;let t=e=>{e.preventDefault(),n(e)};if(window.addEventListener(`beforeinstallprompt`,t),ci()&&e){let e=window.setTimeout(()=>o(!0),1500);return()=>{window.clearTimeout(e),window.removeEventListener(`beforeinstallprompt`,t)}}return()=>window.removeEventListener(`beforeinstallprompt`,t)},[e,r]);let s=()=>{i(!0),n(void 0),o(!1);try{localStorage.setItem(oi,`true`)}catch{}},c=async()=>{if(t===void 0)return;await t.prompt();let e=await t.userChoice;n(void 0),e.outcome===`accepted`&&s()};return!e||r||si()||t===void 0&&!a?null:(0,R.jsx)(`div`,{className:`border-b border-neutral-800 bg-neutral-900 px-3 py-2 text-sm text-neutral-200`,children:(0,R.jsxs)(`div`,{className:`mx-auto flex max-w-3xl items-center gap-2`,children:[(0,R.jsx)(`div`,{className:`min-w-0 flex-1`,children:t===void 0?(0,R.jsxs)(`span`,{className:`inline-flex flex-wrap items-center gap-1`,children:[`Install: tap `,(0,R.jsx)(Je,{size:14,className:`inline shrink-0 text-neutral-400`}),` Share, then `,(0,R.jsx)(`span`,{className:`font-medium`,children:`Add to Home Screen`}),`.`]}):(0,R.jsx)(`span`,{children:`Install pi-forge as an app for a fullscreen experience.`})}),t!==void 0&&(0,R.jsx)(`button`,{type:`button`,onClick:()=>void c(),className:`shrink-0 rounded-md bg-neutral-100 px-3 py-1.5 text-xs font-medium text-neutral-900 hover:bg-neutral-200`,children:`Install`}),(0,R.jsx)(`button`,{type:`button`,onClick:s,"aria-label":`Dismiss install prompt`,className:`inline-flex min-h-9 min-w-9 shrink-0 items-center justify-center rounded text-neutral-500 hover:bg-neutral-800 hover:text-neutral-200`,children:(0,R.jsx)(rt,{size:16})})]})})}function ui({onClose:e,required:t=!1}){let n=er(e=>e.create),r=Zr(e=>e.minimal),i=Zr(e=>e.workspaceRoot),[a,o]=(0,v.useState)(`name`),[s,c]=(0,v.useState)(``),[l,u]=(0,v.useState)(!1),[d,f]=(0,v.useState)(),[p,m]=(0,v.useState)(),[h,g]=(0,v.useState)(null),[_,y]=(0,v.useState)([]),[b,x]=(0,v.useState)(!1),[S,C]=(0,v.useState)(``),[w,T]=(0,v.useState)(!1);(0,v.useEffect)(()=>{if(a!==`browse`)return;let e=!1;return x(!0),f(void 0),I.browse(p).then(t=>{e||(m(t.path),g(t.parentPath),y(t.entries))}).catch(t=>{e||f(t instanceof M?t.code:t.message)}).finally(()=>{e||x(!1)}),()=>{e=!0}},[a,p]);let E=async()=>{let t=s.trim();if(t.length!==0){if(!r){o(`browse`);return}if(i.length===0){f(`workspace_not_loaded`);return}u(!0),f(void 0);try{let{path:r}=await I.mkdir(i,t);await n(t,r),e()}catch(e){f(e instanceof M?e.code:e.message),u(!1)}}},D=async t=>{if(!l){if(i.length>0&&t===i){f(`workspace_root_not_allowed`);return}u(!0),f(void 0);try{await n(s.trim(),t),e()}catch(e){f(e instanceof M?e.code:e.message),u(!1)}}},O=()=>{h!==null&&m(h)},k=async()=>{if(!(!p||S.trim().length===0)){f(void 0);try{let{path:e}=await I.mkdir(p,S.trim());C(``),T(!1),await D(e)}catch(e){f(e instanceof M?e.code:e.message)}}};return(0,R.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/60 px-4`,children:(0,R.jsxs)(`div`,{className:`w-full max-w-lg rounded-lg border border-neutral-800 bg-neutral-900 p-6 shadow-xl`,children:[(0,R.jsxs)(`header`,{className:`mb-4 flex items-center justify-between`,children:[(0,R.jsx)(`h2`,{className:`text-lg font-semibold tracking-tight`,children:a===`name`?`New project`:`Pick a folder for "${s.trim()}"`}),!t&&(0,R.jsx)(`button`,{onClick:e,className:`rounded-md px-2 py-1 text-sm text-neutral-400 hover:bg-neutral-800`,children:`Cancel`})]}),a===`name`&&(0,R.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),E()},className:`space-y-4`,children:[(0,R.jsxs)(`label`,{className:`block space-y-1.5`,children:[(0,R.jsx)(`span`,{className:`text-sm font-medium text-neutral-300`,children:`Project name`}),(0,R.jsx)(`input`,{value:s,onChange:e=>c(e.target.value),autoFocus:!0,className:`w-full rounded-md border border-neutral-700 bg-neutral-950 px-3 py-2 text-sm outline-none focus:border-neutral-500`}),r&&i.length>0&&(0,R.jsxs)(`span`,{className:`block font-mono text-[11px] text-neutral-500`,children:[`Will create `,i,`/`,s.trim().length>0?s.trim():`<name>`]})]}),d!==void 0&&(0,R.jsxs)(`p`,{className:`text-xs text-red-400 light:text-red-700`,children:[`Error: `,d]}),(0,R.jsx)(`button`,{type:`submit`,disabled:s.trim().length===0||l,className:`w-full rounded-md bg-neutral-100 px-3 py-2 text-sm font-medium text-neutral-900 disabled:opacity-50`,children:r?l?`Creating…`:`Create project`:`Next: pick folder`})]}),a===`browse`&&(0,R.jsxs)(`div`,{className:`space-y-3`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-neutral-400`,children:[(0,R.jsx)(`button`,{onClick:O,disabled:h===null,className:`rounded-md border border-neutral-700 px-2 py-1 hover:bg-neutral-800 disabled:cursor-not-allowed disabled:opacity-40`,title:h===null?`At workspace root`:`Up one folder`,children:`↑ up`}),(0,R.jsx)(`code`,{className:`truncate font-mono text-neutral-300`,children:p??`(loading)`})]}),(0,R.jsxs)(`div`,{className:`max-h-64 overflow-y-auto rounded-md border border-neutral-800 bg-neutral-950`,children:[b&&(0,R.jsx)(`div`,{className:`px-3 py-2 text-sm text-neutral-400`,children:`Loading…`}),!b&&_.length===0&&(0,R.jsx)(`div`,{className:`px-3 py-2 text-sm text-neutral-400`,children:`(empty)`}),!b&&_.map(e=>(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b border-neutral-800 px-3 py-2 text-sm last:border-b-0`,children:[(0,R.jsxs)(`button`,{onClick:()=>m(e.path),className:`flex flex-1 items-center gap-2 text-left text-neutral-200 hover:text-white`,children:[(0,R.jsx)(`span`,{children:`📁`}),(0,R.jsx)(`span`,{className:`truncate`,children:e.name}),e.isGitRepo&&(0,R.jsx)(`span`,{className:`rounded-sm bg-neutral-800 px-1.5 py-0.5 text-[10px] uppercase tracking-wider text-neutral-300`,children:`git`})]}),(0,R.jsx)(`button`,{onClick:()=>void D(e.path),disabled:l,className:`rounded-md border border-neutral-700 px-2 py-1 text-xs text-neutral-200 hover:bg-neutral-800 disabled:opacity-50`,children:`Select`})]},e.path))]}),w?(0,R.jsxs)(`div`,{className:`flex gap-2`,children:[(0,R.jsx)(`input`,{value:S,onChange:e=>C(e.target.value),placeholder:`folder name`,className:`flex-1 rounded-md border border-neutral-700 bg-neutral-950 px-3 py-2 text-sm`,autoFocus:!0}),(0,R.jsx)(`button`,{onClick:()=>void k(),className:`rounded-md bg-neutral-100 px-3 py-2 text-sm font-medium text-neutral-900`,children:`Create + select`}),(0,R.jsx)(`button`,{onClick:()=>{T(!1),C(``)},className:`rounded-md border border-neutral-700 px-3 py-2 text-sm text-neutral-300`,children:`Cancel`})]}):(0,R.jsxs)(`div`,{className:`flex justify-between gap-2`,children:[(0,R.jsx)(`button`,{onClick:()=>o(`name`),className:`rounded-md border border-neutral-700 px-3 py-2 text-sm text-neutral-300`,children:`← Back`}),(0,R.jsxs)(`div`,{className:`flex gap-2`,children:[(0,R.jsx)(`button`,{onClick:()=>T(!0),className:`rounded-md border border-neutral-700 px-3 py-2 text-sm text-neutral-300`,children:`+ New folder`}),(0,R.jsx)(`button`,{onClick:()=>p&&void D(p),disabled:!p||l||i.length>0&&p===i,className:`rounded-md bg-neutral-100 px-3 py-2 text-sm font-medium text-neutral-900 disabled:opacity-50`,title:i.length>0&&p===i?`Pick a sub-folder — the workspace root itself can't be a project.`:`Use this folder as the project root`,children:`Select this folder`})]})]})]}),d!==void 0&&(0,R.jsx)(`p`,{className:`mt-3 text-sm text-red-400 light:text-red-700`,children:d===`path_not_allowed`?`That folder is outside the workspace root.`:d===`workspace_root_not_allowed`?`Pick a sub-folder — the workspace root itself can't be a project.`:d===`not_a_directory`?`That path is not a directory.`:d===`already_exists`?`A folder with that name already exists.`:d===`duplicate_path`?`Another project already points at that folder.`:d===`network_error`?`Couldn't reach the server.`:`Error: ${d}`})]})})}function di({open:e,onClose:t,title:n,children:r,width:i=`max-w-sm`,initialFocusRef:a}){let o=(0,v.useRef)(null),s=(0,v.useId)(),c=(0,v.useRef)(t),l=(0,v.useRef)(a);return(0,v.useEffect)(()=>{c.current=t}),(0,v.useEffect)(()=>{l.current=a}),(0,v.useEffect)(()=>{if(!e)return;let t=document.activeElement,n=o.current,r=e=>{if(e.key===`Escape`){e.preventDefault(),c.current();return}if(e.key===`Tab`&&o.current!==null){let t=o.current.querySelectorAll(`a[href], button:not([disabled]), input:not([disabled]), textarea:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])`);if(t.length===0)return;let n=t[0],r=t[t.length-1];e.shiftKey&&document.activeElement===n?(e.preventDefault(),r.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n.focus())}};document.addEventListener(`keydown`,r);let i=window.setTimeout(()=>{let e=l.current?.current;if(e!=null){e.focus();return}(o.current?.querySelector(`a[href], button:not([disabled]), input:not([disabled]), textarea:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])`))?.focus()},0);return()=>{document.removeEventListener(`keydown`,r),window.clearTimeout(i),t!==null&&document.contains(t)&&n!==null&&n.contains(document.activeElement)&&t.focus()}},[e]),e?(0,R.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4`,onClick:t,role:`dialog`,"aria-modal":`true`,"aria-labelledby":s,children:(0,R.jsxs)(`div`,{ref:o,className:`w-full ${i} rounded-lg border border-neutral-800 bg-neutral-900 shadow-xl`,onClick:e=>e.stopPropagation(),children:[(0,R.jsxs)(`header`,{className:`flex items-center justify-between border-b border-neutral-800 px-4 py-2`,children:[(0,R.jsx)(`h2`,{id:s,className:`text-sm font-medium text-neutral-100`,children:n}),(0,R.jsx)(`button`,{onClick:t,className:`rounded p-2 text-neutral-500 hover:bg-neutral-800 hover:text-neutral-200`,title:`Close (Esc)`,"aria-label":`Close`,children:(0,R.jsx)(rt,{size:20})})]}),r]})}):null}function fi({open:e,onClose:t,onSubmit:n,title:r,label:i,initialValue:a=``,placeholder:o,primaryLabel:s=`OK`}){let[c,l]=(0,v.useState)(a),u=(0,v.useRef)(null);(0,v.useEffect)(()=>{e&&l(a)},[e,a]);let d=c.trim(),f=()=>{d.length!==0&&n(d)};return(0,R.jsx)(di,{open:e,onClose:t,title:r,initialFocusRef:u,children:(0,R.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),f()},className:`flex flex-col gap-3 px-4 py-3`,children:[(0,R.jsxs)(`label`,{className:`block space-y-1.5`,children:[(0,R.jsx)(`span`,{className:`text-xs text-neutral-300`,children:i}),(0,R.jsx)(`input`,{ref:u,type:`text`,value:c,onChange:e=>l(e.target.value),placeholder:o,className:`w-full rounded-md border border-neutral-700 bg-neutral-950 px-3 py-1.5 text-sm text-neutral-100 outline-none focus:border-neutral-500`})]}),(0,R.jsxs)(`footer`,{className:`flex justify-end gap-2 pt-1`,children:[(0,R.jsx)(`button`,{type:`button`,onClick:t,className:`rounded-md border border-neutral-700 px-3 py-1 text-xs text-neutral-200 hover:bg-neutral-800`,children:`Cancel`}),(0,R.jsx)(`button`,{type:`submit`,disabled:d.length===0,className:`rounded-md bg-neutral-100 px-3 py-1 text-xs font-medium text-neutral-900 hover:bg-white disabled:cursor-not-allowed disabled:opacity-40`,children:s})]})]})})}function pi({open:e,onClose:t,onConfirm:n,title:r,message:i,primaryLabel:a=`Confirm`,tone:o=`default`}){return(0,R.jsx)(di,{open:e,onClose:t,title:r,children:(0,R.jsxs)(`div`,{className:`flex flex-col gap-3 px-4 py-3`,children:[(0,R.jsx)(`p`,{className:`text-xs text-neutral-300`,children:i}),(0,R.jsxs)(`footer`,{className:`flex justify-end gap-2 pt-1`,children:[(0,R.jsx)(`button`,{type:`button`,onClick:t,className:`rounded-md border border-neutral-700 px-3 py-1 text-xs text-neutral-200 hover:bg-neutral-800`,children:`Cancel`}),(0,R.jsx)(`button`,{type:`button`,onClick:n,className:o===`danger`?`rounded-md bg-red-700 px-3 py-1 text-xs font-medium text-red-50 hover:bg-red-600`:`rounded-md bg-neutral-100 px-3 py-1 text-xs font-medium text-neutral-900 hover:bg-white`,children:a})]})]})})}function mi({projectId:e}){let t=L(t=>t.byProject[e]??Or),n=L(e=>e.activeSessionId),r=L(e=>e.loadSessionsForProject),i=L(e=>e.setActiveSession),a=L(e=>e.disposeSession),o=L(e=>e.renameSession),s=er(e=>e.setActive),c=er(e=>e.activeProjectId),l=t=>{c!==e&&s(e),i(t)},[u,d]=(0,v.useState)(void 0),[f,p]=(0,v.useState)(``),[m,h]=(0,v.useState)(void 0),[g,_]=(0,v.useState)(void 0);(0,v.useEffect)(()=>{if(g===void 0)return;let e=()=>_(void 0),t=window.setTimeout(e,hi),n=t=>{let n=t.target;n instanceof Element&&n.closest(`[data-armed-delete="${g}"]`)===null&&e()},r=t=>{t.key===`Escape`&&e()};return document.addEventListener(`pointerdown`,n),document.addEventListener(`keydown`,r),()=>{window.clearTimeout(t),document.removeEventListener(`pointerdown`,n),document.removeEventListener(`keydown`,r)}},[g]);let y=e=>{if(g===e){_(void 0),a(e,{hard:!0});return}_(e)},[b,x]=(0,v.useState)(new Set),S=()=>x(new Set),C=e=>{x(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[w,T]=(0,v.useState)(new Map),E=(e,t)=>{T(n=>{let r=new Map(n);return r.set(e,!t),r})},{topLevel:D,childrenByParent:O}=(0,v.useMemo)(()=>{let n=new Map,r=new Set(t.filter(e=>e.parentSessionId===void 0).map(e=>e.sessionId));for(let e of t){if(e.parentSessionId===void 0||!r.has(e.parentSessionId))continue;let t=n.get(e.parentSessionId);t===void 0?n.set(e.parentSessionId,[e]):t.push(e)}let i=t.filter(e=>e.parentSessionId===void 0||!r.has(e.parentSessionId));return t.some(e=>e.parentSessionId!==void 0)&&console.info(`[subagent] SessionList grouping`,{projectId:e,sessionCount:t.length,topLevelCount:i.length,childCount:Array.from(n.values()).reduce((e,t)=>e+t.length,0),topLevelIds:Array.from(r),parentIdsOnChildren:t.filter(e=>e.parentSessionId!==void 0).map(e=>e.parentSessionId),bucketed:Array.from(n.keys())}),{topLevel:i,childrenByParent:n}},[t,e]),k=async()=>{if(m===void 0)return;let e=m.sessionIds;h(void 0);for(let t of e)try{await a(t,{hard:!0})}catch{}S()};(0,v.useEffect)(()=>{r(e)},[e,r]);let ee=(e,t)=>{d(e),p(t)},te=()=>{d(void 0),p(``)},ne=async e=>{let t=f.trim();te();try{await o(e,t)}catch{}},re=(e,t)=>{e.key===`Enter`?(e.preventDefault(),ne(t)):e.key===`Escape`&&(e.preventDefault(),te())};return(0,R.jsxs)(`div`,{className:`ml-6 mt-1 space-y-0.5`,children:[t.length===0&&(0,R.jsx)(`p`,{className:`px-2 py-1 text-xs italic text-neutral-600`,children:`No sessions yet.`}),b.size>0&&(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-2 rounded bg-neutral-900/60 px-2 py-1 text-[11px] text-neutral-300`,children:[(0,R.jsxs)(`span`,{children:[b.size,` selected`]}),(0,R.jsxs)(`div`,{className:`flex gap-1`,children:[(0,R.jsx)(`button`,{onClick:()=>h({sessionIds:Array.from(b)}),className:`rounded border border-red-700/50 px-1.5 py-0.5 text-red-300 hover:bg-red-900/20 light:border-red-400 light:text-red-700 light:hover:bg-red-50`,children:`Delete`}),(0,R.jsx)(`button`,{onClick:S,className:`rounded border border-neutral-700 px-1.5 py-0.5 text-neutral-300 hover:border-neutral-500`,children:`Clear`})]})]}),D.flatMap(e=>{let t=O.get(e.sessionId)??[],r=w.get(e.sessionId)===!0,i=[(0,R.jsx)(gi,{session:e,isActive:e.sessionId===n,isSelected:b.has(e.sessionId),isRenaming:u===e.sessionId,renameDraft:f,childCount:t.length,isExpanded:r,isChild:!1,onSelect:l,onToggleSelect:C,onStartRename:ee,onChangeRename:p,onRenameKeyDown:re,onCommitRename:e=>void ne(e),onToggleExpanded:E,isArmedForDelete:g===e.sessionId,onDeleteClick:y},e.sessionId)];if(r)for(let e of t)i.push((0,R.jsx)(gi,{session:e,isActive:e.sessionId===n,isSelected:b.has(e.sessionId),isRenaming:u===e.sessionId,renameDraft:f,childCount:0,isExpanded:!1,isChild:!0,onSelect:l,onToggleSelect:C,onStartRename:ee,onChangeRename:p,onRenameKeyDown:re,onCommitRename:e=>void ne(e),onToggleExpanded:E,isArmedForDelete:g===e.sessionId,onDeleteClick:y},e.sessionId));return i}),(0,R.jsx)(pi,{open:m!==void 0,onClose:()=>h(void 0),onConfirm:()=>void k(),title:`Delete ${m?.sessionIds.length??0} session${(m?.sessionIds.length??0)===1?``:`s`}`,message:`Delete the ${m?.sessionIds.length??0} selected session${(m?.sessionIds.length??0)===1?``:`s`}? Live sessions are killed and on-disk JSONLs are removed. Cannot be undone.`,primaryLabel:`Delete all`,tone:`danger`})]})}var hi=3e3;function gi(e){let{session:t,isActive:n,isSelected:r,isRenaming:i,renameDraft:a,childCount:o,isExpanded:s,isChild:c,onSelect:l,onToggleSelect:u,onStartRename:d,onChangeRename:f,onRenameKeyDown:p,onCommitRename:m,onToggleExpanded:h,isArmedForDelete:g,onDeleteClick:_}=e,v=t.name??(t.firstMessage.length>0?t.firstMessage.slice(0,40):`session ${t.sessionId.slice(0,6)}`);return(0,R.jsxs)(`div`,{className:`group flex items-center gap-1 rounded border-l-2 ${c?`ml-4`:``} px-2 py-0.5 text-xs ${r?`border-blue-400 bg-blue-500/15 text-neutral-100 hover:bg-blue-500/25`:n?`border-transparent bg-neutral-800 text-neutral-100`:`border-transparent text-neutral-400 hover:bg-neutral-900 hover:text-neutral-200`}`,children:[o>0?(0,R.jsx)(`button`,{onClick:()=>h(t.sessionId,s),className:`inline-flex h-4 w-4 shrink-0 items-center justify-center text-neutral-500 hover:text-neutral-200`,title:`${o} sub-agent session${o===1?``:`s`}`,"aria-label":s?`Collapse sub-agents`:`Expand sub-agents`,children:s?(0,R.jsx)(de,{size:12}):(0,R.jsx)(pe,{size:12})}):(0,R.jsx)(`span`,{className:`inline-block h-4 w-4 shrink-0`,"aria-hidden":`true`}),i?(0,R.jsx)(`input`,{autoFocus:!0,value:a,onChange:e=>f(e.target.value),onKeyDown:e=>p(e,t.sessionId),onBlur:()=>m(t.sessionId),placeholder:v,maxLength:200,className:`flex-1 rounded border border-neutral-700 bg-neutral-950 px-1.5 py-0.5 text-xs text-neutral-100 outline-none focus:border-neutral-500`}):(0,R.jsxs)(`button`,{onClick:e=>{if(e.metaKey||e.ctrlKey){u(t.sessionId);return}l(t.sessionId)},onDoubleClick:()=>d(t.sessionId,t.name??``),className:`flex-1 truncate text-left`,title:`${t.sessionId} — double-click to rename, Cmd/Ctrl+click to select for bulk delete`,children:[t.isLive&&(0,R.jsx)(`span`,{className:`mr-1 text-emerald-500 light:text-emerald-700`,children:`●`}),c&&(0,R.jsx)(`span`,{className:`mr-1 text-purple-400 light:text-purple-700`,title:`sub-agent`,children:`↳`}),v]}),!i&&(0,R.jsx)(`button`,{"data-armed-delete":g?t.sessionId:void 0,onClick:e=>{e.stopPropagation(),_(t.sessionId)},className:g?`inline-flex h-6 items-center rounded border border-red-500 px-1.5 text-[11px] font-medium uppercase leading-none tracking-wide text-red-300 hover:bg-red-500/10 light:border-red-600 light:text-red-700 light:hover:bg-red-100`:`inline-flex h-6 w-6 items-center justify-center rounded text-neutral-500 hover:text-red-400 light:hover:text-red-700`,title:g?`Click again to delete (Esc to cancel)`:t.isLive?`Delete session — also kills the live shell`:`Delete session JSONL from disk`,"aria-label":g?`Confirm delete`:`Delete session`,children:g?`Confirm`:(0,R.jsx)(rt,{size:16})})]})}function _i({className:e=``}={}){let t=er(e=>e.projects),n=er(e=>e.activeProjectId),r=er(e=>e.collapsed),i=er(e=>e.setActive),a=er(e=>e.toggleCollapsed),o=er(e=>e.remove),s=er(e=>e.rename),c=L(e=>e.byProject),l=L(e=>e.createSession),u=async e=>{n!==e&&i(e);try{await l(e)}catch{}},[d,f]=(0,v.useState)(!1),[p,m]=(0,v.useState)(),[h,g]=(0,v.useState)(``),[_,y]=(0,v.useState)(void 0),b=(e,t)=>{let n=c[e]??[],r=n.filter(e=>e.isLive).length;if(r>0){alert(`Cannot delete "${t}" — it has ${r} live session${r===1?``:`s`}. Dispose ${r===1?`it`:`them`} first (× next to each session in the sidebar), then try again.`);return}let i=n.filter(e=>!e.isLive).length;y({id:e,name:t,onDiskCount:i,cascade:!1})},x=async()=>{if(_===void 0)return;let{id:e,cascade:t}=_;y(void 0),o(e,{cascade:t})},S=async e=>{let t=h.trim();if(t.length===0){m(void 0);return}try{await s(e,t)}finally{m(void 0),g(``)}};return(0,R.jsxs)(`aside`,{className:`flex h-full w-64 flex-col border-r border-neutral-800 bg-neutral-950 ${e}`,style:{paddingTop:`env(safe-area-inset-top)`,paddingBottom:`env(safe-area-inset-bottom)`},children:[(0,R.jsxs)(`header`,{className:`flex items-center justify-between border-b border-neutral-800 px-3 py-2`,children:[(0,R.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-wider text-neutral-400`,children:`Projects`}),(0,R.jsx)(`button`,{onClick:()=>f(!0),className:`rounded-md border border-neutral-700 px-2 py-0.5 text-xs text-neutral-200 hover:bg-neutral-800`,children:`+ New`})]}),(0,R.jsxs)(`div`,{className:`flex-1 overflow-y-auto py-1`,children:[t.length===0&&(0,R.jsx)(`p`,{className:`px-3 py-4 text-sm text-neutral-500`,children:`No projects yet.`}),t.map(e=>{let t=e.id===n,o=r[e.id]??!1;return(0,R.jsxs)(`div`,{className:`mt-1 px-1`,children:[(0,R.jsxs)(`div`,{className:`group flex items-center gap-1 rounded-md px-2 py-1 text-sm ${t?`bg-neutral-800 text-neutral-100`:`text-neutral-300 hover:bg-neutral-900`}`,children:[(0,R.jsx)(`button`,{onClick:()=>a(e.id),className:`flex items-center text-neutral-500 hover:text-neutral-300`,title:o?`Expand`:`Collapse`,children:o?(0,R.jsx)(pe,{size:16}):(0,R.jsx)(de,{size:16})}),p===e.id?(0,R.jsx)(`input`,{value:h,onChange:e=>g(e.target.value),onBlur:()=>void S(e.id),onKeyDown:t=>{t.key===`Enter`&&S(e.id),t.key===`Escape`&&m(void 0)},autoFocus:!0,className:`flex-1 rounded border border-neutral-700 bg-neutral-950 px-1 py-0.5 text-sm`}):(0,R.jsxs)(`button`,{onClick:()=>i(e.id),onDoubleClick:()=>{m(e.id),g(e.name)},className:`flex min-w-0 flex-1 flex-col items-start text-left leading-tight`,title:e.path,children:[(0,R.jsx)(`span`,{className:`w-full truncate`,children:e.name}),(0,R.jsx)(`span`,{className:`w-full truncate font-mono text-[10px] text-neutral-500`,children:vi(e.path)})]}),(0,R.jsx)(`button`,{onClick:()=>void u(e.id),className:`inline-flex p-1 text-neutral-500 hover:text-neutral-200`,title:`New session in this project`,children:(0,R.jsx)(He,{size:16})}),(0,R.jsx)(`button`,{onClick:()=>b(e.id,e.name),className:`inline-flex items-center p-1 text-neutral-500 hover:text-red-400`,title:`Delete project (blocked while live sessions exist)`,children:(0,R.jsx)(rt,{size:16})})]}),!o&&(0,R.jsx)(mi,{projectId:e.id})]},e.id)})]}),d&&(0,R.jsx)(ui,{onClose:()=>f(!1)}),(0,R.jsx)(di,{open:_!==void 0,onClose:()=>y(void 0),title:_===void 0?`Delete project`:`Delete project "${_.name}"`,children:_!==void 0&&(0,R.jsxs)(`div`,{className:`flex flex-col gap-3 px-4 py-3`,children:[(0,R.jsxs)(`p`,{className:`text-xs text-neutral-300`,children:[`Remove "`,_.name,`" from the pi-forge. The project folder on disk is`,` `,(0,R.jsx)(`strong`,{children:`not`}),` deleted; only the pi-forge's record of it goes away.`]}),_.onDiskCount>0&&(0,R.jsxs)(`label`,{className:`flex items-start gap-2 rounded border border-neutral-800 bg-neutral-950 px-2 py-1.5 text-xs text-neutral-300`,children:[(0,R.jsx)(`input`,{type:`checkbox`,checked:_.cascade,onChange:e=>y(t=>t===void 0?t:{...t,cascade:e.target.checked}),className:`mt-0.5 h-3 w-3`}),(0,R.jsxs)(`span`,{children:[`Also delete `,_.onDiskCount,` on-disk session file`,_.onDiskCount===1?``:`s`,` (under`,` `,(0,R.jsxs)(`code`,{className:`font-mono text-[10px] text-neutral-400`,children:[`.pi/sessions/`,_.id,`/`]}),`). Without this, the JSONLs stay on disk and become orphaned — recoverable but not reachable through the pi-forge.`]})]}),_.onDiskCount===0&&(0,R.jsx)(`p`,{className:`text-[11px] italic text-neutral-500`,children:`No on-disk sessions for this project; nothing to clean up beyond the project record.`}),(0,R.jsxs)(`footer`,{className:`flex justify-end gap-2 pt-1`,children:[(0,R.jsx)(`button`,{type:`button`,onClick:()=>y(void 0),className:`rounded-md border border-neutral-700 px-3 py-1 text-xs text-neutral-200 hover:bg-neutral-800`,children:`Cancel`}),(0,R.jsx)(`button`,{type:`button`,onClick:()=>void x(),className:`rounded-md bg-red-700 px-3 py-1 text-xs font-medium text-red-50 hover:bg-red-600`,children:`Delete`})]})]})})]})}function vi(e){let t=e.split(/[/\\]/).filter(e=>e.length>0);return t[t.length-1]??e}function yi(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=yi(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function bi(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=yi(e))&&(r&&(r+=` `),r+=t);return r}var xi=Object.create,Si=Object.defineProperty,Ci=Object.defineProperties,wi=Object.getOwnPropertyDescriptor,Ti=Object.getOwnPropertyDescriptors,Ei=Object.getOwnPropertyNames,Di=Object.getOwnPropertySymbols,Oi=Object.getPrototypeOf,ki=Object.prototype.hasOwnProperty,Ai=Object.prototype.propertyIsEnumerable,ji=(e,t,n)=>t in e?Si(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Mi=(e,t)=>{for(var n in t||={})ki.call(t,n)&&ji(e,n,t[n]);if(Di)for(var n of Di(t))Ai.call(t,n)&&ji(e,n,t[n]);return e},Ni=(e,t)=>Ci(e,Ti(t)),Pi=(e,t)=>{var n={};for(var r in e)ki.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Di)for(var r of Di(e))t.indexOf(r)<0&&Ai.call(e,r)&&(n[r]=e[r]);return n},Fi=(e,t)=>function(){return t||(0,e[Ei(e)[0]])((t={exports:{}}).exports,t),t.exports},Ii=(e,t)=>{for(var n in t)Si(e,n,{get:t[n],enumerable:!0})},Li=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of Ei(t))!ki.call(e,i)&&i!==n&&Si(e,i,{get:()=>t[i],enumerable:!(r=wi(t,i))||r.enumerable});return e},z=((e,t,n)=>(n=e==null?{}:xi(Oi(e)),Li(t||!e||!e.__esModule?Si(n,`default`,{value:e,enumerable:!0}):n,e)))(Fi({"../../node_modules/.pnpm/prismjs@1.29.0_patch_hash=vrxx3pzkik6jpmgpayxfjunetu/node_modules/prismjs/prism.js"(e,t){var n=function(){var e=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,t=0,n={},r={util:{encode:function e(t){return t instanceof i?new i(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/\u00a0/g,` `)},type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,`__id`,{value:++t}),e.__id},clone:function e(t,n){n||={};var i,a;switch(r.util.type(t)){case`Object`:if(a=r.util.objId(t),n[a])return n[a];for(var o in i={},n[a]=i,t)t.hasOwnProperty(o)&&(i[o]=e(t[o],n));return i;case`Array`:return a=r.util.objId(t),n[a]?n[a]:(i=[],n[a]=i,t.forEach(function(t,r){i[r]=e(t,n)}),i);default:return t}},getLanguage:function(t){for(;t;){var n=e.exec(t.className);if(n)return n[1].toLowerCase();t=t.parentElement}return`none`},setLanguage:function(t,n){t.className=t.className.replace(RegExp(e,`gi`),``),t.classList.add(`language-`+n)},isActive:function(e,t,n){for(var r=`no-`+t;e;){var i=e.classList;if(i.contains(t))return!0;if(i.contains(r))return!1;e=e.parentElement}return!!n}},languages:{plain:n,plaintext:n,text:n,txt:n,extend:function(e,t){var n=r.util.clone(r.languages[e]);for(var i in t)n[i]=t[i];return n},insertBefore:function(e,t,n,i){i||=r.languages;var a=i[e],o={};for(var s in a)if(a.hasOwnProperty(s)){if(s==t)for(var c in n)n.hasOwnProperty(c)&&(o[c]=n[c]);n.hasOwnProperty(s)||(o[s]=a[s])}var l=i[e];return i[e]=o,r.languages.DFS(r.languages,function(t,n){n===l&&t!=e&&(this[t]=o)}),o},DFS:function e(t,n,i,a){a||={};var o=r.util.objId;for(var s in t)if(t.hasOwnProperty(s)){n.call(t,s,t[s],i||s);var c=t[s],l=r.util.type(c);l===`Object`&&!a[o(c)]?(a[o(c)]=!0,e(c,n,null,a)):l===`Array`&&!a[o(c)]&&(a[o(c)]=!0,e(c,n,s,a))}}},plugins:{},highlight:function(e,t,n){var a={code:e,grammar:t,language:n};if(r.hooks.run(`before-tokenize`,a),!a.grammar)throw Error(`The language "`+a.language+`" has no grammar.`);return a.tokens=r.tokenize(a.code,a.grammar),r.hooks.run(`after-tokenize`,a),i.stringify(r.util.encode(a.tokens),a.language)},tokenize:function(e,t){var n=t.rest;if(n){for(var r in n)t[r]=n[r];delete t.rest}var i=new s;return c(i,i.head,e),o(e,i,t,i.head,0),u(i)},hooks:{all:{},add:function(e,t){var n=r.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=r.hooks.all[e];if(!(!n||!n.length))for(var i=0,a;a=n[i++];)a(t)}},Token:i};function i(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=(r||``).length|0}i.stringify=function e(t,n){if(typeof t==`string`)return t;if(Array.isArray(t)){var i=``;return t.forEach(function(t){i+=e(t,n)}),i}var a={type:t.type,content:e(t.content,n),tag:`span`,classes:[`token`,t.type],attributes:{},language:n},o=t.alias;o&&(Array.isArray(o)?Array.prototype.push.apply(a.classes,o):a.classes.push(o)),r.hooks.run(`wrap`,a);var s=``;for(var c in a.attributes)s+=` `+c+`="`+(a.attributes[c]||``).replace(/"/g,`&quot;`)+`"`;return`<`+a.tag+` class="`+a.classes.join(` `)+`"`+s+`>`+a.content+`</`+a.tag+`>`};function a(e,t,n,r){e.lastIndex=t;var i=e.exec(n);if(i&&r&&i[1]){var a=i[1].length;i.index+=a,i[0]=i[0].slice(a)}return i}function o(e,t,n,s,u,d){for(var f in n)if(!(!n.hasOwnProperty(f)||!n[f])){var p=n[f];p=Array.isArray(p)?p:[p];for(var m=0;m<p.length;++m){if(d&&d.cause==f+`,`+m)return;var h=p[m],g=h.inside,_=!!h.lookbehind,v=!!h.greedy,y=h.alias;if(v&&!h.pattern.global){var b=h.pattern.toString().match(/[imsuy]*$/)[0];h.pattern=RegExp(h.pattern.source,b+`g`)}for(var x=h.pattern||h,S=s.next,C=u;S!==t.tail&&!(d&&C>=d.reach);C+=S.value.length,S=S.next){var w=S.value;if(t.length>e.length)return;if(!(w instanceof i)){var T=1,E;if(v){if(E=a(x,C,e,_),!E||E.index>=e.length)break;var D=E.index,O=E.index+E[0].length,k=C;for(k+=S.value.length;D>=k;)S=S.next,k+=S.value.length;if(k-=S.value.length,C=k,S.value instanceof i)continue;for(var ee=S;ee!==t.tail&&(k<O||typeof ee.value==`string`);ee=ee.next)T++,k+=ee.value.length;T--,w=e.slice(C,k),E.index-=C}else if(E=a(x,0,w,_),!E)continue;var D=E.index,te=E[0],ne=w.slice(0,D),re=w.slice(D+te.length),ie=C+w.length;d&&ie>d.reach&&(d.reach=ie);var ae=S.prev;ne&&(ae=c(t,ae,ne),C+=ne.length),l(t,ae,T);var A=new i(f,g?r.tokenize(te,g):te,y,te);if(S=c(t,ae,A),re&&c(t,S,re),T>1){var oe={cause:f+`,`+m,reach:ie};o(e,t,n,S.prev,C,oe),d&&oe.reach>d.reach&&(d.reach=oe.reach)}}}}}}function s(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function c(e,t,n){var r=t.next,i={value:n,prev:t,next:r};return t.next=i,r.prev=i,e.length++,i}function l(e,t,n){for(var r=t.next,i=0;i<n&&r!==e.tail;i++)r=r.next;t.next=r,r.prev=t,e.length-=i}function u(e){for(var t=[],n=e.head.next;n!==e.tail;)t.push(n.value),n=n.next;return t}return r}();t.exports=n,n.default=n}})());z.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:`attr-equals`},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:`named-entity`},/&#x?[\da-f]{1,8};/i]},z.languages.markup.tag.inside[`attr-value`].inside.entity=z.languages.markup.entity,z.languages.markup.doctype.inside[`internal-subset`].inside=z.languages.markup,z.hooks.add(`wrap`,function(e){e.type===`entity`&&(e.attributes.title=e.content.replace(/&amp;/,`&`))}),Object.defineProperty(z.languages.markup.tag,`addInlined`,{value:function(e,t){var n={},n=(n[`language-`+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:z.languages[t]},n.cdata=/^<!\[CDATA\[|\]\]>$/i,{"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}}),t=(n[`language-`+t]={pattern:/[\s\S]+/,inside:z.languages[t]},{});t[e]={pattern:RegExp(`(<__[^>]*>)(?:<!\\[CDATA\\[(?:[^\\]]|\\](?!\\]>))*\\]\\]>|(?!<!\\[CDATA\\[)[\\s\\S])*?(?=<\\/__>)`.replace(/__/g,function(){return e}),`i`),lookbehind:!0,greedy:!0,inside:n},z.languages.insertBefore(`markup`,`cdata`,t)}}),Object.defineProperty(z.languages.markup.tag,`addAttribute`,{value:function(e,t){z.languages.markup.tag.inside[`special-attr`].push({pattern:RegExp(`(^|["'\\s])(?:`+e+`)\\s*=\\s*(?:"[^"]*"|'[^']*'|[^\\s'">=]+(?=[\\s>]))`,`i`),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,`language-`+t],inside:z.languages[t]},punctuation:[{pattern:/^=/,alias:`attr-equals`},/"|'/]}}}})}}),z.languages.html=z.languages.markup,z.languages.mathml=z.languages.markup,z.languages.svg=z.languages.markup,z.languages.xml=z.languages.extend(`markup`,{}),z.languages.ssml=z.languages.xml,z.languages.atom=z.languages.xml,z.languages.rss=z.languages.xml,function(e){var t={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:`escape`},n=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/,r=`(?:[^\\\\-]|`+n.source+`)`,r=RegExp(r+`-`+r),i={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:`variable`};e.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:`operator`},"char-class-punctuation":{pattern:/^\[|\]$/,alias:`punctuation`},range:{pattern:r,inside:{escape:n,"range-punctuation":{pattern:/-/,alias:`operator`}}},"special-escape":t,"char-set":{pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:`class-name`},escape:n}},"special-escape":t,"char-set":{pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:`class-name`},backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:`keyword`},{pattern:/\\k<[^<>']+>/,alias:`keyword`,inside:{"group-name":i}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:`function`},escape:n,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]|<?[=!]|[idmnsuxU]+(?:-[idmnsuxU]+)?:?))?/,alias:`punctuation`,inside:{"group-name":i}},{pattern:/\)/,alias:`punctuation`}],quantifier:{pattern:/(?:[+*?]|\{\d+(?:,\d*)?\})[?+]?/,alias:`number`},alternation:{pattern:/\|/,alias:`keyword`}}}(z),z.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},z.languages.javascript=z.languages.extend(`clike`,{"class-name":[z.languages.clike[`class-name`],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(`(^|[^\\w$])(?:NaN|Infinity|0[bB][01]+(?:_[01]+)*n?|0[oO][0-7]+(?:_[0-7]+)*n?|0[xX][\\dA-Fa-f]+(?:_[\\dA-Fa-f]+)*n?|\\d+(?:_\\d+)*n|(?:\\d+(?:_\\d+)*(?:\\.(?:\\d+(?:_\\d+)*)?)?|\\.\\d+(?:_\\d+)*)(?:[Ee][+-]?\\d+(?:_\\d+)*)?)(?![\\w$])`),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),z.languages.javascript[`class-name`][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,z.languages.insertBefore(`javascript`,`keyword`,{regex:{pattern:RegExp(`((?:^|[^$\\w\\xA0-\\uFFFF."'\\])\\s]|\\b(?:return|yield))\\s*)\\/(?:(?:\\[(?:[^\\]\\\\\\r\\n]|\\\\.)*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}|(?:\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.)*\\])*\\])*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}v[dgimyus]{0,7})(?=(?:\\s|\\/\\*(?:[^*]|\\*(?!\\/))*\\*\\/)*(?:$|[\\r\\n,.;:})\\]]|\\/\\/))`),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:`language-regex`,inside:z.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:`function`},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:z.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:z.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:z.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:z.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),z.languages.insertBefore(`javascript`,`string`,{hashbang:{pattern:/^#!.*/,greedy:!0,alias:`comment`},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:`string`},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:`punctuation`},rest:z.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:`property`}}),z.languages.insertBefore(`javascript`,`operator`,{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:`property`}}),z.languages.markup&&(z.languages.markup.tag.addInlined(`script`,`javascript`),z.languages.markup.tag.addAttribute(`on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)`,`javascript`)),z.languages.js=z.languages.javascript,z.languages.actionscript=z.languages.extend(`javascript`,{keyword:/\b(?:as|break|case|catch|class|const|default|delete|do|dynamic|each|else|extends|final|finally|for|function|get|if|implements|import|in|include|instanceof|interface|internal|is|namespace|native|new|null|override|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|use|var|void|while|with)\b/,operator:/\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<<?|>>?>?|[!=]=?)=?|[~?@]/}),z.languages.actionscript[`class-name`].alias=`function`,delete z.languages.actionscript.parameter,delete z.languages.actionscript[`literal-property`],z.languages.markup&&z.languages.insertBefore(`actionscript`,`string`,{xml:{pattern:/(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\[\s\S]|(?!\2)[^\\])*\2)*\s*\/?>/,lookbehind:!0,inside:z.languages.markup}}),function(e){var t=/#(?!\{).+/,n={pattern:/#\{[^}]+\}/,alias:`variable`};e.languages.coffeescript=e.languages.extend(`javascript`,{comment:t,string:[{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,inside:{interpolation:n}}],keyword:/\b(?:and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/,"class-member":{pattern:/@(?!\d)\w+/,alias:`variable`}}),e.languages.insertBefore(`coffeescript`,`comment`,{"multiline-comment":{pattern:/###[\s\S]+?###/,alias:`comment`},"block-regex":{pattern:/\/{3}[\s\S]*?\/{3}/,alias:`regex`,inside:{comment:t,interpolation:n}}}),e.languages.insertBefore(`coffeescript`,`string`,{"inline-javascript":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,inside:{delimiter:{pattern:/^`|`$/,alias:`punctuation`},script:{pattern:/[\s\S]+/,alias:`language-javascript`,inside:e.languages.javascript}}},"multiline-string":[{pattern:/'''[\s\S]*?'''/,greedy:!0,alias:`string`},{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:`string`,inside:{interpolation:n}}]}),e.languages.insertBefore(`coffeescript`,`keyword`,{property:/(?!\d)\w+(?=\s*:(?!:))/}),delete e.languages.coffeescript[`template-string`],e.languages.coffee=e.languages.coffeescript}(z),function(e){var t=e.languages.javadoclike={parameter:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*@(?:arg|arguments|param)\s+)\w+/m,lookbehind:!0},keyword:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*|\{)@[a-z][a-zA-Z-]+\b/m,lookbehind:!0},punctuation:/[{}]/};Object.defineProperty(t,`addSupport`,{value:function(t,n){(t=typeof t==`string`?[t]:t).forEach(function(t){var r=function(e){e.inside||={},e.inside.rest=n},i=`doc-comment`;if(a=e.languages[t]){var a,o=a[i];if((o||=(a=e.languages.insertBefore(t,`comment`,{"doc-comment":{pattern:/(^|[^\\])\/\*\*[^/][\s\S]*?(?:\*\/|$)/,lookbehind:!0,alias:`comment`}}))[i])instanceof RegExp&&(o=a[i]={pattern:o}),Array.isArray(o))for(var s=0,c=o.length;s<c;s++)o[s]instanceof RegExp&&(o[s]={pattern:o[s]}),r(o[s]);else r(o)}})}}),t.addSupport([`java`,`javascript`,`php`],t)}(z),function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/,t=(e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp(`@[\\w-](?:[^;{\\s"']|\\s+(?!\\s)|`+t.source+`)*?(?:;|(?=\\s*\\{))`),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:`selector`},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp(`\\burl\\((?:`+t.source+`|(?:[^\\\\\\r\\n()"']|\\\\[\\s\\S])*)\\)`,`i`),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp(`^`+t.source+`$`),alias:`url`}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+`)*(?=\\s*\\{)`),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css,e.languages.markup);t&&(t.tag.addInlined(`style`,`css`),t.tag.addAttribute(`style`,`css`))}(z),function(e){var t=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,t=(e.languages.css.selector={pattern:e.languages.css.selector.pattern,lookbehind:!0,inside:t={"pseudo-element":/:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,"pseudo-class":/:[-\w]+/,class:/\.[-\w]+/,id:/#[-\w]+/,attribute:{pattern:RegExp(`\\[(?:[^[\\]"']|`+t.source+`)*\\]`),greedy:!0,inside:{punctuation:/^\[|\]$/,"case-sensitivity":{pattern:/(\s)[si]$/i,lookbehind:!0,alias:`keyword`},namespace:{pattern:/^(\s*)(?:(?!\s)[-*\w\xA0-\uFFFF])*\|(?!=)/,lookbehind:!0,inside:{punctuation:/\|$/}},"attr-name":{pattern:/^(\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+/,lookbehind:!0},"attr-value":[t,{pattern:/(=\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+(?=\s*$)/,lookbehind:!0}],operator:/[|~*^$]?=/}},"n-th":[{pattern:/(\(\s*)[+-]?\d*[\dn](?:\s*[+-]\s*\d+)?(?=\s*\))/,lookbehind:!0,inside:{number:/[\dn]+/,operator:/[+-]/}},{pattern:/(\(\s*)(?:even|odd)(?=\s*\))/i,lookbehind:!0}],combinator:/>|\+|~|\|\|/,punctuation:/[(),]/}},e.languages.css.atrule.inside[`selector-function-argument`].inside=t,e.languages.insertBefore(`css`,`property`,{variable:{pattern:/(^|[^-\w\xA0-\uFFFF])--(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*/i,lookbehind:!0}}),{pattern:/(\b\d+)(?:%|[a-z]+(?![\w-]))/,lookbehind:!0}),n={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0};e.languages.insertBefore(`css`,`function`,{operator:{pattern:/(\s)[+\-*\/](?=\s)/,lookbehind:!0},hexcode:{pattern:/\B#[\da-f]{3,8}\b/i,alias:`color`},color:[{pattern:/(^|[^\w-])(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|RebeccaPurple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)(?![\w-])/i,lookbehind:!0},{pattern:/\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:t,number:n,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:t,number:n})}(z),function(e){var t=/[*&][^\s[\]{},]+/,n=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,r=`(?:`+n.source+`(?:[ ]+`+t.source+`)?|`+t.source+`(?:[ ]+`+n.source+`)?)`,i=`(?:[^\\s\\x00-\\x08\\x0e-\\x1f!"#%&'*,\\-:>?@[\\]\`{|}\\x7f-\\x84\\x86-\\x9f\\ud800-\\udfff\\ufffe\\uffff]|[?:-]<PLAIN>)(?:[ \\t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*`.replace(/<PLAIN>/g,function(){return`[^\\s\\x00-\\x08\\x0e-\\x1f,[\\]{}\\x7f-\\x84\\x86-\\x9f\\ud800-\\udfff\\ufffe\\uffff]`}),a=`"(?:[^"\\\\\\r\\n]|\\\\.)*"|'(?:[^'\\\\\\r\\n]|\\\\.)*'`;function o(e,t){t=(t||``).replace(/m/g,``)+`m`;var n=`([:\\-,[{]\\s*(?:\\s<<prop>>[ \\t]+)?)(?:<<value>>)(?=[ \\t]*(?:$|,|\\]|\\}|(?:[\\r\\n]\\s*)?#))`.replace(/<<prop>>/g,function(){return r}).replace(/<<value>>/g,function(){return e});return RegExp(n,t)}e.languages.yaml={scalar:{pattern:RegExp(`([\\-:]\\s*(?:\\s<<prop>>[ \\t]+)?[|>])[ \\t]*(?:((?:\\r?\\n|\\r)[ \\t]+)\\S[^\\r\\n]*(?:\\2[^\\r\\n]+)*)`.replace(/<<prop>>/g,function(){return r})),lookbehind:!0,alias:`string`},comment:/#.*/,key:{pattern:RegExp(`((?:^|[:\\-,[{\\r\\n?])[ \\t]*(?:<<prop>>[ \\t]+)?)<<key>>(?=\\s*:\\s)`.replace(/<<prop>>/g,function(){return r}).replace(/<<key>>/g,function(){return`(?:`+i+`|`+a+`)`})),lookbehind:!0,greedy:!0,alias:`atrule`},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:`important`},datetime:{pattern:o(`\\d{4}-\\d\\d?-\\d\\d?(?:[tT]|[ \\t]+)\\d\\d?:\\d{2}:\\d{2}(?:\\.\\d*)?(?:[ \\t]*(?:Z|[-+]\\d\\d?(?::\\d{2})?))?|\\d{4}-\\d{2}-\\d{2}|\\d\\d?:\\d{2}(?::\\d{2}(?:\\.\\d*)?)?`),lookbehind:!0,alias:`number`},boolean:{pattern:o(`false|true`,`i`),lookbehind:!0,alias:`important`},null:{pattern:o(`null|~`,`i`),lookbehind:!0,alias:`important`},string:{pattern:o(a),lookbehind:!0,greedy:!0},number:{pattern:o(`[+-]?(?:0x[\\da-f]+|0o[0-7]+|(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:e[+-]?\\d+)?|\\.inf|\\.nan)`,`i`),lookbehind:!0},tag:n,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml}(z),function(e){var t=`(?:\\\\.|[^\\\\\\n\\r]|(?:\\n|\\r\\n?)(?![\\r\\n]))`;function n(e){return e=e.replace(/<inner>/g,function(){return t}),RegExp(`((?:^|[^\\\\])(?:\\\\{2})*)(?:`+e+`)`)}var r="(?:\\\\.|``(?:[^`\\r\\n]|`(?!`))+``|`[^`\\r\\n]+`|[^\\\\|\\r\\n`])+",i=`\\|?__(?:\\|__)+\\|?(?:(?:\\n|\\r\\n?)|(?![\\s\\S]))`.replace(/__/g,function(){return r}),a=`\\|?[ \\t]*:?-{3,}:?[ \\t]*(?:\\|[ \\t]*:?-{3,}:?[ \\t]*)+\\|?(?:\\n|\\r\\n?)`,o=(e.languages.markdown=e.languages.extend(`markup`,{}),e.languages.insertBefore(`markdown`,`prolog`,{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:[`yaml`,`language-yaml`],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:`punctuation`},table:{pattern:RegExp(`^`+i+a+`(?:`+i+`)*`,`m`),inside:{"table-data-rows":{pattern:RegExp(`^(`+i+a+`)(?:`+i+`)*$`),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp(`^(`+i+`)`+a+`$`),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp(`^`+i+`$`),inside:{"table-header":{pattern:RegExp(r),alias:`important`,inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:`keyword`},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:`important`,inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:`important`,inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:`punctuation`},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:`punctuation`},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:`url`},bold:{pattern:n(`\\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\\b|\\*\\*(?:(?!\\*)<inner>|\\*(?:(?!\\*)<inner>)+\\*)+\\*\\*`),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(`\\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\\b|\\*(?:(?!\\*)<inner>|\\*\\*(?:(?!\\*)<inner>)+\\*\\*)+\\*`),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(`(~~?)(?:(?!~)<inner>)+\\2`),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:[`code`,`keyword`]},url:{pattern:n(`!?\\[(?:(?!\\])<inner>)+\\](?:\\([^\\s)]+(?:[\\t ]+"(?:\\\\.|[^"\\\\])*")?\\)|[ \\t]?\\[(?:(?!\\])<inner>)+\\])`),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),[`url`,`bold`,`italic`,`strike`].forEach(function(t){[`url`,`bold`,`italic`,`strike`,`code-snippet`].forEach(function(n){t!==n&&(e.languages.markdown[t].inside.content.inside[n]=e.languages.markdown[n])})}),e.hooks.add(`after-tokenize`,function(e){e.language!==`markdown`&&e.language!==`md`||function e(t){if(t&&typeof t!=`string`)for(var n=0,r=t.length;n<r;n++){var i,a=t[n];a.type===`code`?(i=a.content[1],a=a.content[3],i&&a&&i.type===`code-language`&&a.type===`code-block`&&typeof i.content==`string`&&(i=i.content.replace(/\b#/g,`sharp`).replace(/\b\+\+/g,`pp`),i=`language-`+(i=(/[a-z][\w-]*/i.exec(i)||[``])[0].toLowerCase()),a.alias?typeof a.alias==`string`?a.alias=[a.alias,i]:a.alias.push(i):a.alias=[i])):e(a.content)}}(e.tokens)}),e.hooks.add(`wrap`,function(t){if(t.type===`code-block`){for(var n=``,r=0,i=t.classes.length;r<i;r++){var a=t.classes[r],a=/language-(.+)/.exec(a);if(a){n=a[1];break}}var l,u=e.languages[n];u?t.content=e.highlight(function(e){return e=e.replace(o,``),e=e.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(e,t){var n;return(t=t.toLowerCase())[0]===`#`?(n=t[1]===`x`?parseInt(t.slice(2),16):Number(t.slice(1)),c(n)):s[t]||e})}(t.content),u,n):n&&n!==`none`&&e.plugins.autoloader&&(l=`md-`+new Date().valueOf()+`-`+Math.floor(0x2386f26fc10000*Math.random()),t.attributes.id=l,e.plugins.autoloader.loadLanguages(n,function(){var t=document.getElementById(l);t&&(t.innerHTML=e.highlight(t.textContent,e.languages[n],n))}))}}),RegExp(e.languages.markup.tag.pattern.source,`gi`)),s={amp:`&`,lt:`<`,gt:`>`,quot:`"`},c=String.fromCodePoint||String.fromCharCode;e.languages.md=e.languages.markdown}(z),z.languages.graphql={comment:/#.*/,description:{pattern:/(?:"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*")(?=\s*[a-z_])/i,greedy:!0,alias:`string`,inside:{"language-markdown":{pattern:/(^"(?:"")?)(?!\1)[\s\S]+(?=\1$)/,lookbehind:!0,inside:z.languages.markdown}}},string:{pattern:/"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},number:/(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,boolean:/\b(?:false|true)\b/,variable:/\$[a-z_]\w*/i,directive:{pattern:/@[a-z_]\w*/i,alias:`function`},"attr-name":{pattern:/\b[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,greedy:!0},"atom-input":{pattern:/\b[A-Z]\w*Input\b/,alias:`class-name`},scalar:/\b(?:Boolean|Float|ID|Int|String)\b/,constant:/\b[A-Z][A-Z_\d]*\b/,"class-name":{pattern:/(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*|:\s*|\[)[A-Z_]\w*/,lookbehind:!0},fragment:{pattern:/(\bfragment\s+|\.{3}\s*(?!on\b))[a-zA-Z_]\w*/,lookbehind:!0,alias:`function`},"definition-mutation":{pattern:/(\bmutation\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:`function`},"definition-query":{pattern:/(\bquery\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:`function`},keyword:/\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/,operator:/[!=|&]|\.{3}/,"property-query":/\w+(?=\s*\()/,object:/\w+(?=\s*\{)/,punctuation:/[!(){}\[\]:=,]/,property:/\w+/},z.hooks.add(`after-tokenize`,function(e){if(e.language===`graphql`)for(var t=e.tokens.filter(function(e){return typeof e!=`string`&&e.type!==`comment`&&e.type!==`scalar`}),n=0;n<t.length;){var r=t[n++];if(r.type===`keyword`&&r.content===`mutation`){var i=[];if(d([`definition-mutation`,`punctuation`])&&u(1).content===`(`){n+=2;var a=f(/^\($/,/^\)$/);if(a===-1)continue;for(;n<a;n++){var o=u(0);o.type===`variable`&&(p(o,`variable-input`),i.push(o.content))}n=a+1}if(d([`punctuation`,`property-query`])&&u(0).content===`{`&&(n++,p(u(0),`property-mutation`),0<i.length)){var s=f(/^\{$/,/^\}$/);if(s!==-1)for(var c=n;c<s;c++){var l=t[c];l.type===`variable`&&0<=i.indexOf(l.content)&&p(l,`variable-input`)}}}}function u(e){return t[n+e]}function d(e,t){t||=0;for(var n=0;n<e.length;n++){var r=u(n+t);if(!r||r.type!==e[n])return}return 1}function f(e,r){for(var i=1,a=n;a<t.length;a++){var o=t[a],s=o.content;if(o.type===`punctuation`&&typeof s==`string`){if(e.test(s))i++;else if(r.test(s)&&--i===0)return a}}return-1}function p(e,t){var n=e.alias;n?Array.isArray(n)||(e.alias=n=[n]):e.alias=n=[],n.push(t)}}),z.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},function(e){var t=e.languages.javascript[`template-string`],n=t.pattern.source,r=t.inside.interpolation,i=r.inside[`interpolation-punctuation`],a=r.pattern.source;function o(t,r){if(e.languages[t])return{pattern:RegExp(`((?:`+r+`)\\s*)`+n),lookbehind:!0,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:`string`},"embedded-code":{pattern:/[\s\S]+/,alias:t}}}}function s(t,n,r){return t={code:t,grammar:n,language:r},e.hooks.run(`before-tokenize`,t),t.tokens=e.tokenize(t.code,t.grammar),e.hooks.run(`after-tokenize`,t),t.tokens}function c(t,n,o){var c=e.tokenize(t,{interpolation:{pattern:RegExp(a),lookbehind:!0}}),l=0,u={},c=s(c.map(function(e){if(typeof e==`string`)return e;for(var n,r,e=e.content;t.indexOf((r=l++,n=`___`+o.toUpperCase()+`_`+r+`___`))!==-1;);return u[n]=e,n}).join(``),n,o),d=Object.keys(u);return l=0,function t(n){for(var a=0;a<n.length;a++){if(l>=d.length)return;var o,c,f,p,m,h,g,_=n[a];typeof _==`string`||typeof _.content==`string`?(o=d[l],(g=(h=typeof _==`string`?_:_.content).indexOf(o))!==-1&&(++l,c=h.substring(0,g),m=u[o],f=void 0,(p={})[`interpolation-punctuation`]=i,(p=e.tokenize(m,p)).length===3&&((f=[1,1]).push.apply(f,s(p[1],e.languages.javascript,`javascript`)),p.splice.apply(p,f)),f=new e.Token(`interpolation`,p,r.alias,m),p=h.substring(g+o.length),m=[],c&&m.push(c),m.push(f),p&&(t(h=[p]),m.push.apply(m,h)),typeof _==`string`?(n.splice.apply(n,[a,1].concat(m)),a+=m.length-1):_.content=m)):(g=_.content,t(Array.isArray(g)?g:[g]))}}(c),new e.Token(o,c,`language-`+o,t)}e.languages.javascript[`template-string`]=[o(`css`,`\\b(?:styled(?:\\([^)]*\\))?(?:\\s*\\.\\s*\\w+(?:\\([^)]*\\))*)*|css(?:\\s*\\.\\s*(?:global|resolve))?|createGlobalStyle|keyframes)`),o(`html`,`\\bhtml|\\.\\s*(?:inner|outer)HTML\\s*\\+?=`),o(`svg`,`\\bsvg`),o(`markdown`,`\\b(?:markdown|md)`),o(`graphql`,`\\b(?:gql|graphql(?:\\s*\\.\\s*experimental)?)`),o(`sql`,`\\bsql`),t].filter(Boolean);var l={javascript:!0,js:!0,typescript:!0,ts:!0,jsx:!0,tsx:!0};function u(e){return typeof e==`string`?e:Array.isArray(e)?e.map(u).join(``):u(e.content)}e.hooks.add(`after-tokenize`,function(t){t.language in l&&function t(n){for(var r=0,i=n.length;r<i;r++){var a,o,s,l=n[r];typeof l!=`string`&&(a=l.content,Array.isArray(a)?l.type===`template-string`?(l=a[1],a.length===3&&typeof l!=`string`&&l.type===`embedded-code`&&(o=u(l),l=l.alias,l=Array.isArray(l)?l[0]:l,s=e.languages[l])&&(a[1]=c(o,s,l))):t(a):typeof a!=`string`&&t([a]))}}(t.tokens)})}(z),function(e){e.languages.typescript=e.languages.extend(`javascript`,{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript[`literal-property`];var t=e.languages.extend(`typescript`,{});delete t[`class-name`],e.languages.typescript[`class-name`].inside=t,e.languages.insertBefore(`typescript`,`function`,{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:`operator`},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:`class-name`,inside:t}}}}),e.languages.ts=e.languages.typescript}(z),function(e){var t=e.languages.javascript,n=`\\{(?:[^{}]|\\{(?:[^{}]|\\{[^{}]*\\})*\\})+\\}`,r=`(@(?:arg|argument|param|property)\\s+(?:`+n+`\\s+)?)`;e.languages.jsdoc=e.languages.extend(`javadoclike`,{parameter:{pattern:RegExp(r+`(?:(?!\\s)[$\\w\\xA0-\\uFFFF.])+(?=\\s|$)`),lookbehind:!0,inside:{punctuation:/\./}}}),e.languages.insertBefore(`jsdoc`,`keyword`,{"optional-parameter":{pattern:RegExp(r+`\\[(?:(?!\\s)[$\\w\\xA0-\\uFFFF.])+(?:=[^[\\]]+)?\\](?=\\s|$)`),lookbehind:!0,inside:{parameter:{pattern:/(^\[)[$\w\xA0-\uFFFF\.]+/,lookbehind:!0,inside:{punctuation:/\./}},code:{pattern:/(=)[\s\S]*(?=\]$)/,lookbehind:!0,inside:t,alias:`language-javascript`},punctuation:/[=[\]]/}},"class-name":[{pattern:RegExp(`(@(?:augments|class|extends|interface|memberof!?|template|this|typedef)\\s+(?:<TYPE>\\s+)?)[A-Z]\\w*(?:\\.[A-Z]\\w*)*`.replace(/<TYPE>/g,function(){return n})),lookbehind:!0,inside:{punctuation:/\./}},{pattern:RegExp(`(@[a-z]+\\s+)`+n),lookbehind:!0,inside:{string:t.string,number:t.number,boolean:t.boolean,keyword:e.languages.typescript.keyword,operator:/=>|\.\.\.|[&|?:*]/,punctuation:/[.,;=<>{}()[\]]/}}],example:{pattern:/(@example\s+(?!\s))(?:[^@\s]|\s+(?!\s))+?(?=\s*(?:\*\s*)?(?:@\w|\*\/))/,lookbehind:!0,inside:{code:{pattern:/^([\t ]*(?:\*\s*)?)\S.*$/m,lookbehind:!0,inside:t,alias:`language-javascript`}}}}),e.languages.javadoclike.addSupport(`javascript`,e.languages.jsdoc)}(z),function(e){e.languages.flow=e.languages.extend(`javascript`,{}),e.languages.insertBefore(`flow`,`keyword`,{type:[{pattern:/\b(?:[Bb]oolean|Function|[Nn]umber|[Ss]tring|[Ss]ymbol|any|mixed|null|void)\b/,alias:`class-name`}]}),e.languages.flow[`function-variable`].pattern=/(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=\s*(?:function\b|(?:\([^()]*\)(?:\s*:\s*\w+)?|(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/i,delete e.languages.flow.parameter,e.languages.insertBefore(`flow`,`operator`,{"flow-punctuation":{pattern:/\{\||\|\}/,alias:`punctuation`}}),Array.isArray(e.languages.flow.keyword)||(e.languages.flow.keyword=[e.languages.flow.keyword]),e.languages.flow.keyword.unshift({pattern:/(^|[^$]\b)(?:Class|declare|opaque|type)\b(?!\$)/,lookbehind:!0},{pattern:/(^|[^$]\B)\$(?:Diff|Enum|Exact|Keys|ObjMap|PropertyType|Record|Shape|Subtype|Supertype|await)\b(?!\$)/,lookbehind:!0})}(z),z.languages.n4js=z.languages.extend(`javascript`,{keyword:/\b(?:Array|any|boolean|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|module|new|null|number|package|private|protected|public|return|set|static|string|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/}),z.languages.insertBefore(`n4js`,`constant`,{annotation:{pattern:/@+\w+/,alias:`operator`}}),z.languages.n4jsd=z.languages.n4js,function(e){function t(e,t){return RegExp(e.replace(/<ID>/g,function(){return`(?!\\s)[_$a-zA-Z\\xA0-\\uFFFF](?:(?!\\s)[$\\w\\xA0-\\uFFFF])*`}),t)}e.languages.insertBefore(`javascript`,`function-variable`,{"method-variable":{pattern:RegExp(`(\\.\\s*)`+e.languages.javascript[`function-variable`].pattern.source),lookbehind:!0,alias:[`function-variable`,`method`,`function`,`property-access`]}}),e.languages.insertBefore(`javascript`,`function`,{method:{pattern:RegExp(`(\\.\\s*)`+e.languages.javascript.function.source),lookbehind:!0,alias:[`function`,`property-access`]}}),e.languages.insertBefore(`javascript`,`constant`,{"known-class-name":[{pattern:/\b(?:(?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|(?:Weak)?(?:Map|Set)|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|WebAssembly)\b/,alias:`class-name`},{pattern:/\b(?:[A-Z]\w*)Error\b/,alias:`class-name`}]}),e.languages.insertBefore(`javascript`,`keyword`,{imports:{pattern:t(`(\\bimport\\b\\s*)(?:<ID>(?:\\s*,\\s*(?:\\*\\s*as\\s+<ID>|\\{[^{}]*\\}))?|\\*\\s*as\\s+<ID>|\\{[^{}]*\\})(?=\\s*\\bfrom\\b)`),lookbehind:!0,inside:e.languages.javascript},exports:{pattern:t(`(\\bexport\\b\\s*)(?:\\*(?:\\s*as\\s+<ID>)?(?=\\s*\\bfrom\\b)|\\{[^{}]*\\})`),lookbehind:!0,inside:e.languages.javascript}}),e.languages.javascript.keyword.unshift({pattern:/\b(?:as|default|export|from|import)\b/,alias:`module`},{pattern:/\b(?:await|break|catch|continue|do|else|finally|for|if|return|switch|throw|try|while|yield)\b/,alias:`control-flow`},{pattern:/\bnull\b/,alias:[`null`,`nil`]},{pattern:/\bundefined\b/,alias:`nil`}),e.languages.insertBefore(`javascript`,`operator`,{spread:{pattern:/\.{3}/,alias:`operator`},arrow:{pattern:/=>/,alias:`operator`}}),e.languages.insertBefore(`javascript`,`punctuation`,{"property-access":{pattern:t(`(\\.\\s*)#?<ID>`),lookbehind:!0},"maybe-class-name":{pattern:/(^|[^$\w\xA0-\uFFFF])[A-Z][$\w\xA0-\uFFFF]+/,lookbehind:!0},dom:{pattern:/\b(?:document|(?:local|session)Storage|location|navigator|performance|window)\b/,alias:`variable`},console:{pattern:/\bconsole(?=\s*\.)/,alias:`class-name`}});for(var n=[`function`,`function-variable`,`method`,`method-variable`,`property-access`],r=0;r<n.length;r++){var i=n[r],a=e.languages.javascript[i],i=(a=e.util.type(a)===`RegExp`?e.languages.javascript[i]={pattern:a}:a).inside||{};(a.inside=i)[`maybe-class-name`]=/^[A-Z][\s\S]*/}}(z),function(e){var t=e.util.clone(e.languages.javascript),n=`(?:\\s|\\/\\/.*(?!.)|\\/\\*(?:[^*]|\\*(?!\\/))\\*\\/)`,r=`(?:\\{(?:\\{(?:\\{[^{}]*\\}|[^{}])*\\}|[^{}])*\\})`,i=`(?:\\{<S>*\\.{3}(?:[^{}]|<BRACES>)*\\})`;function a(e,t){return e=e.replace(/<S>/g,function(){return n}).replace(/<BRACES>/g,function(){return r}).replace(/<SPREAD>/g,function(){return i}),RegExp(e,t)}i=a(i).source,e.languages.jsx=e.languages.extend(`markup`,t),e.languages.jsx.tag.pattern=a(`<\\/?(?:[\\w.:-]+(?:<S>+(?:[\\w.:$-]+(?:=(?:"(?:\\\\[\\s\\S]|[^\\\\"])*"|'(?:\\\\[\\s\\S]|[^\\\\'])*'|[^\\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\\/?)?>`),e.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,e.languages.jsx.tag.inside[`attr-value`].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,e.languages.jsx.tag.inside.tag.inside[`class-name`]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,e.languages.jsx.tag.inside.comment=t.comment,e.languages.insertBefore(`inside`,`attr-name`,{spread:{pattern:a(`<SPREAD>`),inside:e.languages.jsx}},e.languages.jsx.tag),e.languages.insertBefore(`inside`,`special-attr`,{script:{pattern:a(`=<BRACES>`),alias:`language-javascript`,inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:`punctuation`},rest:e.languages.jsx}}},e.languages.jsx.tag);function o(t){for(var n=[],r=0;r<t.length;r++){var i=t[r],a=!1;typeof i!=`string`&&(i.type===`tag`&&i.content[0]&&i.content[0].type===`tag`?i.content[0].content[0].content===`</`?0<n.length&&n[n.length-1].tagName===s(i.content[0].content[1])&&n.pop():i.content[i.content.length-1].content!==`/>`&&n.push({tagName:s(i.content[0].content[1]),openedBraces:0}):0<n.length&&i.type===`punctuation`&&i.content===`{`?n[n.length-1].openedBraces++:0<n.length&&0<n[n.length-1].openedBraces&&i.type===`punctuation`&&i.content===`}`?n[n.length-1].openedBraces--:a=!0),(a||typeof i==`string`)&&0<n.length&&n[n.length-1].openedBraces===0&&(a=s(i),r<t.length-1&&(typeof t[r+1]==`string`||t[r+1].type===`plain-text`)&&(a+=s(t[r+1]),t.splice(r+1,1)),0<r&&(typeof t[r-1]==`string`||t[r-1].type===`plain-text`)&&(a=s(t[r-1])+a,t.splice(r-1,1),r--),t[r]=new e.Token(`plain-text`,a,null,a)),i.content&&typeof i.content!=`string`&&o(i.content)}}var s=function(e){return e?typeof e==`string`?e:typeof e.content==`string`?e.content:e.content.map(s).join(``):``};e.hooks.add(`after-tokenize`,function(e){e.language!==`jsx`&&e.language!==`tsx`||o(e.tokens)})}(z),function(e){var t=e.util.clone(e.languages.typescript),t=(e.languages.tsx=e.languages.extend(`jsx`,t),delete e.languages.tsx.parameter,delete e.languages.tsx[`literal-property`],e.languages.tsx.tag);t.pattern=RegExp(`(^|[^\\w$]|(?=<\\/))(?:`+t.pattern.source+`)`,t.pattern.flags),t.lookbehind=!0}(z),z.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(`(^|[^"#])(?:"(?:\\\\(?:\\((?:[^()]|\\([^()]*\\))*\\)|\\r\\n|[^(])|[^\\\\\\r\\n"])*"|"""(?:\\\\(?:\\((?:[^()]|\\([^()]*\\))*\\)|[^(])|[^\\\\"]|"(?!""))*""")(?!["#])`),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:`punctuation`},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(`(^|[^"#])(#+)(?:"(?:\\\\(?:#+\\((?:[^()]|\\([^()]*\\))*\\)|\\r\\n|[^#])|[^\\\\\\r\\n])*?"|"""(?:\\\\(?:#+\\((?:[^()]|\\([^()]*\\))*\\)|[^#])|[^\\\\])*?""")\\2`),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:`punctuation`},string:/[\s\S]+/}}],directive:{pattern:RegExp(`#(?:(?:elseif|if)\\b(?:[ ]*(?:![ \\t]*)?(?:\\b\\w+\\b(?:[ \\t]*\\((?:[^()]|\\([^()]*\\))*\\))?|\\((?:[^()]|\\([^()]*\\))*\\))(?:[ \\t]*(?:&&|\\|\\|))?)+|(?:else|endif)\\b)`),alias:`property`,inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:`constant`},"other-directive":{pattern:/#\w+\b/,alias:`property`},attribute:{pattern:/@\w+/,alias:`atrule`},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:`function`},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:`important`},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:`constant`},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:`keyword`},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},z.languages.swift[`string-literal`].forEach(function(e){e.inside.interpolation.inside=z.languages.swift}),function(e){e.languages.kotlin=e.languages.extend(`clike`,{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete e.languages.kotlin[`class-name`];var t={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:`punctuation`},expression:{pattern:/[\s\S]+/,inside:e.languages.kotlin}};e.languages.insertBefore(`kotlin`,`string`,{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:`multiline`,inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:t},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:`singleline`,inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:t},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete e.languages.kotlin.string,e.languages.insertBefore(`kotlin`,`keyword`,{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:`builtin`}}),e.languages.insertBefore(`kotlin`,`function`,{label:{pattern:/\b\w+@|@\w+\b/,alias:`symbol`}}),e.languages.kt=e.languages.kotlin,e.languages.kts=e.languages.kotlin}(z),z.languages.c=z.languages.extend(`clike`,{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),z.languages.insertBefore(`c`,`string`,{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),z.languages.insertBefore(`c`,`string`,{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:`property`,inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},z.languages.c.string],char:z.languages.c.char,comment:z.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:`function`}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:`keyword`},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:z.languages.c}}}}),z.languages.insertBefore(`c`,`function`,{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete z.languages.c.boolean,z.languages.objectivec=z.languages.extend(`c`,{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete z.languages.objectivec[`class-name`],z.languages.objc=z.languages.objectivec,z.languages.reason=z.languages.extend(`clike`,{string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,greedy:!0},"class-name":/\b[A-Z]\w*/,keyword:/\b(?:and|as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|method|module|mutable|new|nonrec|object|of|open|or|private|rec|sig|struct|switch|then|to|try|type|val|virtual|when|while|with)\b/,operator:/\.{3}|:[:=]|\|>|->|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:asr|land|lor|lsl|lsr|lxor|mod)\b/}),z.languages.insertBefore(`reason`,`class-name`,{char:{pattern:/'(?:\\x[\da-f]{2}|\\o[0-3][0-7][0-7]|\\\d{3}|\\.|[^'\\\r\n])'/,greedy:!0},constructor:/\b[A-Z]\w*\b(?!\s*\.)/,label:{pattern:/\b[a-z]\w*(?=::)/,alias:`symbol`}}),delete z.languages.reason.function,function(e){for(var t=`\\/\\*(?:[^*/]|\\*(?!\\/)|\\/(?!\\*)|<self>)*\\*\\/`,n=0;n<2;n++)t=t.replace(/<self>/g,function(){return t});t=t.replace(/<self>/g,function(){return`[^\\s\\S]`}),e.languages.rust={comment:[{pattern:RegExp(`(^|[^\\\\])`+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:`attr-name`,inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:`punctuation`},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:`symbol`},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:`punctuation`},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:`function`},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:`class-name`},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:`namespace`},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:`namespace`,inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:`property`},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},e.languages.rust[`closure-params`].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string}(z),z.languages.go=z.languages.extend(`clike`,{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),z.languages.insertBefore(`go`,`string`,{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete z.languages.go[`class-name`],function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=`\\b(?!<keyword>)\\w+(?:\\s*\\.\\s*\\w+)*\\b`.replace(/<keyword>/g,function(){return t.source});e.languages.cpp=e.languages.extend(`c`,{"class-name":[{pattern:RegExp(`(\\b(?:class|concept|enum|struct|typename)\\s+)(?!<keyword>)\\w+`.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore(`cpp`,`string`,{module:{pattern:RegExp(`(\\b(?:import|module)\\s+)(?:"(?:\\\\(?:\\r\\n|[\\s\\S])|[^"\\\\\\r\\n])*"|<[^<>\\r\\n]*>|`+`<mod-name>(?:\\s*:\\s*<mod-name>)?|:\\s*<mod-name>`.replace(/<mod-name>/g,function(){return n})+`)`),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:`string`,greedy:!0}}),e.languages.insertBefore(`cpp`,`keyword`,{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:`class-name`,inside:e.languages.cpp}}}}),e.languages.insertBefore(`cpp`,`operator`,{"double-colon":{pattern:/::/,alias:`punctuation`}}),e.languages.insertBefore(`cpp`,`class-name`,{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend(`cpp`,{})}}),e.languages.insertBefore(`inside`,`double-colon`,{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp[`base-clause`])}(z),z.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:`punctuation`},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:`string`},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:[`annotation`,`punctuation`],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},z.languages.python[`string-interpolation`].inside.interpolation.inside.rest=z.languages.python,z.languages.py=z.languages.python,z.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:`keyword`}},z.languages.webmanifest=z.languages.json;var Ri={};Ii(Ri,{dracula:()=>zi,duotoneDark:()=>Bi,duotoneLight:()=>Vi,github:()=>Hi,gruvboxMaterialDark:()=>ia,gruvboxMaterialLight:()=>aa,jettwaveDark:()=>ea,jettwaveLight:()=>ta,nightOwl:()=>Ui,nightOwlLight:()=>Wi,oceanicNext:()=>Ki,okaidia:()=>qi,oneDark:()=>na,oneLight:()=>ra,palenight:()=>Ji,shadesOfPurple:()=>Yi,synthwave84:()=>Xi,ultramin:()=>Zi,vsDark:()=>Qi,vsLight:()=>$i});var zi={plain:{color:`#F8F8F2`,backgroundColor:`#282A36`},styles:[{types:[`prolog`,`constant`,`builtin`],style:{color:`rgb(189, 147, 249)`}},{types:[`inserted`,`function`],style:{color:`rgb(80, 250, 123)`}},{types:[`deleted`],style:{color:`rgb(255, 85, 85)`}},{types:[`changed`],style:{color:`rgb(255, 184, 108)`}},{types:[`punctuation`,`symbol`],style:{color:`rgb(248, 248, 242)`}},{types:[`string`,`char`,`tag`,`selector`],style:{color:`rgb(255, 121, 198)`}},{types:[`keyword`,`variable`],style:{color:`rgb(189, 147, 249)`,fontStyle:`italic`}},{types:[`comment`],style:{color:`rgb(98, 114, 164)`}},{types:[`attr-name`],style:{color:`rgb(241, 250, 140)`}}]},Bi={plain:{backgroundColor:`#2a2734`,color:`#9a86fd`},styles:[{types:[`comment`,`prolog`,`doctype`,`cdata`,`punctuation`],style:{color:`#6c6783`}},{types:[`namespace`],style:{opacity:.7}},{types:[`tag`,`operator`,`number`],style:{color:`#e09142`}},{types:[`property`,`function`],style:{color:`#9a86fd`}},{types:[`tag-id`,`selector`,`atrule-id`],style:{color:`#eeebff`}},{types:[`attr-name`],style:{color:`#c4b9fe`}},{types:[`boolean`,`string`,`entity`,`url`,`attr-value`,`keyword`,`control`,`directive`,`unit`,`statement`,`regex`,`atrule`,`placeholder`,`variable`],style:{color:`#ffcc99`}},{types:[`deleted`],style:{textDecorationLine:`line-through`}},{types:[`inserted`],style:{textDecorationLine:`underline`}},{types:[`italic`],style:{fontStyle:`italic`}},{types:[`important`,`bold`],style:{fontWeight:`bold`}},{types:[`important`],style:{color:`#c4b9fe`}}]},Vi={plain:{backgroundColor:`#faf8f5`,color:`#728fcb`},styles:[{types:[`comment`,`prolog`,`doctype`,`cdata`,`punctuation`],style:{color:`#b6ad9a`}},{types:[`namespace`],style:{opacity:.7}},{types:[`tag`,`operator`,`number`],style:{color:`#063289`}},{types:[`property`,`function`],style:{color:`#b29762`}},{types:[`tag-id`,`selector`,`atrule-id`],style:{color:`#2d2006`}},{types:[`attr-name`],style:{color:`#896724`}},{types:[`boolean`,`string`,`entity`,`url`,`attr-value`,`keyword`,`control`,`directive`,`unit`,`statement`,`regex`,`atrule`],style:{color:`#728fcb`}},{types:[`placeholder`,`variable`],style:{color:`#93abdc`}},{types:[`deleted`],style:{textDecorationLine:`line-through`}},{types:[`inserted`],style:{textDecorationLine:`underline`}},{types:[`italic`],style:{fontStyle:`italic`}},{types:[`important`,`bold`],style:{fontWeight:`bold`}},{types:[`important`],style:{color:`#896724`}}]},Hi={plain:{color:`#393A34`,backgroundColor:`#f6f8fa`},styles:[{types:[`comment`,`prolog`,`doctype`,`cdata`],style:{color:`#999988`,fontStyle:`italic`}},{types:[`namespace`],style:{opacity:.7}},{types:[`string`,`attr-value`],style:{color:`#e3116c`}},{types:[`punctuation`,`operator`],style:{color:`#393A34`}},{types:[`entity`,`url`,`symbol`,`number`,`boolean`,`variable`,`constant`,`property`,`regex`,`inserted`],style:{color:`#36acaa`}},{types:[`atrule`,`keyword`,`attr-name`,`selector`],style:{color:`#00a4db`}},{types:[`function`,`deleted`,`tag`],style:{color:`#d73a49`}},{types:[`function-variable`],style:{color:`#6f42c1`}},{types:[`tag`,`selector`,`keyword`],style:{color:`#00009f`}}]},Ui={plain:{color:`#d6deeb`,backgroundColor:`#011627`},styles:[{types:[`changed`],style:{color:`rgb(162, 191, 252)`,fontStyle:`italic`}},{types:[`deleted`],style:{color:`rgba(239, 83, 80, 0.56)`,fontStyle:`italic`}},{types:[`inserted`,`attr-name`],style:{color:`rgb(173, 219, 103)`,fontStyle:`italic`}},{types:[`comment`],style:{color:`rgb(99, 119, 119)`,fontStyle:`italic`}},{types:[`string`,`url`],style:{color:`rgb(173, 219, 103)`}},{types:[`variable`],style:{color:`rgb(214, 222, 235)`}},{types:[`number`],style:{color:`rgb(247, 140, 108)`}},{types:[`builtin`,`char`,`constant`,`function`],style:{color:`rgb(130, 170, 255)`}},{types:[`punctuation`],style:{color:`rgb(199, 146, 234)`}},{types:[`selector`,`doctype`],style:{color:`rgb(199, 146, 234)`,fontStyle:`italic`}},{types:[`class-name`],style:{color:`rgb(255, 203, 139)`}},{types:[`tag`,`operator`,`keyword`],style:{color:`rgb(127, 219, 202)`}},{types:[`boolean`],style:{color:`rgb(255, 88, 116)`}},{types:[`property`],style:{color:`rgb(128, 203, 196)`}},{types:[`namespace`],style:{color:`rgb(178, 204, 214)`}}]},Wi={plain:{color:`#403f53`,backgroundColor:`#FBFBFB`},styles:[{types:[`changed`],style:{color:`rgb(162, 191, 252)`,fontStyle:`italic`}},{types:[`deleted`],style:{color:`rgba(239, 83, 80, 0.56)`,fontStyle:`italic`}},{types:[`inserted`,`attr-name`],style:{color:`rgb(72, 118, 214)`,fontStyle:`italic`}},{types:[`comment`],style:{color:`rgb(152, 159, 177)`,fontStyle:`italic`}},{types:[`string`,`builtin`,`char`,`constant`,`url`],style:{color:`rgb(72, 118, 214)`}},{types:[`variable`],style:{color:`rgb(201, 103, 101)`}},{types:[`number`],style:{color:`rgb(170, 9, 130)`}},{types:[`punctuation`],style:{color:`rgb(153, 76, 195)`}},{types:[`function`,`selector`,`doctype`],style:{color:`rgb(153, 76, 195)`,fontStyle:`italic`}},{types:[`class-name`],style:{color:`rgb(17, 17, 17)`}},{types:[`tag`],style:{color:`rgb(153, 76, 195)`}},{types:[`operator`,`property`,`keyword`,`namespace`],style:{color:`rgb(12, 150, 155)`}},{types:[`boolean`],style:{color:`rgb(188, 84, 84)`}}]},Gi={char:`#D8DEE9`,comment:`#999999`,keyword:`#c5a5c5`,primitive:`#5a9bcf`,string:`#8dc891`,variable:`#d7deea`,boolean:`#ff8b50`,punctuation:`#5FB3B3`,tag:`#fc929e`,function:`#79b6f2`,className:`#FAC863`,method:`#6699CC`,operator:`#fc929e`},Ki={plain:{backgroundColor:`#282c34`,color:`#ffffff`},styles:[{types:[`attr-name`],style:{color:Gi.keyword}},{types:[`attr-value`],style:{color:Gi.string}},{types:[`comment`,`block-comment`,`prolog`,`doctype`,`cdata`,`shebang`],style:{color:Gi.comment}},{types:[`property`,`number`,`function-name`,`constant`,`symbol`,`deleted`],style:{color:Gi.primitive}},{types:[`boolean`],style:{color:Gi.boolean}},{types:[`tag`],style:{color:Gi.tag}},{types:[`string`],style:{color:Gi.string}},{types:[`punctuation`],style:{color:Gi.string}},{types:[`selector`,`char`,`builtin`,`inserted`],style:{color:Gi.char}},{types:[`function`],style:{color:Gi.function}},{types:[`operator`,`entity`,`url`,`variable`],style:{color:Gi.variable}},{types:[`keyword`],style:{color:Gi.keyword}},{types:[`atrule`,`class-name`],style:{color:Gi.className}},{types:[`important`],style:{fontWeight:`400`}},{types:[`bold`],style:{fontWeight:`bold`}},{types:[`italic`],style:{fontStyle:`italic`}},{types:[`namespace`],style:{opacity:.7}}]},qi={plain:{color:`#f8f8f2`,backgroundColor:`#272822`},styles:[{types:[`changed`],style:{color:`rgb(162, 191, 252)`,fontStyle:`italic`}},{types:[`deleted`],style:{color:`#f92672`,fontStyle:`italic`}},{types:[`inserted`],style:{color:`rgb(173, 219, 103)`,fontStyle:`italic`}},{types:[`comment`],style:{color:`#8292a2`,fontStyle:`italic`}},{types:[`string`,`url`],style:{color:`#a6e22e`}},{types:[`variable`],style:{color:`#f8f8f2`}},{types:[`number`],style:{color:`#ae81ff`}},{types:[`builtin`,`char`,`constant`,`function`,`class-name`],style:{color:`#e6db74`}},{types:[`punctuation`],style:{color:`#f8f8f2`}},{types:[`selector`,`doctype`],style:{color:`#a6e22e`,fontStyle:`italic`}},{types:[`tag`,`operator`,`keyword`],style:{color:`#66d9ef`}},{types:[`boolean`],style:{color:`#ae81ff`}},{types:[`namespace`],style:{color:`rgb(178, 204, 214)`,opacity:.7}},{types:[`tag`,`property`],style:{color:`#f92672`}},{types:[`attr-name`],style:{color:`#a6e22e !important`}},{types:[`doctype`],style:{color:`#8292a2`}},{types:[`rule`],style:{color:`#e6db74`}}]},Ji={plain:{color:`#bfc7d5`,backgroundColor:`#292d3e`},styles:[{types:[`comment`],style:{color:`rgb(105, 112, 152)`,fontStyle:`italic`}},{types:[`string`,`inserted`],style:{color:`rgb(195, 232, 141)`}},{types:[`number`],style:{color:`rgb(247, 140, 108)`}},{types:[`builtin`,`char`,`constant`,`function`],style:{color:`rgb(130, 170, 255)`}},{types:[`punctuation`,`selector`],style:{color:`rgb(199, 146, 234)`}},{types:[`variable`],style:{color:`rgb(191, 199, 213)`}},{types:[`class-name`,`attr-name`],style:{color:`rgb(255, 203, 107)`}},{types:[`tag`,`deleted`],style:{color:`rgb(255, 85, 114)`}},{types:[`operator`],style:{color:`rgb(137, 221, 255)`}},{types:[`boolean`],style:{color:`rgb(255, 88, 116)`}},{types:[`keyword`],style:{fontStyle:`italic`}},{types:[`doctype`],style:{color:`rgb(199, 146, 234)`,fontStyle:`italic`}},{types:[`namespace`],style:{color:`rgb(178, 204, 214)`}},{types:[`url`],style:{color:`rgb(221, 221, 221)`}}]},Yi={plain:{color:`#9EFEFF`,backgroundColor:`#2D2A55`},styles:[{types:[`changed`],style:{color:`rgb(255, 238, 128)`}},{types:[`deleted`],style:{color:`rgba(239, 83, 80, 0.56)`}},{types:[`inserted`],style:{color:`rgb(173, 219, 103)`}},{types:[`comment`],style:{color:`rgb(179, 98, 255)`,fontStyle:`italic`}},{types:[`punctuation`],style:{color:`rgb(255, 255, 255)`}},{types:[`constant`],style:{color:`rgb(255, 98, 140)`}},{types:[`string`,`url`],style:{color:`rgb(165, 255, 144)`}},{types:[`variable`],style:{color:`rgb(255, 238, 128)`}},{types:[`number`,`boolean`],style:{color:`rgb(255, 98, 140)`}},{types:[`attr-name`],style:{color:`rgb(255, 180, 84)`}},{types:[`keyword`,`operator`,`property`,`namespace`,`tag`,`selector`,`doctype`],style:{color:`rgb(255, 157, 0)`}},{types:[`builtin`,`char`,`constant`,`function`,`class-name`],style:{color:`rgb(250, 208, 0)`}}]},Xi={plain:{backgroundColor:`linear-gradient(to bottom, #2a2139 75%, #34294f)`,backgroundImage:`#34294f`,color:`#f92aad`,textShadow:`0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3`},styles:[{types:[`comment`,`block-comment`,`prolog`,`doctype`,`cdata`],style:{color:`#495495`,fontStyle:`italic`}},{types:[`punctuation`],style:{color:`#ccc`}},{types:[`tag`,`attr-name`,`namespace`,`number`,`unit`,`hexcode`,`deleted`],style:{color:`#e2777a`}},{types:[`property`,`selector`],style:{color:`#72f1b8`,textShadow:`0 0 2px #100c0f, 0 0 10px #257c5575, 0 0 35px #21272475`}},{types:[`function-name`],style:{color:`#6196cc`}},{types:[`boolean`,`selector-id`,`function`],style:{color:`#fdfdfd`,textShadow:`0 0 2px #001716, 0 0 3px #03edf975, 0 0 5px #03edf975, 0 0 8px #03edf975`}},{types:[`class-name`,`maybe-class-name`,`builtin`],style:{color:`#fff5f6`,textShadow:`0 0 2px #000, 0 0 10px #fc1f2c75, 0 0 5px #fc1f2c75, 0 0 25px #fc1f2c75`}},{types:[`constant`,`symbol`],style:{color:`#f92aad`,textShadow:`0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3`}},{types:[`important`,`atrule`,`keyword`,`selector-class`],style:{color:`#f4eee4`,textShadow:`0 0 2px #393a33, 0 0 8px #f39f0575, 0 0 2px #f39f0575`}},{types:[`string`,`char`,`attr-value`,`regex`,`variable`],style:{color:`#f87c32`}},{types:[`parameter`],style:{fontStyle:`italic`}},{types:[`entity`,`url`],style:{color:`#67cdcc`}},{types:[`operator`],style:{color:`ffffffee`}},{types:[`important`,`bold`],style:{fontWeight:`bold`}},{types:[`italic`],style:{fontStyle:`italic`}},{types:[`entity`],style:{cursor:`help`}},{types:[`inserted`],style:{color:`green`}}]},Zi={plain:{color:`#282a2e`,backgroundColor:`#ffffff`},styles:[{types:[`comment`],style:{color:`rgb(197, 200, 198)`}},{types:[`string`,`number`,`builtin`,`variable`],style:{color:`rgb(150, 152, 150)`}},{types:[`class-name`,`function`,`tag`,`attr-name`],style:{color:`rgb(40, 42, 46)`}}]},Qi={plain:{color:`#9CDCFE`,backgroundColor:`#1E1E1E`},styles:[{types:[`prolog`],style:{color:`rgb(0, 0, 128)`}},{types:[`comment`],style:{color:`rgb(106, 153, 85)`}},{types:[`builtin`,`changed`,`keyword`,`interpolation-punctuation`],style:{color:`rgb(86, 156, 214)`}},{types:[`number`,`inserted`],style:{color:`rgb(181, 206, 168)`}},{types:[`constant`],style:{color:`rgb(100, 102, 149)`}},{types:[`attr-name`,`variable`],style:{color:`rgb(156, 220, 254)`}},{types:[`deleted`,`string`,`attr-value`,`template-punctuation`],style:{color:`rgb(206, 145, 120)`}},{types:[`selector`],style:{color:`rgb(215, 186, 125)`}},{types:[`tag`],style:{color:`rgb(78, 201, 176)`}},{types:[`tag`],languages:[`markup`],style:{color:`rgb(86, 156, 214)`}},{types:[`punctuation`,`operator`],style:{color:`rgb(212, 212, 212)`}},{types:[`punctuation`],languages:[`markup`],style:{color:`#808080`}},{types:[`function`],style:{color:`rgb(220, 220, 170)`}},{types:[`class-name`],style:{color:`rgb(78, 201, 176)`}},{types:[`char`],style:{color:`rgb(209, 105, 105)`}}]},$i={plain:{color:`#000000`,backgroundColor:`#ffffff`},styles:[{types:[`comment`],style:{color:`rgb(0, 128, 0)`}},{types:[`builtin`],style:{color:`rgb(0, 112, 193)`}},{types:[`number`,`variable`,`inserted`],style:{color:`rgb(9, 134, 88)`}},{types:[`operator`],style:{color:`rgb(0, 0, 0)`}},{types:[`constant`,`char`],style:{color:`rgb(129, 31, 63)`}},{types:[`tag`],style:{color:`rgb(128, 0, 0)`}},{types:[`attr-name`],style:{color:`rgb(255, 0, 0)`}},{types:[`deleted`,`string`],style:{color:`rgb(163, 21, 21)`}},{types:[`changed`,`punctuation`],style:{color:`rgb(4, 81, 165)`}},{types:[`function`,`keyword`],style:{color:`rgb(0, 0, 255)`}},{types:[`class-name`],style:{color:`rgb(38, 127, 153)`}}]},ea={plain:{color:`#f8fafc`,backgroundColor:`#011627`},styles:[{types:[`prolog`],style:{color:`#000080`}},{types:[`comment`],style:{color:`#6A9955`}},{types:[`builtin`,`changed`,`keyword`,`interpolation-punctuation`],style:{color:`#569CD6`}},{types:[`number`,`inserted`],style:{color:`#B5CEA8`}},{types:[`constant`],style:{color:`#f8fafc`}},{types:[`attr-name`,`variable`],style:{color:`#9CDCFE`}},{types:[`deleted`,`string`,`attr-value`,`template-punctuation`],style:{color:`#cbd5e1`}},{types:[`selector`],style:{color:`#D7BA7D`}},{types:[`tag`],style:{color:`#0ea5e9`}},{types:[`tag`],languages:[`markup`],style:{color:`#0ea5e9`}},{types:[`punctuation`,`operator`],style:{color:`#D4D4D4`}},{types:[`punctuation`],languages:[`markup`],style:{color:`#808080`}},{types:[`function`],style:{color:`#7dd3fc`}},{types:[`class-name`],style:{color:`#0ea5e9`}},{types:[`char`],style:{color:`#D16969`}}]},ta={plain:{color:`#0f172a`,backgroundColor:`#f1f5f9`},styles:[{types:[`prolog`],style:{color:`#000080`}},{types:[`comment`],style:{color:`#6A9955`}},{types:[`builtin`,`changed`,`keyword`,`interpolation-punctuation`],style:{color:`#0c4a6e`}},{types:[`number`,`inserted`],style:{color:`#B5CEA8`}},{types:[`constant`],style:{color:`#0f172a`}},{types:[`attr-name`,`variable`],style:{color:`#0c4a6e`}},{types:[`deleted`,`string`,`attr-value`,`template-punctuation`],style:{color:`#64748b`}},{types:[`selector`],style:{color:`#D7BA7D`}},{types:[`tag`],style:{color:`#0ea5e9`}},{types:[`tag`],languages:[`markup`],style:{color:`#0ea5e9`}},{types:[`punctuation`,`operator`],style:{color:`#475569`}},{types:[`punctuation`],languages:[`markup`],style:{color:`#808080`}},{types:[`function`],style:{color:`#0e7490`}},{types:[`class-name`],style:{color:`#0ea5e9`}},{types:[`char`],style:{color:`#D16969`}}]},na={plain:{backgroundColor:`hsl(220, 13%, 18%)`,color:`hsl(220, 14%, 71%)`,textShadow:`0 1px rgba(0, 0, 0, 0.3)`},styles:[{types:[`comment`,`prolog`,`cdata`],style:{color:`hsl(220, 10%, 40%)`}},{types:[`doctype`,`punctuation`,`entity`],style:{color:`hsl(220, 14%, 71%)`}},{types:[`attr-name`,`class-name`,`maybe-class-name`,`boolean`,`constant`,`number`,`atrule`],style:{color:`hsl(29, 54%, 61%)`}},{types:[`keyword`],style:{color:`hsl(286, 60%, 67%)`}},{types:[`property`,`tag`,`symbol`,`deleted`,`important`],style:{color:`hsl(355, 65%, 65%)`}},{types:[`selector`,`string`,`char`,`builtin`,`inserted`,`regex`,`attr-value`],style:{color:`hsl(95, 38%, 62%)`}},{types:[`variable`,`operator`,`function`],style:{color:`hsl(207, 82%, 66%)`}},{types:[`url`],style:{color:`hsl(187, 47%, 55%)`}},{types:[`deleted`],style:{textDecorationLine:`line-through`}},{types:[`inserted`],style:{textDecorationLine:`underline`}},{types:[`italic`],style:{fontStyle:`italic`}},{types:[`important`,`bold`],style:{fontWeight:`bold`}},{types:[`important`],style:{color:`hsl(220, 14%, 71%)`}}]},ra={plain:{backgroundColor:`hsl(230, 1%, 98%)`,color:`hsl(230, 8%, 24%)`},styles:[{types:[`comment`,`prolog`,`cdata`],style:{color:`hsl(230, 4%, 64%)`}},{types:[`doctype`,`punctuation`,`entity`],style:{color:`hsl(230, 8%, 24%)`}},{types:[`attr-name`,`class-name`,`boolean`,`constant`,`number`,`atrule`],style:{color:`hsl(35, 99%, 36%)`}},{types:[`keyword`],style:{color:`hsl(301, 63%, 40%)`}},{types:[`property`,`tag`,`symbol`,`deleted`,`important`],style:{color:`hsl(5, 74%, 59%)`}},{types:[`selector`,`string`,`char`,`builtin`,`inserted`,`regex`,`attr-value`,`punctuation`],style:{color:`hsl(119, 34%, 47%)`}},{types:[`variable`,`operator`,`function`],style:{color:`hsl(221, 87%, 60%)`}},{types:[`url`],style:{color:`hsl(198, 99%, 37%)`}},{types:[`deleted`],style:{textDecorationLine:`line-through`}},{types:[`inserted`],style:{textDecorationLine:`underline`}},{types:[`italic`],style:{fontStyle:`italic`}},{types:[`important`,`bold`],style:{fontWeight:`bold`}},{types:[`important`],style:{color:`hsl(230, 8%, 24%)`}}]},ia={plain:{color:`#ebdbb2`,backgroundColor:`#292828`},styles:[{types:[`imports`,`class-name`,`maybe-class-name`,`constant`,`doctype`,`builtin`,`function`],style:{color:`#d8a657`}},{types:[`property-access`],style:{color:`#7daea3`}},{types:[`tag`],style:{color:`#e78a4e`}},{types:[`attr-name`,`char`,`url`,`regex`],style:{color:`#a9b665`}},{types:[`attr-value`,`string`],style:{color:`#89b482`}},{types:[`comment`,`prolog`,`cdata`,`operator`,`inserted`],style:{color:`#a89984`}},{types:[`delimiter`,`boolean`,`keyword`,`selector`,`important`,`atrule`,`property`,`variable`,`deleted`],style:{color:`#ea6962`}},{types:[`entity`,`number`,`symbol`],style:{color:`#d3869b`}}]},aa={plain:{color:`#654735`,backgroundColor:`#f9f5d7`},styles:[{types:[`delimiter`,`boolean`,`keyword`,`selector`,`important`,`atrule`,`property`,`variable`,`deleted`],style:{color:`#af2528`}},{types:[`imports`,`class-name`,`maybe-class-name`,`constant`,`doctype`,`builtin`],style:{color:`#b4730e`}},{types:[`string`,`attr-value`],style:{color:`#477a5b`}},{types:[`property-access`],style:{color:`#266b79`}},{types:[`function`,`attr-name`,`char`,`url`],style:{color:`#72761e`}},{types:[`tag`],style:{color:`#b94c07`}},{types:[`comment`,`prolog`,`cdata`,`operator`,`inserted`],style:{color:`#a89984`}},{types:[`entity`,`number`,`symbol`],style:{color:`#924f79`}}]},oa=e=>(0,v.useCallback)(t=>{var n=t,{className:r,style:i,line:a}=n;let o=Ni(Mi({},Pi(n,[`className`,`style`,`line`])),{className:bi(`token-line`,r)});return typeof e==`object`&&`plain`in e&&(o.style=e.plain),typeof i==`object`&&(o.style=Mi(Mi({},o.style||{}),i)),o},[e]),sa=e=>{let t=(0,v.useCallback)(({types:t,empty:n})=>{if(e!=null)return t.length===1&&t[0]===`plain`?n==null?void 0:{display:`inline-block`}:t.length===1&&n!=null?e[t[0]]:Object.assign(n==null?{}:{display:`inline-block`},...t.map(t=>e[t]))},[e]);return(0,v.useCallback)(e=>{var n=e,{token:r,className:i,style:a}=n;let o=Ni(Mi({},Pi(n,[`token`,`className`,`style`])),{className:bi(`token`,...r.types,i),children:r.content,style:t(r)});return a!=null&&(o.style=Mi(Mi({},o.style||{}),a)),o},[t])},ca=/\r\n|\r|\n/,la=e=>{e.length===0?e.push({types:[`plain`],content:`
18
+ `,empty:!0}):e.length===1&&e[0].content===``&&(e[0].content=`
19
+ `,e[0].empty=!0)},ua=(e,t)=>{let n=e.length;return n>0&&e[n-1]===t?e:e.concat(t)},da=e=>{let t=[[]],n=[e],r=[0],i=[e.length],a=0,o=0,s=[],c=[s];for(;o>-1;){for(;(a=r[o]++)<i[o];){let e,l=t[o],u=n[o][a];if(typeof u==`string`?(l=o>0?l:[`plain`],e=u):(l=ua(l,u.type),u.alias&&(l=ua(l,u.alias)),e=u.content),typeof e!=`string`){o++,t.push(l),n.push(e),r.push(0),i.push(e.length);continue}let d=e.split(ca),f=d.length;s.push({types:l,content:d[0]});for(let e=1;e<f;e++)la(s),c.push(s=[]),s.push({types:l,content:d[e]})}o--,t.pop(),n.pop(),r.pop(),i.pop()}return la(s),c},fa=({prism:e,code:t,grammar:n,language:r})=>(0,v.useMemo)(()=>{if(n==null)return da([t]);let i={code:t,grammar:n,language:r,tokens:[]};return e.hooks.run(`before-tokenize`,i),i.tokens=e.tokenize(t,n),e.hooks.run(`after-tokenize`,i),da(i.tokens)},[t,n,r,e]),pa=(e,t)=>{let{plain:n}=e,r=e.styles.reduce((e,n)=>{let{languages:r,style:i}=n;return r&&!r.includes(t)||n.types.forEach(t=>{e[t]=Mi(Mi({},e[t]),i)}),e},{});return r.root=n,r.plain=Ni(Mi({},n),{backgroundColor:void 0}),r},ma=({children:e,language:t,code:n,theme:r,prism:i})=>{let a=t.toLowerCase(),o=pa(r,a),s=oa(o),c=sa(o),l=i.languages[a];return e({tokens:fa({prism:i,language:a,code:n,grammar:l}),className:`prism-code language-${a}`,style:o==null?{}:o.root,getLineProps:s,getTokenProps:c})},ha=e=>(0,v.createElement)(ma,Ni(Mi({},e),{prism:e.prism||z,theme:e.theme||Qi,code:e.code,language:e.language}));function ga(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 _a(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var va=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ya=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ba={};function xa(e,t){return((t||ba).jsx?ya:va).test(e)}var Sa=/[ \t\n\f\r]/g;function Ca(e){return typeof e==`object`?e.type===`text`?wa(e.value):!1:wa(e)}function wa(e){return e.replace(Sa,``)===``}var Ta=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};Ta.prototype.normal={},Ta.prototype.property={},Ta.prototype.space=void 0;function Ea(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new Ta(n,r,t)}function Da(e){return e.toLowerCase()}var Oa=class{constructor(e,t){this.attribute=t,this.property=e}};Oa.prototype.attribute=``,Oa.prototype.booleanish=!1,Oa.prototype.boolean=!1,Oa.prototype.commaOrSpaceSeparated=!1,Oa.prototype.commaSeparated=!1,Oa.prototype.defined=!1,Oa.prototype.mustUseProperty=!1,Oa.prototype.number=!1,Oa.prototype.overloadedBoolean=!1,Oa.prototype.property=``,Oa.prototype.spaceSeparated=!1,Oa.prototype.space=void 0;var ka=s({boolean:()=>ja,booleanish:()=>Ma,commaOrSpaceSeparated:()=>Ia,commaSeparated:()=>Fa,number:()=>B,overloadedBoolean:()=>Na,spaceSeparated:()=>Pa}),Aa=0,ja=La(),Ma=La(),Na=La(),B=La(),Pa=La(),Fa=La(),Ia=La();function La(){return 2**++Aa}var Ra=Object.keys(ka),za=class extends Oa{constructor(e,t,n,r){let i=-1;if(super(e,t),Ba(this,`space`,r),typeof n==`number`)for(;++i<Ra.length;){let e=Ra[i];Ba(this,Ra[i],(n&ka[e])===ka[e])}}};za.prototype.defined=!0;function Ba(e,t,n){n&&(e[t]=n)}function Va(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new za(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Da(r)]=r,n[Da(a.attribute)]=r}return new Ta(t,n,e.space)}var Ha=Va({properties:{ariaActiveDescendant:null,ariaAtomic:Ma,ariaAutoComplete:null,ariaBusy:Ma,ariaChecked:Ma,ariaColCount:B,ariaColIndex:B,ariaColSpan:B,ariaControls:Pa,ariaCurrent:null,ariaDescribedBy:Pa,ariaDetails:null,ariaDisabled:Ma,ariaDropEffect:Pa,ariaErrorMessage:null,ariaExpanded:Ma,ariaFlowTo:Pa,ariaGrabbed:Ma,ariaHasPopup:null,ariaHidden:Ma,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Pa,ariaLevel:B,ariaLive:null,ariaModal:Ma,ariaMultiLine:Ma,ariaMultiSelectable:Ma,ariaOrientation:null,ariaOwns:Pa,ariaPlaceholder:null,ariaPosInSet:B,ariaPressed:Ma,ariaReadOnly:Ma,ariaRelevant:null,ariaRequired:Ma,ariaRoleDescription:Pa,ariaRowCount:B,ariaRowIndex:B,ariaRowSpan:B,ariaSelected:Ma,ariaSetSize:B,ariaSort:null,ariaValueMax:B,ariaValueMin:B,ariaValueNow:B,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function Ua(e,t){return t in e?e[t]:t}function Wa(e,t){return Ua(e,t.toLowerCase())}var Ga=Va({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:Fa,acceptCharset:Pa,accessKey:Pa,action:null,allow:null,allowFullScreen:ja,allowPaymentRequest:ja,allowUserMedia:ja,alt:null,as:null,async:ja,autoCapitalize:null,autoComplete:Pa,autoFocus:ja,autoPlay:ja,blocking:Pa,capture:null,charSet:null,checked:ja,cite:null,className:Pa,cols:B,colSpan:null,content:null,contentEditable:Ma,controls:ja,controlsList:Pa,coords:B|Fa,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ja,defer:ja,dir:null,dirName:null,disabled:ja,download:Na,draggable:Ma,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ja,formTarget:null,headers:Pa,height:B,hidden:Na,high:B,href:null,hrefLang:null,htmlFor:Pa,httpEquiv:Pa,id:null,imageSizes:null,imageSrcSet:null,inert:ja,inputMode:null,integrity:null,is:null,isMap:ja,itemId:null,itemProp:Pa,itemRef:Pa,itemScope:ja,itemType:Pa,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ja,low:B,manifest:null,max:null,maxLength:B,media:null,method:null,min:null,minLength:B,multiple:ja,muted:ja,name:null,nonce:null,noModule:ja,noValidate:ja,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:ja,optimum:B,pattern:null,ping:Pa,placeholder:null,playsInline:ja,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ja,referrerPolicy:null,rel:Pa,required:ja,reversed:ja,rows:B,rowSpan:B,sandbox:Pa,scope:null,scoped:ja,seamless:ja,selected:ja,shadowRootClonable:ja,shadowRootDelegatesFocus:ja,shadowRootMode:null,shape:null,size:B,sizes:null,slot:null,span:B,spellCheck:Ma,src:null,srcDoc:null,srcLang:null,srcSet:null,start:B,step:null,style:null,tabIndex:B,target:null,title:null,translate:null,type:null,typeMustMatch:ja,useMap:null,value:Ma,width:B,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Pa,axis:null,background:null,bgColor:null,border:B,borderColor:null,bottomMargin:B,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ja,declare:ja,event:null,face:null,frame:null,frameBorder:null,hSpace:B,leftMargin:B,link:null,longDesc:null,lowSrc:null,marginHeight:B,marginWidth:B,noResize:ja,noHref:ja,noShade:ja,noWrap:ja,object:null,profile:null,prompt:null,rev:null,rightMargin:B,rules:null,scheme:null,scrolling:Ma,standby:null,summary:null,text:null,topMargin:B,valueType:null,version:null,vAlign:null,vLink:null,vSpace:B,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ja,disableRemotePlayback:ja,prefix:null,property:null,results:B,security:null,unselectable:null},space:`html`,transform:Wa}),Ka=Va({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`,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:Ia,accentHeight:B,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:B,amplitude:B,arabicForm:null,ascent:B,attributeName:null,attributeType:null,azimuth:B,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:B,by:null,calcMode:null,capHeight:B,className:Pa,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:B,diffuseConstant:B,direction:null,display:null,dur:null,divisor:B,dominantBaseline:null,download:ja,dx:null,dy:null,edgeMode:null,editable:null,elevation:B,enableBackground:null,end:null,event:null,exponent:B,externalResourcesRequired:null,fill:null,fillOpacity:B,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:Fa,g2:Fa,glyphName:Fa,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:B,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:B,horizOriginX:B,horizOriginY:B,id:null,ideographic:B,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:B,k:B,k1:B,k2:B,k3:B,k4:B,kernelMatrix:Ia,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:B,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:B,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:B,overlineThickness:B,paintOrder:null,panose1:null,path:null,pathLength:B,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Pa,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:B,pointsAtY:B,pointsAtZ:B,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ia,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ia,rev:Ia,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ia,requiredFeatures:Ia,requiredFonts:Ia,requiredFormats:Ia,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:B,specularExponent:B,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:B,strikethroughThickness:B,string:null,stroke:null,strokeDashArray:Ia,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:B,strokeOpacity:B,strokeWidth:null,style:null,surfaceScale:B,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ia,tabIndex:B,tableValues:null,target:null,targetX:B,targetY:B,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ia,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:B,underlineThickness:B,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:B,values:null,vAlphabetic:B,vMathematical:B,vectorEffect:null,vHanging:B,vIdeographic:B,version:null,vertAdvY:B,vertOriginX:B,vertOriginY:B,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:B,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:Ua}),qa=Va({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()}}),Ja=Va({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:Wa}),Ya=Va({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),Xa={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`},Za=/[A-Z]/g,Qa=/-[a-z]/g,$a=/^data[-\w.:]+$/i;function eo(e,t){let n=Da(t),r=t,i=Oa;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&$a.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(Qa,no);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!Qa.test(e)){let n=e.replace(Za,to);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=za}return new i(r,t)}function to(e){return`-`+e.toLowerCase()}function no(e){return e.charAt(1).toUpperCase()}var ro=Ea([Ha,Ga,qa,Ja,Ya],`html`),io=Ea([Ha,Ka,qa,Ja,Ya],`svg`);function ao(e){let t=String(e||``).trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function oo(e){return e.join(` `).trim()}var so=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=`
20
+ `,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})),co=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(so());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}})),lo=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))}})),uo=o(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(co()),r=lo();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})),fo=mo(`end`),po=mo(`start`);function mo(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 ho(e){let t=po(e),n=fo(e);if(t&&n)return{start:t,end:n}}function go(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?vo(e.position):`start`in e||`end`in e?vo(e):`line`in e||`column`in e?_o(e):``}function _o(e){return yo(e&&e.line)+`:`+yo(e&&e.column)}function vo(e){return _o(e&&e.start)+`-`+_o(e&&e.end)}function yo(e){return e&&typeof e==`number`?e:1}var bo=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=go(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}};bo.prototype.file=``,bo.prototype.name=``,bo.prototype.reason=``,bo.prototype.message=``,bo.prototype.stack=``,bo.prototype.column=void 0,bo.prototype.line=void 0,bo.prototype.ancestors=void 0,bo.prototype.cause=void 0,bo.prototype.fatal=void 0,bo.prototype.place=void 0,bo.prototype.ruleId=void 0,bo.prototype.source=void 0;var xo=l(uo(),1),So={}.hasOwnProperty,Co=new Map,wo=/[A-Z]/g,To=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),Eo=new Set([`td`,`th`]),Do=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function Oo(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=zo(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=Ro(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`?io:ro,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=ko(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function ko(e,t,n){if(t.type===`element`)return Ao(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return jo(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return No(e,t,n);if(t.type===`mdxjsEsm`)return Mo(e,t);if(t.type===`root`)return Po(e,t,n);if(t.type===`text`)return Fo(e,t)}function Ao(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=io,e.schema=i),e.ancestors.push(t);let a=Go(e,t.tagName,!1),o=Bo(e,t),s=Ho(e,t);return To.has(t.tagName)&&(s=s.filter(function(e){return typeof e==`string`?!Ca(e):!0})),Io(e,o,a,t),Lo(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function jo(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)}Ko(e,t.position)}function Mo(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Ko(e,t.position)}function No(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=io,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:Go(e,t.name,!0),o=Vo(e,t),s=Ho(e,t);return Io(e,o,a,t),Lo(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Po(e,t,n){let r={};return Lo(r,Ho(e,t)),e.create(t,e.Fragment,r,n)}function Fo(e,t){return t.value}function Io(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Lo(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function Ro(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 zo(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=po(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 Bo(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&So.call(t.properties,i)){let a=Uo(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&Eo.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 Vo(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 Ko(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 Ko(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function Ho(e,t){let n=[],r=-1,i=e.passKeys?new Map:Co;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=ko(e,a,o);s!==void 0&&n.push(s)}return n}function Uo(e,t,n){let r=eo(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?_a(n):oo(n)),r.property===`style`){let t=typeof n==`object`?n:Wo(e,String(n));return e.stylePropertyNameCase===`css`&&(t=qo(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?Xa[r.property]||r.property:r.attribute,n]}}function Wo(e,t){try{return(0,xo.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new bo("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=Do+`#cannot-parse-style-attribute`,r}}function Go(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=xa(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=xa(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return So.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);Ko(e)}function Ko(e,t){let n=new bo("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=Do+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function qo(e){let t={},n;for(n in e)So.call(e,n)&&(t[Jo(n)]=e[n]);return t}function Jo(e){let t=e.replace(wo,Yo);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function Yo(e){return`-`+e.toLowerCase()}var Xo={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`]},Zo={};function Qo(e,t){let n=t||Zo;return $o(e,typeof n.includeImageAlt==`boolean`?n.includeImageAlt:!0,typeof n.includeHtml==`boolean`?n.includeHtml:!0)}function $o(e,t,n){if(ts(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 es(e.children,t,n)}return Array.isArray(e)?es(e,t,n):``}function es(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=$o(e[i],t,n);return r.join(``)}function ts(e){return!!(e&&typeof e==`object`)}var ns=document.createElement(`i`);function rs(e){let t=`&`+e+`;`;ns.innerHTML=t;let n=ns.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`||n===t?!1:n}function is(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 as(e,t){return e.length>0?(is(e,e.length,0,t),e):t}var os={}.hasOwnProperty;function ss(e){let t={},n=-1;for(;++n<e.length;)cs(t,e[n]);return t}function cs(e,t){let n;for(n in t){let r=(os.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){os.call(r,a)||(r[a]=[]);let e=i[a];ls(r[a],Array.isArray(e)?e:e?[e]:[])}}}function ls(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);is(e,0,0,r)}function us(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)}function ds(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var fs=ws(/[A-Za-z]/),ps=ws(/[\dA-Za-z]/),ms=ws(/[#-'*+\--9=?A-Z^-~]/);function hs(e){return e!==null&&(e<32||e===127)}var gs=ws(/\d/),_s=ws(/[\dA-Fa-f]/),vs=ws(/[!-/:-@[-`{-~]/);function ys(e){return e!==null&&e<-2}function bs(e){return e!==null&&(e<0||e===32)}function xs(e){return e===-2||e===-1||e===32}var Ss=ws(/\p{P}|\p{S}/u),Cs=ws(/\s/);function ws(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Ts(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&ps(e.charCodeAt(n+1))&&ps(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 Es(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return xs(r)?(e.enter(n),s(r)):t(r)}function s(r){return xs(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var Ds={tokenize:Os};function Os(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`),Es(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 ys(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var ks={tokenize:js},As={tokenize:Ms};function js(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 is(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(As,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(As,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 ys(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++;is(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 Ms(e,t,n){return Es(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function Ns(e){if(e===null||bs(e)||Cs(e))return 1;if(Ss(e))return 2}function Ps(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 Fs={name:`attention`,resolveAll:Is,tokenize:Ls};function Is(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};Rs(d,-c),Rs(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=as(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=as(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=as(l,Ps(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=as(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=as(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,is(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 Ls(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Ns(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=Ns(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 Rs(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var zs={name:`autolink`,tokenize:Bs};function Bs(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 fs(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||ps(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||ps(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||hs(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):ms(t)?(e.consume(t),l):n(t)}function u(e){return ps(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||ps(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var Vs={partial:!0,tokenize:Hs};function Hs(e,t,n){return r;function r(t){return xs(t)?Es(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||ys(e)?t(e):n(e)}}var Us={continuation:{tokenize:Gs},exit:Ks,name:`blockQuote`,tokenize:Ws};function Ws(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 xs(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function Gs(e,t,n){let r=this;return i;function i(t){return xs(t)?Es(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(Us,t,n)(r)}}function Ks(e){e.exit(`blockQuote`)}var qs={name:`characterEscape`,tokenize:Js};function Js(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 vs(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var Ys={name:`characterReference`,tokenize:Xs};function Xs(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=ps,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=_s,u):(e.enter(`characterReferenceValue`),a=7,o=gs,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===ps&&!rs(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 Zs={partial:!0,tokenize:ec},Qs={concrete:!0,name:`codeFenced`,tokenize:$s};function $s(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`),xs(t)?Es(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||ys(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(Zs,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||ys(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):xs(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),Es(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||ys(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||ys(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&&xs(t)?Es(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||ys(t)?e.check(Zs,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||ys(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`),xs(t)?Es(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`),xs(t)?Es(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||ys(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function ec(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 tc={name:`codeIndented`,tokenize:rc},nc={partial:!0,tokenize:ic};function rc(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),Es(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):ys(t)?e.attempt(nc,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||ys(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function ic(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):ys(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):Es(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):ys(e)?i(e):n(e)}}var ac={name:`codeText`,previous:sc,resolve:oc,tokenize:cc};function oc(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 sc(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function cc(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)):ys(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||ys(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 lc=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&&uc(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),uc(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),uc(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);uc(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);uc(this.left,t.reverse())}}};function uc(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 dc(e){let t={},n=-1,r,i,a,o,s,c,l,u=new lc(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,fc(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 is(e,0,1/0,u.slice(0)),!l}function fc(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 pc={resolve:hc,tokenize:gc},mc={partial:!0,tokenize:_c};function hc(e){return dc(e),e}function gc(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):ys(t)?e.check(mc,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 _c(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Es(e,a,`linePrefix`)}function a(i){if(i===null||ys(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 vc(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||hs(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||ys(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||bs(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||hs(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 yc(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):ys(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||ys(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!xs(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function bc(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):ys(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Es(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||ys(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 xc(e,t){let n;return r;function r(i){return ys(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):xs(i)?Es(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var Sc={name:`definition`,tokenize:wc},Cc={partial:!0,tokenize:Tc};function wc(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return yc.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=ds(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 bs(t)?xc(e,l)(t):l(t)}function l(t){return vc(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(Cc,d,d)(t)}function d(t){return xs(t)?Es(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||ys(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function Tc(e,t,n){return r;function r(t){return bs(t)?xc(e,i)(t):n(t)}function i(t){return bc(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return xs(t)?Es(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||ys(e)?t(e):n(e)}}var Ec={name:`hardBreakEscape`,tokenize:Dc};function Dc(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return ys(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var Oc={name:`headingAtx`,resolve:kc,tokenize:Ac};function kc(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`},is(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function Ac(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||bs(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||ys(n)?(e.exit(`atxHeading`),t(n)):xs(n)?Es(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||bs(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var jc=`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(`.`),Mc=[`pre`,`script`,`style`,`textarea`],Nc={concrete:!0,name:`htmlFlow`,resolveTo:Ic,tokenize:Lc},Pc={partial:!0,tokenize:zc},Fc={partial:!0,tokenize:Rc};function Ic(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 Lc(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:A):fs(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):fs(a)?(e.consume(a),i=4,r.interrupt?t:A):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:A):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 fs(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||bs(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&Mc.includes(l)?(i=1,r.interrupt?t(s):O(s)):jc.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||ps(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 xs(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||fs(t)?(e.consume(t),b):xs(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||ps(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):xs(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):xs(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||ys(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||bs(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||xs(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||ys(t)?O(t):xs(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),ne):t===60&&i===1?(e.consume(t),re):t===62&&i===4?(e.consume(t),oe):t===63&&i===3?(e.consume(t),A):t===93&&i===5?(e.consume(t),ae):ys(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(Pc,j,k)(t)):t===null||ys(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(Fc,ee,j)(t)}function ee(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),te}function te(t){return t===null||ys(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function ne(t){return t===45?(e.consume(t),A):O(t)}function re(t){return t===47?(e.consume(t),o=``,ie):O(t)}function ie(t){if(t===62){let n=o.toLowerCase();return Mc.includes(n)?(e.consume(t),oe):O(t)}return fs(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),ie):O(t)}function ae(t){return t===93?(e.consume(t),A):O(t)}function A(t){return t===62?(e.consume(t),oe):t===45&&i===2?(e.consume(t),A):O(t)}function oe(t){return t===null||ys(t)?(e.exit(`htmlFlowData`),j(t)):(e.consume(t),oe)}function j(n){return e.exit(`htmlFlow`),t(n)}}function Rc(e,t,n){let r=this;return i;function i(t){return ys(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 zc(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(Vs,t,n)}}var Bc={name:`htmlText`,tokenize:Vc};function Vc(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):fs(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):fs(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):ys(t)?(o=d,re(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?ne(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):ys(t)?(o=h,re(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?ne(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?ne(t):ys(t)?(o=v,re(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):ys(t)?(o=y,re(t)):(e.consume(t),y)}function b(e){return e===62?ne(e):y(e)}function x(t){return fs(t)?(e.consume(t),S):n(t)}function S(t){return t===45||ps(t)?(e.consume(t),S):C(t)}function C(t){return ys(t)?(o=C,re(t)):xs(t)?(e.consume(t),C):ne(t)}function w(t){return t===45||ps(t)?(e.consume(t),w):t===47||t===62||bs(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),ne):t===58||t===95||fs(t)?(e.consume(t),E):ys(t)?(o=T,re(t)):xs(t)?(e.consume(t),T):ne(t)}function E(t){return t===45||t===46||t===58||t===95||ps(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):ys(t)?(o=D,re(t)):xs(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,k):ys(t)?(o=O,re(t)):xs(t)?(e.consume(t),O):(e.consume(t),ee)}function k(t){return t===i?(e.consume(t),i=void 0,te):t===null?n(t):ys(t)?(o=k,re(t)):(e.consume(t),k)}function ee(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||bs(t)?T(t):(e.consume(t),ee)}function te(e){return e===47||e===62||bs(e)?T(e):n(e)}function ne(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function re(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ie}function ie(t){return xs(t)?Es(e,ae,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):ae(t)}function ae(t){return e.enter(`htmlTextData`),o(t)}}var Hc={name:`labelEnd`,resolveAll:Kc,resolveTo:qc,tokenize:Jc},Uc={tokenize:Yc},Wc={tokenize:Xc},Gc={tokenize:Zc};function Kc(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&&is(e,0,e.length,n),e}function qc(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=as(s,e.slice(a+1,a+r+3)),s=as(s,[[`enter`,u,t]]),s=as(s,Ps(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=as(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=as(s,e.slice(o+1)),s=as(s,[[`exit`,c,t]]),is(e,a,e.length,s),e}function Jc(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(ds(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(Uc,u,o?u:d)(t):t===91?e.attempt(Wc,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(Gc,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function Yc(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 bs(t)?xc(e,a)(t):a(t)}function a(t){return t===41?u(t):vc(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return bs(t)?xc(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?bc(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return bs(t)?xc(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 Xc(e,t,n){let r=this;return i;function i(t){return yc.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(ds(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function Zc(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 Qc={name:`labelStartImage`,resolveAll:Hc.resolveAll,tokenize:$c};function $c(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 el={name:`labelStartLink`,resolveAll:Hc.resolveAll,tokenize:tl};function tl(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 nl={name:`lineEnding`,tokenize:rl};function rl(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Es(e,t,`linePrefix`)}}var il={name:`thematicBreak`,tokenize:al};function al(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||ys(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),xs(t)?Es(e,s,`whitespace`)(t):s(t))}}var ol={continuation:{tokenize:ul},exit:fl,name:`list`,tokenize:ll},sl={partial:!0,tokenize:pl},cl={partial:!0,tokenize:dl};function ll(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:gs(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(il,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 gs(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(Vs,r.interrupt?n:u,e.attempt(sl,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return xs(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 ul(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(Vs,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Es(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!xs(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(cl,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,Es(e,e.attempt(ol,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function dl(e,t,n){let r=this;return Es(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 fl(e){e.exit(this.containerState.type)}function pl(e,t,n){let r=this;return Es(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!xs(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var ml={name:`setextUnderline`,resolveTo:hl,tokenize:gl};function hl(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 gl(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`),xs(t)?Es(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||ys(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var _l={tokenize:vl};function vl(e){let t=this,n=e.attempt(Vs,r,e.attempt(this.parser.constructs.flowInitial,i,Es(e,e.attempt(this.parser.constructs.flow,i,e.attempt(pc,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 yl={resolveAll:Cl()},bl=Sl(`string`),xl=Sl(`text`);function Sl(e){return{resolveAll:Cl(e===`text`?wl: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 Cl(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 wl(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 Tl=s({attentionMarkers:()=>Nl,contentInitial:()=>Dl,disable:()=>Pl,document:()=>El,flow:()=>kl,flowInitial:()=>Ol,insideSpan:()=>Ml,string:()=>Al,text:()=>jl}),El={42:ol,43:ol,45:ol,48:ol,49:ol,50:ol,51:ol,52:ol,53:ol,54:ol,55:ol,56:ol,57:ol,62:Us},Dl={91:Sc},Ol={[-2]:tc,[-1]:tc,32:tc},kl={35:Oc,42:il,45:[ml,il],60:Nc,61:ml,95:il,96:Qs,126:Qs},Al={38:Ys,92:qs},jl={[-5]:nl,[-4]:nl,[-3]:nl,33:Qc,38:Ys,42:Fs,60:[zs,Bc],91:el,92:[Ec,qs],93:Hc,95:Fs,96:ac},Ml={null:[Fs,yl]},Nl={null:[42,95]},Pl={null:[]};function Fl(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=as(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=Ps(a,l.events,l),l.events):[]}function f(e,t){return Ll(p(e),t)}function p(e){return Il(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){ys(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&&is(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 Il(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 Ll(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=`
21
+ `;break;case-3:o=`\r
22
+ `;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 Rl(e){let t={constructs:ss([Tl,...(e||{}).extensions||[]]),content:n(Ds),defined:[],document:n(ks),flow:n(_l),lazy:{},string:n(bl),text:n(xl)};return t;function n(e){return n;function n(n){return Fl(t,e,n)}}}function zl(e){for(;!dc(e););return e}var Bl=/[\0\t\n\r]/g;function Vl(){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(Bl.lastIndex=u,c=Bl.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 Hl=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Ul(e){return e.replace(Hl,Wl)}function Wl(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return us(n.slice(t?2:1),t?16:10)}return rs(n)||e}var Gl={}.hasOwnProperty;function Kl(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),ql(n)(zl(Rl(n).document().write(Vl()(e,t,!0))))}function ql(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(te),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(k),htmlFlowData:E,htmlText:c(ee),htmlTextData:E,image:c(re),label:ae,labelText:ie,lineEnding:D,link:c(ne),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:ce,resourceDestinationString:A,resourceTitleString:oe,resource:j,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};Yl(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]];Gl.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]||Zl).call(a,void 0,e[0])}for(r.position={start:Jl(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:Jl(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:Jl(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]||Zl).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+go({start:e.start,end:e.end})+`): it’s not open`);n.position.end=Jl(e.end)}function u(){return Qo(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=ds(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:Jl(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=Jl(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=Jl(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 k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}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 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(){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 ie(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=Ul(t),n.identifier=ds(t).toLowerCase()}function ae(){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 A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function oe(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function j(){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=ds(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=us(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=rs(t);let i=this.stack[this.stack.length-1];i.value+=r}function de(e){let t=this.stack.pop();t.position.end=Jl(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 Jl(e){return{line:e.line,column:e.column,offset:e.offset}}function Yl(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?Yl(e,r):Xl(e,r)}}function Xl(e,t){let n;for(n in t)if(Gl.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 Zl(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+go({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+go({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+go({start:t.start,end:t.end})+`) is still open`)}function Ql(e){let t=this;t.parser=n;function n(n){return Kl(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function $l(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 eu(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
23
+ `}]}function tu(e,t){let n=t.value?t.value+`
24
+ `:``,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 nu(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ru(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function iu(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=Ts(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 au(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 ou(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function su(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 cu(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return su(e,t);let i={src:Ts(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 lu(e,t){let n={src:Ts(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 uu(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 du(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return su(e,t);let i={href:Ts(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 fu(e,t){let n={href:Ts(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 pu(e,t,n){let r=e.all(t),i=n?mu(n):hu(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:`
25
+ `}),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:`
26
+ `});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function mu(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=hu(n[r])}return t}function hu(e){return e.spread??e.children.length>1}function gu(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 _u(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function vu(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function yu(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function bu(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=po(t.children[1]),o=fo(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 xu(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 Su(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var Cu=9,wu=32;function Tu(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(Eu(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(Eu(t.slice(i),i>0,!1)),a.join(``)}function Eu(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===Cu||t===wu;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===Cu||t===wu;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function Du(e,t){let n={type:`text`,value:Tu(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Ou(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var ku={blockquote:$l,break:eu,code:tu,delete:nu,emphasis:ru,footnoteReference:iu,heading:au,html:ou,imageReference:cu,image:lu,inlineCode:uu,linkReference:du,link:fu,listItem:pu,list:gu,paragraph:_u,root:vu,strong:yu,table:bu,tableCell:Su,tableRow:xu,text:Du,thematicBreak:Ou,toml:Au,yaml:Au,definition:Au,footnoteDefinition:Au};function Au(){}var ju=typeof self==`object`?self:globalThis,Mu=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new ju[e](t)},Nu=(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(Mu(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(Mu(a,o),i)};return r},Pu=e=>Nu(new Map,e)(0),Fu=``,{toString:Iu}={},{keys:Lu}=Object,Ru=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=Iu.call(e).slice(8,-1);switch(n){case`Array`:return[1,Fu];case`Object`:return[2,Fu];case`Date`:return[3,Fu];case`RegExp`:return[4,Fu];case`Map`:return[5,Fu];case`Set`:return[6,Fu];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:n.includes(`Error`)?[7,n]:[2,n]},zu=([e,t])=>e===0&&(t===`function`||t===`symbol`),Bu=(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]=Ru(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 Lu(r))(e||!zu(Ru(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||!(zu(Ru(n))||zu(Ru(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!zu(Ru(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a},Vu=(e,{json:t,lossy:n}={})=>{let r=[];return Bu(!(t||n),!!t,new Map,r)(e),r},Hu=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?Pu(Vu(e,t)):structuredClone(e):(e,t)=>Pu(Vu(e,t));function Uu(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 Wu(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function Gu(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||Uu,r=e.options.footnoteBackLabel||Wu,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=Ts(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:{...Hu(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
27
+ `},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
28
+ `}]}}var Ku=(function(e){if(e==null)return Zu;if(typeof e==`function`)return Xu(e);if(typeof e==`object`)return Array.isArray(e)?qu(e):Ju(e);if(typeof e==`string`)return Yu(e);throw Error(`Expected function, string, or object as test`)});function qu(e){let t=[],n=-1;for(;++n<e.length;)t[n]=Ku(e[n]);return Xu(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function Ju(e){let t=e;return Xu(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function Yu(e){return Xu(t);function t(t){return t&&t.type===e}}function Xu(e){return t;function t(t,n,r){return!!(Qu(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function Zu(){return!0}function Qu(e){return typeof e==`object`&&!!e&&`type`in e}function $u(e){return e}var ed=[],td=`skip`;function nd(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=Ku(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 (`+$u(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=ed,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=rd(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 rd(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?ed:[e]}function id(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),nd(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 ad={}.hasOwnProperty,od={};function sd(e,t){let n=t||od,r=new Map,i=new Map,a={all:s,applyData:ld,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...ku,...n.handlers},one:o,options:n,patch:cd,wrap:dd};return id(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(ad.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=Hu(n);return r.children=a.all(e),r}return Hu(e)}return(a.options.unknownHandler||ud)(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=fd(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=fd(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function cd(e,t){e.position&&(t.position=ho(e))}function ld(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,Hu(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function ud(e,t){let n=t.data||{},r=`value`in t&&!(ad.call(n,`hProperties`)||ad.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 dd(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
29
+ `});++r<e.length;)r&&n.push({type:`text`,value:`
30
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
31
+ `}),n}function fd(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function pd(e,t){let n=sd(e,t),r=n.one(e,void 0),i=Gu(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
32
+ `},i)),a}function md(e,t){return e&&`run`in e?async function(n,r){let i=pd(n,{file:r,...t});await e.run(i,r)}:function(n,r){return pd(n,{file:r,...e||t})}}function hd(e){if(e)throw e}var gd=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 _d(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 vd(){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?yd(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 yd(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 bd={basename:xd,dirname:Sd,extname:Cd,join:wd,sep:`/`};function xd(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);Dd(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 Sd(e){if(Dd(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 Cd(e){Dd(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 wd(...e){let t=-1,n;for(;++t<e.length;)Dd(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:Td(n)}function Td(e){Dd(e);let t=e.codePointAt(0)===47,n=Ed(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function Ed(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 Dd(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var Od={cwd:kd};function kd(){return`/`}function Ad(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function jd(e){if(typeof e==`string`)e=new URL(e);else if(!Ad(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 Md(e)}function Md(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 Nd=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],Pd=class{constructor(e){let t;t=e?Ad(e)?{path:e}:typeof e==`string`||Rd(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:Od.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<Nd.length;){let e=Nd[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)Nd.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?bd.basename(this.path):void 0}set basename(e){Id(e,`basename`),Fd(e,`basename`),this.path=bd.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?bd.dirname(this.path):void 0}set dirname(e){Ld(this.basename,`dirname`),this.path=bd.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?bd.extname(this.path):void 0}set extname(e){if(Fd(e,`extname`),Ld(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=bd.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){Ad(e)&&(e=jd(e)),Id(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?bd.basename(this.path,this.extname):void 0}set stem(e){Id(e,`stem`),Fd(e,`stem`),this.path=bd.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 bo(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 Fd(e,t){if(e&&e.includes(bd.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+bd.sep+"`")}function Id(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function Ld(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function Rd(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var zd=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),Bd=l(gd(),1),Vd={}.hasOwnProperty,Hd=new class e extends zd{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=vd()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,Bd.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(Gd(`data`,this.frozen),this.namespace[e]=t,this):Vd.call(this.namespace,e)&&this.namespace[e]||void 0:e?(Gd(`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=Jd(e),n=this.parser||this.Parser;return Ud(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),Ud(`process`,this.parser||this.Parser),Wd(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=Jd(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);Xd(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(),Ud(`processSync`,this.parser||this.Parser),Wd(`processSync`,this.compiler||this.Compiler),this.process(e,r),qd(`processSync`,`process`,t),n;function r(e,r){t=!0,hd(e),n=r}}run(e,t,n){Kd(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=Jd(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),qd(`runSync`,`run`,n),r;function i(e,t){hd(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=Jd(t),r=this.compiler||this.Compiler;return Wd(`stringify`,r),Kd(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(Gd(`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,Bd.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];_d(o)&&_d(r)&&(r=(0,Bd.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function Ud(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function Wd(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function Gd(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 Kd(e){if(!_d(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function qd(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function Jd(e){return Yd(e)?e:new Pd(e)}function Yd(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function Xd(e){return typeof e==`string`||Zd(e)}function Zd(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var Qd=[],$d={allowDangerousHtml:!0},ef=/^(https?|ircs?|mailto|xmpp)$/i,tf=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function nf(e){let t=rf(e),n=af(e);return of(t.runSync(t.parse(n),n),e)}function rf(e){let t=e.rehypePlugins||Qd,n=e.remarkPlugins||Qd,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...$d}:$d;return Hd().use(Ql).use(n).use(md,r).use(t)}function af(e){let t=e.children||``,n=new Pd;return typeof t==`string`?n.value=t:``+t,n}function of(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||sf;for(let e of tf)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return id(e,l),Oo(e,{Fragment:R.Fragment,components:i,ignoreInvalidStyle:!0,jsx:R.jsx,jsxs:R.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in Xo)if(Object.hasOwn(Xo,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=Xo[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function sf(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||ef.test(e.slice(0,t))?e:``}var cf=/[#.]/g;function lf(e,t){let n=e||``,r={},i=0,a,o;for(;i<n.length;){cf.lastIndex=i;let e=cf.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 uf(e,t,n){let r=n?gf(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=lf(n,t);let s=o.tagName.toLowerCase(),c=r?r.get(s):void 0;if(o.tagName=c||s,df(i))a.unshift(i);else for(let[t,n]of Object.entries(i))ff(e,o.properties,t,n)}for(let e of a)pf(o.children,e);return o.type===`element`&&o.tagName===`template`&&(o.content={type:`root`,children:o.children},o.children=[]),o}return i}function df(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 ff(e,t,n,r){let i=eo(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?ao(r):i.commaSeparated?ga(r):i.commaOrSpaceSeparated?ao(ga(r).join(` `)):mf(i,i.property,r):Array.isArray(r)?[...r]:i.property===`style`?hf(r):String(r);if(Array.isArray(a)){let e=[];for(let t of a)e.push(mf(i,i.property,t));a=e}i.property===`className`&&Array.isArray(t.className)&&(a=t.className.concat(a)),t[i.property]=a}}function pf(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)pf(e,n);else if(typeof t==`object`&&`type`in t)t.type===`root`?pf(e,t.children):e.push(t);else throw Error("Expected node, nodes, or string, got `"+t+"`")}function mf(e,t,n){if(typeof n==`string`){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===``||Da(n)===Da(t)))return!0}return n}function hf(e){let t=[];for(let[n,r]of Object.entries(e))t.push([n,r].join(`: `));return t.join(`; `)}function gf(e){let t=new Map;for(let n of e)t.set(n.toLowerCase(),n);return t}var _f=`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(`.`),vf=uf(ro,`div`),yf=uf(io,`g`,_f),bf={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/`};function xf(e,t){return Sf(e,t||{})||{type:`root`,children:[]}}function Sf(e,t){let n=Cf(e,t);return n&&t.afterTransform&&t.afterTransform(e,n),n}function Cf(e,t){switch(e.nodeType){case 1:return Of(e,t);case 3:return Ef(e);case 8:return Df(e);case 9:return wf(e,t);case 10:return Tf();case 11:return wf(e,t);default:return}}function wf(e,t){return{type:`root`,children:kf(e,t)}}function Tf(){return{type:`doctype`}}function Ef(e){return{type:`text`,value:e.nodeValue||``}}function Df(e){return{type:`comment`,value:e.nodeValue||``}}function Of(e,t){let n=e.namespaceURI,r=n===bf.svg?yf:vf,i=n===bf.html?e.tagName.toLowerCase():e.tagName,a=n===bf.html&&i===`template`?e.content:e,o=e.getAttributeNames(),s={},c=-1;for(;++c<o.length;)s[o[c]]=e.getAttribute(o[c])||``;return r(i,s,kf(a,t))}function kf(e,t){let n=e.childNodes,r=[],i=-1;for(;++i<n.length;){let e=Sf(n[i],t);e!==void 0&&r.push(e)}return r}var Af=new DOMParser;function jf(e,t){return xf(t?.fragment?Mf(e):Af.parseFromString(e,`text/html`))}function Mf(e){let t=document.createElement(`template`);return t.innerHTML=e,t.content}var Nf=(function(e,t,n){let r=Ku(n);if(!e||!e.type||!e.children)throw Error(`Expected parent node`);if(typeof t==`number`){if(t<0||t===1/0)throw Error(`Expected positive finite number as index`)}else if(t=e.children.indexOf(t),t<0)throw Error(`Expected child node or index`);for(;++t<e.children.length;)if(r(e.children[t],t,e))return e.children[t]}),Pf=(function(e){if(e==null)return Rf;if(typeof e==`string`)return If(e);if(typeof e==`object`)return Ff(e);if(typeof e==`function`)return Lf(e);throw Error("Expected function, string, or array as `test`")});function Ff(e){let t=[],n=-1;for(;++n<e.length;)t[n]=Pf(e[n]);return Lf(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function If(e){return Lf(t);function t(t){return t.tagName===e}}function Lf(e){return t;function t(t,n,r){return!!(zf(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function Rf(e){return!!(e&&typeof e==`object`&&`type`in e&&e.type===`element`&&`tagName`in e&&typeof e.tagName==`string`)}function zf(e){return typeof e==`object`&&!!e&&`type`in e&&`tagName`in e}var Bf=/\n/g,Vf=/[\t ]+/g,Hf=Pf(`br`),Uf=Pf(np),Wf=Pf(`p`),Gf=Pf(`tr`),Kf=Pf([`datalist`,`head`,`noembed`,`noframes`,`noscript`,`rp`,`script`,`style`,`template`,`title`,tp,rp]),qf=Pf(`address.article.aside.blockquote.body.caption.center.dd.dialog.dir.dl.dt.div.figure.figcaption.footer.form,.h1.h2.h3.h4.h5.h6.header.hgroup.hr.html.legend.li.listing.main.menu.nav.ol.p.plaintext.pre.section.ul.xmp`.split(`.`));function Jf(e,t){let n=t||{},r=`children`in e?e.children:[],i=qf(e),a=ep(e,{whitespace:n.whitespace||`normal`,breakBefore:!1,breakAfter:!1}),o=[];(e.type===`text`||e.type===`comment`)&&o.push(...Zf(e,{whitespace:a,breakBefore:!0,breakAfter:!0}));let s=-1;for(;++s<r.length;)o.push(...Yf(r[s],e,{whitespace:a,breakBefore:s?void 0:i,breakAfter:s<r.length-1?Hf(r[s+1]):i}));let c=[],l;for(s=-1;++s<o.length;){let e=o[s];typeof e==`number`?l!==void 0&&e>l&&(l=e):e&&(l!==void 0&&l>-1&&c.push(`
33
+ `.repeat(l)||` `),l=-1,c.push(e))}return c.join(``)}function Yf(e,t,n){return e.type===`element`?Xf(e,t,n):e.type===`text`?n.whitespace===`normal`?Zf(e,n):Qf(e):[]}function Xf(e,t,n){let r=ep(e,n),i=e.children||[],a=-1,o=[];if(Kf(e))return o;let s,c;for(Hf(e)||Gf(e)&&Nf(t,e,Gf)?c=`
34
+ `:Wf(e)?(s=2,c=2):qf(e)&&(s=1,c=1);++a<i.length;)o=o.concat(Yf(i[a],e,{whitespace:r,breakBefore:a?void 0:s,breakAfter:a<i.length-1?Hf(i[a+1]):c}));return Uf(e)&&Nf(t,e,Uf)&&o.push(` `),s&&o.unshift(s),c&&o.push(c),o}function Zf(e,t){let n=String(e.value),r=[],i=[],a=0;for(;a<=n.length;){Bf.lastIndex=a;let e=Bf.exec(n),i=e&&`index`in e?e.index:n.length;r.push($f(n.slice(a,i).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,``),a===0?t.breakBefore:!0,i===n.length?t.breakAfter:!0)),a=i+1}let o=-1,s;for(;++o<r.length;)r[o].charCodeAt(r[o].length-1)===8203||o<r.length-1&&r[o+1].charCodeAt(0)===8203?(i.push(r[o]),s=void 0):r[o]?(typeof s==`number`&&i.push(s),i.push(r[o]),s=0):(o===0||o===r.length-1)&&i.push(0);return i}function Qf(e){return[String(e.value)]}function $f(e,t,n){let r=[],i=0,a;for(;i<e.length;){Vf.lastIndex=i;let n=Vf.exec(e);a=n?n.index:e.length,!i&&!a&&n&&!t&&r.push(``),i!==a&&r.push(e.slice(i,a)),i=n?a+n[0].length:a}return i!==a&&!n&&r.push(``),r.join(` `)}function ep(e,t){if(e.type===`element`){let n=e.properties||{};switch(e.tagName){case`listing`:case`plaintext`:case`xmp`:return`pre`;case`nobr`:return`nowrap`;case`pre`:return n.wrap?`pre-wrap`:`pre`;case`td`:case`th`:return n.noWrap?`nowrap`:t.whitespace;case`textarea`:return`pre-wrap`;default:}}return t.whitespace}function tp(e){return!!(e.properties||{}).hidden}function np(e){return e.tagName===`td`||e.tagName===`th`}function rp(e){return e.tagName===`dialog`&&!(e.properties||{}).open}var V=class e extends Error{constructor(t,n){var r=`KaTeX parse error: `+t,i,a,o=n&&n.loc;if(o&&o.start<=o.end){var s=o.lexer.input;i=o.start,a=o.end,i===s.length?r+=` at end of input: `:r+=` at position `+(i+1)+`: `;var c=s.slice(i,a).replace(/[^]/g,`$&̲`),l=i>15?`…`+s.slice(i-15,i):s.slice(0,i),u=a+15<s.length?s.slice(a,a+15)+`…`:s.slice(a);r+=l+c+u}super(r),this.name=`ParseError`,this.position=void 0,this.length=void 0,this.rawMessage=void 0,Object.setPrototypeOf(this,e.prototype),this.position=i,i!=null&&a!=null&&(this.length=a-i),this.rawMessage=t}},ip=/([A-Z])/g,ap=e=>e.replace(ip,`-$1`).toLowerCase(),op={"&":`&amp;`,">":`&gt;`,"<":`&lt;`,'"':`&quot;`,"'":`&#x27;`},sp=/[&><"']/g,cp=e=>String(e).replace(sp,e=>op[e]),lp=e=>e.type===`ordgroup`||e.type===`color`?e.body.length===1?lp(e.body[0]):e:e.type===`font`?lp(e.body):e,up=new Set([`mathord`,`textord`,`atom`]),dp=e=>up.has(lp(e).type),fp=e=>{var t=/^[\x00-\x20]*([^\\/#?]*?)(:|&#0*58|&#x0*3a|&colon)/i.exec(e);return t?t[2]!==`:`||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?null:t[1].toLowerCase():`_relative`},pp={displayMode:{type:`boolean`,description:`Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.`,cli:`-d, --display-mode`},output:{type:{enum:[`htmlAndMathml`,`html`,`mathml`]},description:`Determines the markup language of the output.`,cli:`-F, --format <type>`},leqno:{type:`boolean`,description:`Render display math in leqno style (left-justified tags).`},fleqn:{type:`boolean`,description:`Render display math flush left.`},throwOnError:{type:`boolean`,default:!0,cli:`-t, --no-throw-on-error`,cliDescription:`Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error.`},errorColor:{type:`string`,default:`#cc0000`,cli:`-c, --error-color <color>`,cliDescription:`A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.`,cliProcessor:e=>`#`+e},macros:{type:`object`,cli:`-m, --macro <def>`,cliDescription:`Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).`,cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:`number`,description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:`--min-rule-thickness <size>`,cliProcessor:parseFloat},colorIsTextColor:{type:`boolean`,description:`Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.`,cli:`-b, --color-is-text-color`},strict:{type:[{enum:[`warn`,`ignore`,`error`]},`boolean`,`function`],description:`Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.`,cli:`-S, --strict`,cliDefault:!1},trust:{type:[`boolean`,`function`],description:`Trust the input, enabling all HTML features such as \\url.`,cli:`-T, --trust`},maxSize:{type:`number`,default:1/0,description:`If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large`,processor:e=>Math.max(0,e),cli:`-s, --max-size <n>`,cliProcessor:parseInt},maxExpand:{type:`number`,default:1e3,description:`Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.`,processor:e=>Math.max(0,e),cli:`-e, --max-expand <n>`,cliProcessor:e=>e===`Infinity`?1/0:parseInt(e)},globalGroup:{type:`boolean`,cli:!1}};function mp(e){if(typeof e!=`string`)return e.enum[0];switch(e){case`boolean`:return!1;case`string`:return``;case`number`:return 0;case`object`:return{};default:throw Error(`Unexpected schema type; settings must declare an explicit default.`)}}function hp(e){return e.default===void 0?mp(Array.isArray(e.type)?e.type[0]:e.type):e.default}function gp(e,t,n,r){var i=n[t];e[t]=i===void 0?hp(r):r.processor?r.processor(i):i}var _p=class{constructor(e){e===void 0&&(e={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e||={};for(var t of Object.keys(pp)){var n=pp[t];n&&gp(this,t,e,n)}}reportNonstrict(e,t,n){var r=this.strict;if(typeof r==`function`&&(r=r(e,t,n)),!(!r||r===`ignore`)){if(r===!0||r===`error`)throw new V(`LaTeX-incompatible input and strict mode is set to 'error': `+(t+` [`+e+`]`),n);r===`warn`?typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to 'warn': `+(t+` [`+e+`]`)):typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to `+(`unrecognized '`+r+`': `+t+` [`+e+`]`))}}useStrictBehavior(e,t,n){var r=this.strict;if(typeof r==`function`)try{r=r(e,t,n)}catch{r=`error`}return!r||r===`ignore`?!1:r===!0||r===`error`?!0:r===`warn`?(typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to 'warn': `+(t+` [`+e+`]`)),!1):(typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to `+(`unrecognized '`+r+`': `+t+` [`+e+`]`)),!1)}isTrusted(e){if(`url`in e&&e.url&&!e.protocol){var t=fp(e.url);if(t==null)return!1;e.protocol=t}return!!(typeof this.trust==`function`?this.trust(e):this.trust)}},vp=class{constructor(e,t,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=n}sup(){return Dp[Op[this.id]]}sub(){return Dp[kp[this.id]]}fracNum(){return Dp[Ap[this.id]]}fracDen(){return Dp[jp[this.id]]}cramp(){return Dp[Mp[this.id]]}text(){return Dp[Np[this.id]]}isTight(){return this.size>=2}},yp=0,bp=1,xp=2,Sp=3,Cp=4,wp=5,Tp=6,Ep=7,Dp=[new vp(yp,0,!1),new vp(bp,0,!0),new vp(xp,1,!1),new vp(Sp,1,!0),new vp(Cp,2,!1),new vp(wp,2,!0),new vp(Tp,3,!1),new vp(Ep,3,!0)],Op=[Cp,wp,Cp,wp,Tp,Ep,Tp,Ep],kp=[wp,wp,wp,wp,Ep,Ep,Ep,Ep],Ap=[xp,Sp,Cp,wp,Tp,Ep,Tp,Ep],jp=[Sp,Sp,wp,wp,Ep,Ep,Ep,Ep],Mp=[bp,bp,Sp,Sp,wp,wp,Ep,Ep],Np=[yp,bp,xp,Sp,xp,Sp,xp,Sp],Pp={DISPLAY:Dp[yp],TEXT:Dp[xp],SCRIPT:Dp[Cp],SCRIPTSCRIPT:Dp[Tp]},Fp=[{name:`latin`,blocks:[[256,591],[768,879]]},{name:`cyrillic`,blocks:[[1024,1279]]},{name:`armenian`,blocks:[[1328,1423]]},{name:`brahmic`,blocks:[[2304,4255]]},{name:`georgian`,blocks:[[4256,4351]]},{name:`cjk`,blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:`hangul`,blocks:[[44032,55215]]}];function Ip(e){for(var t=0;t<Fp.length;t++)for(var n=Fp[t],r=0;r<n.blocks.length;r++){var i=n.blocks[r];if(e>=i[0]&&e<=i[1])return n.name}return null}var Lp=[];Fp.forEach(e=>e.blocks.forEach(e=>Lp.push(...e)));function Rp(e){for(var t=0;t<Lp.length;t+=2)if(e>=Lp[t]&&e<=Lp[t+1])return!0;return!1}var zp=e=>e+` `+e,Bp=80,Vp=function(e,t){return`M95,`+(622+e+t)+`
35
+ c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
36
+ c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
37
+ c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
38
+ s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
39
+ c69,-144,104.5,-217.7,106.5,-221
40
+ l`+e/2.075+` -`+e+`
41
+ c5.3,-9.3,12,-14,20,-14
42
+ H400000v`+(40+e)+`H845.2724
43
+ s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
44
+ c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
45
+ M`+(834+e)+` `+t+`h400000v`+(40+e)+`h-400000z`},Hp=function(e,t){return`M263,`+(601+e+t)+`c0.7,0,18,39.7,52,119
46
+ c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
47
+ c340,-704.7,510.7,-1060.3,512,-1067
48
+ l`+e/2.084+` -`+e+`
49
+ c4.7,-7.3,11,-11,19,-11
50
+ H40000v`+(40+e)+`H1012.3
51
+ s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232
52
+ c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1
53
+ s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
54
+ c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
55
+ M`+(1001+e)+` `+t+`h400000v`+(40+e)+`h-400000z`},Up=function(e,t){return`M983 `+(10+e+t)+`
56
+ l`+e/3.13+` -`+e+`
57
+ c4,-6.7,10,-10,18,-10 H400000v`+(40+e)+`
58
+ H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7
59
+ s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744
60
+ c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30
61
+ c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722
62
+ c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5
63
+ c53.7,-170.3,84.5,-266.8,92.5,-289.5z
64
+ M`+(1001+e)+` `+t+`h400000v`+(40+e)+`h-400000z`},Wp=function(e,t){return`M424,`+(2398+e+t)+`
65
+ c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514
66
+ c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20
67
+ s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121
68
+ s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081
69
+ l`+e/4.223+` -`+e+`c4,-6.7,10,-10,18,-10 H400000
70
+ v`+(40+e)+`H1014.6
71
+ s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185
72
+ c-2,6,-10,9,-24,9
73
+ c-8,0,-12,-0.7,-12,-2z M`+(1001+e)+` `+t+`
74
+ h400000v`+(40+e)+`h-400000z`},Gp=function(e,t){return`M473,`+(2713+e+t)+`
75
+ c339.3,-1799.3,509.3,-2700,510,-2702 l`+e/5.298+` -`+e+`
76
+ c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+e)+`H1017.7
77
+ s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9
78
+ c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200
79
+ c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26
80
+ s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,
81
+ 606zM`+(1001+e)+` `+t+`h400000v`+(40+e)+`H1017.7z`},Kp=function(e){var t=e/2;return`M400000 `+e+` H0 L`+t+` 0 l65 45 L145 `+(e-80)+` H400000z`},qp=function(e,t,n){var r=n-54-t-e;return`M702 `+(e+t)+`H400000`+(40+e)+`
82
+ H742v`+r+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1
83
+ h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
84
+ c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
85
+ 219 661 l218 661zM702 `+t+`H400000v`+(40+e)+`H742z`},Jp=function(e,t,n){t=1e3*t;var r=``;switch(e){case`sqrtMain`:r=Vp(t,Bp);break;case`sqrtSize1`:r=Hp(t,Bp);break;case`sqrtSize2`:r=Up(t,Bp);break;case`sqrtSize3`:r=Wp(t,Bp);break;case`sqrtSize4`:r=Gp(t,Bp);break;case`sqrtTall`:r=qp(t,Bp,n)}return r},Yp=function(e,t){switch(e){case`⎜`:return zp(`M291 0 H417 V`+t+` H291z`);case`∣`:return zp(`M145 0 H188 V`+t+` H145z`);case`∥`:return zp(`M145 0 H188 V`+t+` H145z`)+zp(`M367 0 H410 V`+t+` H367z`);case`⎟`:return zp(`M457 0 H583 V`+t+` H457z`);case`⎢`:return zp(`M319 0 H403 V`+t+` H319z`);case`⎥`:return zp(`M263 0 H347 V`+t+` H263z`);case`⎪`:return zp(`M384 0 H504 V`+t+` H384z`);case`⏐`:return zp(`M312 0 H355 V`+t+` H312z`);case`‖`:return zp(`M257 0 H300 V`+t+` H257z`)+zp(`M478 0 H521 V`+t+` H478z`);default:return``}},Xp={doubleleftarrow:`M262 157
86
+ l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3
87
+ 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28
88
+ 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5
89
+ c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5
90
+ 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87
91
+ -86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
92
+ -2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
93
+ m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l
94
+ -10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5
95
+ 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88
96
+ -33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68
97
+ -17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18
98
+ -13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
99
+ c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3
100
+ -107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120
101
+ 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8
102
+ -5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247
103
+ c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208
104
+ 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3
105
+ 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202
106
+ l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
107
+ -45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
108
+ 5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13
109
+ 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688
110
+ 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
111
+ -331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80
112
+ H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0
113
+ 435 0h399565z`,leftgroupunder:`M400000 262
114
+ H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219
115
+ 435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
116
+ -3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5
117
+ -18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7
118
+ -196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5
119
+ 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3
120
+ -4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7
121
+ -10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
122
+ m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
123
+ 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
124
+ 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667
125
+ -152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12
126
+ 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7
127
+ -2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
128
+ v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5
129
+ -83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3
130
+ -68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21
131
+ 71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:zp(`M40 281 V428 H0 V94 H40 V241 H400000 v40z`),leftbracketunder:zp(`M0 0 h120 V290 H399995 v120 H0z`),leftbracketover:zp(`M0 440 h120 V150 H399995 v-120 H0z`),leftmapsto:zp(`M40 281 V448H0V74H40V241H400000v40z`),leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
132
+ -.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
133
+ c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3
134
+ 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:zp(`M0 50 h400000 v40H0z m0 194h40000v40H0z`),midbrace:`M200428 334
135
+ c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14
136
+ -53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
137
+ 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11
138
+ 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214
139
+ c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14
140
+ 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
141
+ 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0
142
+ -5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6
143
+ -320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
144
+ m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8
145
+ 60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8
146
+ -451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
147
+ m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
148
+ c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6
149
+ -480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
150
+ m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0
151
+ 85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8
152
+ -707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
153
+ m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
154
+ c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128
155
+ -16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20
156
+ 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7
157
+ 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85
158
+ -40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
159
+ -12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
160
+ 151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l
161
+ -6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5
162
+ s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1
163
+ c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3
164
+ 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
165
+ -174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0
166
+ 3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18
167
+ 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3
168
+ -3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2
169
+ -10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58
170
+ 69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11
171
+ -18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7
172
+ 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z
173
+ m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8
174
+ 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5
175
+ -7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95
176
+ -27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8
177
+ 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3
178
+ 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3
179
+ -64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
180
+ m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3
181
+ 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0
182
+ -13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21
183
+ 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:zp(`M399960 241 V94 h40 V428 h-40 V281 H0 v-40z`),rightbracketunder:zp(`M399995 0 h-120 V290 H0 v120 H400000z`),rightbracketover:zp(`M399995 440 h-120 V150 H0 v-120 H399995z`),rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23
184
+ 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
185
+ -52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142
186
+ -167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40
187
+ 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69
188
+ -70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
189
+ -40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
190
+ -37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
191
+ 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167
192
+ c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3
193
+ 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42
194
+ 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
195
+ -19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
196
+ 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,tilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7
197
+ -2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0
198
+ 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0
199
+ 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
200
+ -68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418
201
+ -8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9
202
+ 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
203
+ c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751
204
+ 181.476 676 181.476c-149 0-189-126.21-332-126.21z`,tilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457
205
+ -11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
206
+ 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
207
+ 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
208
+ -338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
209
+ -11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
210
+ 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
211
+ 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
212
+ -175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5
213
+ 3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
214
+ 10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63
215
+ -1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1
216
+ -7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
217
+ H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
218
+ c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22
219
+ c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10
220
+ -11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10
221
+ -11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10
222
+ -11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,
223
+ -5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
224
+ -11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
225
+ -11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
226
+ -11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202
227
+ c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
228
+ c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130
229
+ s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47
230
+ 121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6
231
+ s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11
232
+ c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
233
+ M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
234
+ -27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0
235
+ 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39
236
+ -84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5
237
+ -119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
238
+ -12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
239
+ 151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
240
+ c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
241
+ c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21
242
+ c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
243
+ c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
244
+ M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0
245
+ c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
246
+ -231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
247
+ c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
248
+ M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
249
+ c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,
250
+ 1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,
251
+ -152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
252
+ M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0
253
+ c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
254
+ -231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
255
+ c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
256
+ M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},Zp=function(e,t){switch(e){case`lbrack`:return`M403 1759 V84 H666 V0 H319 V1759 v`+t+` v1759 v84 h347 v-84
257
+ H403z M403 1759 V0 H319 V1759 v`+t+` v1759 v84 h84z`;case`rbrack`:return`M347 1759 V0 H0 V84 H263 V1759 v`+t+` v1759 H0 v84 H347z
258
+ M347 1759 V0 H263 V1759 v`+t+` v1759 h84z`;case`vert`:return`M145 15 v585 v`+t+` v585 c2.667,10,9.667,15,21,15
259
+ c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15
260
+ c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+t+` v585 h43z`;case`doublevert`:return`M145 15 v585 v`+t+` v585 c2.667,10,9.667,15,21,15
261
+ c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15
262
+ c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+t+` v585 h43z
263
+ M367 15 v585 v`+t+` v585 c2.667,10,9.667,15,21,15
264
+ c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15
265
+ c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+t+` v585 h43z`;case`lfloor`:return`M319 602 V0 H403 V602 v`+t+` v1715 h263 v84 H319z
266
+ MM319 602 V0 H403 V602 v`+t+` v1715 H319z`;case`rfloor`:return`M319 602 V0 H403 V602 v`+t+` v1799 H0 v-84 H319z
267
+ MM319 602 V0 H403 V602 v`+t+` v1715 H319z`;case`lceil`:return`M403 1759 V84 H666 V0 H319 V1759 v`+t+` v602 h84z
268
+ M403 1759 V0 H319 V1759 v`+t+` v602 h84z`;case`rceil`:return`M347 1759 V0 H0 V84 H263 V1759 v`+t+` v602 h84z
269
+ M347 1759 V0 h-84 V1759 v`+t+` v602 h84z`;case`lparen`:return`M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1
270
+ c-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,
271
+ -36,557 l0,`+(t+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,
272
+ 949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9
273
+ c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,
274
+ -544.7,-112.5,-882c-2,-104,-3,-167,-3,-189
275
+ l0,-`+(t+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,
276
+ -210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z`;case`rparen`:return`M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,
277
+ 63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5
278
+ c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(t+9)+`
279
+ c-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664
280
+ c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11
281
+ c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17
282
+ c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558
283
+ l0,-`+(t+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
284
+ -470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw Error(`Unknown stretchy delimiter.`)}};function Qp(e){return`toText`in e}var $p=class{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return this.classes.includes(e)}toNode(){for(var e=document.createDocumentFragment(),t=0;t<this.children.length;t++)e.appendChild(this.children[t].toNode());return e}toMarkup(){for(var e=``,t=0;t<this.children.length;t++)e+=this.children[t].toMarkup();return e}toText(){return this.children.map(e=>{if(Qp(e))return e.toText();throw Error(`Expected MathDomNode with toText, got `+e.constructor.name)}).join(``)}},em={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},tm={ex:!0,em:!0,mu:!0},nm=function(e){return typeof e!=`string`&&(e=e.unit),e in em||e in tm||e===`ex`},rm=function(e,t){var n;if(e.unit in em)n=em[e.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if(e.unit===`mu`)n=t.fontMetrics().cssEmPerMu;else{var r=t.style.isTight()?t.havingStyle(t.style.text()):t;if(e.unit===`ex`)n=r.fontMetrics().xHeight;else if(e.unit===`em`)n=r.fontMetrics().quad;else throw new V(`Invalid unit: '`+e.unit+`'`);r!==t&&(n*=r.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*n,t.maxSize)},H=function(e){return+e.toFixed(4)+`em`},im=function(e){return e.filter(e=>e).join(` `)},am=function(e){var t=``;for(var n of Object.keys(e)){var r=e[n];r!==void 0&&(t+=ap(n)+`:`+r+`;`)}return t},om=function(e,t,n){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},t){t.style.isTight()&&this.classes.push(`mtight`);var r=t.getColor();r&&(this.style.color=r)}},sm=function(e){var t=document.createElement(e);t.className=im(this.classes),Object.assign(t.style,this.style);for(var n of Object.keys(this.attributes))t.setAttribute(n,this.attributes[n]);for(var r=0;r<this.children.length;r++)t.appendChild(this.children[r].toNode());return t},cm=/[\s"'>/=\x00-\x1f]/,lm=function(e){var t=`<`+e;this.classes.length&&(t+=` class="`+cp(im(this.classes))+`"`);var n=am(this.style);n&&(t+=` style="`+cp(n)+`"`);for(var r of Object.keys(this.attributes)){if(cm.test(r))throw new V(`Invalid attribute name '`+r+`'`);t+=` `+r+`="`+cp(this.attributes[r])+`"`}t+=`>`;for(var i=0;i<this.children.length;i++)t+=this.children[i].toMarkup();return t+=`</`+e+`>`,t},um=class{constructor(e,t,n,r){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,om.call(this,e,n,r),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return sm.call(this,`span`)}toMarkup(){return lm.call(this,`span`)}},dm=class{constructor(e,t,n,r){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,om.call(this,t,r),this.children=n||[],this.setAttribute(`href`,e)}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return sm.call(this,`a`)}toMarkup(){return lm.call(this,`a`)}},fm=class{constructor(e,t,n){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=t,this.src=e,this.classes=[`mord`],this.height=0,this.depth=0,this.maxFontSize=0,this.style=n}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createElement(`img`);return e.src=this.src,e.alt=this.alt,e.className=`mord`,Object.assign(e.style,this.style),e}toMarkup(){var e=`<img src="`+cp(this.src)+`"`+(` alt="`+cp(this.alt)+`"`),t=am(this.style);return t&&(e+=` style="`+cp(t)+`"`),e+=`'/>`,e}},pm={î:`ı̂`,ï:`ı̈`,í:`ı́`,ì:`ı̀`},mm=class{constructor(e,t,n,r,i,a,o,s){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=e,this.height=t||0,this.depth=n||0,this.italic=r||0,this.skew=i||0,this.width=a||0,this.classes=o||[],this.style=s||{},this.maxFontSize=0;var c=Ip(this.text.charCodeAt(0));c&&this.classes.push(c+`_fallback`),/[îïíì]/.test(this.text)&&(this.text=pm[this.text])}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createTextNode(this.text),t=null;return this.italic>0&&(t=document.createElement(`span`),t.style.marginRight=H(this.italic)),this.classes.length>0&&(t||=document.createElement(`span`),t.className=im(this.classes)),Object.keys(this.style).length>0&&(t||=document.createElement(`span`),Object.assign(t.style,this.style)),t?(t.appendChild(e),t):e}toMarkup(){var e=!1,t=`<span`;this.classes.length&&(e=!0,t+=` class="`,t+=cp(im(this.classes)),t+=`"`);var n=``;this.italic>0&&(n+=`margin-right:`+H(this.italic)+`;`),n+=am(this.style),n&&(e=!0,t+=` style="`+cp(n)+`"`);var r=cp(this.text);return e?(t+=`>`,t+=r,t+=`</span>`,t):r}},hm=class{constructor(e,t){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=t||{}}toNode(){var e=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`);for(var t of Object.keys(this.attributes))e.setAttribute(t,this.attributes[t]);for(var n=0;n<this.children.length;n++)e.appendChild(this.children[n].toNode());return e}toMarkup(){var e=`<svg xmlns="http://www.w3.org/2000/svg"`;for(var t of Object.keys(this.attributes))e+=` `+t+`="`+cp(this.attributes[t])+`"`;e+=`>`;for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+=`</svg>`,e}},gm=class{constructor(e,t){this.pathName=void 0,this.alternate=void 0,this.pathName=e,this.alternate=t}toNode(){var e=document.createElementNS(`http://www.w3.org/2000/svg`,`path`);return this.alternate?e.setAttribute(`d`,this.alternate):e.setAttribute(`d`,Xp[this.pathName]),e}toMarkup(){return this.alternate?`<path d="`+cp(this.alternate)+`"/>`:`<path d="`+cp(Xp[this.pathName])+`"/>`}},_m=class{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e=document.createElementNS(`http://www.w3.org/2000/svg`,`line`);for(var t of Object.keys(this.attributes))e.setAttribute(t,this.attributes[t]);return e}toMarkup(){var e=`<line`;for(var t of Object.keys(this.attributes))e+=` `+t+`="`+cp(this.attributes[t])+`"`;return e+=`/>`,e}};function vm(e){if(e instanceof mm)return e;throw Error(`Expected symbolNode but got `+String(e)+`.`)}function ym(e){if(e instanceof um)return e;throw Error(`Expected span<HtmlDomNode> but got `+String(e)+`.`)}var bm=e=>e instanceof um||e instanceof dm||e instanceof $p,xm={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},Sm={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},Cm={Å:`A`,Ð:`D`,Þ:`o`,å:`a`,ð:`d`,þ:`o`,А:`A`,Б:`B`,В:`B`,Г:`F`,Д:`A`,Е:`E`,Ж:`K`,З:`3`,И:`N`,Й:`N`,К:`K`,Л:`N`,М:`M`,Н:`H`,О:`O`,П:`N`,Р:`P`,С:`C`,Т:`T`,У:`y`,Ф:`O`,Х:`X`,Ц:`U`,Ч:`h`,Ш:`W`,Щ:`W`,Ъ:`B`,Ы:`X`,Ь:`B`,Э:`3`,Ю:`X`,Я:`R`,а:`a`,б:`b`,в:`a`,г:`r`,д:`y`,е:`e`,ж:`m`,з:`e`,и:`n`,й:`n`,к:`n`,л:`n`,м:`m`,н:`n`,о:`o`,п:`n`,р:`p`,с:`c`,т:`o`,у:`y`,ф:`b`,х:`x`,ц:`n`,ч:`n`,ш:`w`,щ:`w`,ъ:`a`,ы:`m`,ь:`a`,э:`e`,ю:`m`,я:`r`};function wm(e,t){xm[e]=t}function Tm(e,t,n){if(!xm[t])throw Error(`Font metrics not found for font: `+t+`.`);var r=e.charCodeAt(0),i=xm[t][r];if(!i&&e[0]in Cm&&(r=Cm[e[0]].charCodeAt(0),i=xm[t][r]),!i&&n===`text`&&Rp(r)&&(i=xm[t][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var Em={};function Dm(e){var t=e>=5?0:e>=3?1:2;if(!Em[t]){var n=Em[t]={cssEmPerMu:Sm.quad[t]/18};for(var r in Sm)Sm.hasOwnProperty(r)&&(n[r]=Sm[r][t])}return Em[t]}var Om={math:{},text:{}};function U(e,t,n,r,i,a){Om[e][i]={font:t,group:n,replace:r},a&&r&&(Om[e][r]=Om[e][i])}var W=`math`,G=`text`,K=`main`,q=`ams`,km=`accent-token`,Am=`bin`,jm=`close`,Mm=`inner`,Nm=`mathord`,Pm=`op-token`,Fm=`open`,Im=`punct`,J=`rel`,Lm=`spacing`,Y=`textord`;U(W,K,J,`≡`,`\\equiv`,!0),U(W,K,J,`≺`,`\\prec`,!0),U(W,K,J,`≻`,`\\succ`,!0),U(W,K,J,`∼`,`\\sim`,!0),U(W,K,J,`⊥`,`\\perp`),U(W,K,J,`⪯`,`\\preceq`,!0),U(W,K,J,`⪰`,`\\succeq`,!0),U(W,K,J,`≃`,`\\simeq`,!0),U(W,K,J,`∣`,`\\mid`,!0),U(W,K,J,`≪`,`\\ll`,!0),U(W,K,J,`≫`,`\\gg`,!0),U(W,K,J,`≍`,`\\asymp`,!0),U(W,K,J,`∥`,`\\parallel`),U(W,K,J,`⋈`,`\\bowtie`,!0),U(W,K,J,`⌣`,`\\smile`,!0),U(W,K,J,`⊑`,`\\sqsubseteq`,!0),U(W,K,J,`⊒`,`\\sqsupseteq`,!0),U(W,K,J,`≐`,`\\doteq`,!0),U(W,K,J,`⌢`,`\\frown`,!0),U(W,K,J,`∋`,`\\ni`,!0),U(W,K,J,`∝`,`\\propto`,!0),U(W,K,J,`⊢`,`\\vdash`,!0),U(W,K,J,`⊣`,`\\dashv`,!0),U(W,K,J,`∋`,`\\owns`),U(W,K,Im,`.`,`\\ldotp`),U(W,K,Im,`⋅`,`\\cdotp`),U(W,K,Im,`⋅`,`·`),U(G,K,Y,`⋅`,`·`),U(W,K,Y,`#`,`\\#`),U(G,K,Y,`#`,`\\#`),U(W,K,Y,`&`,`\\&`),U(G,K,Y,`&`,`\\&`),U(W,K,Y,`ℵ`,`\\aleph`,!0),U(W,K,Y,`∀`,`\\forall`,!0),U(W,K,Y,`ℏ`,`\\hbar`,!0),U(W,K,Y,`∃`,`\\exists`,!0),U(W,K,Y,`∇`,`\\nabla`,!0),U(W,K,Y,`♭`,`\\flat`,!0),U(W,K,Y,`ℓ`,`\\ell`,!0),U(W,K,Y,`♮`,`\\natural`,!0),U(W,K,Y,`♣`,`\\clubsuit`,!0),U(W,K,Y,`℘`,`\\wp`,!0),U(W,K,Y,`♯`,`\\sharp`,!0),U(W,K,Y,`♢`,`\\diamondsuit`,!0),U(W,K,Y,`ℜ`,`\\Re`,!0),U(W,K,Y,`♡`,`\\heartsuit`,!0),U(W,K,Y,`ℑ`,`\\Im`,!0),U(W,K,Y,`♠`,`\\spadesuit`,!0),U(W,K,Y,`§`,`\\S`,!0),U(G,K,Y,`§`,`\\S`),U(W,K,Y,`¶`,`\\P`,!0),U(G,K,Y,`¶`,`\\P`),U(W,K,Y,`†`,`\\dag`),U(G,K,Y,`†`,`\\dag`),U(G,K,Y,`†`,`\\textdagger`),U(W,K,Y,`‡`,`\\ddag`),U(G,K,Y,`‡`,`\\ddag`),U(G,K,Y,`‡`,`\\textdaggerdbl`),U(W,K,jm,`⎱`,`\\rmoustache`,!0),U(W,K,Fm,`⎰`,`\\lmoustache`,!0),U(W,K,jm,`⟯`,`\\rgroup`,!0),U(W,K,Fm,`⟮`,`\\lgroup`,!0),U(W,K,Am,`∓`,`\\mp`,!0),U(W,K,Am,`⊖`,`\\ominus`,!0),U(W,K,Am,`⊎`,`\\uplus`,!0),U(W,K,Am,`⊓`,`\\sqcap`,!0),U(W,K,Am,`∗`,`\\ast`),U(W,K,Am,`⊔`,`\\sqcup`,!0),U(W,K,Am,`◯`,`\\bigcirc`,!0),U(W,K,Am,`∙`,`\\bullet`,!0),U(W,K,Am,`‡`,`\\ddagger`),U(W,K,Am,`≀`,`\\wr`,!0),U(W,K,Am,`⨿`,`\\amalg`),U(W,K,Am,`&`,`\\And`),U(W,K,J,`⟵`,`\\longleftarrow`,!0),U(W,K,J,`⇐`,`\\Leftarrow`,!0),U(W,K,J,`⟸`,`\\Longleftarrow`,!0),U(W,K,J,`⟶`,`\\longrightarrow`,!0),U(W,K,J,`⇒`,`\\Rightarrow`,!0),U(W,K,J,`⟹`,`\\Longrightarrow`,!0),U(W,K,J,`↔`,`\\leftrightarrow`,!0),U(W,K,J,`⟷`,`\\longleftrightarrow`,!0),U(W,K,J,`⇔`,`\\Leftrightarrow`,!0),U(W,K,J,`⟺`,`\\Longleftrightarrow`,!0),U(W,K,J,`↦`,`\\mapsto`,!0),U(W,K,J,`⟼`,`\\longmapsto`,!0),U(W,K,J,`↗`,`\\nearrow`,!0),U(W,K,J,`↩`,`\\hookleftarrow`,!0),U(W,K,J,`↪`,`\\hookrightarrow`,!0),U(W,K,J,`↘`,`\\searrow`,!0),U(W,K,J,`↼`,`\\leftharpoonup`,!0),U(W,K,J,`⇀`,`\\rightharpoonup`,!0),U(W,K,J,`↙`,`\\swarrow`,!0),U(W,K,J,`↽`,`\\leftharpoondown`,!0),U(W,K,J,`⇁`,`\\rightharpoondown`,!0),U(W,K,J,`↖`,`\\nwarrow`,!0),U(W,K,J,`⇌`,`\\rightleftharpoons`,!0),U(W,q,J,`≮`,`\\nless`,!0),U(W,q,J,``,`\\@nleqslant`),U(W,q,J,``,`\\@nleqq`),U(W,q,J,`⪇`,`\\lneq`,!0),U(W,q,J,`≨`,`\\lneqq`,!0),U(W,q,J,``,`\\@lvertneqq`),U(W,q,J,`⋦`,`\\lnsim`,!0),U(W,q,J,`⪉`,`\\lnapprox`,!0),U(W,q,J,`⊀`,`\\nprec`,!0),U(W,q,J,`⋠`,`\\npreceq`,!0),U(W,q,J,`⋨`,`\\precnsim`,!0),U(W,q,J,`⪹`,`\\precnapprox`,!0),U(W,q,J,`≁`,`\\nsim`,!0),U(W,q,J,``,`\\@nshortmid`),U(W,q,J,`∤`,`\\nmid`,!0),U(W,q,J,`⊬`,`\\nvdash`,!0),U(W,q,J,`⊭`,`\\nvDash`,!0),U(W,q,J,`⋪`,`\\ntriangleleft`),U(W,q,J,`⋬`,`\\ntrianglelefteq`,!0),U(W,q,J,`⊊`,`\\subsetneq`,!0),U(W,q,J,``,`\\@varsubsetneq`),U(W,q,J,`⫋`,`\\subsetneqq`,!0),U(W,q,J,``,`\\@varsubsetneqq`),U(W,q,J,`≯`,`\\ngtr`,!0),U(W,q,J,``,`\\@ngeqslant`),U(W,q,J,``,`\\@ngeqq`),U(W,q,J,`⪈`,`\\gneq`,!0),U(W,q,J,`≩`,`\\gneqq`,!0),U(W,q,J,``,`\\@gvertneqq`),U(W,q,J,`⋧`,`\\gnsim`,!0),U(W,q,J,`⪊`,`\\gnapprox`,!0),U(W,q,J,`⊁`,`\\nsucc`,!0),U(W,q,J,`⋡`,`\\nsucceq`,!0),U(W,q,J,`⋩`,`\\succnsim`,!0),U(W,q,J,`⪺`,`\\succnapprox`,!0),U(W,q,J,`≆`,`\\ncong`,!0),U(W,q,J,``,`\\@nshortparallel`),U(W,q,J,`∦`,`\\nparallel`,!0),U(W,q,J,`⊯`,`\\nVDash`,!0),U(W,q,J,`⋫`,`\\ntriangleright`),U(W,q,J,`⋭`,`\\ntrianglerighteq`,!0),U(W,q,J,``,`\\@nsupseteqq`),U(W,q,J,`⊋`,`\\supsetneq`,!0),U(W,q,J,``,`\\@varsupsetneq`),U(W,q,J,`⫌`,`\\supsetneqq`,!0),U(W,q,J,``,`\\@varsupsetneqq`),U(W,q,J,`⊮`,`\\nVdash`,!0),U(W,q,J,`⪵`,`\\precneqq`,!0),U(W,q,J,`⪶`,`\\succneqq`,!0),U(W,q,J,``,`\\@nsubseteqq`),U(W,q,Am,`⊴`,`\\unlhd`),U(W,q,Am,`⊵`,`\\unrhd`),U(W,q,J,`↚`,`\\nleftarrow`,!0),U(W,q,J,`↛`,`\\nrightarrow`,!0),U(W,q,J,`⇍`,`\\nLeftarrow`,!0),U(W,q,J,`⇏`,`\\nRightarrow`,!0),U(W,q,J,`↮`,`\\nleftrightarrow`,!0),U(W,q,J,`⇎`,`\\nLeftrightarrow`,!0),U(W,q,J,`△`,`\\vartriangle`),U(W,q,Y,`ℏ`,`\\hslash`),U(W,q,Y,`▽`,`\\triangledown`),U(W,q,Y,`◊`,`\\lozenge`),U(W,q,Y,`Ⓢ`,`\\circledS`),U(W,q,Y,`®`,`\\circledR`),U(G,q,Y,`®`,`\\circledR`),U(W,q,Y,`∡`,`\\measuredangle`,!0),U(W,q,Y,`∄`,`\\nexists`),U(W,q,Y,`℧`,`\\mho`),U(W,q,Y,`Ⅎ`,`\\Finv`,!0),U(W,q,Y,`⅁`,`\\Game`,!0),U(W,q,Y,`‵`,`\\backprime`),U(W,q,Y,`▲`,`\\blacktriangle`),U(W,q,Y,`▼`,`\\blacktriangledown`),U(W,q,Y,`■`,`\\blacksquare`),U(W,q,Y,`⧫`,`\\blacklozenge`),U(W,q,Y,`★`,`\\bigstar`),U(W,q,Y,`∢`,`\\sphericalangle`,!0),U(W,q,Y,`∁`,`\\complement`,!0),U(W,q,Y,`ð`,`\\eth`,!0),U(G,K,Y,`ð`,`ð`),U(W,q,Y,`╱`,`\\diagup`),U(W,q,Y,`╲`,`\\diagdown`),U(W,q,Y,`□`,`\\square`),U(W,q,Y,`□`,`\\Box`),U(W,q,Y,`◊`,`\\Diamond`),U(W,q,Y,`¥`,`\\yen`,!0),U(G,q,Y,`¥`,`\\yen`,!0),U(W,q,Y,`✓`,`\\checkmark`,!0),U(G,q,Y,`✓`,`\\checkmark`),U(W,q,Y,`ℶ`,`\\beth`,!0),U(W,q,Y,`ℸ`,`\\daleth`,!0),U(W,q,Y,`ℷ`,`\\gimel`,!0),U(W,q,Y,`ϝ`,`\\digamma`,!0),U(W,q,Y,`ϰ`,`\\varkappa`),U(W,q,Fm,`┌`,`\\@ulcorner`,!0),U(W,q,jm,`┐`,`\\@urcorner`,!0),U(W,q,Fm,`└`,`\\@llcorner`,!0),U(W,q,jm,`┘`,`\\@lrcorner`,!0),U(W,q,J,`≦`,`\\leqq`,!0),U(W,q,J,`⩽`,`\\leqslant`,!0),U(W,q,J,`⪕`,`\\eqslantless`,!0),U(W,q,J,`≲`,`\\lesssim`,!0),U(W,q,J,`⪅`,`\\lessapprox`,!0),U(W,q,J,`≊`,`\\approxeq`,!0),U(W,q,Am,`⋖`,`\\lessdot`),U(W,q,J,`⋘`,`\\lll`,!0),U(W,q,J,`≶`,`\\lessgtr`,!0),U(W,q,J,`⋚`,`\\lesseqgtr`,!0),U(W,q,J,`⪋`,`\\lesseqqgtr`,!0),U(W,q,J,`≑`,`\\doteqdot`),U(W,q,J,`≓`,`\\risingdotseq`,!0),U(W,q,J,`≒`,`\\fallingdotseq`,!0),U(W,q,J,`∽`,`\\backsim`,!0),U(W,q,J,`⋍`,`\\backsimeq`,!0),U(W,q,J,`⫅`,`\\subseteqq`,!0),U(W,q,J,`⋐`,`\\Subset`,!0),U(W,q,J,`⊏`,`\\sqsubset`,!0),U(W,q,J,`≼`,`\\preccurlyeq`,!0),U(W,q,J,`⋞`,`\\curlyeqprec`,!0),U(W,q,J,`≾`,`\\precsim`,!0),U(W,q,J,`⪷`,`\\precapprox`,!0),U(W,q,J,`⊲`,`\\vartriangleleft`),U(W,q,J,`⊴`,`\\trianglelefteq`),U(W,q,J,`⊨`,`\\vDash`,!0),U(W,q,J,`⊪`,`\\Vvdash`,!0),U(W,q,J,`⌣`,`\\smallsmile`),U(W,q,J,`⌢`,`\\smallfrown`),U(W,q,J,`≏`,`\\bumpeq`,!0),U(W,q,J,`≎`,`\\Bumpeq`,!0),U(W,q,J,`≧`,`\\geqq`,!0),U(W,q,J,`⩾`,`\\geqslant`,!0),U(W,q,J,`⪖`,`\\eqslantgtr`,!0),U(W,q,J,`≳`,`\\gtrsim`,!0),U(W,q,J,`⪆`,`\\gtrapprox`,!0),U(W,q,Am,`⋗`,`\\gtrdot`),U(W,q,J,`⋙`,`\\ggg`,!0),U(W,q,J,`≷`,`\\gtrless`,!0),U(W,q,J,`⋛`,`\\gtreqless`,!0),U(W,q,J,`⪌`,`\\gtreqqless`,!0),U(W,q,J,`≖`,`\\eqcirc`,!0),U(W,q,J,`≗`,`\\circeq`,!0),U(W,q,J,`≜`,`\\triangleq`,!0),U(W,q,J,`∼`,`\\thicksim`),U(W,q,J,`≈`,`\\thickapprox`),U(W,q,J,`⫆`,`\\supseteqq`,!0),U(W,q,J,`⋑`,`\\Supset`,!0),U(W,q,J,`⊐`,`\\sqsupset`,!0),U(W,q,J,`≽`,`\\succcurlyeq`,!0),U(W,q,J,`⋟`,`\\curlyeqsucc`,!0),U(W,q,J,`≿`,`\\succsim`,!0),U(W,q,J,`⪸`,`\\succapprox`,!0),U(W,q,J,`⊳`,`\\vartriangleright`),U(W,q,J,`⊵`,`\\trianglerighteq`),U(W,q,J,`⊩`,`\\Vdash`,!0),U(W,q,J,`∣`,`\\shortmid`),U(W,q,J,`∥`,`\\shortparallel`),U(W,q,J,`≬`,`\\between`,!0),U(W,q,J,`⋔`,`\\pitchfork`,!0),U(W,q,J,`∝`,`\\varpropto`),U(W,q,J,`◀`,`\\blacktriangleleft`),U(W,q,J,`∴`,`\\therefore`,!0),U(W,q,J,`∍`,`\\backepsilon`),U(W,q,J,`▶`,`\\blacktriangleright`),U(W,q,J,`∵`,`\\because`,!0),U(W,q,J,`⋘`,`\\llless`),U(W,q,J,`⋙`,`\\gggtr`),U(W,q,Am,`⊲`,`\\lhd`),U(W,q,Am,`⊳`,`\\rhd`),U(W,q,J,`≂`,`\\eqsim`,!0),U(W,K,J,`⋈`,`\\Join`),U(W,q,J,`≑`,`\\Doteq`,!0),U(W,q,Am,`∔`,`\\dotplus`,!0),U(W,q,Am,`∖`,`\\smallsetminus`),U(W,q,Am,`⋒`,`\\Cap`,!0),U(W,q,Am,`⋓`,`\\Cup`,!0),U(W,q,Am,`⩞`,`\\doublebarwedge`,!0),U(W,q,Am,`⊟`,`\\boxminus`,!0),U(W,q,Am,`⊞`,`\\boxplus`,!0),U(W,q,Am,`⋇`,`\\divideontimes`,!0),U(W,q,Am,`⋉`,`\\ltimes`,!0),U(W,q,Am,`⋊`,`\\rtimes`,!0),U(W,q,Am,`⋋`,`\\leftthreetimes`,!0),U(W,q,Am,`⋌`,`\\rightthreetimes`,!0),U(W,q,Am,`⋏`,`\\curlywedge`,!0),U(W,q,Am,`⋎`,`\\curlyvee`,!0),U(W,q,Am,`⊝`,`\\circleddash`,!0),U(W,q,Am,`⊛`,`\\circledast`,!0),U(W,q,Am,`⋅`,`\\centerdot`),U(W,q,Am,`⊺`,`\\intercal`,!0),U(W,q,Am,`⋒`,`\\doublecap`),U(W,q,Am,`⋓`,`\\doublecup`),U(W,q,Am,`⊠`,`\\boxtimes`,!0),U(W,q,J,`⇢`,`\\dashrightarrow`,!0),U(W,q,J,`⇠`,`\\dashleftarrow`,!0),U(W,q,J,`⇇`,`\\leftleftarrows`,!0),U(W,q,J,`⇆`,`\\leftrightarrows`,!0),U(W,q,J,`⇚`,`\\Lleftarrow`,!0),U(W,q,J,`↞`,`\\twoheadleftarrow`,!0),U(W,q,J,`↢`,`\\leftarrowtail`,!0),U(W,q,J,`↫`,`\\looparrowleft`,!0),U(W,q,J,`⇋`,`\\leftrightharpoons`,!0),U(W,q,J,`↶`,`\\curvearrowleft`,!0),U(W,q,J,`↺`,`\\circlearrowleft`,!0),U(W,q,J,`↰`,`\\Lsh`,!0),U(W,q,J,`⇈`,`\\upuparrows`,!0),U(W,q,J,`↿`,`\\upharpoonleft`,!0),U(W,q,J,`⇃`,`\\downharpoonleft`,!0),U(W,K,J,`⊶`,`\\origof`,!0),U(W,K,J,`⊷`,`\\imageof`,!0),U(W,q,J,`⊸`,`\\multimap`,!0),U(W,q,J,`↭`,`\\leftrightsquigarrow`,!0),U(W,q,J,`⇉`,`\\rightrightarrows`,!0),U(W,q,J,`⇄`,`\\rightleftarrows`,!0),U(W,q,J,`↠`,`\\twoheadrightarrow`,!0),U(W,q,J,`↣`,`\\rightarrowtail`,!0),U(W,q,J,`↬`,`\\looparrowright`,!0),U(W,q,J,`↷`,`\\curvearrowright`,!0),U(W,q,J,`↻`,`\\circlearrowright`,!0),U(W,q,J,`↱`,`\\Rsh`,!0),U(W,q,J,`⇊`,`\\downdownarrows`,!0),U(W,q,J,`↾`,`\\upharpoonright`,!0),U(W,q,J,`⇂`,`\\downharpoonright`,!0),U(W,q,J,`⇝`,`\\rightsquigarrow`,!0),U(W,q,J,`⇝`,`\\leadsto`),U(W,q,J,`⇛`,`\\Rrightarrow`,!0),U(W,q,J,`↾`,`\\restriction`),U(W,K,Y,`‘`,"`"),U(W,K,Y,`$`,`\\$`),U(G,K,Y,`$`,`\\$`),U(G,K,Y,`$`,`\\textdollar`),U(W,K,Y,`%`,`\\%`),U(G,K,Y,`%`,`\\%`),U(W,K,Y,`_`,`\\_`),U(G,K,Y,`_`,`\\_`),U(G,K,Y,`_`,`\\textunderscore`),U(W,K,Y,`∠`,`\\angle`,!0),U(W,K,Y,`∞`,`\\infty`,!0),U(W,K,Y,`′`,`\\prime`),U(W,K,Y,`△`,`\\triangle`),U(W,K,Y,`Γ`,`\\Gamma`,!0),U(W,K,Y,`Δ`,`\\Delta`,!0),U(W,K,Y,`Θ`,`\\Theta`,!0),U(W,K,Y,`Λ`,`\\Lambda`,!0),U(W,K,Y,`Ξ`,`\\Xi`,!0),U(W,K,Y,`Π`,`\\Pi`,!0),U(W,K,Y,`Σ`,`\\Sigma`,!0),U(W,K,Y,`Υ`,`\\Upsilon`,!0),U(W,K,Y,`Φ`,`\\Phi`,!0),U(W,K,Y,`Ψ`,`\\Psi`,!0),U(W,K,Y,`Ω`,`\\Omega`,!0),U(W,K,Y,`A`,`Α`),U(W,K,Y,`B`,`Β`),U(W,K,Y,`E`,`Ε`),U(W,K,Y,`Z`,`Ζ`),U(W,K,Y,`H`,`Η`),U(W,K,Y,`I`,`Ι`),U(W,K,Y,`K`,`Κ`),U(W,K,Y,`M`,`Μ`),U(W,K,Y,`N`,`Ν`),U(W,K,Y,`O`,`Ο`),U(W,K,Y,`P`,`Ρ`),U(W,K,Y,`T`,`Τ`),U(W,K,Y,`X`,`Χ`),U(W,K,Y,`¬`,`\\neg`,!0),U(W,K,Y,`¬`,`\\lnot`),U(W,K,Y,`⊤`,`\\top`),U(W,K,Y,`⊥`,`\\bot`),U(W,K,Y,`∅`,`\\emptyset`),U(W,q,Y,`∅`,`\\varnothing`),U(W,K,Nm,`α`,`\\alpha`,!0),U(W,K,Nm,`β`,`\\beta`,!0),U(W,K,Nm,`γ`,`\\gamma`,!0),U(W,K,Nm,`δ`,`\\delta`,!0),U(W,K,Nm,`ϵ`,`\\epsilon`,!0),U(W,K,Nm,`ζ`,`\\zeta`,!0),U(W,K,Nm,`η`,`\\eta`,!0),U(W,K,Nm,`θ`,`\\theta`,!0),U(W,K,Nm,`ι`,`\\iota`,!0),U(W,K,Nm,`κ`,`\\kappa`,!0),U(W,K,Nm,`λ`,`\\lambda`,!0),U(W,K,Nm,`μ`,`\\mu`,!0),U(W,K,Nm,`ν`,`\\nu`,!0),U(W,K,Nm,`ξ`,`\\xi`,!0),U(W,K,Nm,`ο`,`\\omicron`,!0),U(W,K,Nm,`π`,`\\pi`,!0),U(W,K,Nm,`ρ`,`\\rho`,!0),U(W,K,Nm,`σ`,`\\sigma`,!0),U(W,K,Nm,`τ`,`\\tau`,!0),U(W,K,Nm,`υ`,`\\upsilon`,!0),U(W,K,Nm,`ϕ`,`\\phi`,!0),U(W,K,Nm,`χ`,`\\chi`,!0),U(W,K,Nm,`ψ`,`\\psi`,!0),U(W,K,Nm,`ω`,`\\omega`,!0),U(W,K,Nm,`ε`,`\\varepsilon`,!0),U(W,K,Nm,`ϑ`,`\\vartheta`,!0),U(W,K,Nm,`ϖ`,`\\varpi`,!0),U(W,K,Nm,`ϱ`,`\\varrho`,!0),U(W,K,Nm,`ς`,`\\varsigma`,!0),U(W,K,Nm,`φ`,`\\varphi`,!0),U(W,K,Am,`∗`,`*`,!0),U(W,K,Am,`+`,`+`),U(W,K,Am,`−`,`-`,!0),U(W,K,Am,`⋅`,`\\cdot`,!0),U(W,K,Am,`∘`,`\\circ`,!0),U(W,K,Am,`÷`,`\\div`,!0),U(W,K,Am,`±`,`\\pm`,!0),U(W,K,Am,`×`,`\\times`,!0),U(W,K,Am,`∩`,`\\cap`,!0),U(W,K,Am,`∪`,`\\cup`,!0),U(W,K,Am,`∖`,`\\setminus`,!0),U(W,K,Am,`∧`,`\\land`),U(W,K,Am,`∨`,`\\lor`),U(W,K,Am,`∧`,`\\wedge`,!0),U(W,K,Am,`∨`,`\\vee`,!0),U(W,K,Y,`√`,`\\surd`),U(W,K,Fm,`⟨`,`\\langle`,!0),U(W,K,Fm,`∣`,`\\lvert`),U(W,K,Fm,`∥`,`\\lVert`),U(W,K,jm,`?`,`?`),U(W,K,jm,`!`,`!`),U(W,K,jm,`⟩`,`\\rangle`,!0),U(W,K,jm,`∣`,`\\rvert`),U(W,K,jm,`∥`,`\\rVert`),U(W,K,J,`=`,`=`),U(W,K,J,`:`,`:`),U(W,K,J,`≈`,`\\approx`,!0),U(W,K,J,`≅`,`\\cong`,!0),U(W,K,J,`≥`,`\\ge`),U(W,K,J,`≥`,`\\geq`,!0),U(W,K,J,`←`,`\\gets`),U(W,K,J,`>`,`\\gt`,!0),U(W,K,J,`∈`,`\\in`,!0),U(W,K,J,``,`\\@not`),U(W,K,J,`⊂`,`\\subset`,!0),U(W,K,J,`⊃`,`\\supset`,!0),U(W,K,J,`⊆`,`\\subseteq`,!0),U(W,K,J,`⊇`,`\\supseteq`,!0),U(W,q,J,`⊈`,`\\nsubseteq`,!0),U(W,q,J,`⊉`,`\\nsupseteq`,!0),U(W,K,J,`⊨`,`\\models`),U(W,K,J,`←`,`\\leftarrow`,!0),U(W,K,J,`≤`,`\\le`),U(W,K,J,`≤`,`\\leq`,!0),U(W,K,J,`<`,`\\lt`,!0),U(W,K,J,`→`,`\\rightarrow`,!0),U(W,K,J,`→`,`\\to`),U(W,q,J,`≱`,`\\ngeq`,!0),U(W,q,J,`≰`,`\\nleq`,!0),U(W,K,Lm,`\xA0`,`\\ `),U(W,K,Lm,`\xA0`,`\\space`),U(W,K,Lm,`\xA0`,`\\nobreakspace`),U(G,K,Lm,`\xA0`,`\\ `),U(G,K,Lm,`\xA0`,` `),U(G,K,Lm,`\xA0`,`\\space`),U(G,K,Lm,`\xA0`,`\\nobreakspace`),U(W,K,Lm,``,`\\nobreak`),U(W,K,Lm,``,`\\allowbreak`),U(W,K,Im,`,`,`,`),U(W,K,Im,`;`,`;`),U(W,q,Am,`⊼`,`\\barwedge`,!0),U(W,q,Am,`⊻`,`\\veebar`,!0),U(W,K,Am,`⊙`,`\\odot`,!0),U(W,K,Am,`⊕`,`\\oplus`,!0),U(W,K,Am,`⊗`,`\\otimes`,!0),U(W,K,Y,`∂`,`\\partial`,!0),U(W,K,Am,`⊘`,`\\oslash`,!0),U(W,q,Am,`⊚`,`\\circledcirc`,!0),U(W,q,Am,`⊡`,`\\boxdot`,!0),U(W,K,Am,`△`,`\\bigtriangleup`),U(W,K,Am,`▽`,`\\bigtriangledown`),U(W,K,Am,`†`,`\\dagger`),U(W,K,Am,`⋄`,`\\diamond`),U(W,K,Am,`⋆`,`\\star`),U(W,K,Am,`◃`,`\\triangleleft`),U(W,K,Am,`▹`,`\\triangleright`),U(W,K,Fm,`{`,`\\{`),U(G,K,Y,`{`,`\\{`),U(G,K,Y,`{`,`\\textbraceleft`),U(W,K,jm,`}`,`\\}`),U(G,K,Y,`}`,`\\}`),U(G,K,Y,`}`,`\\textbraceright`),U(W,K,Fm,`{`,`\\lbrace`),U(W,K,jm,`}`,`\\rbrace`),U(W,K,Fm,`[`,`\\lbrack`,!0),U(G,K,Y,`[`,`\\lbrack`,!0),U(W,K,jm,`]`,`\\rbrack`,!0),U(G,K,Y,`]`,`\\rbrack`,!0),U(W,K,Fm,`(`,`\\lparen`,!0),U(W,K,jm,`)`,`\\rparen`,!0),U(G,K,Y,`<`,`\\textless`,!0),U(G,K,Y,`>`,`\\textgreater`,!0),U(W,K,Fm,`⌊`,`\\lfloor`,!0),U(W,K,jm,`⌋`,`\\rfloor`,!0),U(W,K,Fm,`⌈`,`\\lceil`,!0),U(W,K,jm,`⌉`,`\\rceil`,!0),U(W,K,Y,`\\`,`\\backslash`),U(W,K,Y,`∣`,`|`),U(W,K,Y,`∣`,`\\vert`),U(G,K,Y,`|`,`\\textbar`,!0),U(W,K,Y,`∥`,`\\|`),U(W,K,Y,`∥`,`\\Vert`),U(G,K,Y,`∥`,`\\textbardbl`),U(G,K,Y,`~`,`\\textasciitilde`),U(G,K,Y,`\\`,`\\textbackslash`),U(G,K,Y,`^`,`\\textasciicircum`),U(W,K,J,`↑`,`\\uparrow`,!0),U(W,K,J,`⇑`,`\\Uparrow`,!0),U(W,K,J,`↓`,`\\downarrow`,!0),U(W,K,J,`⇓`,`\\Downarrow`,!0),U(W,K,J,`↕`,`\\updownarrow`,!0),U(W,K,J,`⇕`,`\\Updownarrow`,!0),U(W,K,Pm,`∐`,`\\coprod`),U(W,K,Pm,`⋁`,`\\bigvee`),U(W,K,Pm,`⋀`,`\\bigwedge`),U(W,K,Pm,`⨄`,`\\biguplus`),U(W,K,Pm,`⋂`,`\\bigcap`),U(W,K,Pm,`⋃`,`\\bigcup`),U(W,K,Pm,`∫`,`\\int`),U(W,K,Pm,`∫`,`\\intop`),U(W,K,Pm,`∬`,`\\iint`),U(W,K,Pm,`∭`,`\\iiint`),U(W,K,Pm,`∏`,`\\prod`),U(W,K,Pm,`∑`,`\\sum`),U(W,K,Pm,`⨂`,`\\bigotimes`),U(W,K,Pm,`⨁`,`\\bigoplus`),U(W,K,Pm,`⨀`,`\\bigodot`),U(W,K,Pm,`∮`,`\\oint`),U(W,K,Pm,`∯`,`\\oiint`),U(W,K,Pm,`∰`,`\\oiiint`),U(W,K,Pm,`⨆`,`\\bigsqcup`),U(W,K,Pm,`∫`,`\\smallint`),U(G,K,Mm,`…`,`\\textellipsis`),U(W,K,Mm,`…`,`\\mathellipsis`),U(G,K,Mm,`…`,`\\ldots`,!0),U(W,K,Mm,`…`,`\\ldots`,!0),U(W,K,Mm,`⋯`,`\\@cdots`,!0),U(W,K,Mm,`⋱`,`\\ddots`,!0),U(W,K,Y,`⋮`,`\\varvdots`),U(G,K,Y,`⋮`,`\\varvdots`),U(W,K,km,`ˊ`,`\\acute`),U(W,K,km,`ˋ`,`\\grave`),U(W,K,km,`¨`,`\\ddot`),U(W,K,km,`~`,`\\tilde`),U(W,K,km,`ˉ`,`\\bar`),U(W,K,km,`˘`,`\\breve`),U(W,K,km,`ˇ`,`\\check`),U(W,K,km,`^`,`\\hat`),U(W,K,km,`⃗`,`\\vec`),U(W,K,km,`˙`,`\\dot`),U(W,K,km,`˚`,`\\mathring`),U(W,K,Nm,``,`\\@imath`),U(W,K,Nm,``,`\\@jmath`),U(W,K,Y,`ı`,`ı`),U(W,K,Y,`ȷ`,`ȷ`),U(G,K,Y,`ı`,`\\i`,!0),U(G,K,Y,`ȷ`,`\\j`,!0),U(G,K,Y,`ß`,`\\ss`,!0),U(G,K,Y,`æ`,`\\ae`,!0),U(G,K,Y,`œ`,`\\oe`,!0),U(G,K,Y,`ø`,`\\o`,!0),U(G,K,Y,`Æ`,`\\AE`,!0),U(G,K,Y,`Œ`,`\\OE`,!0),U(G,K,Y,`Ø`,`\\O`,!0),U(G,K,km,`ˊ`,`\\'`),U(G,K,km,`ˋ`,"\\`"),U(G,K,km,`ˆ`,`\\^`),U(G,K,km,`˜`,`\\~`),U(G,K,km,`ˉ`,`\\=`),U(G,K,km,`˘`,`\\u`),U(G,K,km,`˙`,`\\.`),U(G,K,km,`¸`,`\\c`),U(G,K,km,`˚`,`\\r`),U(G,K,km,`ˇ`,`\\v`),U(G,K,km,`¨`,`\\"`),U(G,K,km,`˝`,`\\H`),U(G,K,km,`◯`,`\\textcircled`);var Rm={"--":!0,"---":!0,"``":!0,"''":!0};U(G,K,Y,`–`,`--`,!0),U(G,K,Y,`–`,`\\textendash`),U(G,K,Y,`—`,`---`,!0),U(G,K,Y,`—`,`\\textemdash`),U(G,K,Y,`‘`,"`",!0),U(G,K,Y,`‘`,`\\textquoteleft`),U(G,K,Y,`’`,`'`,!0),U(G,K,Y,`’`,`\\textquoteright`),U(G,K,Y,`“`,"``",!0),U(G,K,Y,`“`,`\\textquotedblleft`),U(G,K,Y,`”`,`''`,!0),U(G,K,Y,`”`,`\\textquotedblright`),U(W,K,Y,`°`,`\\degree`,!0),U(G,K,Y,`°`,`\\degree`),U(G,K,Y,`°`,`\\textdegree`,!0),U(W,K,Y,`£`,`\\pounds`),U(W,K,Y,`£`,`\\mathsterling`,!0),U(G,K,Y,`£`,`\\pounds`),U(G,K,Y,`£`,`\\textsterling`,!0),U(W,q,Y,`✠`,`\\maltese`),U(G,q,Y,`✠`,`\\maltese`);for(var zm=`0123456789/@."`,Bm=0;Bm<zm.length;Bm++){var Vm=zm.charAt(Bm);U(W,K,Y,Vm,Vm)}for(var Hm=`0123456789!@*()-=+";:?/.,`,Um=0;Um<Hm.length;Um++){var Wm=Hm.charAt(Um);U(G,K,Y,Wm,Wm)}for(var Gm=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`,Km=0;Km<Gm.length;Km++){var qm=Gm.charAt(Km);U(W,K,Nm,qm,qm),U(G,K,Y,qm,qm)}U(W,q,Y,`C`,`ℂ`),U(G,q,Y,`C`,`ℂ`),U(W,q,Y,`H`,`ℍ`),U(G,q,Y,`H`,`ℍ`),U(W,q,Y,`N`,`ℕ`),U(G,q,Y,`N`,`ℕ`),U(W,q,Y,`P`,`ℙ`),U(G,q,Y,`P`,`ℙ`),U(W,q,Y,`Q`,`ℚ`),U(G,q,Y,`Q`,`ℚ`),U(W,q,Y,`R`,`ℝ`),U(G,q,Y,`R`,`ℝ`),U(W,q,Y,`Z`,`ℤ`),U(G,q,Y,`Z`,`ℤ`),U(W,K,Nm,`h`,`ℎ`),U(G,K,Nm,`h`,`ℎ`);for(var Jm,Ym=0;Ym<Gm.length;Ym++){var Xm=Gm.charAt(Ym);Jm=String.fromCharCode(55349,56320+Ym),U(W,K,Nm,Xm,Jm),U(G,K,Y,Xm,Jm),Jm=String.fromCharCode(55349,56372+Ym),U(W,K,Nm,Xm,Jm),U(G,K,Y,Xm,Jm),Jm=String.fromCharCode(55349,56424+Ym),U(W,K,Nm,Xm,Jm),U(G,K,Y,Xm,Jm),Jm=String.fromCharCode(55349,56580+Ym),U(W,K,Nm,Xm,Jm),U(G,K,Y,Xm,Jm),Jm=String.fromCharCode(55349,56684+Ym),U(W,K,Nm,Xm,Jm),U(G,K,Y,Xm,Jm),Jm=String.fromCharCode(55349,56736+Ym),U(W,K,Nm,Xm,Jm),U(G,K,Y,Xm,Jm),Jm=String.fromCharCode(55349,56788+Ym),U(W,K,Nm,Xm,Jm),U(G,K,Y,Xm,Jm),Jm=String.fromCharCode(55349,56840+Ym),U(W,K,Nm,Xm,Jm),U(G,K,Y,Xm,Jm),Jm=String.fromCharCode(55349,56944+Ym),U(W,K,Nm,Xm,Jm),U(G,K,Y,Xm,Jm),Ym<26&&(Jm=String.fromCharCode(55349,56632+Ym),U(W,K,Nm,Xm,Jm),U(G,K,Y,Xm,Jm),Jm=String.fromCharCode(55349,56476+Ym),U(W,K,Nm,Xm,Jm),U(G,K,Y,Xm,Jm))}Jm=String.fromCharCode(55349,56668),U(W,K,Nm,`k`,Jm),U(G,K,Y,`k`,Jm);for(var Zm=0;Zm<10;Zm++){var Qm=Zm.toString();Jm=String.fromCharCode(55349,57294+Zm),U(W,K,Nm,Qm,Jm),U(G,K,Y,Qm,Jm),Jm=String.fromCharCode(55349,57314+Zm),U(W,K,Nm,Qm,Jm),U(G,K,Y,Qm,Jm),Jm=String.fromCharCode(55349,57324+Zm),U(W,K,Nm,Qm,Jm),U(G,K,Y,Qm,Jm),Jm=String.fromCharCode(55349,57334+Zm),U(W,K,Nm,Qm,Jm),U(G,K,Y,Qm,Jm)}for(var $m=`ÐÞþ`,eh=0;eh<$m.length;eh++){var th=$m.charAt(eh);U(W,K,Nm,th,th),U(G,K,Y,th,th)}var nh={mathClass:`mathbf`,textClass:`textbf`,font:`Main-Bold`},rh={mathClass:`mathnormal`,textClass:`textit`,font:`Math-Italic`},ih={mathClass:`boldsymbol`,textClass:`boldsymbol`,font:`Main-BoldItalic`},ah={mathClass:`mathscr`,textClass:`textscr`,font:`Script-Regular`},oh={mathClass:``,textClass:``,font:``},sh={mathClass:`mathfrak`,textClass:`textfrak`,font:`Fraktur-Regular`},ch={mathClass:`mathbb`,textClass:`textbb`,font:`AMS-Regular`},lh={mathClass:`mathboldfrak`,textClass:`textboldfrak`,font:`Fraktur-Regular`},uh={mathClass:`mathsf`,textClass:`textsf`,font:`SansSerif-Regular`},dh={mathClass:`mathboldsf`,textClass:`textboldsf`,font:`SansSerif-Bold`},fh={mathClass:`mathitsf`,textClass:`textitsf`,font:`SansSerif-Italic`},ph={mathClass:`mathtt`,textClass:`texttt`,font:`Typewriter-Regular`},mh=[nh,nh,rh,rh,ih,ih,ah,oh,oh,oh,sh,sh,ch,ch,lh,lh,uh,uh,dh,dh,fh,fh,oh,oh,ph,ph],hh=[nh,oh,uh,dh,ph],gh=e=>{var t=e.charCodeAt(0),n=e.charCodeAt(1),r=(t-55296)*1024+(n-56320)+65536;if(119808<=r&&r<120484)return mh[Math.floor((r-119808)/26)];if(120782<=r&&r<=120831)return hh[Math.floor((r-120782)/10)];if(r===120485||r===120486)return mh[0];if(120486<r&&r<120782)return oh;throw new V(`Unsupported character: `+e)},_h=function(e,t,n){if(Om[n][e]){var r=Om[n][e].replace;r&&(e=r)}return{value:e,metrics:Tm(e,t,n)}},vh=function(e,t,n,r,i){var a=_h(e,t,n),o=a.metrics;e=a.value;var s;if(o){var c=o.italic;(n===`text`||r&&r.font===`mathit`)&&(c=0),s=new mm(e,o.height,o.depth,c,o.skew,o.width,i)}else typeof console<`u`&&console.warn(`No character metrics `+(`for '`+e+`' in style '`+t+`' and mode '`+n+`'`)),s=new mm(e,0,0,0,0,0,i);if(r){s.maxFontSize=r.sizeMultiplier,r.style.isTight()&&s.classes.push(`mtight`);var l=r.getColor();l&&(s.style.color=l)}return s},yh=function(e,t,n,r){return r===void 0&&(r=[]),n.font===`boldsymbol`&&_h(e,`Main-Bold`,t).metrics?vh(e,`Main-Bold`,t,n,r.concat([`mathbf`])):e===`\\`||Om[t][e].font===`main`?vh(e,`Main-Regular`,t,n,r):vh(e,`AMS-Regular`,t,n,r.concat([`amsrm`]))},bh=function(e,t,n){return n!==`textord`&&_h(e,`Math-BoldItalic`,t).metrics?{fontName:`Math-BoldItalic`,fontClass:`boldsymbol`}:{fontName:`Main-Bold`,fontClass:`mathbf`}},xh=function(e,t,n){var r=e.mode,i=e.text,a=[`mord`],{font:o,fontFamily:s,fontWeight:c,fontShape:l}=t,u=r===`math`||r===`text`&&!!o,d=u?o:s,f=``,p=``;if(i.charCodeAt(0)===55349){var m=gh(i);f=m.font,p=m[r+`Class`]}if(f)return vh(i,f,r,t,a.concat(p));if(d){var h,g;if(d===`boldsymbol`){var _=bh(i,r,n);h=_.fontName,g=[_.fontClass]}else u?(h=Ph[o].fontName,g=[o]):(h=Nh(s,c,l),g=[s,c,l]);if(_h(i,h,r).metrics)return vh(i,h,r,t,a.concat(g));if(Rm.hasOwnProperty(i)&&h.slice(0,10)===`Typewriter`){for(var v=[],y=0;y<i.length;y++)v.push(vh(i[y],h,r,t,a.concat(g)));return Oh(v)}}if(n===`mathord`)return vh(i,`Math-Italic`,r,t,a.concat([`mathnormal`]));if(n===`textord`){var b=Om[r][i]&&Om[r][i].font;if(b===`ams`)return vh(i,Nh(`amsrm`,c,l),r,t,a.concat(`amsrm`,c,l));if(b===`main`||!b)return vh(i,Nh(`textrm`,c,l),r,t,a.concat(c,l));var x=Nh(b,c,l);return vh(i,x,r,t,a.concat(x,c,l))}else throw Error(`unexpected type: `+n+` in makeOrd`)},Sh=(e,t)=>{if(im(e.classes)!==im(t.classes)||e.skew!==t.skew||e.maxFontSize!==t.maxFontSize||e.italic!==0&&e.hasClass(`mathnormal`))return!1;if(e.classes.length===1){var n=e.classes[0];if(n===`mbin`||n===`mord`)return!1}for(var r of Object.keys(e.style))if(e.style[r]!==t.style[r])return!1;for(var i of Object.keys(t.style))if(e.style[i]!==t.style[i])return!1;return!0},Ch=e=>{for(var t=0;t<e.length-1;t++){var n=e[t],r=e[t+1];n instanceof mm&&r instanceof mm&&Sh(n,r)&&(n.text+=r.text,n.height=Math.max(n.height,r.height),n.depth=Math.max(n.depth,r.depth),n.italic=r.italic,e.splice(t+1,1),t--)}return e},wh=function(e){for(var t=0,n=0,r=0,i=0;i<e.children.length;i++){var a=e.children[i];a.height>t&&(t=a.height),a.depth>n&&(n=a.depth),a.maxFontSize>r&&(r=a.maxFontSize)}e.height=t,e.depth=n,e.maxFontSize=r},X=function(e,t,n,r){var i=new um(e,t,n,r);return wh(i),i},Th=(e,t,n,r)=>new um(e,t,n,r),Eh=function(e,t,n){var r=X([e],[],t);return r.height=Math.max(n||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),r.style.borderBottomWidth=H(r.height),r.maxFontSize=1,r},Dh=function(e,t,n,r){var i=new dm(e,t,n,r);return wh(i),i},Oh=function(e){var t=new $p(e);return wh(t),t},kh=function(e,t){return e instanceof $p?X([],[e],t):e},Ah=function(e){if(e.positionType===`individualShift`){for(var t=e.children,n=[t[0]],r=-t[0].shift-t[0].elem.depth,i=r,a=1;a<t.length;a++){var o=-t[a].shift-i-t[a].elem.depth,s=o-(t[a-1].elem.height+t[a-1].elem.depth);i+=o,n.push({type:`kern`,size:s}),n.push(t[a])}return{children:n,depth:r}}var c;if(e.positionType===`top`){for(var l=e.positionData,u=0;u<e.children.length;u++){var d=e.children[u];l-=d.type===`kern`?d.size:d.elem.height+d.elem.depth}c=l}else if(e.positionType===`bottom`)c=-e.positionData;else{var f=e.children[0];if(f.type!==`elem`)throw Error(`First child must have type "elem".`);if(e.positionType===`shift`)c=-f.elem.depth-e.positionData;else if(e.positionType===`firstBaseline`)c=-f.elem.depth;else throw Error(`Invalid positionType `+e.positionType+`.`)}return{children:e.children,depth:c}},jh=function(e,t){for(var{children:n,depth:r}=Ah(e),i=0,a=0;a<n.length;a++){var o=n[a];if(o.type===`elem`){var s=o.elem;i=Math.max(i,s.maxFontSize,s.height)}}i+=2;var c=X([`pstrut`],[]);c.style.height=H(i);for(var l=[],u=r,d=r,f=r,p=0;p<n.length;p++){var m=n[p];if(m.type===`kern`)f+=m.size;else{var h=m.elem,g=m.wrapperClasses||[],_=m.wrapperStyle||{},v=X(g,[c,h],void 0,_);v.style.top=H(-i-f-h.depth),m.marginLeft&&(v.style.marginLeft=m.marginLeft),m.marginRight&&(v.style.marginRight=m.marginRight),l.push(v),f+=h.height+h.depth}u=Math.min(u,f),d=Math.max(d,f)}var y=X([`vlist`],l);y.style.height=H(d);var b;if(u<0){var x=X([`vlist`],[X([],[])]);x.style.height=H(-u),b=[X([`vlist-r`],[y,X([`vlist-s`],[new mm(`​`)])]),X([`vlist-r`],[x])]}else b=[X([`vlist-r`],[y])];var S=X([`vlist-t`],b);return b.length===2&&S.classes.push(`vlist-t2`),S.height=d,S.depth=-u,S},Mh=(e,t)=>{var n=X([`mspace`],[],t),r=rm(e,t);return n.style.marginRight=H(r),n},Nh=(e,t,n)=>{var r,i;switch(e){case`amsrm`:r=`AMS`;break;case`textrm`:r=`Main`;break;case`textsf`:r=`SansSerif`;break;case`texttt`:r=`Typewriter`;break;default:r=e}return i=t===`textbf`&&n===`textit`?`BoldItalic`:t===`textbf`?`Bold`:n===`textit`?`Italic`:`Regular`,r+`-`+i},Ph={mathbf:{variant:`bold`,fontName:`Main-Bold`},mathrm:{variant:`normal`,fontName:`Main-Regular`},textit:{variant:`italic`,fontName:`Main-Italic`},mathit:{variant:`italic`,fontName:`Main-Italic`},mathnormal:{variant:`italic`,fontName:`Math-Italic`},mathsfit:{variant:`sans-serif-italic`,fontName:`SansSerif-Italic`},mathbb:{variant:`double-struck`,fontName:`AMS-Regular`},mathcal:{variant:`script`,fontName:`Caligraphic-Regular`},mathfrak:{variant:`fraktur`,fontName:`Fraktur-Regular`},mathscr:{variant:`script`,fontName:`Script-Regular`},mathsf:{variant:`sans-serif`,fontName:`SansSerif-Regular`},mathtt:{variant:`monospace`,fontName:`Typewriter-Regular`}},Fh={vec:[`vec`,.471,.714],oiintSize1:[`oiintSize1`,.957,.499],oiintSize2:[`oiintSize2`,1.472,.659],oiiintSize1:[`oiiintSize1`,1.304,.499],oiiintSize2:[`oiiintSize2`,1.98,.659]},Ih=function(e,t){var[n,r,i]=Fh[e],a=Th([`overlay`],[new hm([new gm(n)],{width:H(r),height:H(i),style:`width:`+H(r),viewBox:`0 0 `+1e3*r+` `+1e3*i,preserveAspectRatio:`xMinYMin`})],t);return a.height=i,a.style.height=H(i),a.style.width=H(r),a},Lh={number:3,unit:`mu`},Rh={number:4,unit:`mu`},zh={number:5,unit:`mu`},Bh={mord:{mop:Lh,mbin:Rh,mrel:zh,minner:Lh},mop:{mord:Lh,mop:Lh,mrel:zh,minner:Lh},mbin:{mord:Rh,mop:Rh,mopen:Rh,minner:Rh},mrel:{mord:zh,mop:zh,mopen:zh,minner:zh},mopen:{},mclose:{mop:Lh,mbin:Rh,mrel:zh,minner:Lh},mpunct:{mord:Lh,mop:Lh,mrel:zh,mopen:Lh,mclose:Lh,mpunct:Lh,minner:Lh},minner:{mord:Lh,mop:Lh,mbin:Rh,mrel:zh,mopen:Lh,mpunct:Lh,minner:Lh}},Vh={mord:{mop:Lh},mop:{mord:Lh,mop:Lh},mbin:{},mrel:{},mopen:{},mclose:{mop:Lh},mpunct:{},minner:{mop:Lh}},Hh={},Uh={},Wh={};function Z(e){for(var{type:t,names:n,props:r,handler:i,htmlBuilder:a,mathmlBuilder:o}=e,s={type:t,numArgs:r.numArgs,argTypes:r.argTypes,allowedInArgument:!!r.allowedInArgument,allowedInText:!!r.allowedInText,allowedInMath:r.allowedInMath===void 0?!0:r.allowedInMath,numOptionalArgs:r.numOptionalArgs||0,infix:!!r.infix,primitive:!!r.primitive,handler:i},c=0;c<n.length;++c)Hh[n[c]]=s;t&&(a&&(Uh[t]=a),o&&(Wh[t]=o))}function Gh(e){var{type:t,htmlBuilder:n,mathmlBuilder:r}=e;Z({type:t,names:[],props:{numArgs:0},handler(){throw Error(`Should never be called.`)},htmlBuilder:n,mathmlBuilder:r})}var Kh=function(e){return e.type===`ordgroup`&&e.body.length===1?e.body[0]:e},qh=function(e){return e.type===`ordgroup`?e.body:[e]},Jh=new Set([`leftmost`,`mbin`,`mopen`,`mrel`,`mop`,`mpunct`]),Yh=new Set([`rightmost`,`mrel`,`mclose`,`mpunct`]),Xh={display:Pp.DISPLAY,text:Pp.TEXT,script:Pp.SCRIPT,scriptscript:Pp.SCRIPTSCRIPT},Zh={mord:`mord`,mop:`mop`,mbin:`mbin`,mrel:`mrel`,mopen:`mopen`,mclose:`mclose`,mpunct:`mpunct`,minner:`minner`},Qh=function(e,t,n,r){r===void 0&&(r=[null,null]);for(var i=[],a=0;a<e.length;a++){var o=ig(e[a],t);if(o instanceof $p){var s=o.children;i.push(...s)}else i.push(o)}if(Ch(i),!n)return i;var c=t;if(e.length===1){var l=e[0];l.type===`sizing`?c=t.havingSize(l.size):l.type===`styling`&&(c=t.havingStyle(Xh[l.style]))}var u=X([r[0]||`leftmost`],[],t),d=X([r[1]||`rightmost`],[],t),f=n===`root`;return $h(i,(e,t)=>{var n=t.classes[0],r=e.classes[0];n===`mbin`&&Yh.has(r)?t.classes[0]=`mord`:r===`mbin`&&Jh.has(n)&&(e.classes[0]=`mord`)},{node:u},d,f),$h(i,(e,t)=>{var n=ng(t),r=ng(e),i=n&&r?e.hasClass(`mtight`)?Vh[n]?.[r]:Bh[n]?.[r]:null;if(i)return Mh(i,c)},{node:u},d,f),i},$h=function(e,t,n,r,i){r&&e.push(r);for(var a=0;a<e.length;a++){var o=e[a],s=eg(o);if(s){$h(s.children,t,n,null,i);continue}var c=!o.hasClass(`mspace`);if(c){var l=t(o,n.node);l&&(n.insertAfter?n.insertAfter(l):(e.unshift(l),a++))}c?n.node=o:i&&o.hasClass(`newline`)&&(n.node=X([`leftmost`])),n.insertAfter=(t=>n=>{e.splice(t+1,0,n),a++})(a)}r&&e.pop()},eg=function(e){return e instanceof $p||e instanceof dm||e instanceof um&&e.hasClass(`enclosing`)?e:null},tg=function(e,t){var n=eg(e);if(n){var r=n.children;if(r.length){if(t===`right`)return tg(r[r.length-1],`right`);if(t===`left`)return tg(r[0],`left`)}}return e},ng=function(e,t){return e?(t&&(e=tg(e,t)),Zh[e.classes[0]]||null):null},rg=function(e,t){var n=[`nulldelimiter`].concat(e.baseSizingClasses());return X(t.concat(n))},ig=function(e,t,n){if(!e)return X();if(Uh[e.type]){var r=Uh[e.type](e,t);if(n&&t.size!==n.size){r=X(t.sizingClasses(n),[r],t);var i=t.sizeMultiplier/n.sizeMultiplier;r.height*=i,r.depth*=i}return r}else throw new V(`Got group of unknown type: '`+e.type+`'`)};function ag(e,t){var n=X([`base`],e,t),r=X([`strut`]);return r.style.height=H(n.height+n.depth),n.depth&&(r.style.verticalAlign=H(-n.depth)),n.children.unshift(r),n}function og(e,t){var n=null;e.length===1&&e[0].type===`tag`&&(n=e[0].tag,e=e[0].body);var r=Qh(e,t,`root`),i;r.length===2&&r[1].hasClass(`tag`)&&(i=r.pop());for(var a=[],o=[],s=0;s<r.length;s++)if(o.push(r[s]),r[s].hasClass(`mbin`)||r[s].hasClass(`mrel`)||r[s].hasClass(`allowbreak`)){for(var c=!1;s<r.length-1&&r[s+1].hasClass(`mspace`)&&!r[s+1].hasClass(`newline`);)s++,o.push(r[s]),r[s].hasClass(`nobreak`)&&(c=!0);c||(a.push(ag(o,t)),o=[])}else r[s].hasClass(`newline`)&&(o.pop(),o.length>0&&(a.push(ag(o,t)),o=[]),a.push(r[s]));o.length>0&&a.push(ag(o,t));var l;n?(l=ag(Qh(n,t,!0),t),l.classes=[`tag`],a.push(l)):i&&a.push(i);var u=X([`katex-html`],a);if(u.setAttribute(`aria-hidden`,`true`),l){var d=l.children[0];d.style.height=H(u.height+u.depth),u.depth&&(d.style.verticalAlign=H(-u.depth))}return u}function sg(e){return new $p(e)}var Q=class{constructor(e,t,n){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=t||[],this.classes=n||[]}setAttribute(e,t){this.attributes[e]=t}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS(`http://www.w3.org/1998/Math/MathML`,this.type);for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);this.classes.length>0&&(e.className=im(this.classes));for(var n=0;n<this.children.length;n++)if(this.children[n]instanceof cg&&this.children[n+1]instanceof cg){for(var r=this.children[n].toText()+this.children[++n].toText();this.children[n+1]instanceof cg;)r+=this.children[++n].toText();e.appendChild(new cg(r).toNode())}else e.appendChild(this.children[n].toNode());return e}toMarkup(){var e=`<`+this.type;for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=` `+t+`="`,e+=cp(this.attributes[t]),e+=`"`);this.classes.length>0&&(e+=` class ="`+cp(im(this.classes))+`"`),e+=`>`;for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+=`</`+this.type+`>`,e}toText(){return this.children.map(e=>e.toText()).join(``)}},cg=class{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return cp(this.toText())}toText(){return this.text}},lg=class{constructor(e){this.width=void 0,this.character=void 0,this.width=e,e>=.05555&&e<=.05556?this.character=` `:e>=.1666&&e<=.1667?this.character=` `:e>=.2222&&e<=.2223?this.character=` `:e>=.2777&&e<=.2778?this.character=`  `:e>=-.05556&&e<=-.05555?this.character=` ⁣`:e>=-.1667&&e<=-.1666?this.character=` ⁣`:e>=-.2223&&e<=-.2222?this.character=` ⁣`:e>=-.2778&&e<=-.2777?this.character=` ⁣`:this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS(`http://www.w3.org/1998/Math/MathML`,`mspace`);return e.setAttribute(`width`,H(this.width)),e}toMarkup(){return this.character?`<mtext>`+this.character+`</mtext>`:`<mspace width="`+H(this.width)+`"/>`}toText(){return this.character?this.character:` `}},ug=new Set([`\\imath`,`\\jmath`]),dg=new Set([`mrow`,`mtable`]),fg=function(e,t,n){return Om[t][e]&&Om[t][e].replace&&e.charCodeAt(0)!==55349&&!(Rm.hasOwnProperty(e)&&n&&(n.fontFamily&&n.fontFamily.slice(4,6)===`tt`||n.font&&n.font.slice(4,6)===`tt`))&&(e=Om[t][e].replace),new cg(e)},pg=function(e){return e.length===1?e[0]:new Q(`mrow`,e)},mg={mathit:`italic`,boldsymbol:e=>e.type===`textord`?`bold`:`bold-italic`,mathbf:`bold`,mathbb:`double-struck`,mathsfit:`sans-serif-italic`,mathfrak:`fraktur`,mathscr:`script`,mathcal:`script`,mathsf:`sans-serif`,mathtt:`monospace`},hg=(e,t)=>{if(e.mode===`text`){if(t.fontFamily===`texttt`)return`monospace`;if(t.fontFamily===`textsf`)return t.fontShape===`textit`&&t.fontWeight===`textbf`?`sans-serif-bold-italic`:t.fontShape===`textit`?`sans-serif-italic`:t.fontWeight===`textbf`?`bold-sans-serif`:`sans-serif`;if(t.fontShape===`textit`&&t.fontWeight===`textbf`)return`bold-italic`;if(t.fontShape===`textit`)return`italic`;if(t.fontWeight===`textbf`)return`bold`}var n=t.font;if(!n||n===`mathnormal`)return null;var r=e.mode,i=mg[n];if(i)return typeof i==`function`?i(e):i;var a=e.text;if(ug.has(a))return null;if(Om[r][a]){var o=Om[r][a].replace;o&&(a=o)}var s=Ph[n].fontName;return Tm(a,s,r)?Ph[n].variant:null};function gg(e){if(!e)return!1;if(e.type===`mi`&&e.children.length===1){var t=e.children[0];return t instanceof cg&&t.text===`.`}else if(e.type===`mo`&&e.children.length===1&&e.getAttribute(`separator`)===`true`&&e.getAttribute(`lspace`)===`0em`&&e.getAttribute(`rspace`)===`0em`){var n=e.children[0];return n instanceof cg&&n.text===`,`}else return!1}var _g=function(e,t,n){if(e.length===1){var r=yg(e[0],t);return n&&r instanceof Q&&r.type===`mo`&&(r.setAttribute(`lspace`,`0em`),r.setAttribute(`rspace`,`0em`)),[r]}for(var i=[],a,o=0;o<e.length;o++){var s=yg(e[o],t);if(s instanceof Q&&a instanceof Q){if(s.type===`mtext`&&a.type===`mtext`&&s.getAttribute(`mathvariant`)===a.getAttribute(`mathvariant`)){a.children.push(...s.children);continue}else if(s.type===`mn`&&a.type===`mn`){a.children.push(...s.children);continue}else if(gg(s)&&a.type===`mn`){a.children.push(...s.children);continue}else if(s.type===`mn`&&gg(a))s.children=[...a.children,...s.children],i.pop();else if((s.type===`msup`||s.type===`msub`)&&s.children.length>=1&&(a.type===`mn`||gg(a))){var c=s.children[0];c instanceof Q&&c.type===`mn`&&(c.children=[...a.children,...c.children],i.pop())}else if(a.type===`mi`&&a.children.length===1){var l=a.children[0];if(l instanceof cg&&l.text===`̸`&&(s.type===`mo`||s.type===`mi`||s.type===`mn`)){var u=s.children[0];u instanceof cg&&u.text.length>0&&(u.text=u.text.slice(0,1)+`̸`+u.text.slice(1),i.pop())}}}i.push(s),a=s}return i},vg=function(e,t,n){return pg(_g(e,t,n))},yg=function(e,t){if(!e)return new Q(`mrow`);if(Wh[e.type])return Wh[e.type](e,t);throw new V(`Got group of unknown type: '`+e.type+`'`)};function bg(e,t,n,r,i){var a=_g(e,n),o=a.length===1&&a[0]instanceof Q&&dg.has(a[0].type)?a[0]:new Q(`mrow`,a),s=new Q(`annotation`,[new cg(t)]);s.setAttribute(`encoding`,`application/x-tex`);var c=new Q(`math`,[new Q(`semantics`,[o,s])]);return c.setAttribute(`xmlns`,`http://www.w3.org/1998/Math/MathML`),r&&c.setAttribute(`display`,`block`),X([i?`katex`:`katex-mathml`],[c])}var xg=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],Sg=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],Cg=function(e,t){return t.size<2?e:xg[e-1][t.size-1]},wg=class e{constructor(t){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=t.style,this.color=t.color,this.size=t.size||e.BASESIZE,this.textSize=t.textSize||this.size,this.phantom=!!t.phantom,this.font=t.font||``,this.fontFamily=t.fontFamily||``,this.fontWeight=t.fontWeight||``,this.fontShape=t.fontShape||``,this.sizeMultiplier=Sg[this.size-1],this.maxSize=t.maxSize,this.minRuleThickness=t.minRuleThickness,this._fontMetrics=void 0}extend(t){var n={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};return Object.assign(n,t),new e(n)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:Cg(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:Sg[e-1]})}havingBaseStyle(t){t||=this.style.text();var n=Cg(e.BASESIZE,t);return this.size===n&&this.textSize===e.BASESIZE&&this.style===t?this:this.extend({style:t,size:n})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:``})}withTextFontWeight(e){return this.extend({fontWeight:e,font:``})}withTextFontShape(e){return this.extend({fontShape:e,font:``})}sizingClasses(e){return e.size===this.size?[]:[`sizing`,`reset-size`+e.size,`size`+this.size]}baseSizingClasses(){return this.size===e.BASESIZE?[]:[`sizing`,`reset-size`+this.size,`size`+e.BASESIZE]}fontMetrics(){return this._fontMetrics||=Dm(this.size),this._fontMetrics}getColor(){return this.phantom?`transparent`:this.color}};wg.BASESIZE=6;var Tg=function(e){return new wg({style:e.displayMode?Pp.DISPLAY:Pp.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},Eg=function(e,t){if(t.displayMode){var n=[`katex-display`];t.leqno&&n.push(`leqno`),t.fleqn&&n.push(`fleqn`),e=X(n,[e])}return e},Dg=function(e,t,n){var r=Tg(n),i;return n.output===`mathml`?bg(e,t,r,n.displayMode,!0):(i=n.output===`html`?X([`katex`],[og(e,r)]):X([`katex`],[bg(e,t,r,n.displayMode,!1),og(e,r)]),Eg(i,n))},Og=function(e,t,n){return Eg(X([`katex`],[og(e,Tg(n))]),n)},kg={widehat:`^`,widecheck:`ˇ`,widetilde:`~`,utilde:`~`,overleftarrow:`←`,underleftarrow:`←`,xleftarrow:`←`,overrightarrow:`→`,underrightarrow:`→`,xrightarrow:`→`,underbrace:`⏟`,overbrace:`⏞`,underbracket:`⎵`,overbracket:`⎴`,overgroup:`⏠`,undergroup:`⏡`,overleftrightarrow:`↔`,underleftrightarrow:`↔`,xleftrightarrow:`↔`,Overrightarrow:`⇒`,xRightarrow:`⇒`,overleftharpoon:`↼`,xleftharpoonup:`↼`,overrightharpoon:`⇀`,xrightharpoonup:`⇀`,xLeftarrow:`⇐`,xLeftrightarrow:`⇔`,xhookleftarrow:`↩`,xhookrightarrow:`↪`,xmapsto:`↦`,xrightharpoondown:`⇁`,xleftharpoondown:`↽`,xrightleftharpoons:`⇌`,xleftrightharpoons:`⇋`,xtwoheadleftarrow:`↞`,xtwoheadrightarrow:`↠`,xlongequal:`=`,xtofrom:`⇄`,xrightleftarrows:`⇄`,xrightequilibrium:`⇌`,xleftequilibrium:`⇋`,"\\cdrightarrow":`→`,"\\cdleftarrow":`←`,"\\cdlongequal":`=`},Ag=function(e){var t=new Q(`mo`,[new cg(kg[e.replace(/^\\/,``)])]);return t.setAttribute(`stretchy`,`true`),t},jg={overrightarrow:[[`rightarrow`],.888,522,`xMaxYMin`],overleftarrow:[[`leftarrow`],.888,522,`xMinYMin`],underrightarrow:[[`rightarrow`],.888,522,`xMaxYMin`],underleftarrow:[[`leftarrow`],.888,522,`xMinYMin`],xrightarrow:[[`rightarrow`],1.469,522,`xMaxYMin`],"\\cdrightarrow":[[`rightarrow`],3,522,`xMaxYMin`],xleftarrow:[[`leftarrow`],1.469,522,`xMinYMin`],"\\cdleftarrow":[[`leftarrow`],3,522,`xMinYMin`],Overrightarrow:[[`doublerightarrow`],.888,560,`xMaxYMin`],xRightarrow:[[`doublerightarrow`],1.526,560,`xMaxYMin`],xLeftarrow:[[`doubleleftarrow`],1.526,560,`xMinYMin`],overleftharpoon:[[`leftharpoon`],.888,522,`xMinYMin`],xleftharpoonup:[[`leftharpoon`],.888,522,`xMinYMin`],xleftharpoondown:[[`leftharpoondown`],.888,522,`xMinYMin`],overrightharpoon:[[`rightharpoon`],.888,522,`xMaxYMin`],xrightharpoonup:[[`rightharpoon`],.888,522,`xMaxYMin`],xrightharpoondown:[[`rightharpoondown`],.888,522,`xMaxYMin`],xlongequal:[[`longequal`],.888,334,`xMinYMin`],"\\cdlongequal":[[`longequal`],3,334,`xMinYMin`],xtwoheadleftarrow:[[`twoheadleftarrow`],.888,334,`xMinYMin`],xtwoheadrightarrow:[[`twoheadrightarrow`],.888,334,`xMaxYMin`],overleftrightarrow:[[`leftarrow`,`rightarrow`],.888,522],overbrace:[[`leftbrace`,`midbrace`,`rightbrace`],1.6,548],underbrace:[[`leftbraceunder`,`midbraceunder`,`rightbraceunder`],1.6,548],underleftrightarrow:[[`leftarrow`,`rightarrow`],.888,522],xleftrightarrow:[[`leftarrow`,`rightarrow`],1.75,522],xLeftrightarrow:[[`doubleleftarrow`,`doublerightarrow`],1.75,560],xrightleftharpoons:[[`leftharpoondownplus`,`rightharpoonplus`],1.75,716],xleftrightharpoons:[[`leftharpoonplus`,`rightharpoondownplus`],1.75,716],xhookleftarrow:[[`leftarrow`,`righthook`],1.08,522],xhookrightarrow:[[`lefthook`,`rightarrow`],1.08,522],overlinesegment:[[`leftlinesegment`,`rightlinesegment`],.888,522],underlinesegment:[[`leftlinesegment`,`rightlinesegment`],.888,522],overbracket:[[`leftbracketover`,`rightbracketover`],1.6,440],underbracket:[[`leftbracketunder`,`rightbracketunder`],1.6,410],overgroup:[[`leftgroup`,`rightgroup`],.888,342],undergroup:[[`leftgroupunder`,`rightgroupunder`],.888,342],xmapsto:[[`leftmapsto`,`rightarrow`],1.5,522],xtofrom:[[`leftToFrom`,`rightToFrom`],1.75,528],xrightleftarrows:[[`baraboveleftarrow`,`rightarrowabovebar`],1.75,901],xrightequilibrium:[[`baraboveshortleftharpoon`,`rightharpoonaboveshortbar`],1.75,716],xleftequilibrium:[[`shortbaraboveleftharpoon`,`shortrightharpoonabovebar`],1.75,716]},Mg=new Set([`widehat`,`widecheck`,`widetilde`,`utilde`]),Ng=function(e,t){function n(){var n=4e5,r=e.label.slice(1);if(Mg.has(r)&&`base`in e){var i=e.base.type===`ordgroup`?e.base.body.length:1,a,o,s;if(i>5)r===`widehat`||r===`widecheck`?(a=420,n=2364,s=.42,o=r+`4`):(a=312,n=2340,s=.34,o=`tilde4`);else{var c=[1,1,2,2,3,3][i];r===`widehat`||r===`widecheck`?(n=[0,1062,2364,2364,2364][c],a=[0,239,300,360,420][c],s=[0,.24,.3,.3,.36,.42][c],o=r+c):(n=[0,600,1033,2339,2340][c],a=[0,260,286,306,312][c],s=[0,.26,.286,.3,.306,.34][c],o=`tilde`+c)}return{span:Th([],[new hm([new gm(o)],{width:`100%`,height:H(s),viewBox:`0 0 `+n+` `+a,preserveAspectRatio:`none`})],t),minWidth:0,height:s}}else{var l=[],u=jg[r];if(!u)throw Error(`No SVG data for "`+r+`".`);var[d,f,p]=u,m=p/1e3,h=d.length,g,_;if(h===1){if(u.length!==4)throw Error(`Expected 4-tuple for single-path SVG data "`+r+`".`);g=[`hide-tail`],_=[u[3]]}else if(h===2)g=[`halfarrow-left`,`halfarrow-right`],_=[`xMinYMin`,`xMaxYMin`];else if(h===3)g=[`brace-left`,`brace-center`,`brace-right`],_=[`xMinYMin`,`xMidYMin`,`xMaxYMin`];else throw Error(`Correct katexImagesData or update code here to support
285
+ `+h+` children.`);for(var v=0;v<h;v++){var y=new hm([new gm(d[v])],{width:`400em`,height:H(m),viewBox:`0 0 `+n+` `+p,preserveAspectRatio:_[v]+` slice`}),b=Th([g[v]],[y],t);if(h===1)return{span:b,minWidth:f,height:m};b.style.height=H(m),l.push(b)}return{span:X([`stretchy`],l,t),minWidth:f,height:m}}}var{span:r,minWidth:i,height:a}=n();return r.height=a,r.style.height=H(a),i>0&&(r.style.minWidth=H(i)),r},Pg=function(e,t,n,r,i){var a,o=e.height+e.depth+n+r;if(/fbox|color|angl/.test(t)){if(a=X([`stretchy`,t],[],i),t===`fbox`){var s=i.color&&i.getColor();s&&(a.style.borderColor=s)}}else{var c=[];/^[bx]cancel$/.test(t)&&c.push(new _m({x1:`0`,y1:`0`,x2:`100%`,y2:`100%`,"stroke-width":`0.046em`})),/^x?cancel$/.test(t)&&c.push(new _m({x1:`0`,y1:`100%`,x2:`100%`,y2:`0`,"stroke-width":`0.046em`})),a=Th([],[new hm(c,{width:`100%`,height:H(o)})],i)}return a.height=o,a.style.height=H(o),a},Fg={bin:1,close:1,inner:1,open:1,punct:1,rel:1},Ig={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function Lg(e){return e in Fg}function Rg(e,t){if(!e||e.type!==t)throw Error(`Expected node of type `+t+`, but got `+(e?`node of type `+e.type:String(e)));return e}function zg(e){var t=Bg(e);if(!t)throw Error(`Expected node of symbol group type, but got `+(e?`node of type `+e.type:String(e)));return t}function Bg(e){return e&&(e.type===`atom`||Ig.hasOwnProperty(e.type))?e:null}var Vg=e=>{if(e instanceof mm)return e;if(bm(e)&&e.children.length===1)return Vg(e.children[0])},Hg=(e,t)=>{var n,r,i;e&&e.type===`supsub`?(r=Rg(e.base,`accent`),n=r.base,e.base=n,i=ym(ig(e,t)),e.base=r):(r=Rg(e,`accent`),n=r.base);var a=ig(n,t.havingCrampedStyle()),o=r.isShifty&&dp(n),s=0;o&&(s=Vg(a)?.skew??0);var c=r.label===`\\c`,l=c?a.height+a.depth:Math.min(a.height,t.fontMetrics().xHeight),u;if(r.isStretchy)u=Ng(r,t),u=jh({positionType:`firstBaseline`,children:[{type:`elem`,elem:a},{type:`elem`,elem:u,wrapperClasses:[`svg-align`],wrapperStyle:s>0?{width:`calc(100% - `+H(2*s)+`)`,marginLeft:H(2*s)}:void 0}]});else{var d,f;r.label===`\\vec`?(d=Ih(`vec`,t),f=Fh.vec[1]):(d=xh({type:`textord`,mode:r.mode,text:r.label},t,`textord`),d=vm(d),d.italic=0,f=d.width,c&&(l+=d.depth)),u=X([`accent-body`],[d]);var p=r.label===`\\textcircled`;p&&(u.classes.push(`accent-full`),l=a.height);var m=s;p||(m-=f/2),u.style.left=H(m),r.label===`\\textcircled`&&(u.style.top=`.2em`),u=jh({positionType:`firstBaseline`,children:[{type:`elem`,elem:a},{type:`kern`,size:-l},{type:`elem`,elem:u}]})}var h=X([`mord`,`accent`],[u],t);return i?(i.children[0]=h,i.height=Math.max(h.height,i.height),i.classes[0]=`mord`,i):h},Ug=(e,t)=>{var n=e.isStretchy?Ag(e.label):new Q(`mo`,[fg(e.label,e.mode)]),r=new Q(`mover`,[yg(e.base,t),n]);return r.setAttribute(`accent`,`true`),r},Wg=new RegExp([`\\acute`,`\\grave`,`\\ddot`,`\\tilde`,`\\bar`,`\\breve`,`\\check`,`\\hat`,`\\vec`,`\\dot`,`\\mathring`].map(e=>`\\`+e).join(`|`));Z({type:`accent`,names:[`\\acute`,`\\grave`,`\\ddot`,`\\tilde`,`\\bar`,`\\breve`,`\\check`,`\\hat`,`\\vec`,`\\dot`,`\\mathring`,`\\widecheck`,`\\widehat`,`\\widetilde`,`\\overrightarrow`,`\\overleftarrow`,`\\Overrightarrow`,`\\overleftrightarrow`,`\\overgroup`,`\\overlinesegment`,`\\overleftharpoon`,`\\overrightharpoon`],props:{numArgs:1},handler:(e,t)=>{var n=Kh(t[0]),r=!Wg.test(e.funcName),i=!r||e.funcName===`\\widehat`||e.funcName===`\\widetilde`||e.funcName===`\\widecheck`;return{type:`accent`,mode:e.parser.mode,label:e.funcName,isStretchy:r,isShifty:i,base:n}},htmlBuilder:Hg,mathmlBuilder:Ug}),Z({type:`accent`,names:[`\\'`,"\\`",`\\^`,`\\~`,`\\=`,`\\u`,`\\.`,`\\"`,`\\c`,`\\r`,`\\H`,`\\v`,`\\textcircled`],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:[`primitive`]},handler:(e,t)=>{var n=t[0],r=e.parser.mode;return r===`math`&&(e.parser.settings.reportNonstrict(`mathVsTextAccents`,`LaTeX's accent `+e.funcName+` works only in text mode`),r=`text`),{type:`accent`,mode:r,label:e.funcName,isStretchy:!1,isShifty:!0,base:n}},htmlBuilder:Hg,mathmlBuilder:Ug}),Z({type:`accentUnder`,names:[`\\underleftarrow`,`\\underrightarrow`,`\\underleftrightarrow`,`\\undergroup`,`\\underlinesegment`,`\\utilde`],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:`accentUnder`,mode:n.mode,label:r,base:i}},htmlBuilder:(e,t)=>{var n=ig(e.base,t),r=Ng(e,t),i=e.label===`\\utilde`?.12:0;return X([`mord`,`accentunder`],[jh({positionType:`top`,positionData:n.height,children:[{type:`elem`,elem:r,wrapperClasses:[`svg-align`]},{type:`kern`,size:i},{type:`elem`,elem:n}]})],t)},mathmlBuilder:(e,t)=>{var n=Ag(e.label),r=new Q(`munder`,[yg(e.base,t),n]);return r.setAttribute(`accentunder`,`true`),r}});var Gg=e=>{var t=new Q(`mpadded`,e?[e]:[]);return t.setAttribute(`width`,`+0.6em`),t.setAttribute(`lspace`,`0.3em`),t};Z({type:`xArrow`,names:[`\\xleftarrow`,`\\xrightarrow`,`\\xLeftarrow`,`\\xRightarrow`,`\\xleftrightarrow`,`\\xLeftrightarrow`,`\\xhookleftarrow`,`\\xhookrightarrow`,`\\xmapsto`,`\\xrightharpoondown`,`\\xrightharpoonup`,`\\xleftharpoondown`,`\\xleftharpoonup`,`\\xrightleftharpoons`,`\\xleftrightharpoons`,`\\xlongequal`,`\\xtwoheadrightarrow`,`\\xtwoheadleftarrow`,`\\xtofrom`,`\\xrightleftarrows`,`\\xrightequilibrium`,`\\xleftequilibrium`,`\\\\cdrightarrow`,`\\\\cdleftarrow`,`\\\\cdlongequal`],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:r,funcName:i}=e;return{type:`xArrow`,mode:r.mode,label:i,body:t[0],below:n[0]}},htmlBuilder(e,t){var n=t.style,r=t.havingStyle(n.sup()),i=kh(ig(e.body,r,t),t),a=e.label.slice(0,2)===`\\x`?`x`:`cd`;i.classes.push(a+`-arrow-pad`);var o;e.below&&(r=t.havingStyle(n.sub()),o=kh(ig(e.below,r,t),t),o.classes.push(a+`-arrow-pad`));var s=Ng(e,t),c=-t.fontMetrics().axisHeight+.5*s.height,l=-t.fontMetrics().axisHeight-.5*s.height-.111;(i.depth>.25||e.label===`\\xleftequilibrium`)&&(l-=i.depth);var u;if(o){var d=-t.fontMetrics().axisHeight+o.height+.5*s.height+.111;u=jh({positionType:`individualShift`,children:[{type:`elem`,elem:i,shift:l},{type:`elem`,elem:s,shift:c,wrapperClasses:[`svg-align`]},{type:`elem`,elem:o,shift:d}]})}else u=jh({positionType:`individualShift`,children:[{type:`elem`,elem:i,shift:l},{type:`elem`,elem:s,shift:c,wrapperClasses:[`svg-align`]}]});return X([`mrel`,`x-arrow`],[u],t)},mathmlBuilder(e,t){var n=Ag(e.label);n.setAttribute(`minsize`,e.label.charAt(0)===`x`?`1.75em`:`3.0em`);var r;if(e.body){var i=Gg(yg(e.body,t));r=e.below?new Q(`munderover`,[n,Gg(yg(e.below,t)),i]):new Q(`mover`,[n,i])}else e.below?r=new Q(`munder`,[n,Gg(yg(e.below,t))]):(r=Gg(),r=new Q(`mover`,[n,r]));return r}});function Kg(e,t){var n=Qh(e.body,t,!0);return X([e.mclass],n,t)}function qg(e,t){var n,r=_g(e.body,t);return e.mclass===`minner`?n=new Q(`mpadded`,r):e.mclass===`mord`?e.isCharacterBox?(n=r[0],n.type=`mi`):n=new Q(`mi`,r):(e.isCharacterBox?(n=r[0],n.type=`mo`):n=new Q(`mo`,r),e.mclass===`mbin`?(n.attributes.lspace=`0.22em`,n.attributes.rspace=`0.22em`):e.mclass===`mpunct`?(n.attributes.lspace=`0em`,n.attributes.rspace=`0.17em`):e.mclass===`mopen`||e.mclass===`mclose`?(n.attributes.lspace=`0em`,n.attributes.rspace=`0em`):e.mclass===`minner`&&(n.attributes.lspace=`0.0556em`,n.attributes.width=`+0.1111em`)),n}Z({type:`mclass`,names:[`\\mathord`,`\\mathbin`,`\\mathrel`,`\\mathopen`,`\\mathclose`,`\\mathpunct`,`\\mathinner`],props:{numArgs:1,primitive:!0},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:`mclass`,mode:n.mode,mclass:`m`+r.slice(5),body:qh(i),isCharacterBox:dp(i)}},htmlBuilder:Kg,mathmlBuilder:qg});var Jg=e=>{var t=e.type===`ordgroup`&&e.body.length?e.body[0]:e;return t.type===`atom`&&(t.family===`bin`||t.family===`rel`)?`m`+t.family:`mord`};Z({type:`mclass`,names:[`\\@binrel`],props:{numArgs:2},handler(e,t){var{parser:n}=e;return{type:`mclass`,mode:n.mode,mclass:Jg(t[0]),body:qh(t[1]),isCharacterBox:dp(t[1])}}}),Z({type:`mclass`,names:[`\\stackrel`,`\\overset`,`\\underset`],props:{numArgs:2},handler(e,t){var{parser:n,funcName:r}=e,i=t[1],a=t[0],o=r===`\\stackrel`?`mrel`:Jg(i),s={type:`op`,mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:r!==`\\stackrel`,body:qh(i)},c={type:`supsub`,mode:a.mode,base:s,sup:r===`\\underset`?null:a,sub:r===`\\underset`?a:null};return{type:`mclass`,mode:n.mode,mclass:o,body:[c],isCharacterBox:dp(c)}},htmlBuilder:Kg,mathmlBuilder:qg}),Z({type:`pmb`,names:[`\\pmb`],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:`pmb`,mode:n.mode,mclass:Jg(t[0]),body:qh(t[0])}},htmlBuilder(e,t){var n=Qh(e.body,t,!0),r=X([e.mclass],n,t);return r.style.textShadow=`0.02em 0.01em 0.04px`,r},mathmlBuilder(e,t){var n=new Q(`mstyle`,_g(e.body,t));return n.setAttribute(`style`,`text-shadow: 0.02em 0.01em 0.04px`),n}});var Yg={">":`\\\\cdrightarrow`,"<":`\\\\cdleftarrow`,"=":`\\\\cdlongequal`,A:`\\uparrow`,V:`\\downarrow`,"|":`\\Vert`,".":`no arrow`},Xg=()=>({type:`styling`,body:[],mode:`math`,style:`display`,resetFont:!0}),Zg=e=>e.type===`textord`&&e.text===`@`,Qg=(e,t)=>(e.type===`mathord`||e.type===`atom`)&&e.text===t;function $g(e,t,n){var r=Yg[e];switch(r){case`\\\\cdrightarrow`:case`\\\\cdleftarrow`:return n.callFunction(r,[t[0]],[t[1]]);case`\\uparrow`:case`\\downarrow`:var i=n.callFunction(`\\\\cdleft`,[t[0]],[]),a={type:`atom`,text:r,mode:`math`,family:`rel`},o={type:`ordgroup`,mode:`math`,body:[i,n.callFunction(`\\Big`,[a],[]),n.callFunction(`\\\\cdright`,[t[1]],[])]};return n.callFunction(`\\\\cdparent`,[o],[]);case`\\\\cdlongequal`:return n.callFunction(`\\\\cdlongequal`,[],[]);case`\\Vert`:return n.callFunction(`\\Big`,[{type:`textord`,text:`\\Vert`,mode:`math`}],[]);default:return{type:`textord`,text:` `,mode:`math`}}}function e_(e){var t=[];for(e.gullet.beginGroup(),e.gullet.macros.set(`\\cr`,`\\\\\\relax`),e.gullet.beginGroup();;){t.push(e.parseExpression(!1,`\\\\`)),e.gullet.endGroup(),e.gullet.beginGroup();var n=e.fetch().text;if(n===`&`||n===`\\\\`)e.consume();else if(n===`\\end`){t[t.length-1].length===0&&t.pop();break}else throw new V(`Expected \\\\ or \\cr or \\end`,e.nextToken)}for(var r=[],i=[r],a=0;a<t.length;a++){for(var o=t[a],s=Xg(),c=0;c<o.length;c++)if(!Zg(o[c]))s.body.push(o[c]);else{r.push(s),c+=1;var l=zg(o[c]).text,u=[,,];if(u[0]={type:`ordgroup`,mode:`math`,body:[]},u[1]={type:`ordgroup`,mode:`math`,body:[]},!`=|.`.includes(l))if(`<>AV`.includes(l))for(var d=0;d<2;d++){for(var f=!0,p=c+1;p<o.length;p++){if(Qg(o[p],l)){f=!1,c=p;break}if(Zg(o[p]))throw new V(`Missing a `+l+` character to complete a CD arrow.`,o[p]);u[d].body.push(o[p])}if(f)throw new V(`Missing a `+l+` character to complete a CD arrow.`,o[c])}else throw new V(`Expected one of "<>AV=|." after @`,o[c]);var m={type:`styling`,body:[$g(l,u,e)],mode:`math`,style:`display`,resetFont:!0};r.push(m),s=Xg()}a%2==0?r.push(s):r.shift(),r=[],i.push(r)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:`array`,mode:`math`,body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:Array(i[0].length).fill({type:`align`,align:`c`,pregap:.25,postgap:.25}),colSeparationType:`CD`,hLinesBeforeRow:Array(i.length+1).fill([])}}Z({type:`cdlabel`,names:[`\\\\cdleft`,`\\\\cdright`],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e;return{type:`cdlabel`,mode:n.mode,side:r.slice(4),label:t[0]}},htmlBuilder(e,t){var n=t.havingStyle(t.style.sup()),r=kh(ig(e.label,n,t),t);return r.classes.push(`cd-label-`+e.side),r.style.bottom=H(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,t){var n=new Q(`mrow`,[yg(e.label,t)]);return n=new Q(`mpadded`,[n]),n.setAttribute(`width`,`0`),e.side===`left`&&n.setAttribute(`lspace`,`-1width`),n.setAttribute(`voffset`,`0.7em`),n=new Q(`mstyle`,[n]),n.setAttribute(`displaystyle`,`false`),n.setAttribute(`scriptlevel`,`1`),n}}),Z({type:`cdlabelparent`,names:[`\\\\cdparent`],props:{numArgs:1},handler(e,t){var{parser:n}=e;return{type:`cdlabelparent`,mode:n.mode,fragment:t[0]}},htmlBuilder(e,t){var n=kh(ig(e.fragment,t),t);return n.classes.push(`cd-vert-arrow`),n},mathmlBuilder(e,t){return new Q(`mrow`,[yg(e.fragment,t)])}}),Z({type:`textord`,names:[`\\@char`],props:{numArgs:1,allowedInText:!0},handler(e,t){for(var{parser:n}=e,r=Rg(t[0],`ordgroup`).body,i=``,a=0;a<r.length;a++){var o=Rg(r[a],`textord`);i+=o.text}var s=parseInt(i),c;if(isNaN(s))throw new V(`\\@char has non-numeric argument `+i);if(s<0||s>=1114111)throw new V(`\\@char with invalid code point `+i);return s<=65535?c=String.fromCharCode(s):(s-=65536,c=String.fromCharCode((s>>10)+55296,(s&1023)+56320)),{type:`textord`,mode:n.mode,text:c}}});var t_=(e,t)=>Oh(Qh(e.body,t.withColor(e.color),!1)),n_=(e,t)=>{var n=new Q(`mstyle`,_g(e.body,t.withColor(e.color)));return n.setAttribute(`mathcolor`,e.color),n};Z({type:`color`,names:[`\\textcolor`],props:{numArgs:2,allowedInText:!0,argTypes:[`color`,`original`]},handler(e,t){var{parser:n}=e,r=Rg(t[0],`color-token`).color,i=t[1];return{type:`color`,mode:n.mode,color:r,body:qh(i)}},htmlBuilder:t_,mathmlBuilder:n_}),Z({type:`color`,names:[`\\color`],props:{numArgs:1,allowedInText:!0,argTypes:[`color`]},handler(e,t){var{parser:n,breakOnTokenText:r}=e,i=Rg(t[0],`color-token`).color;n.gullet.macros.set(`\\current@color`,i);var a=n.parseExpression(!0,r);return{type:`color`,mode:n.mode,color:i,body:a}},htmlBuilder:t_,mathmlBuilder:n_}),Z({type:`cr`,names:[`\\\\`],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(e,t,n){var{parser:r}=e,i=r.gullet.future().text===`[`?r.parseSizeGroup(!0):null,a=!r.settings.displayMode||!r.settings.useStrictBehavior(`newLineInDisplayMode`,`In LaTeX, \\\\ or \\newline does nothing in display mode`);return{type:`cr`,mode:r.mode,newLine:a,size:i&&Rg(i,`size`).value}},htmlBuilder(e,t){var n=X([`mspace`],[],t);return e.newLine&&(n.classes.push(`newline`),e.size&&(n.style.marginTop=H(rm(e.size,t)))),n},mathmlBuilder(e,t){var n=new Q(`mspace`);return e.newLine&&(n.setAttribute(`linebreak`,`newline`),e.size&&n.setAttribute(`height`,H(rm(e.size,t)))),n}});var r_={"\\global":`\\global`,"\\long":`\\\\globallong`,"\\\\globallong":`\\\\globallong`,"\\def":`\\gdef`,"\\gdef":`\\gdef`,"\\edef":`\\xdef`,"\\xdef":`\\xdef`,"\\let":`\\\\globallet`,"\\futurelet":`\\\\globalfuture`},i_=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new V(`Expected a control sequence`,e);return t},a_=e=>{var t=e.gullet.popToken();return t.text===`=`&&(t=e.gullet.popToken(),t.text===` `&&(t=e.gullet.popToken())),t},o_=(e,t,n,r)=>{var i=e.gullet.macros.get(n.text);i??=(n.noexpand=!0,{tokens:[n],numArgs:0,unexpandable:!e.gullet.isExpandable(n.text)}),e.gullet.macros.set(t,i,r)};Z({type:`internal`,names:[`\\global`,`\\long`,`\\\\globallong`],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:t,funcName:n}=e;t.consumeSpaces();var r=t.fetch();if(r_[r.text])return(n===`\\global`||n===`\\\\globallong`)&&(r.text=r_[r.text]),Rg(t.parseFunction(),`internal`);throw new V(`Invalid token after macro prefix`,r)}}),Z({type:`internal`,names:[`\\def`,`\\gdef`,`\\edef`,`\\xdef`],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=t.gullet.popToken(),i=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new V(`Expected a control sequence`,r);for(var a=0,o,s=[[]];t.gullet.future().text!==`{`;)if(r=t.gullet.popToken(),r.text===`#`){if(t.gullet.future().text===`{`){o=t.gullet.future(),s[a].push(`{`);break}if(r=t.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new V(`Invalid argument number "`+r.text+`"`);if(parseInt(r.text)!==a+1)throw new V(`Argument number "`+r.text+`" out of order`);a++,s.push([])}else if(r.text===`EOF`)throw new V(`Expected a macro definition`);else s[a].push(r.text);var{tokens:c}=t.gullet.consumeArg();return o&&c.unshift(o),(n===`\\edef`||n===`\\xdef`)&&(c=t.gullet.expandTokens(c),c.reverse()),t.gullet.macros.set(i,{tokens:c,numArgs:a,delimiters:s},n===r_[n]),{type:`internal`,mode:t.mode}}}),Z({type:`internal`,names:[`\\let`,`\\\\globallet`],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=i_(t.gullet.popToken());return t.gullet.consumeSpaces(),o_(t,r,a_(t),n===`\\\\globallet`),{type:`internal`,mode:t.mode}}}),Z({type:`internal`,names:[`\\futurelet`,`\\\\globalfuture`],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=i_(t.gullet.popToken()),i=t.gullet.popToken(),a=t.gullet.popToken();return o_(t,r,a,n===`\\\\globalfuture`),t.gullet.pushToken(a),t.gullet.pushToken(i),{type:`internal`,mode:t.mode}}});var s_=function(e,t,n){var r=Tm(Om.math[e]&&Om.math[e].replace||e,t,n);if(!r)throw Error(`Unsupported symbol `+e+` and font size `+t+`.`);return r},c_=function(e,t,n,r){var i=n.havingBaseStyle(t),a=X(r.concat(i.sizingClasses(n)),[e],n),o=i.sizeMultiplier/n.sizeMultiplier;return a.height*=o,a.depth*=o,a.maxFontSize=i.sizeMultiplier,a},l_=function(e,t,n){var r=t.havingBaseStyle(n),i=(1-t.sizeMultiplier/r.sizeMultiplier)*t.fontMetrics().axisHeight;e.classes.push(`delimcenter`),e.style.top=H(i),e.height-=i,e.depth+=i},u_=function(e,t,n,r,i,a){var o=c_(vh(e,`Main-Regular`,i,r),t,r,a);return n&&l_(o,r,t),o},d_=function(e,t,n,r){return vh(e,`Size`+t+`-Regular`,n,r)},f_=function(e,t,n,r,i,a){var o=d_(e,t,i,r),s=c_(X([`delimsizing`,`size`+t],[o],r),Pp.TEXT,r,a);return n&&l_(s,r,Pp.TEXT),s},p_=function(e,t,n){return{type:`elem`,elem:X([`delimsizinginner`,t===`Size1-Regular`?`delim-size1`:`delim-size4`],[X([],[vh(e,t,n)])])}},m_=function(e,t,n){var r=xm[`Size4-Regular`][e.charCodeAt(0)]?xm[`Size4-Regular`][e.charCodeAt(0)][4]:xm[`Size1-Regular`][e.charCodeAt(0)][4],i=Th([],[new hm([new gm(`inner`,Yp(e,Math.round(1e3*t)))],{width:H(r),height:H(t),style:`width:`+H(r),viewBox:`0 0 `+1e3*r+` `+Math.round(1e3*t),preserveAspectRatio:`xMinYMin`})],n);return i.height=t,i.style.height=H(t),i.style.width=H(r),{type:`elem`,elem:i}},h_=.008,g_={type:`kern`,size:-1*h_},__=new Set([`|`,`\\lvert`,`\\rvert`,`\\vert`]),v_=new Set([`\\|`,`\\lVert`,`\\rVert`,`\\Vert`]),y_=function(e,t,n,r,i,a){var o,s,c,l,u=``,d=0;o=c=l=e,s=null;var f=`Size1-Regular`;e===`\\uparrow`?c=l=`⏐`:e===`\\Uparrow`?c=l=`‖`:e===`\\downarrow`?o=c=`⏐`:e===`\\Downarrow`?o=c=`‖`:e===`\\updownarrow`?(o=`\\uparrow`,c=`⏐`,l=`\\downarrow`):e===`\\Updownarrow`?(o=`\\Uparrow`,c=`‖`,l=`\\Downarrow`):__.has(e)?(c=`∣`,u=`vert`,d=333):v_.has(e)?(c=`∥`,u=`doublevert`,d=556):e===`[`||e===`\\lbrack`?(o=`⎡`,c=`⎢`,l=`⎣`,f=`Size4-Regular`,u=`lbrack`,d=667):e===`]`||e===`\\rbrack`?(o=`⎤`,c=`⎥`,l=`⎦`,f=`Size4-Regular`,u=`rbrack`,d=667):e===`\\lfloor`||e===`⌊`?(c=o=`⎢`,l=`⎣`,f=`Size4-Regular`,u=`lfloor`,d=667):e===`\\lceil`||e===`⌈`?(o=`⎡`,c=l=`⎢`,f=`Size4-Regular`,u=`lceil`,d=667):e===`\\rfloor`||e===`⌋`?(c=o=`⎥`,l=`⎦`,f=`Size4-Regular`,u=`rfloor`,d=667):e===`\\rceil`||e===`⌉`?(o=`⎤`,c=l=`⎥`,f=`Size4-Regular`,u=`rceil`,d=667):e===`(`||e===`\\lparen`?(o=`⎛`,c=`⎜`,l=`⎝`,f=`Size4-Regular`,u=`lparen`,d=875):e===`)`||e===`\\rparen`?(o=`⎞`,c=`⎟`,l=`⎠`,f=`Size4-Regular`,u=`rparen`,d=875):e===`\\{`||e===`\\lbrace`?(o=`⎧`,s=`⎨`,l=`⎩`,c=`⎪`,f=`Size4-Regular`):e===`\\}`||e===`\\rbrace`?(o=`⎫`,s=`⎬`,l=`⎭`,c=`⎪`,f=`Size4-Regular`):e===`\\lgroup`||e===`⟮`?(o=`⎧`,l=`⎩`,c=`⎪`,f=`Size4-Regular`):e===`\\rgroup`||e===`⟯`?(o=`⎫`,l=`⎭`,c=`⎪`,f=`Size4-Regular`):e===`\\lmoustache`||e===`⎰`?(o=`⎧`,l=`⎭`,c=`⎪`,f=`Size4-Regular`):(e===`\\rmoustache`||e===`⎱`)&&(o=`⎫`,l=`⎩`,c=`⎪`,f=`Size4-Regular`);var p=s_(o,f,i),m=p.height+p.depth,h=s_(c,f,i),g=h.height+h.depth,_=s_(l,f,i),v=_.height+_.depth,y=0,b=1;if(s!==null){var x=s_(s,f,i);y=x.height+x.depth,b=2}var S=m+v+y,C=S+Math.max(0,Math.ceil((t-S)/(b*g)))*b*g,w=r.fontMetrics().axisHeight;n&&(w*=r.sizeMultiplier);var T=C/2-w,E=[];if(u.length>0){var D=C-m-v,O=Math.round(C*1e3),k=Zp(u,Math.round(D*1e3)),ee=new gm(u,k),te=H(d/1e3),ne=H(O/1e3),re=Th([],[new hm([ee],{width:te,height:ne,viewBox:`0 0 `+d+` `+O})],r);re.height=O/1e3,re.style.width=te,re.style.height=ne,E.push({type:`elem`,elem:re})}else{if(E.push(p_(l,f,i)),E.push(g_),s===null){var ie=C-m-v+2*h_;E.push(m_(c,ie,r))}else{var ae=(C-m-v-y)/2+2*h_;E.push(m_(c,ae,r)),E.push(g_),E.push(p_(s,f,i)),E.push(g_),E.push(m_(c,ae,r))}E.push(g_),E.push(p_(o,f,i))}var A=r.havingBaseStyle(Pp.TEXT);return c_(X([`delimsizing`,`mult`],[jh({positionType:`bottom`,positionData:T,children:E})],A),Pp.TEXT,r,a)},b_=80,x_=.08,S_=function(e,t,n,r,i){return Th([`hide-tail`],[new hm([new gm(e,Jp(e,r,n))],{width:`400em`,height:H(t),viewBox:`0 0 400000 `+n,preserveAspectRatio:`xMinYMin slice`})],i)},C_=function(e,t){var n=t.havingBaseSizing(),r=N_(`\\surd`,e*n.sizeMultiplier,j_,n),i=n.sizeMultiplier,a=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),o,s,c,l,u;return r.type===`small`?(l=1e3+1e3*a+b_,e<1?i=1:e<1.4&&(i=.7),s=(1+a+x_)/i,c=(1+a)/i,o=S_(`sqrtMain`,s,l,a,t),o.style.minWidth=`0.853em`,u=.833/i):r.type===`large`?(l=(1e3+b_)*D_[r.size],c=(D_[r.size]+a)/i,s=(D_[r.size]+a+x_)/i,o=S_(`sqrtSize`+r.size,s,l,a,t),o.style.minWidth=`1.02em`,u=1/i):(s=e+a+x_,c=e+a,l=Math.floor(1e3*e+a)+b_,o=S_(`sqrtTall`,s,l,a,t),o.style.minWidth=`0.742em`,u=1.056),o.height=c,o.style.height=H(s),{span:o,advanceWidth:u,ruleWidth:(t.fontMetrics().sqrtRuleThickness+a)*i}},w_=new Set([`(`,`\\lparen`,`)`,`\\rparen`,`[`,`\\lbrack`,`]`,`\\rbrack`,`\\{`,`\\lbrace`,`\\}`,`\\rbrace`,`\\lfloor`,`\\rfloor`,`⌊`,`⌋`,`\\lceil`,`\\rceil`,`⌈`,`⌉`,`\\surd`]),T_=new Set([`\\uparrow`,`\\downarrow`,`\\updownarrow`,`\\Uparrow`,`\\Downarrow`,`\\Updownarrow`,`|`,`\\|`,`\\vert`,`\\Vert`,`\\lvert`,`\\rvert`,`\\lVert`,`\\rVert`,`\\lgroup`,`\\rgroup`,`⟮`,`⟯`,`\\lmoustache`,`\\rmoustache`,`⎰`,`⎱`]),E_=new Set([`<`,`>`,`\\langle`,`\\rangle`,`/`,`\\backslash`,`\\lt`,`\\gt`]),D_=[0,1.2,1.8,2.4,3],O_=function(e,t,n,r,i){if(e===`<`||e===`\\lt`||e===`⟨`?e=`\\langle`:(e===`>`||e===`\\gt`||e===`⟩`)&&(e=`\\rangle`),w_.has(e)||E_.has(e))return f_(e,t,!1,n,r,i);if(T_.has(e))return y_(e,D_[t],!1,n,r,i);throw new V(`Illegal delimiter: '`+e+`'`)},k_=[{type:`small`,style:Pp.SCRIPTSCRIPT},{type:`small`,style:Pp.SCRIPT},{type:`small`,style:Pp.TEXT},{type:`large`,size:1},{type:`large`,size:2},{type:`large`,size:3},{type:`large`,size:4}],A_=[{type:`small`,style:Pp.SCRIPTSCRIPT},{type:`small`,style:Pp.SCRIPT},{type:`small`,style:Pp.TEXT},{type:`stack`}],j_=[{type:`small`,style:Pp.SCRIPTSCRIPT},{type:`small`,style:Pp.SCRIPT},{type:`small`,style:Pp.TEXT},{type:`large`,size:1},{type:`large`,size:2},{type:`large`,size:3},{type:`large`,size:4},{type:`stack`}],M_=function(e){if(e.type===`small`)return`Main-Regular`;if(e.type===`large`)return`Size`+e.size+`-Regular`;if(e.type===`stack`)return`Size4-Regular`;var t=e.type;throw Error(`Add support for delim type '`+t+`' here.`)},N_=function(e,t,n,r){for(var i=Math.min(2,3-r.style.size);i<n.length;i++){var a=n[i];if(a.type===`stack`)break;var o=s_(e,M_(a),`math`),s=o.height+o.depth;if(a.type===`small`){var c=r.havingBaseStyle(a.style);s*=c.sizeMultiplier}if(s>t)return a}return n[n.length-1]},P_=function(e,t,n,r,i,a){e===`<`||e===`\\lt`||e===`⟨`?e=`\\langle`:(e===`>`||e===`\\gt`||e===`⟩`)&&(e=`\\rangle`);var o=E_.has(e)?k_:w_.has(e)?j_:A_,s=N_(e,t,o,r);return s.type===`small`?u_(e,s.style,n,r,i,a):s.type===`large`?f_(e,s.size,n,r,i,a):y_(e,t,n,r,i,a)},F_=function(e,t,n,r,i,a){var o=r.fontMetrics().axisHeight*r.sizeMultiplier,s=901,c=5/r.fontMetrics().ptPerEm,l=Math.max(t-o,n+o);return P_(e,Math.max(l/500*s,2*l-c),!0,r,i,a)},I_={"\\bigl":{mclass:`mopen`,size:1},"\\Bigl":{mclass:`mopen`,size:2},"\\biggl":{mclass:`mopen`,size:3},"\\Biggl":{mclass:`mopen`,size:4},"\\bigr":{mclass:`mclose`,size:1},"\\Bigr":{mclass:`mclose`,size:2},"\\biggr":{mclass:`mclose`,size:3},"\\Biggr":{mclass:`mclose`,size:4},"\\bigm":{mclass:`mrel`,size:1},"\\Bigm":{mclass:`mrel`,size:2},"\\biggm":{mclass:`mrel`,size:3},"\\Biggm":{mclass:`mrel`,size:4},"\\big":{mclass:`mord`,size:1},"\\Big":{mclass:`mord`,size:2},"\\bigg":{mclass:`mord`,size:3},"\\Bigg":{mclass:`mord`,size:4}},L_=new Set(`(,\\lparen,),\\rparen,[,\\lbrack,],\\rbrack,\\{,\\lbrace,\\},\\rbrace,\\lfloor,\\rfloor,⌊,⌋,\\lceil,\\rceil,⌈,⌉,<,>,\\langle,⟨,\\rangle,⟩,\\lt,\\gt,\\lvert,\\rvert,\\lVert,\\rVert,\\lgroup,\\rgroup,⟮,⟯,\\lmoustache,\\rmoustache,⎰,⎱,/,\\backslash,|,\\vert,\\|,\\Vert,\\uparrow,\\Uparrow,\\downarrow,\\Downarrow,\\updownarrow,\\Updownarrow,.`.split(`,`));function R_(e){return`isMiddle`in e}function z_(e,t){var n=Bg(e);if(n&&L_.has(n.text))return n;throw n?new V(`Invalid delimiter '`+n.text+`' after '`+t.funcName+`'`,e):new V(`Invalid delimiter type '`+e.type+`'`,e)}Z({type:`delimsizing`,names:[`\\bigl`,`\\Bigl`,`\\biggl`,`\\Biggl`,`\\bigr`,`\\Bigr`,`\\biggr`,`\\Biggr`,`\\bigm`,`\\Bigm`,`\\biggm`,`\\Biggm`,`\\big`,`\\Big`,`\\bigg`,`\\Bigg`],props:{numArgs:1,argTypes:[`primitive`]},handler:(e,t)=>{var n=z_(t[0],e);return{type:`delimsizing`,mode:e.parser.mode,size:I_[e.funcName].size,mclass:I_[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>e.delim===`.`?X([e.mclass]):O_(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];e.delim!==`.`&&t.push(fg(e.delim,e.mode));var n=new Q(`mo`,t);e.mclass===`mopen`||e.mclass===`mclose`?n.setAttribute(`fence`,`true`):n.setAttribute(`fence`,`false`),n.setAttribute(`stretchy`,`true`);var r=H(D_[e.size]);return n.setAttribute(`minsize`,r),n.setAttribute(`maxsize`,r),n}});function B_(e){if(!e.body)throw Error(`Bug: The leftright ParseNode wasn't fully parsed.`)}Z({type:`leftright-right`,names:[`\\right`],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=e.parser.gullet.macros.get(`\\current@color`);if(n&&typeof n!=`string`)throw new V(`\\current@color set to non-string in \\right`);return{type:`leftright-right`,mode:e.parser.mode,delim:z_(t[0],e).text,color:n}}}),Z({type:`leftright`,names:[`\\left`],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=z_(t[0],e),r=e.parser;++r.leftrightDepth;var i=r.parseExpression(!1);--r.leftrightDepth,r.expect(`\\right`,!1);var a=Rg(r.parseFunction(),`leftright-right`);return{type:`leftright`,mode:r.mode,body:i,left:n.text,right:a.delim,rightColor:a.color}},htmlBuilder:(e,t)=>{B_(e);for(var n=Qh(e.body,t,!0,[`mopen`,`mclose`]),r=0,i=0,a=!1,o=0;o<n.length;o++){var s=n[o];R_(s)?a=!0:(r=Math.max(n[o].height,r),i=Math.max(n[o].depth,i))}r*=t.sizeMultiplier,i*=t.sizeMultiplier;var c=e.left===`.`?rg(t,[`mopen`]):F_(e.left,r,i,t,e.mode,[`mopen`]);if(n.unshift(c),a)for(var l=1;l<n.length;l++){var u=n[l];if(R_(u)){var d=u.isMiddle;n[l]=F_(d.delim,r,i,d.options,e.mode,[])}}var f;if(e.right===`.`)f=rg(t,[`mclose`]);else{var p=e.rightColor?t.withColor(e.rightColor):t;f=F_(e.right,r,i,p,e.mode,[`mclose`])}return n.push(f),X([`minner`],n,t)},mathmlBuilder:(e,t)=>{B_(e);var n=_g(e.body,t);if(e.left!==`.`){var r=new Q(`mo`,[fg(e.left,e.mode)]);r.setAttribute(`fence`,`true`),n.unshift(r)}if(e.right!==`.`){var i=new Q(`mo`,[fg(e.right,e.mode)]);i.setAttribute(`fence`,`true`),e.rightColor&&i.setAttribute(`mathcolor`,e.rightColor),n.push(i)}return pg(n)}}),Z({type:`middle`,names:[`\\middle`],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=z_(t[0],e);if(!e.parser.leftrightDepth)throw new V(`\\middle without preceding \\left`,n);return{type:`middle`,mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;return e.delim===`.`?n=rg(t,[]):(n=O_(e.delim,1,t,e.mode,[]),n.isMiddle={delim:e.delim,options:t}),n},mathmlBuilder:(e,t)=>{var n=new Q(`mo`,[e.delim===`\\vert`||e.delim===`|`?fg(`|`,`text`):fg(e.delim,e.mode)]);return n.setAttribute(`fence`,`true`),n.setAttribute(`lspace`,`0.05em`),n.setAttribute(`rspace`,`0.05em`),n}});var V_=(e,t)=>{var n=kh(ig(e.body,t),t),r=e.label.slice(1),i=t.sizeMultiplier,a,o,s=dp(e.body);if(r===`sout`)a=X([`stretchy`,`sout`]),a.height=t.fontMetrics().defaultRuleThickness/i,o=-.5*t.fontMetrics().xHeight;else if(r===`phase`){var c=rm({number:.6,unit:`pt`},t),l=rm({number:.35,unit:`ex`},t),u=t.havingBaseSizing();i/=u.sizeMultiplier;var d=n.height+n.depth+c+l;n.style.paddingLeft=H(d/2+c);var f=Math.floor(1e3*d*i);a=Th([`hide-tail`],[new hm([new gm(`phase`,Kp(f))],{width:`400em`,height:H(f/1e3),viewBox:`0 0 400000 `+f,preserveAspectRatio:`xMinYMin slice`})],t),a.style.height=H(d),o=n.depth+c+l}else{/cancel/.test(r)?s||n.classes.push(`cancel-pad`):r===`angl`?n.classes.push(`anglpad`):n.classes.push(`boxpad`);var p,m,h=0;/box/.test(r)?(h=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),p=t.fontMetrics().fboxsep+(r===`colorbox`?0:h),m=p):r===`angl`?(h=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness),p=4*h,m=Math.max(0,.25-n.depth)):(p=s?.2:0,m=p),a=Pg(n,r,p,m,t),/fbox|boxed|fcolorbox/.test(r)?(a.style.borderStyle=`solid`,a.style.borderWidth=H(h)):r===`angl`&&h!==.049&&(a.style.borderTopWidth=H(h),a.style.borderRightWidth=H(h)),o=n.depth+m,e.backgroundColor&&(a.style.backgroundColor=e.backgroundColor,e.borderColor&&(a.style.borderColor=e.borderColor))}var g;if(e.backgroundColor)g=jh({positionType:`individualShift`,children:[{type:`elem`,elem:a,shift:o},{type:`elem`,elem:n,shift:0}]});else{var _=/cancel|phase/.test(r)?[`svg-align`]:[];g=jh({positionType:`individualShift`,children:[{type:`elem`,elem:n,shift:0},{type:`elem`,elem:a,shift:o,wrapperClasses:_}]})}return/cancel/.test(r)&&(g.height=n.height,g.depth=n.depth),/cancel/.test(r)&&!s?X([`mord`,`cancel-lap`],[g],t):X([`mord`],[g],t)},H_=(e,t)=>{var n,r=new Q(e.label.includes(`colorbox`)?`mpadded`:`menclose`,[yg(e.body,t)]);switch(e.label){case`\\cancel`:r.setAttribute(`notation`,`updiagonalstrike`);break;case`\\bcancel`:r.setAttribute(`notation`,`downdiagonalstrike`);break;case`\\phase`:r.setAttribute(`notation`,`phasorangle`);break;case`\\sout`:r.setAttribute(`notation`,`horizontalstrike`);break;case`\\fbox`:r.setAttribute(`notation`,`box`);break;case`\\angl`:r.setAttribute(`notation`,`actuarial`);break;case`\\fcolorbox`:case`\\colorbox`:if(n=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,r.setAttribute(`width`,`+`+2*n+`pt`),r.setAttribute(`height`,`+`+2*n+`pt`),r.setAttribute(`lspace`,n+`pt`),r.setAttribute(`voffset`,n+`pt`),e.label===`\\fcolorbox`){var i=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);r.setAttribute(`style`,`border: `+H(i)+` solid `+e.borderColor)}break;case`\\xcancel`:r.setAttribute(`notation`,`updiagonalstrike downdiagonalstrike`);break}return e.backgroundColor&&r.setAttribute(`mathbackground`,e.backgroundColor),r};Z({type:`enclose`,names:[`\\colorbox`],props:{numArgs:2,allowedInText:!0,argTypes:[`color`,`hbox`]},handler(e,t,n){var{parser:r,funcName:i}=e,a=Rg(t[0],`color-token`).color,o=t[1];return{type:`enclose`,mode:r.mode,label:i,backgroundColor:a,body:o}},htmlBuilder:V_,mathmlBuilder:H_}),Z({type:`enclose`,names:[`\\fcolorbox`],props:{numArgs:3,allowedInText:!0,argTypes:[`color`,`color`,`hbox`]},handler(e,t,n){var{parser:r,funcName:i}=e,a=Rg(t[0],`color-token`).color,o=Rg(t[1],`color-token`).color,s=t[2];return{type:`enclose`,mode:r.mode,label:i,backgroundColor:o,borderColor:a,body:s}},htmlBuilder:V_,mathmlBuilder:H_}),Z({type:`enclose`,names:[`\\fbox`],props:{numArgs:1,argTypes:[`hbox`],allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:`enclose`,mode:n.mode,label:`\\fbox`,body:t[0]}}}),Z({type:`enclose`,names:[`\\cancel`,`\\bcancel`,`\\xcancel`,`\\phase`],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:`enclose`,mode:n.mode,label:r,body:i}},htmlBuilder:V_,mathmlBuilder:H_}),Z({type:`enclose`,names:[`\\sout`],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e;n.mode===`math`&&n.settings.reportNonstrict(`mathVsSout`,`LaTeX's \\sout works only in text mode`);var i=t[0];return{type:`enclose`,mode:n.mode,label:r,body:i}},htmlBuilder:V_,mathmlBuilder:H_}),Z({type:`enclose`,names:[`\\angl`],props:{numArgs:1,argTypes:[`hbox`],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:`enclose`,mode:n.mode,label:`\\angl`,body:t[0]}}});var U_={};function W_(e){for(var{type:t,names:n,props:r,handler:i,htmlBuilder:a,mathmlBuilder:o}=e,s={type:t,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},c=0;c<n.length;++c)U_[n[c]]=s;a&&(Uh[t]=a),o&&(Wh[t]=o)}var G_={};function $(e,t){G_[e]=t}var K_=class e{constructor(e,t,n){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=t,this.end=n}static range(t,n){return n?!t||!t.loc||!n.loc||t.loc.lexer!==n.loc.lexer?null:new e(t.loc.lexer,t.loc.start,n.loc.end):t&&t.loc}},q_=class e{constructor(e,t){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=t}range(t,n){return new e(n,K_.range(this,t))}};function J_(e){var t=[];e.consumeSpaces();var n=e.fetch().text;for(n===`\\relax`&&(e.consume(),e.consumeSpaces(),n=e.fetch().text);n===`\\hline`||n===`\\hdashline`;)e.consume(),t.push(n===`\\hdashline`),e.consumeSpaces(),n=e.fetch().text;return t}var Y_=e=>{if(!e.parser.settings.displayMode)throw new V(`{`+e.envName+`} can be used only in display mode.`)},X_=new Set([`gather`,`gather*`]);function Z_(e){if(!e.includes(`ed`))return!e.includes(`*`)}function Q_(e,t,n){var{hskipBeforeAndAfter:r,addJot:i,cols:a,arraystretch:o,colSeparationType:s,autoTag:c,singleRow:l,emptySingleRow:u,maxNumCols:d,leqno:f}=t;if(e.gullet.beginGroup(),l||e.gullet.macros.set(`\\cr`,`\\\\\\relax`),!o){var p=e.gullet.expandMacroAsText(`\\arraystretch`);if(p==null)o=1;else if(o=parseFloat(p),!o||o<0)throw new V(`Invalid \\arraystretch: `+p)}e.gullet.beginGroup();var m=[],h=[m],g=[],_=[],v=c==null?void 0:[];function y(){c&&e.gullet.macros.set(`\\@eqnsw`,`1`,!0)}function b(){v&&(e.gullet.macros.get(`\\df@tag`)?(v.push(e.subparse([new q_(`\\df@tag`)])),e.gullet.macros.set(`\\df@tag`,void 0,!0)):v.push(!!c&&e.gullet.macros.get(`\\@eqnsw`)===`1`))}for(y(),_.push(J_(e));;){var x=e.parseExpression(!1,l?`\\end`:`\\\\`);e.gullet.endGroup(),e.gullet.beginGroup();var S={type:`ordgroup`,mode:e.mode,body:x};n&&(S={type:`styling`,mode:e.mode,style:n,resetFont:!0,body:[S]}),m.push(S);var C=e.fetch().text;if(C===`&`){if(d&&m.length===d){if(l||s)throw new V(`Too many tab characters: &`,e.nextToken);e.settings.reportNonstrict(`textEnv`,`Too few columns specified in the {array} column argument.`)}e.consume()}else if(C===`\\end`){b(),m.length===1&&S.type===`styling`&&S.body.length===1&&S.body[0].type===`ordgroup`&&S.body[0].body.length===0&&(h.length>1||!u)&&h.pop(),_.length<h.length+1&&_.push([]);break}else if(C===`\\\\`){e.consume();var w=void 0;e.gullet.future().text!==` `&&(w=e.parseSizeGroup(!0)),g.push(w?w.value:null),b(),_.push(J_(e)),m=[],h.push(m),y()}else throw new V(`Expected & or \\\\ or \\cr or \\end`,e.nextToken)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:`array`,mode:e.mode,addJot:i,arraystretch:o,body:h,cols:a,rowGaps:g,hskipBeforeAndAfter:r,hLinesBeforeRow:_,colSeparationType:s,tags:v,leqno:f}}function $_(e){return e.slice(0,1)===`d`?`display`:`text`}var ev=function(e,t){var n,r,i=e.body.length,a=e.hLinesBeforeRow,o=0,s=Array(i),c=[],l=Math.max(t.fontMetrics().arrayRuleWidth,t.minRuleThickness),u=1/t.fontMetrics().ptPerEm,d=5*u;e.colSeparationType&&e.colSeparationType===`small`&&(d=.2778*(t.havingStyle(Pp.SCRIPT).sizeMultiplier/t.sizeMultiplier));var f=e.colSeparationType===`CD`?rm({number:3,unit:`ex`},t):12*u,p=3*u,m=e.arraystretch*f,h=.7*m,g=.3*m,_=0;function v(e){for(var t=0;t<e.length;++t)t>0&&(_+=.25),c.push({pos:_,isDashed:e[t]})}for(v(a[0]),n=0;n<e.body.length;++n){var y=e.body[n],b=h,x=g;o<y.length&&(o=y.length);var S={cells:Array(y.length),height:0,depth:0,pos:0};for(r=0;r<y.length;++r){var C=ig(y[r],t);x<C.depth&&(x=C.depth),b<C.height&&(b=C.height),S.cells[r]=C}var w=e.rowGaps[n],T=0;w&&(T=rm(w,t),T>0&&(T+=g,x<T&&(x=T),T=0)),e.addJot&&n<e.body.length-1&&(x+=p),S.height=b,S.depth=x,_+=b,S.pos=_,_+=x+T,s[n]=S,v(a[n+1])}var E=_/2+t.fontMetrics().axisHeight,D=e.cols||[],O=[],k,ee,te=[];if(e.tags&&e.tags.some(e=>e))for(n=0;n<i;++n){var ne=s[n],re=ne.pos-E,ie=e.tags[n],ae=void 0;ae=ie===!0?X([`eqn-num`],[],t):ie===!1?X([],[],t):X([],Qh(ie,t,!0),t),ae.depth=ne.depth,ae.height=ne.height,te.push({type:`elem`,elem:ae,shift:re})}for(r=0,ee=0;r<o||ee<D.length;++r,++ee){for(var A=D[ee],oe=!0;(j=A)?.type===`separator`;){var j;if(oe||(k=X([`arraycolsep`],[]),k.style.width=H(t.fontMetrics().doubleRuleSep),O.push(k)),A.separator===`|`||A.separator===`:`){var se=A.separator===`|`?`solid`:`dashed`,ce=X([`vertical-separator`],[],t);ce.style.height=H(_),ce.style.borderRightWidth=H(l),ce.style.borderRightStyle=se,ce.style.margin=`0 `+H(-l/2);var le=_-E;le&&(ce.style.verticalAlign=H(-le)),O.push(ce)}else throw new V(`Invalid separator type: `+A.separator);ee++,A=D[ee],oe=!1}if(!(r>=o)){var ue=void 0;(r>0||e.hskipBeforeAndAfter)&&(ue=A?.pregap??d,ue!==0&&(k=X([`arraycolsep`],[]),k.style.width=H(ue),O.push(k)));var de=[];for(n=0;n<i;++n){var fe=s[n],pe=fe.cells[r];if(pe){var me=fe.pos-E;pe.depth=fe.depth,pe.height=fe.height,de.push({type:`elem`,elem:pe,shift:me})}}var he=jh({positionType:`individualShift`,children:de}),ge=X([`col-align-`+(A?.align||`c`)],[he]);O.push(ge),(r<o-1||e.hskipBeforeAndAfter)&&(ue=A?.postgap??d,ue!==0&&(k=X([`arraycolsep`],[]),k.style.width=H(ue),O.push(k)))}}var _e=X([`mtable`],O);if(c.length>0){for(var ve=Eh(`hline`,t,l),ye=Eh(`hdashline`,t,l),be=[{type:`elem`,elem:_e,shift:0}];c.length>0;){var xe=c.pop(),Se=xe.pos-E;xe.isDashed?be.push({type:`elem`,elem:ye,shift:Se}):be.push({type:`elem`,elem:ve,shift:Se})}_e=jh({positionType:`individualShift`,children:be})}if(te.length===0)return X([`mord`],[_e],t);var Ce=X([`tag`],[jh({positionType:`individualShift`,children:te})],t);return Oh([_e,Ce])},tv={c:`center `,l:`left `,r:`right `},nv=function(e,t){for(var n=[],r=new Q(`mtd`,[],[`mtr-glue`]),i=new Q(`mtd`,[],[`mml-eqn-num`]),a=0;a<e.body.length;a++){for(var o=e.body[a],s=[],c=0;c<o.length;c++)s.push(new Q(`mtd`,[yg(o[c],t)]));e.tags&&e.tags[a]&&(s.unshift(r),s.push(r),e.leqno?s.unshift(i):s.push(i)),n.push(new Q(`mtr`,s))}var l=new Q(`mtable`,n),u=e.arraystretch===.5?.1:.16+e.arraystretch-1+(e.addJot?.09:0);l.setAttribute(`rowspacing`,H(u));var d=``,f=``;if(e.cols&&e.cols.length>0){var p=e.cols,m=``,h=!1,g=0,_=p.length;p[0].type===`separator`&&(d+=`top `,g=1),p[p.length-1].type===`separator`&&(d+=`bottom `,--_);for(var v=g;v<_;v++){var y=p[v];y.type===`align`?(f+=tv[y.align],h&&(m+=`none `),h=!0):y.type===`separator`&&(h&&=(m+=y.separator===`|`?`solid `:`dashed `,!1))}l.setAttribute(`columnalign`,f.trim()),/[sd]/.test(m)&&l.setAttribute(`columnlines`,m.trim())}if(e.colSeparationType===`align`){for(var b=e.cols||[],x=``,S=1;S<b.length;S++)x+=S%2?`0em `:`1em `;l.setAttribute(`columnspacing`,x.trim())}else e.colSeparationType===`alignat`||e.colSeparationType===`gather`?l.setAttribute(`columnspacing`,`0em`):e.colSeparationType===`small`?l.setAttribute(`columnspacing`,`0.2778em`):e.colSeparationType===`CD`?l.setAttribute(`columnspacing`,`0.5em`):l.setAttribute(`columnspacing`,`1em`);var C=``,w=e.hLinesBeforeRow;d+=w[0].length>0?`left `:``,d+=w[w.length-1].length>0?`right `:``;for(var T=1;T<w.length-1;T++)C+=w[T].length===0?`none `:w[T][0]?`dashed `:`solid `;return/[sd]/.test(C)&&l.setAttribute(`rowlines`,C.trim()),d!==``&&(l=new Q(`menclose`,[l]),l.setAttribute(`notation`,d.trim())),e.arraystretch&&e.arraystretch<1&&(l=new Q(`mstyle`,[l]),l.setAttribute(`scriptlevel`,`1`)),l},rv=function(e,t){e.envName.includes(`ed`)||Y_(e);var n=[],r=e.envName.includes(`at`)?`alignat`:`align`,i=e.envName===`split`,a=Q_(e.parser,{cols:n,addJot:!0,autoTag:i?void 0:Z_(e.envName),emptySingleRow:!0,colSeparationType:r,maxNumCols:i?2:void 0,leqno:e.parser.settings.leqno},`display`),o=0,s=0,c={type:`ordgroup`,mode:e.mode,body:[]};if(t[0]&&t[0].type===`ordgroup`){for(var l=``,u=0;u<t[0].body.length;u++){var d=Rg(t[0].body[u],`textord`);l+=d.text}o=Number(l),s=o*2}var f=!s;a.body.forEach(function(e){for(var t=1;t<e.length;t+=2)Rg(Rg(e[t],`styling`).body[0],`ordgroup`).body.unshift(c);if(f)s<e.length&&(s=e.length);else{var n=e.length/2;if(o<n)throw new V(`Too many math in a row: `+(`expected `+o+`, but got `+n),e[0])}});for(var p=0;p<s;++p){var m=`r`,h=0;p%2==1?m=`l`:p>0&&f&&(h=1),n[p]={type:`align`,align:m,pregap:h,postgap:0}}return a.colSeparationType=f?`align`:`alignat`,a};W_({type:`array`,names:[`array`,`darray`],props:{numArgs:1},handler(e,t){var n=(Bg(t[0])?[t[0]]:Rg(t[0],`ordgroup`).body).map(function(e){var t=zg(e).text;if(`lcr`.includes(t))return{type:`align`,align:t};if(t===`|`)return{type:`separator`,separator:`|`};if(t===`:`)return{type:`separator`,separator:`:`};throw new V(`Unknown column alignment: `+t,e)}),r={cols:n,hskipBeforeAndAfter:!0,maxNumCols:n.length};return Q_(e.parser,r,$_(e.envName))},htmlBuilder:ev,mathmlBuilder:nv}),W_({type:`array`,names:[`matrix`,`pmatrix`,`bmatrix`,`Bmatrix`,`vmatrix`,`Vmatrix`,`matrix*`,`pmatrix*`,`bmatrix*`,`Bmatrix*`,`vmatrix*`,`Vmatrix*`],props:{numArgs:0},handler(e){var t={matrix:null,pmatrix:[`(`,`)`],bmatrix:[`[`,`]`],Bmatrix:[`\\{`,`\\}`],vmatrix:[`|`,`|`],Vmatrix:[`\\Vert`,`\\Vert`]}[e.envName.replace(`*`,``)],n=`c`,r={hskipBeforeAndAfter:!1,cols:[{type:`align`,align:n}]};if(e.envName.charAt(e.envName.length-1)===`*`){var i=e.parser;if(i.consumeSpaces(),i.fetch().text===`[`){if(i.consume(),i.consumeSpaces(),n=i.fetch().text,!`lcr`.includes(n))throw new V(`Expected l or c or r`,i.nextToken);i.consume(),i.consumeSpaces(),i.expect(`]`),i.consume(),r.cols=[{type:`align`,align:n}]}}var a=Q_(e.parser,r,$_(e.envName)),o=Math.max(0,...a.body.map(e=>e.length));return a.cols=Array(o).fill({type:`align`,align:n}),t?{type:`leftright`,mode:e.mode,body:[a],left:t[0],right:t[1],rightColor:void 0}:a},htmlBuilder:ev,mathmlBuilder:nv}),W_({type:`array`,names:[`smallmatrix`],props:{numArgs:0},handler(e){var t=Q_(e.parser,{arraystretch:.5},`script`);return t.colSeparationType=`small`,t},htmlBuilder:ev,mathmlBuilder:nv}),W_({type:`array`,names:[`subarray`],props:{numArgs:1},handler(e,t){var n=(Bg(t[0])?[t[0]]:Rg(t[0],`ordgroup`).body).map(function(e){var t=zg(e).text;if(`lc`.includes(t))return{type:`align`,align:t};throw new V(`Unknown column alignment: `+t,e)});if(n.length>1)throw new V(`{subarray} can contain only one column`);var r={cols:n,hskipBeforeAndAfter:!1,arraystretch:.5},i=Q_(e.parser,r,`script`);if(i.body.length>0&&i.body[0].length>1)throw new V(`{subarray} can contain only one column`);return i},htmlBuilder:ev,mathmlBuilder:nv}),W_({type:`array`,names:[`cases`,`dcases`,`rcases`,`drcases`],props:{numArgs:0},handler(e){var t=Q_(e.parser,{arraystretch:1.2,cols:[{type:`align`,align:`l`,pregap:0,postgap:1},{type:`align`,align:`l`,pregap:0,postgap:0}]},$_(e.envName));return{type:`leftright`,mode:e.mode,body:[t],left:e.envName.includes(`r`)?`.`:`\\{`,right:e.envName.includes(`r`)?`\\}`:`.`,rightColor:void 0}},htmlBuilder:ev,mathmlBuilder:nv}),W_({type:`array`,names:[`align`,`align*`,`aligned`,`split`],props:{numArgs:0},handler:rv,htmlBuilder:ev,mathmlBuilder:nv}),W_({type:`array`,names:[`gathered`,`gather`,`gather*`],props:{numArgs:0},handler(e){X_.has(e.envName)&&Y_(e);var t={cols:[{type:`align`,align:`c`}],addJot:!0,colSeparationType:`gather`,autoTag:Z_(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return Q_(e.parser,t,`display`)},htmlBuilder:ev,mathmlBuilder:nv}),W_({type:`array`,names:[`alignat`,`alignat*`,`alignedat`],props:{numArgs:1},handler:rv,htmlBuilder:ev,mathmlBuilder:nv}),W_({type:`array`,names:[`equation`,`equation*`],props:{numArgs:0},handler(e){Y_(e);var t={autoTag:Z_(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return Q_(e.parser,t,`display`)},htmlBuilder:ev,mathmlBuilder:nv}),W_({type:`array`,names:[`CD`],props:{numArgs:0},handler(e){return Y_(e),e_(e.parser)},htmlBuilder:ev,mathmlBuilder:nv}),$(`\\nonumber`,`\\gdef\\@eqnsw{0}`),$(`\\notag`,`\\nonumber`),Z({type:`text`,names:[`\\hline`,`\\hdashline`],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,t){throw new V(e.funcName+` valid only within array environment`)}});var iv=U_;Z({type:`environment`,names:[`\\begin`,`\\end`],props:{numArgs:1,argTypes:[`text`]},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];if(i.type!==`ordgroup`)throw new V(`Invalid environment name`,i);for(var a=``,o=0;o<i.body.length;++o)a+=Rg(i.body[o],`textord`).text;if(r===`\\begin`){if(!iv.hasOwnProperty(a))throw new V(`No such environment: `+a,i);var s=iv[a],{args:c,optArgs:l}=n.parseArguments(`\\begin{`+a+`}`,s),u={mode:n.mode,envName:a,parser:n},d=s.handler(u,c,l);n.expect(`\\end`,!1);var f=n.nextToken,p=Rg(n.parseFunction(),`environment`);if(p.name!==a)throw new V(`Mismatch: \\begin{`+a+`} matched by \\end{`+p.name+`}`,f);return d}return{type:`environment`,mode:n.mode,name:a,nameGroup:i}}});var av=(e,t)=>{var n=e.font,r=t.withFont(n);return ig(e.body,r)},ov=(e,t)=>{var n=e.font,r=t.withFont(n);return yg(e.body,r)},sv={"\\Bbb":`\\mathbb`,"\\bold":`\\mathbf`,"\\frak":`\\mathfrak`};Z({type:`font`,names:[`\\mathrm`,`\\mathit`,`\\mathbf`,`\\mathnormal`,`\\mathsfit`,`\\mathbb`,`\\mathcal`,`\\mathfrak`,`\\mathscr`,`\\mathsf`,`\\mathtt`,`\\Bbb`,`\\bold`,`\\frak`],props:{numArgs:1,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=Kh(t[0]),a=r;return a in sv&&(a=sv[a]),{type:`font`,mode:n.mode,font:a.slice(1),body:i}},htmlBuilder:av,mathmlBuilder:ov}),Z({type:`mclass`,names:[`\\boldsymbol`,`\\bm`],props:{numArgs:1},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:`mclass`,mode:n.mode,mclass:Jg(r),body:[{type:`font`,mode:n.mode,font:`boldsymbol`,body:r}],isCharacterBox:dp(r)}}}),Z({type:`font`,names:[`\\rm`,`\\sf`,`\\tt`,`\\bf`,`\\it`,`\\cal`],props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r,breakOnTokenText:i}=e,{mode:a}=n,o=n.parseExpression(!0,i);return{type:`font`,mode:a,font:`math`+r.slice(1),body:{type:`ordgroup`,mode:n.mode,body:o}}},htmlBuilder:av,mathmlBuilder:ov});var cv=(e,t)=>{var n=t.style,r=n.fracNum(),i=n.fracDen(),a=t.havingStyle(r),o=ig(e.numer,a,t);if(e.continued){var s=8.5/t.fontMetrics().ptPerEm,c=3.5/t.fontMetrics().ptPerEm;o.height=o.height<s?s:o.height,o.depth=o.depth<c?c:o.depth}a=t.havingStyle(i);var l=ig(e.denom,a,t),u,d,f;e.hasBarLine?(e.barSize?(d=rm(e.barSize,t),u=Eh(`frac-line`,t,d)):u=Eh(`frac-line`,t),d=u.height,f=u.height):(u=null,d=0,f=t.fontMetrics().defaultRuleThickness);var p,m,h;n.size===Pp.DISPLAY.size?(p=t.fontMetrics().num1,m=d>0?3*f:7*f,h=t.fontMetrics().denom1):(d>0?(p=t.fontMetrics().num2,m=f):(p=t.fontMetrics().num3,m=3*f),h=t.fontMetrics().denom2);var g;if(u){var _=t.fontMetrics().axisHeight;p-o.depth-(_+.5*d)<m&&(p+=m-(p-o.depth-(_+.5*d))),_-.5*d-(l.height-h)<m&&(h+=m-(_-.5*d-(l.height-h)));var v=-(_-.5*d);g=jh({positionType:`individualShift`,children:[{type:`elem`,elem:l,shift:h},{type:`elem`,elem:u,shift:v},{type:`elem`,elem:o,shift:-p}]})}else{var y=p-o.depth-(l.height-h);y<m&&(p+=.5*(m-y),h+=.5*(m-y)),g=jh({positionType:`individualShift`,children:[{type:`elem`,elem:l,shift:h},{type:`elem`,elem:o,shift:-p}]})}a=t.havingStyle(n),g.height*=a.sizeMultiplier/t.sizeMultiplier,g.depth*=a.sizeMultiplier/t.sizeMultiplier;var b=n.size===Pp.DISPLAY.size?t.fontMetrics().delim1:n.size===Pp.SCRIPTSCRIPT.size?t.havingStyle(Pp.SCRIPT).fontMetrics().delim2:t.fontMetrics().delim2,x=e.leftDelim==null?rg(t,[`mopen`]):P_(e.leftDelim,b,!0,t.havingStyle(n),e.mode,[`mopen`]),S=e.continued?X([]):e.rightDelim==null?rg(t,[`mclose`]):P_(e.rightDelim,b,!0,t.havingStyle(n),e.mode,[`mclose`]);return X([`mord`].concat(a.sizingClasses(t)),[x,X([`mfrac`],[g]),S],t)},lv=(e,t)=>{var n=new Q(`mfrac`,[yg(e.numer,t),yg(e.denom,t)]);if(!e.hasBarLine)n.setAttribute(`linethickness`,`0px`);else if(e.barSize){var r=rm(e.barSize,t);n.setAttribute(`linethickness`,H(r))}if(e.leftDelim!=null||e.rightDelim!=null){var i=[];if(e.leftDelim!=null){var a=new Q(`mo`,[new cg(e.leftDelim.replace(`\\`,``))]);a.setAttribute(`fence`,`true`),i.push(a)}if(i.push(n),e.rightDelim!=null){var o=new Q(`mo`,[new cg(e.rightDelim.replace(`\\`,``))]);o.setAttribute(`fence`,`true`),i.push(o)}return pg(i)}return n},uv=(e,t)=>t?{type:`styling`,mode:e.mode,style:t,body:[e]}:e;Z({type:`genfrac`,names:[`\\cfrac`,`\\dfrac`,`\\frac`,`\\tfrac`,`\\dbinom`,`\\binom`,`\\tbinom`,`\\\\atopfrac`,`\\\\bracefrac`,`\\\\brackfrac`],props:{numArgs:2,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0],a=t[1],o,s=null,c=null;switch(r){case`\\cfrac`:case`\\dfrac`:case`\\frac`:case`\\tfrac`:o=!0;break;case`\\\\atopfrac`:o=!1;break;case`\\dbinom`:case`\\binom`:case`\\tbinom`:o=!1,s=`(`,c=`)`;break;case`\\\\bracefrac`:o=!1,s=`\\{`,c=`\\}`;break;case`\\\\brackfrac`:o=!1,s=`[`,c=`]`;break;default:throw Error(`Unrecognized genfrac command`)}var l=r===`\\cfrac`,u=null;return l||r.startsWith(`\\d`)?u=`display`:r.startsWith(`\\t`)&&(u=`text`),uv({type:`genfrac`,mode:n.mode,numer:i,denom:a,continued:l,hasBarLine:o,leftDelim:s,rightDelim:c,barSize:null},u)},htmlBuilder:cv,mathmlBuilder:lv}),Z({type:`infix`,names:[`\\over`,`\\choose`,`\\atop`,`\\brace`,`\\brack`],props:{numArgs:0,infix:!0},handler(e){var{parser:t,funcName:n,token:r}=e,i;switch(n){case`\\over`:i=`\\frac`;break;case`\\choose`:i=`\\binom`;break;case`\\atop`:i=`\\\\atopfrac`;break;case`\\brace`:i=`\\\\bracefrac`;break;case`\\brack`:i=`\\\\brackfrac`;break;default:throw Error(`Unrecognized infix genfrac command`)}return{type:`infix`,mode:t.mode,replaceWith:i,token:r}}});var dv=[`display`,`text`,`script`,`scriptscript`],fv=function(e){var t=null;return e.length>0&&(t=e,t=t===`.`?null:t),t};Z({type:`genfrac`,names:[`\\genfrac`],props:{numArgs:6,allowedInArgument:!0,argTypes:[`math`,`math`,`size`,`text`,`math`,`math`]},handler(e,t){var{parser:n}=e,r=t[4],i=t[5],a=Kh(t[0]),o=a.type===`atom`&&a.family===`open`?fv(a.text):null,s=Kh(t[1]),c=s.type===`atom`&&s.family===`close`?fv(s.text):null,l=Rg(t[2],`size`),u,d=null;l.isBlank?u=!0:(d=l.value,u=d.number>0);var f=null,p=t[3];if(p.type===`ordgroup`){if(p.body.length>0){var m=Rg(p.body[0],`textord`);f=dv[Number(m.text)]}}else p=Rg(p,`textord`),f=dv[Number(p.text)];return uv({type:`genfrac`,mode:n.mode,numer:r,denom:i,continued:!1,hasBarLine:u,barSize:d,leftDelim:o,rightDelim:c},f)}}),Z({type:`infix`,names:[`\\above`],props:{numArgs:1,argTypes:[`size`],infix:!0},handler(e,t){var{parser:n,funcName:r,token:i}=e;return{type:`infix`,mode:n.mode,replaceWith:`\\\\abovefrac`,size:Rg(t[0],`size`).value,token:i}}}),Z({type:`genfrac`,names:[`\\\\abovefrac`],props:{numArgs:3,argTypes:[`math`,`size`,`math`]},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0],a=Rg(t[1],`infix`).size;if(!a)throw Error(`\\\\abovefrac expected size, but got `+String(a));var o=t[2],s=a.number>0;return{type:`genfrac`,mode:n.mode,numer:i,denom:o,continued:!1,hasBarLine:s,barSize:a,leftDelim:null,rightDelim:null}}});var pv=(e,t)=>{var n=t.style,r,i;e.type===`supsub`?(r=e.sup?ig(e.sup,t.havingStyle(n.sup()),t):ig(e.sub,t.havingStyle(n.sub()),t),i=Rg(e.base,`horizBrace`)):i=Rg(e,`horizBrace`);var a=ig(i.base,t.havingBaseStyle(Pp.DISPLAY)),o=Ng(i,t),s=i.isOver?jh({positionType:`firstBaseline`,children:[{type:`elem`,elem:a},{type:`kern`,size:.1},{type:`elem`,elem:o,wrapperClasses:[`svg-align`]}]}):jh({positionType:`bottom`,positionData:a.depth+.1+o.height,children:[{type:`elem`,elem:o,wrapperClasses:[`svg-align`]},{type:`kern`,size:.1},{type:`elem`,elem:a}]});if(r){var c=X([`minner`,i.isOver?`mover`:`munder`],[s],t);s=i.isOver?jh({positionType:`firstBaseline`,children:[{type:`elem`,elem:c},{type:`kern`,size:.2},{type:`elem`,elem:r}]}):jh({positionType:`bottom`,positionData:c.depth+.2+r.height+r.depth,children:[{type:`elem`,elem:r},{type:`kern`,size:.2},{type:`elem`,elem:c}]})}return X([`minner`,i.isOver?`mover`:`munder`],[s],t)};Z({type:`horizBrace`,names:[`\\overbrace`,`\\underbrace`,`\\overbracket`,`\\underbracket`],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e;return{type:`horizBrace`,mode:n.mode,label:r,isOver:r.includes(`\\over`),base:t[0]}},htmlBuilder:pv,mathmlBuilder:(e,t)=>{var n=Ag(e.label);return new Q(e.isOver?`mover`:`munder`,[yg(e.base,t),n])}}),Z({type:`href`,names:[`\\href`],props:{numArgs:2,argTypes:[`url`,`original`],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[1],i=Rg(t[0],`url`).url;return n.settings.isTrusted({command:`\\href`,url:i})?{type:`href`,mode:n.mode,href:i,body:qh(r)}:n.formatUnsupportedCmd(`\\href`)},htmlBuilder:(e,t)=>{var n=Qh(e.body,t,!1);return Dh(e.href,[],n,t)},mathmlBuilder:(e,t)=>{var n=vg(e.body,t);return n instanceof Q||(n=new Q(`mrow`,[n])),n.setAttribute(`href`,e.href),n}}),Z({type:`href`,names:[`\\url`],props:{numArgs:1,argTypes:[`url`],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=Rg(t[0],`url`).url;if(!n.settings.isTrusted({command:`\\url`,url:r}))return n.formatUnsupportedCmd(`\\url`);for(var i=[],a=0;a<r.length;a++){var o=r[a];o===`~`&&(o=`\\textasciitilde`),i.push({type:`textord`,mode:`text`,text:o})}var s={type:`text`,mode:n.mode,font:`\\texttt`,body:i};return{type:`href`,mode:n.mode,href:r,body:qh(s)}}}),Z({type:`hbox`,names:[`\\hbox`],props:{numArgs:1,argTypes:[`text`],allowedInText:!0,primitive:!0},handler(e,t){var{parser:n}=e;return{type:`hbox`,mode:n.mode,body:qh(t[0])}},htmlBuilder(e,t){return Oh(Qh(e.body,t.withFont(``),!1))},mathmlBuilder(e,t){return new Q(`mrow`,_g(e.body,t.withFont(``)))}}),Z({type:`html`,names:[`\\htmlClass`,`\\htmlId`,`\\htmlStyle`,`\\htmlData`],props:{numArgs:2,argTypes:[`raw`,`original`],allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r,token:i}=e,a=Rg(t[0],`raw`).string,o=t[1];n.settings.strict&&n.settings.reportNonstrict(`htmlExtension`,`HTML extension is disabled on strict mode`);var s,c={};switch(r){case`\\htmlClass`:c.class=a,s={command:`\\htmlClass`,class:a};break;case`\\htmlId`:c.id=a,s={command:`\\htmlId`,id:a};break;case`\\htmlStyle`:c.style=a,s={command:`\\htmlStyle`,style:a};break;case`\\htmlData`:for(var l=a.split(`,`),u=0;u<l.length;u++){var d=l[u],f=d.indexOf(`=`);if(f<0)throw new V(`\\htmlData key/value '`+d+`' missing equals sign`);var p=d.slice(0,f),m=d.slice(f+1);c[`data-`+p.trim()]=m}s={command:`\\htmlData`,attributes:c};break;default:throw Error(`Unrecognized html command`)}return n.settings.isTrusted(s)?{type:`html`,mode:n.mode,attributes:c,body:qh(o)}:n.formatUnsupportedCmd(r)},htmlBuilder:(e,t)=>{var n=Qh(e.body,t,!1),r=[`enclosing`];e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var i=X(r,n,t);for(var a in e.attributes)a!==`class`&&e.attributes.hasOwnProperty(a)&&i.setAttribute(a,e.attributes[a]);return i},mathmlBuilder:(e,t)=>vg(e.body,t)}),Z({type:`htmlmathml`,names:[`\\html@mathml`],props:{numArgs:2,allowedInArgument:!0,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e;return{type:`htmlmathml`,mode:n.mode,html:qh(t[0]),mathml:qh(t[1])}},htmlBuilder:(e,t)=>Oh(Qh(e.html,t,!1)),mathmlBuilder:(e,t)=>vg(e.mathml,t)});var mv=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:`bp`};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!t)throw new V(`Invalid size: '`+e+`' in \\includegraphics`);var n={number:+(t[1]+t[2]),unit:t[3]};if(!nm(n))throw new V(`Invalid unit: '`+n.unit+`' in \\includegraphics.`);return n};Z({type:`includegraphics`,names:[`\\includegraphics`],props:{numArgs:1,numOptionalArgs:1,argTypes:[`raw`,`url`],allowedInText:!1},handler:(e,t,n)=>{var{parser:r}=e,i={number:0,unit:`em`},a={number:.9,unit:`em`},o={number:0,unit:`em`},s=``;if(n[0])for(var c=Rg(n[0],`raw`).string.split(`,`),l=0;l<c.length;l++){var u=c[l].split(`=`);if(u.length===2){var d=u[1].trim();switch(u[0].trim()){case`alt`:s=d;break;case`width`:i=mv(d);break;case`height`:a=mv(d);break;case`totalheight`:o=mv(d);break;default:throw new V(`Invalid key: '`+u[0]+`' in \\includegraphics.`)}}}var f=Rg(t[0],`url`).url;return s===``&&(s=f,s=s.replace(/^.*[\\/]/,``),s=s.substring(0,s.lastIndexOf(`.`))),r.settings.isTrusted({command:`\\includegraphics`,url:f})?{type:`includegraphics`,mode:r.mode,alt:s,width:i,height:a,totalheight:o,src:f}:r.formatUnsupportedCmd(`\\includegraphics`)},htmlBuilder:(e,t)=>{var n=rm(e.height,t),r=0;e.totalheight.number>0&&(r=rm(e.totalheight,t)-n);var i=0;e.width.number>0&&(i=rm(e.width,t));var a={height:H(n+r)};i>0&&(a.width=H(i)),r>0&&(a.verticalAlign=H(-r));var o=new fm(e.src,e.alt,a);return o.height=n,o.depth=r,o},mathmlBuilder:(e,t)=>{var n=new Q(`mglyph`,[]);n.setAttribute(`alt`,e.alt);var r=rm(e.height,t),i=0;if(e.totalheight.number>0&&(i=rm(e.totalheight,t)-r,n.setAttribute(`valign`,H(-i))),n.setAttribute(`height`,H(r+i)),e.width.number>0){var a=rm(e.width,t);n.setAttribute(`width`,H(a))}return n.setAttribute(`src`,e.src),n}}),Z({type:`kern`,names:[`\\kern`,`\\mkern`,`\\hskip`,`\\mskip`],props:{numArgs:1,argTypes:[`size`],primitive:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e,i=Rg(t[0],`size`);if(n.settings.strict){var a=r[1]===`m`,o=i.value.unit===`mu`;a?(o||n.settings.reportNonstrict(`mathVsTextUnits`,`LaTeX's `+r+` supports only mu units, `+(`not `+i.value.unit+` units`)),n.mode!==`math`&&n.settings.reportNonstrict(`mathVsTextUnits`,`LaTeX's `+r+` works only in math mode`)):o&&n.settings.reportNonstrict(`mathVsTextUnits`,`LaTeX's `+r+` doesn't support mu units`)}return{type:`kern`,mode:n.mode,dimension:i.value}},htmlBuilder(e,t){return Mh(e.dimension,t)},mathmlBuilder(e,t){return new lg(rm(e.dimension,t))}}),Z({type:`lap`,names:[`\\mathllap`,`\\mathrlap`,`\\mathclap`],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:`lap`,mode:n.mode,alignment:r.slice(5),body:i}},htmlBuilder:(e,t)=>{var n;e.alignment===`clap`?(n=X([],[ig(e.body,t)]),n=X([`inner`],[n],t)):n=X([`inner`],[ig(e.body,t)]);var r=X([`fix`],[]),i=X([e.alignment],[n,r],t),a=X([`strut`]);return a.style.height=H(i.height+i.depth),i.depth&&(a.style.verticalAlign=H(-i.depth)),i.children.unshift(a),i=X([`thinbox`],[i],t),X([`mord`,`vbox`],[i],t)},mathmlBuilder:(e,t)=>{var n=new Q(`mpadded`,[yg(e.body,t)]);if(e.alignment!==`rlap`){var r=e.alignment===`llap`?`-1`:`-0.5`;n.setAttribute(`lspace`,r+`width`)}return n.setAttribute(`width`,`0px`),n}}),Z({type:`styling`,names:[`\\(`,`$`],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){var{funcName:n,parser:r}=e,i=r.mode;r.switchMode(`math`);var a=n===`\\(`?`\\)`:`$`,o=r.parseExpression(!1,a);return r.expect(a),r.switchMode(i),{type:`styling`,mode:r.mode,style:`text`,resetFont:!0,body:o}}}),Z({type:`text`,names:[`\\)`,`\\]`],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){throw new V(`Mismatched `+e.funcName)}});var hv=(e,t)=>{switch(t.style.size){case Pp.DISPLAY.size:return e.display;case Pp.TEXT.size:return e.text;case Pp.SCRIPT.size:return e.script;case Pp.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};Z({type:`mathchoice`,names:[`\\mathchoice`],props:{numArgs:4,primitive:!0},handler:(e,t)=>{var{parser:n}=e;return{type:`mathchoice`,mode:n.mode,display:qh(t[0]),text:qh(t[1]),script:qh(t[2]),scriptscript:qh(t[3])}},htmlBuilder:(e,t)=>Oh(Qh(hv(e,t),t,!1)),mathmlBuilder:(e,t)=>vg(hv(e,t),t)});var gv=(e,t,n,r,i,a,o)=>{e=X([],[e]);var s=n&&dp(n),c,l;if(t){var u=ig(t,r.havingStyle(i.sup()),r);l={elem:u,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-u.depth)}}if(n){var d=ig(n,r.havingStyle(i.sub()),r);c={elem:d,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-d.height)}}var f;if(l&&c)f=jh({positionType:`bottom`,positionData:r.fontMetrics().bigOpSpacing5+c.elem.height+c.elem.depth+c.kern+e.depth+o,children:[{type:`kern`,size:r.fontMetrics().bigOpSpacing5},{type:`elem`,elem:c.elem,marginLeft:H(-a)},{type:`kern`,size:c.kern},{type:`elem`,elem:e},{type:`kern`,size:l.kern},{type:`elem`,elem:l.elem,marginLeft:H(a)},{type:`kern`,size:r.fontMetrics().bigOpSpacing5}]});else if(c)f=jh({positionType:`top`,positionData:e.height-o,children:[{type:`kern`,size:r.fontMetrics().bigOpSpacing5},{type:`elem`,elem:c.elem,marginLeft:H(-a)},{type:`kern`,size:c.kern},{type:`elem`,elem:e}]});else if(l)f=jh({positionType:`bottom`,positionData:e.depth+o,children:[{type:`elem`,elem:e},{type:`kern`,size:l.kern},{type:`elem`,elem:l.elem,marginLeft:H(a)},{type:`kern`,size:r.fontMetrics().bigOpSpacing5}]});else return e;var p=[f];if(c&&a!==0&&!s){var m=X([`mspace`],[],r);m.style.marginRight=H(a),p.unshift(m)}return X([`mop`,`op-limits`],p,r)},_v=new Set([`\\smallint`]),vv=(e,t)=>{var n,r,i=!1,a;e.type===`supsub`?(n=e.sup,r=e.sub,a=Rg(e.base,`op`),i=!0):a=Rg(e,`op`);var o=t.style,s=!1;o.size===Pp.DISPLAY.size&&a.symbol&&!_v.has(a.name)&&(s=!0);var c,l;if(a.symbol){var u=s?`Size2-Regular`:`Size1-Regular`,d=``;if((a.name===`\\oiint`||a.name===`\\oiiint`)&&(d=a.name.slice(1),a.name=d===`oiint`?`\\iint`:`\\iiint`),c=vh(a.name,u,`math`,t,[`mop`,`op-symbol`,s?`large-op`:`small-op`]),l=c.italic,d.length>0){var f=Ih(d+`Size`+(s?`2`:`1`),t);c=jh({positionType:`individualShift`,children:[{type:`elem`,elem:c,shift:0},{type:`elem`,elem:f,shift:s?.08:0}]}),a.name=`\\`+d,c.classes.unshift(`mop`),c.italic=l}}else if(a.body){var p=Qh(a.body,t,!0);p.length===1&&p[0]instanceof mm?(c=p[0],c.classes[0]=`mop`):c=X([`mop`],p,t)}else{for(var m=[],h=1;h<a.name.length;h++)m.push(yh(a.name[h],a.mode,t));c=X([`mop`],m,t)}var g=0,_=0;return(c instanceof mm||a.name===`\\oiint`||a.name===`\\oiiint`)&&!a.suppressBaseShift&&(g=(c.height-c.depth)/2-t.fontMetrics().axisHeight,_=c.italic??0),i?gv(c,n,r,t,o,_,g):(g&&(c.style.position=`relative`,c.style.top=H(g)),c)},yv=(e,t)=>{var n;if(e.symbol)n=new Q(`mo`,[fg(e.name,e.mode)]),_v.has(e.name)&&n.setAttribute(`largeop`,`false`);else if(e.body)n=new Q(`mo`,_g(e.body,t));else{n=new Q(`mi`,[new cg(e.name.slice(1))]);var r=new Q(`mo`,[fg(`⁡`,`text`)]);n=e.parentIsSupSub?new Q(`mrow`,[n,r]):sg([n,r])}return n},bv={"∏":`\\prod`,"∐":`\\coprod`,"∑":`\\sum`,"⋀":`\\bigwedge`,"⋁":`\\bigvee`,"⋂":`\\bigcap`,"⋃":`\\bigcup`,"⨀":`\\bigodot`,"⨁":`\\bigoplus`,"⨂":`\\bigotimes`,"⨄":`\\biguplus`,"⨆":`\\bigsqcup`};Z({type:`op`,names:`\\coprod.\\bigvee.\\bigwedge.\\biguplus.\\bigcap.\\bigcup.\\intop.\\prod.\\sum.\\bigotimes.\\bigoplus.\\bigodot.\\bigsqcup.\\smallint.∏.∐.∑.⋀.⋁.⋂.⋃.⨀.⨁.⨂.⨄.⨆`.split(`.`),props:{numArgs:0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=r;return i.length===1&&(i=bv[i]),{type:`op`,mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:vv,mathmlBuilder:yv}),Z({type:`op`,names:[`\\mathop`],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:`op`,mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:qh(r)}},htmlBuilder:vv,mathmlBuilder:yv});var xv={"∫":`\\int`,"∬":`\\iint`,"∭":`\\iiint`,"∮":`\\oint`,"∯":`\\oiint`,"∰":`\\oiiint`};Z({type:`op`,names:`\\arcsin.\\arccos.\\arctan.\\arctg.\\arcctg.\\arg.\\ch.\\cos.\\cosec.\\cosh.\\cot.\\cotg.\\coth.\\csc.\\ctg.\\cth.\\deg.\\dim.\\exp.\\hom.\\ker.\\lg.\\ln.\\log.\\sec.\\sin.\\sinh.\\sh.\\tan.\\tanh.\\tg.\\th`.split(`.`),props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:`op`,mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:vv,mathmlBuilder:yv}),Z({type:`op`,names:[`\\det`,`\\gcd`,`\\inf`,`\\lim`,`\\max`,`\\min`,`\\Pr`,`\\sup`],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:`op`,mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:vv,mathmlBuilder:yv}),Z({type:`op`,names:[`\\int`,`\\iint`,`\\iiint`,`\\oint`,`\\oiint`,`\\oiiint`,`∫`,`∬`,`∭`,`∮`,`∯`,`∰`],props:{numArgs:0,allowedInArgument:!0},handler(e){var{parser:t,funcName:n}=e,r=n;return r.length===1&&(r=xv[r]),{type:`op`,mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:vv,mathmlBuilder:yv});var Sv=(e,t)=>{var n,r,i=!1,a;e.type===`supsub`?(n=e.sup,r=e.sub,a=Rg(e.base,`operatorname`),i=!0):a=Rg(e,`operatorname`);var o;if(a.body.length>0){for(var s=Qh(a.body.map(e=>{var t=`text`in e?e.text:void 0;return typeof t==`string`?{type:`textord`,mode:e.mode,text:t}:e}),t.withFont(`mathrm`),!0),c=0;c<s.length;c++){var l=s[c];l instanceof mm&&(l.text=l.text.replace(/\u2212/,`-`).replace(/\u2217/,`*`))}o=X([`mop`],s,t)}else o=X([`mop`],[],t);return i?gv(o,n,r,t,t.style,0,0):o};Z({type:`operatorname`,names:[`\\operatorname@`,`\\operatornamewithlimits`],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:`operatorname`,mode:n.mode,body:qh(i),alwaysHandleSupSub:r===`\\operatornamewithlimits`,limits:!1,parentIsSupSub:!1}},htmlBuilder:Sv,mathmlBuilder:(e,t)=>{for(var n=_g(e.body,t.withFont(`mathrm`)),r=!0,i=0;i<n.length;i++){var a=n[i];if(!(a instanceof lg))if(a instanceof Q)switch(a.type){case`mi`:case`mn`:case`mspace`:case`mtext`:break;case`mo`:var o=a.children[0];a.children.length===1&&o instanceof cg?o.text=o.text.replace(/\u2212/,`-`).replace(/\u2217/,`*`):r=!1;break;default:r=!1}else r=!1}r&&(n=[new cg(n.map(e=>e.toText()).join(``))]);var s=new Q(`mi`,n);s.setAttribute(`mathvariant`,`normal`);var c=new Q(`mo`,[fg(`⁡`,`text`)]);return e.parentIsSupSub?new Q(`mrow`,[s,c]):sg([s,c])}}),$(`\\operatorname`,`\\@ifstar\\operatornamewithlimits\\operatorname@`),Gh({type:`ordgroup`,htmlBuilder(e,t){return e.semisimple?Oh(Qh(e.body,t,!1)):X([`mord`],Qh(e.body,t,!0),t)},mathmlBuilder(e,t){return vg(e.body,t,!0)}}),Z({type:`overline`,names:[`\\overline`],props:{numArgs:1},handler(e,t){var{parser:n}=e,r=t[0];return{type:`overline`,mode:n.mode,body:r}},htmlBuilder(e,t){var n=ig(e.body,t.havingCrampedStyle()),r=Eh(`overline-line`,t),i=t.fontMetrics().defaultRuleThickness;return X([`mord`,`overline`],[jh({positionType:`firstBaseline`,children:[{type:`elem`,elem:n},{type:`kern`,size:3*i},{type:`elem`,elem:r},{type:`kern`,size:i}]})],t)},mathmlBuilder(e,t){var n=new Q(`mo`,[new cg(`‾`)]);n.setAttribute(`stretchy`,`true`);var r=new Q(`mover`,[yg(e.body,t),n]);return r.setAttribute(`accent`,`true`),r}}),Z({type:`phantom`,names:[`\\phantom`],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:`phantom`,mode:n.mode,body:qh(r)}},htmlBuilder:(e,t)=>Oh(Qh(e.body,t.withPhantom(),!1)),mathmlBuilder:(e,t)=>new Q(`mphantom`,_g(e.body,t))}),$(`\\hphantom`,`\\smash{\\phantom{#1}}`),Z({type:`vphantom`,names:[`\\vphantom`],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:`vphantom`,mode:n.mode,body:r}},htmlBuilder:(e,t)=>X([`mord`,`rlap`],[X([`inner`],[ig(e.body,t.withPhantom())]),X([`fix`],[])],t),mathmlBuilder:(e,t)=>{var n=new Q(`mpadded`,[new Q(`mphantom`,_g(qh(e.body),t))]);return n.setAttribute(`width`,`0px`),n}}),Z({type:`raisebox`,names:[`\\raisebox`],props:{numArgs:2,argTypes:[`size`,`hbox`],allowedInText:!0},handler(e,t){var{parser:n}=e,r=Rg(t[0],`size`).value,i=t[1];return{type:`raisebox`,mode:n.mode,dy:r,body:i}},htmlBuilder(e,t){var n=ig(e.body,t);return jh({positionType:`shift`,positionData:-rm(e.dy,t),children:[{type:`elem`,elem:n}]})},mathmlBuilder(e,t){var n=new Q(`mpadded`,[yg(e.body,t)]),r=e.dy.number+e.dy.unit;return n.setAttribute(`voffset`,r),n}}),Z({type:`internal`,names:[`\\relax`],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(e){var{parser:t}=e;return{type:`internal`,mode:t.mode}}}),Z({type:`rule`,names:[`\\rule`],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:[`size`,`size`,`size`]},handler(e,t,n){var{parser:r}=e,i=n[0],a=Rg(t[0],`size`),o=Rg(t[1],`size`);return{type:`rule`,mode:r.mode,shift:i&&Rg(i,`size`).value,width:a.value,height:o.value}},htmlBuilder(e,t){var n=X([`mord`,`rule`],[],t),r=rm(e.width,t),i=rm(e.height,t),a=e.shift?rm(e.shift,t):0;return n.style.borderRightWidth=H(r),n.style.borderTopWidth=H(i),n.style.bottom=H(a),n.width=r,n.height=i+a,n.depth=-a,n.maxFontSize=i*1.125*t.sizeMultiplier,n},mathmlBuilder(e,t){var n=rm(e.width,t),r=rm(e.height,t),i=e.shift?rm(e.shift,t):0,a=t.color&&t.getColor()||`black`,o=new Q(`mspace`);o.setAttribute(`mathbackground`,a),o.setAttribute(`width`,H(n)),o.setAttribute(`height`,H(r));var s=new Q(`mpadded`,[o]);return i>=0?s.setAttribute(`height`,H(i)):(s.setAttribute(`height`,H(i)),s.setAttribute(`depth`,H(-i))),s.setAttribute(`voffset`,H(i)),s}});function Cv(e,t,n){for(var r=Qh(e,t,!1),i=t.sizeMultiplier/n.sizeMultiplier,a=0;a<r.length;a++){var o=r[a].classes.indexOf(`sizing`);o<0?Array.prototype.push.apply(r[a].classes,t.sizingClasses(n)):r[a].classes[o+1]===`reset-size`+t.size&&(r[a].classes[o+1]=`reset-size`+n.size),r[a].height*=i,r[a].depth*=i}return Oh(r)}var wv=[`\\tiny`,`\\sixptsize`,`\\scriptsize`,`\\footnotesize`,`\\small`,`\\normalsize`,`\\large`,`\\Large`,`\\LARGE`,`\\huge`,`\\Huge`];Z({type:`sizing`,names:wv,props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{breakOnTokenText:n,funcName:r,parser:i}=e,a=i.parseExpression(!1,n);return{type:`sizing`,mode:i.mode,size:wv.indexOf(r)+1,body:a}},htmlBuilder:(e,t)=>{var n=t.havingSize(e.size);return Cv(e.body,n,t)},mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),r=new Q(`mstyle`,_g(e.body,n));return r.setAttribute(`mathsize`,H(n.sizeMultiplier)),r}}),Z({type:`smash`,names:[`\\smash`],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,t,n)=>{var{parser:r}=e,i=!1,a=!1,o=n[0]&&Rg(n[0],`ordgroup`);if(o)for(var s,c=0;c<o.body.length;++c){var l=o.body[c];if(s=zg(l).text,s===`t`)i=!0;else if(s===`b`)a=!0;else{i=!1,a=!1;break}}else i=!0,a=!0;var u=t[0];return{type:`smash`,mode:r.mode,body:u,smashHeight:i,smashDepth:a}},htmlBuilder:(e,t)=>{var n=X([],[ig(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return n;if(e.smashHeight&&(n.height=0),e.smashDepth&&(n.depth=0),e.smashHeight&&e.smashDepth)return X([`mord`,`smash`],[n],t);if(n.children)for(var r=0;r<n.children.length;r++)e.smashHeight&&(n.children[r].height=0),e.smashDepth&&(n.children[r].depth=0);return X([`mord`],[jh({positionType:`firstBaseline`,children:[{type:`elem`,elem:n}]})],t)},mathmlBuilder:(e,t)=>{var n=new Q(`mpadded`,[yg(e.body,t)]);return e.smashHeight&&n.setAttribute(`height`,`0px`),e.smashDepth&&n.setAttribute(`depth`,`0px`),n}}),Z({type:`sqrt`,names:[`\\sqrt`],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:r}=e,i=n[0],a=t[0];return{type:`sqrt`,mode:r.mode,body:a,index:i}},htmlBuilder(e,t){var n=ig(e.body,t.havingCrampedStyle());n.height===0&&(n.height=t.fontMetrics().xHeight),n=kh(n,t);var r=t.fontMetrics().defaultRuleThickness,i=r;t.style.id<Pp.TEXT.id&&(i=t.fontMetrics().xHeight);var a=r+i/4,{span:o,ruleWidth:s,advanceWidth:c}=C_(n.height+n.depth+a+r,t),l=o.height-s;l>n.height+n.depth+a&&(a=(a+l-n.height-n.depth)/2);var u=o.height-n.height-a-s;n.style.paddingLeft=H(c);var d=jh({positionType:`firstBaseline`,children:[{type:`elem`,elem:n,wrapperClasses:[`svg-align`]},{type:`kern`,size:-(n.height+u)},{type:`elem`,elem:o},{type:`kern`,size:s}]});if(e.index){var f=t.havingStyle(Pp.SCRIPTSCRIPT),p=ig(e.index,f,t);return X([`mord`,`sqrt`],[X([`root`],[jh({positionType:`shift`,positionData:-(.6*(d.height-d.depth)),children:[{type:`elem`,elem:p}]})]),d],t)}else return X([`mord`,`sqrt`],[d],t)},mathmlBuilder(e,t){var{body:n,index:r}=e;return r?new Q(`mroot`,[yg(n,t),yg(r,t)]):new Q(`msqrt`,[yg(n,t)])}});var Tv={display:Pp.DISPLAY,text:Pp.TEXT,script:Pp.SCRIPT,scriptscript:Pp.SCRIPTSCRIPT};function Ev(e){return e in Tv}Z({type:`styling`,names:[`\\displaystyle`,`\\textstyle`,`\\scriptstyle`,`\\scriptscriptstyle`],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,t){var{breakOnTokenText:n,funcName:r,parser:i}=e,a=i.parseExpression(!0,n),o=r.slice(1,r.length-5);if(!Ev(o))throw Error(`Unknown style: `+o);return{type:`styling`,mode:i.mode,style:o,body:a}},htmlBuilder(e,t){var n=Tv[e.style],r=t.havingStyle(n);return e.resetFont&&(r=r.withFont(``)),Cv(e.body,r,t)},mathmlBuilder(e,t){var n=Tv[e.style],r=t.havingStyle(n);e.resetFont&&(r=r.withFont(``));var i=new Q(`mstyle`,_g(e.body,r)),a={display:[`0`,`true`],text:[`0`,`false`],script:[`1`,`false`],scriptscript:[`2`,`false`]}[e.style];return i.setAttribute(`scriptlevel`,a[0]),i.setAttribute(`displaystyle`,a[1]),i}});var Dv=function(e,t){var n=e.base;return n?n.type===`op`?n.limits&&(t.style.size===Pp.DISPLAY.size||n.alwaysHandleSupSub)?vv:null:n.type===`operatorname`?n.alwaysHandleSupSub&&(t.style.size===Pp.DISPLAY.size||n.limits)?Sv:null:n.type===`accent`?dp(n.base)?Hg:null:n.type===`horizBrace`&&!e.sub===n.isOver?pv:null:null};Gh({type:`supsub`,htmlBuilder(e,t){var n=Dv(e,t);if(n)return n(e,t);var{base:r,sup:i,sub:a}=e,o=ig(r,t),s,c,l=t.fontMetrics(),u=0,d=0,f=r&&dp(r);if(i){var p=t.havingStyle(t.style.sup());s=ig(i,p,t),f||(u=o.height-p.fontMetrics().supDrop*p.sizeMultiplier/t.sizeMultiplier)}if(a){var m=t.havingStyle(t.style.sub());c=ig(a,m,t),f||(d=o.depth+m.fontMetrics().subDrop*m.sizeMultiplier/t.sizeMultiplier)}var h=t.style===Pp.DISPLAY?l.sup1:t.style.cramped?l.sup3:l.sup2,g=t.sizeMultiplier,_=H(.5/l.ptPerEm/g),v=null;if(c){var y=e.base&&e.base.type===`op`&&e.base.name&&(e.base.name===`\\oiint`||e.base.name===`\\oiiint`);(o instanceof mm||y)&&(v=H(-(o.italic??0)))}var b;if(s&&c){u=Math.max(u,h,s.depth+.25*l.xHeight),d=Math.max(d,l.sub2);var x=4*l.defaultRuleThickness;if(u-s.depth-(c.height-d)<x){d=x-(u-s.depth)+c.height;var S=.8*l.xHeight-(u-s.depth);S>0&&(u+=S,d-=S)}b=jh({positionType:`individualShift`,children:[{type:`elem`,elem:c,shift:d,marginRight:_,marginLeft:v},{type:`elem`,elem:s,shift:-u,marginRight:_}]})}else if(c)d=Math.max(d,l.sub1,c.height-.8*l.xHeight),b=jh({positionType:`shift`,positionData:d,children:[{type:`elem`,elem:c,marginLeft:v,marginRight:_}]});else if(s)u=Math.max(u,h,s.depth+.25*l.xHeight),b=jh({positionType:`shift`,positionData:-u,children:[{type:`elem`,elem:s,marginRight:_}]});else throw Error(`supsub must have either sup or sub.`);return X([ng(o,`right`)||`mord`],[o,X([`msupsub`],[b])],t)},mathmlBuilder(e,t){var n=!1,r,i;e.base&&e.base.type===`horizBrace`&&(i=!!e.sup,i===e.base.isOver&&(n=!0,r=e.base.isOver)),e.base&&(e.base.type===`op`||e.base.type===`operatorname`)&&(e.base.parentIsSupSub=!0);var a=[yg(e.base,t)];e.sub&&a.push(yg(e.sub,t)),e.sup&&a.push(yg(e.sup,t));var o;if(n)o=r?`mover`:`munder`;else if(!e.sub){var s=e.base;o=s&&s.type===`op`&&s.limits&&(t.style===Pp.DISPLAY||s.alwaysHandleSupSub)||s&&s.type===`operatorname`&&s.alwaysHandleSupSub&&(s.limits||t.style===Pp.DISPLAY)?`mover`:`msup`}else if(e.sup){var c=e.base;o=c&&c.type===`op`&&c.limits&&t.style===Pp.DISPLAY||c&&c.type===`operatorname`&&c.alwaysHandleSupSub&&(t.style===Pp.DISPLAY||c.limits)?`munderover`:`msubsup`}else{var l=e.base;o=l&&l.type===`op`&&l.limits&&(t.style===Pp.DISPLAY||l.alwaysHandleSupSub)||l&&l.type===`operatorname`&&l.alwaysHandleSupSub&&(l.limits||t.style===Pp.DISPLAY)?`munder`:`msub`}return new Q(o,a)}}),Gh({type:`atom`,htmlBuilder(e,t){return yh(e.text,e.mode,t,[`m`+e.family])},mathmlBuilder(e,t){var n=new Q(`mo`,[fg(e.text,e.mode)]);if(e.family===`bin`){var r=hg(e,t);r===`bold-italic`&&n.setAttribute(`mathvariant`,r)}else e.family===`punct`?n.setAttribute(`separator`,`true`):(e.family===`open`||e.family===`close`)&&n.setAttribute(`stretchy`,`false`);return n}});var Ov={mi:`italic`,mn:`normal`,mtext:`normal`};Gh({type:`mathord`,htmlBuilder(e,t){return xh(e,t,`mathord`)},mathmlBuilder(e,t){var n=new Q(`mi`,[fg(e.text,e.mode,t)]),r=hg(e,t)||`italic`;return r!==Ov[n.type]&&n.setAttribute(`mathvariant`,r),n}}),Gh({type:`textord`,htmlBuilder(e,t){return xh(e,t,`textord`)},mathmlBuilder(e,t){var n=fg(e.text,e.mode,t),r=hg(e,t)||`normal`,i=e.mode===`text`?new Q(`mtext`,[n]):/[0-9]/.test(e.text)?new Q(`mn`,[n]):e.text===`\\prime`?new Q(`mo`,[n]):new Q(`mi`,[n]);return r!==Ov[i.type]&&i.setAttribute(`mathvariant`,r),i}});var kv={"\\nobreak":`nobreak`,"\\allowbreak":`allowbreak`},Av={" ":{},"\\ ":{},"~":{className:`nobreak`},"\\space":{},"\\nobreakspace":{className:`nobreak`}};Gh({type:`spacing`,htmlBuilder(e,t){if(Av.hasOwnProperty(e.text)){var n=Av[e.text].className||``;if(e.mode===`text`){var r=xh(e,t,`textord`);return r.classes.push(n),r}else return X([`mspace`,n],[yh(e.text,e.mode,t)],t)}else if(kv.hasOwnProperty(e.text))return X([`mspace`,kv[e.text]],[],t);else throw new V(`Unknown type of space "`+e.text+`"`)},mathmlBuilder(e,t){var n;if(Av.hasOwnProperty(e.text))n=new Q(`mtext`,[new cg(`\xA0`)]);else if(kv.hasOwnProperty(e.text))return new Q(`mspace`);else throw new V(`Unknown type of space "`+e.text+`"`);return n}});var jv=()=>{var e=new Q(`mtd`,[]);return e.setAttribute(`width`,`50%`),e};Gh({type:`tag`,mathmlBuilder(e,t){var n=new Q(`mtable`,[new Q(`mtr`,[jv(),new Q(`mtd`,[vg(e.body,t)]),jv(),new Q(`mtd`,[vg(e.tag,t)])])]);return n.setAttribute(`width`,`100%`),n}});var Mv={"\\text":void 0,"\\textrm":`textrm`,"\\textsf":`textsf`,"\\texttt":`texttt`,"\\textnormal":`textrm`},Nv={"\\textbf":`textbf`,"\\textmd":`textmd`},Pv={"\\textit":`textit`,"\\textup":`textup`},Fv=(e,t)=>{var n=e.font;return n?Mv[n]?t.withTextFontFamily(Mv[n]):Nv[n]?t.withTextFontWeight(Nv[n]):n===`\\emph`?t.fontShape===`textit`?t.withTextFontShape(`textup`):t.withTextFontShape(`textit`):t.withTextFontShape(Pv[n]):t};Z({type:`text`,names:[`\\text`,`\\textrm`,`\\textsf`,`\\texttt`,`\\textnormal`,`\\textbf`,`\\textmd`,`\\textit`,`\\textup`,`\\emph`],props:{numArgs:1,argTypes:[`text`],allowedInArgument:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:`text`,mode:n.mode,body:qh(i),font:r}},htmlBuilder(e,t){var n=Fv(e,t);return X([`mord`,`text`],Qh(e.body,n,!0),n)},mathmlBuilder(e,t){var n=Fv(e,t);return vg(e.body,n)}}),Z({type:`underline`,names:[`\\underline`],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:`underline`,mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=ig(e.body,t),r=Eh(`underline-line`,t),i=t.fontMetrics().defaultRuleThickness;return X([`mord`,`underline`],[jh({positionType:`top`,positionData:n.height,children:[{type:`kern`,size:i},{type:`elem`,elem:r},{type:`kern`,size:3*i},{type:`elem`,elem:n}]})],t)},mathmlBuilder(e,t){var n=new Q(`mo`,[new cg(`‾`)]);n.setAttribute(`stretchy`,`true`);var r=new Q(`munder`,[yg(e.body,t),n]);return r.setAttribute(`accentunder`,`true`),r}}),Z({type:`vcenter`,names:[`\\vcenter`],props:{numArgs:1,argTypes:[`original`],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:`vcenter`,mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=ig(e.body,t),r=t.fontMetrics().axisHeight;return jh({positionType:`shift`,positionData:.5*(n.height-r-(n.depth+r)),children:[{type:`elem`,elem:n}]})},mathmlBuilder(e,t){return new Q(`mrow`,[new Q(`mpadded`,[yg(e.body,t)],[`vcenter`])])}}),Z({type:`verb`,names:[`\\verb`],props:{numArgs:0,allowedInText:!0},handler(e,t,n){throw new V(`\\verb ended by end of line instead of matching delimiter`)},htmlBuilder(e,t){for(var n=Iv(e),r=[],i=t.havingStyle(t.style.text()),a=0;a<n.length;a++){var o=n[a];o===`~`&&(o=`\\textasciitilde`),r.push(vh(o,`Typewriter-Regular`,e.mode,i,[`mord`,`texttt`]))}return X([`mord`,`text`].concat(i.sizingClasses(t)),Ch(r),i)},mathmlBuilder(e,t){var n=new Q(`mtext`,[new cg(Iv(e))]);return n.setAttribute(`mathvariant`,`monospace`),n}});var Iv=e=>e.body.replace(/ /g,e.star?`␣`:`\xA0`),Lv=Hh,Rv=`[ \r
286
+ ]`,zv=`\\\\[a-zA-Z@]+`,Bv=`\\\\[^\ud800-\udfff]`,Vv=`(`+zv+`)`+Rv+`*`,Hv=`\\\\(
287
+ |[ \r ]+
288
+ ?)[ \r ]*`,Uv=`[̀-ͯ]`,Wv=RegExp(Uv+`+$`),Gv=`(`+Rv+`+)|`+(Hv+`|`)+`([!-\\[\\]-‧‪-퟿豈-￿]`+(Uv+`*`)+`|[\ud800-\udbff][\udc00-\udfff]`+(Uv+`*`)+`|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5`+(`|`+Vv)+(`|`+Bv+`)`),Kv=class{constructor(e,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=t,this.tokenRegex=new RegExp(Gv,`g`),this.catcodes={"%":14,"~":13}}setCatcode(e,t){this.catcodes[e]=t}lex(){var e=this.input,t=this.tokenRegex.lastIndex;if(t===e.length)return new q_(`EOF`,new K_(this,t,t));var n=this.tokenRegex.exec(e);if(n===null||n.index!==t)throw new V(`Unexpected character: '`+e[t]+`'`,new q_(e[t],new K_(this,t,t+1)));var r=n[6]||n[3]||(n[2]?`\\ `:` `);if(this.catcodes[r]===14){var i=e.indexOf(`
289
+ `,this.tokenRegex.lastIndex);return i===-1?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict(`commentAtEnd`,`% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)`)):this.tokenRegex.lastIndex=i+1,this.lex()}return new q_(r,new K_(this,t,this.tokenRegex.lastIndex))}},qv=class{constructor(e,t){e===void 0&&(e={}),t===void 0&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new V(`Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug`);var e=this.undefStack.pop();for(var t in e)e.hasOwnProperty(t)&&(e[t]==null?delete this.current[t]:this.current[t]=e[t])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,t,n){if(n===void 0&&(n=!1),n){for(var r=0;r<this.undefStack.length;r++)delete this.undefStack[r][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{var i=this.undefStack[this.undefStack.length-1];i&&!i.hasOwnProperty(e)&&(i[e]=this.current[e])}t==null?delete this.current[e]:this.current[e]=t}},Jv=G_;$(`\\noexpand`,function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}}),$(`\\expandafter`,function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}}),$(`\\@firstoftwo`,function(e){return{tokens:e.consumeArgs(2)[0],numArgs:0}}),$(`\\@secondoftwo`,function(e){return{tokens:e.consumeArgs(2)[1],numArgs:0}}),$(`\\@ifnextchar`,function(e){var t=e.consumeArgs(3);e.consumeSpaces();var n=e.future();return t[0].length===1&&t[0][0].text===n.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}}),$(`\\@ifstar`,`\\@ifnextchar *{\\@firstoftwo{#1}}`),$(`\\TextOrMath`,function(e){var t=e.consumeArgs(2);return e.mode===`text`?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}});var Yv={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};$(`\\char`,function(e){var t=e.popToken(),n,r=0;if(t.text===`'`)n=8,t=e.popToken();else if(t.text===`"`)n=16,t=e.popToken();else if(t.text==="`")if(t=e.popToken(),t.text[0]===`\\`)r=t.text.charCodeAt(1);else if(t.text===`EOF`)throw new V("\\char` missing argument");else r=t.text.charCodeAt(0);else n=10;if(n){if(r=Yv[t.text],r==null||r>=n)throw new V(`Invalid base-`+n+` digit `+t.text);for(var i;(i=Yv[e.future().text])!=null&&i<n;)r*=n,r+=i,e.popToken()}return`\\@char{`+r+`}`});var Xv=(e,t,n,r)=>{var i=e.consumeArg().tokens;if(i.length!==1)throw new V(`\\newcommand's first argument must be a macro name`);var a=i[0].text,o=e.isDefined(a);if(o&&!t)throw new V(`\\newcommand{`+a+`} attempting to redefine `+(a+`; use \\renewcommand`));if(!o&&!n)throw new V(`\\renewcommand{`+a+`} when command `+a+` does not yet exist; use \\newcommand`);var s=0;if(i=e.consumeArg().tokens,i.length===1&&i[0].text===`[`){for(var c=``,l=e.expandNextToken();l.text!==`]`&&l.text!==`EOF`;)c+=l.text,l=e.expandNextToken();if(!c.match(/^\s*[0-9]+\s*$/))throw new V(`Invalid number of arguments: `+c);s=parseInt(c),i=e.consumeArg().tokens}return o&&r||e.macros.set(a,{tokens:i,numArgs:s}),``};$(`\\newcommand`,e=>Xv(e,!1,!0,!1)),$(`\\renewcommand`,e=>Xv(e,!0,!1,!1)),$(`\\providecommand`,e=>Xv(e,!0,!0,!0)),$(`\\message`,e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map(e=>e.text).join(``)),``}),$(`\\errmessage`,e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map(e=>e.text).join(``)),``}),$(`\\show`,e=>{var t=e.popToken(),n=t.text;return console.log(t,e.macros.get(n),Lv[n],Om.math[n],Om.text[n]),``}),$(`\\bgroup`,`{`),$(`\\egroup`,`}`),$(`~`,`\\nobreakspace`),$(`\\lq`,"`"),$(`\\rq`,`'`),$(`\\aa`,`\\r a`),$(`\\AA`,`\\r A`),$(`\\textcopyright`,"\\html@mathml{\\textcircled{c}}{\\char`©}"),$(`\\copyright`,`\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}`),$(`\\textregistered`,"\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"),$(`ℬ`,`\\mathscr{B}`),$(`ℰ`,`\\mathscr{E}`),$(`ℱ`,`\\mathscr{F}`),$(`ℋ`,`\\mathscr{H}`),$(`ℐ`,`\\mathscr{I}`),$(`ℒ`,`\\mathscr{L}`),$(`ℳ`,`\\mathscr{M}`),$(`ℛ`,`\\mathscr{R}`),$(`ℭ`,`\\mathfrak{C}`),$(`ℌ`,`\\mathfrak{H}`),$(`ℨ`,`\\mathfrak{Z}`),$(`\\Bbbk`,`\\Bbb{k}`),$(`\\llap`,`\\mathllap{\\textrm{#1}}`),$(`\\rlap`,`\\mathrlap{\\textrm{#1}}`),$(`\\clap`,`\\mathclap{\\textrm{#1}}`),$(`\\mathstrut`,`\\vphantom{(}`),$(`\\underbar`,`\\underline{\\text{#1}}`),$(`\\not`,`\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}`),$(`\\neq`,"\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"),$(`\\ne`,`\\neq`),$(`≠`,`\\neq`),$(`\\notin`,"\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"),$(`∉`,`\\notin`),$(`≘`,"\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"),$(`≙`,"\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"),$(`≚`,"\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"),$(`≛`,"\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"),$(`≝`,"\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"),$(`≞`,"\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"),$(`≟`,"\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"),$(`⟂`,`\\perp`),$(`‼`,`\\mathclose{!\\mkern-0.8mu!}`),$(`∌`,`\\notni`),$(`⌜`,`\\ulcorner`),$(`⌝`,`\\urcorner`),$(`⌞`,`\\llcorner`),$(`⌟`,`\\lrcorner`),$(`©`,`\\copyright`),$(`®`,`\\textregistered`),$(`\\ulcorner`,`\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}`),$(`\\urcorner`,`\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}`),$(`\\llcorner`,`\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}`),$(`\\lrcorner`,`\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}`),$(`\\vdots`,`{\\varvdots\\rule{0pt}{15pt}}`),$(`⋮`,`\\vdots`),$(`\\varGamma`,`\\mathit{\\Gamma}`),$(`\\varDelta`,`\\mathit{\\Delta}`),$(`\\varTheta`,`\\mathit{\\Theta}`),$(`\\varLambda`,`\\mathit{\\Lambda}`),$(`\\varXi`,`\\mathit{\\Xi}`),$(`\\varPi`,`\\mathit{\\Pi}`),$(`\\varSigma`,`\\mathit{\\Sigma}`),$(`\\varUpsilon`,`\\mathit{\\Upsilon}`),$(`\\varPhi`,`\\mathit{\\Phi}`),$(`\\varPsi`,`\\mathit{\\Psi}`),$(`\\varOmega`,`\\mathit{\\Omega}`),$(`\\substack`,`\\begin{subarray}{c}#1\\end{subarray}`),$(`\\colon`,`\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax`),$(`\\boxed`,`\\fbox{$\\displaystyle{#1}$}`),$(`\\iff`,`\\DOTSB\\;\\Longleftrightarrow\\;`),$(`\\implies`,`\\DOTSB\\;\\Longrightarrow\\;`),$(`\\impliedby`,`\\DOTSB\\;\\Longleftarrow\\;`),$(`\\dddot`,`{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}`),$(`\\ddddot`,`{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}`);var Zv={",":`\\dotsc`,"\\not":`\\dotsb`,"+":`\\dotsb`,"=":`\\dotsb`,"<":`\\dotsb`,">":`\\dotsb`,"-":`\\dotsb`,"*":`\\dotsb`,":":`\\dotsb`,"\\DOTSB":`\\dotsb`,"\\coprod":`\\dotsb`,"\\bigvee":`\\dotsb`,"\\bigwedge":`\\dotsb`,"\\biguplus":`\\dotsb`,"\\bigcap":`\\dotsb`,"\\bigcup":`\\dotsb`,"\\prod":`\\dotsb`,"\\sum":`\\dotsb`,"\\bigotimes":`\\dotsb`,"\\bigoplus":`\\dotsb`,"\\bigodot":`\\dotsb`,"\\bigsqcup":`\\dotsb`,"\\And":`\\dotsb`,"\\longrightarrow":`\\dotsb`,"\\Longrightarrow":`\\dotsb`,"\\longleftarrow":`\\dotsb`,"\\Longleftarrow":`\\dotsb`,"\\longleftrightarrow":`\\dotsb`,"\\Longleftrightarrow":`\\dotsb`,"\\mapsto":`\\dotsb`,"\\longmapsto":`\\dotsb`,"\\hookrightarrow":`\\dotsb`,"\\doteq":`\\dotsb`,"\\mathbin":`\\dotsb`,"\\mathrel":`\\dotsb`,"\\relbar":`\\dotsb`,"\\Relbar":`\\dotsb`,"\\xrightarrow":`\\dotsb`,"\\xleftarrow":`\\dotsb`,"\\DOTSI":`\\dotsi`,"\\int":`\\dotsi`,"\\oint":`\\dotsi`,"\\iint":`\\dotsi`,"\\iiint":`\\dotsi`,"\\iiiint":`\\dotsi`,"\\idotsint":`\\dotsi`,"\\DOTSX":`\\dotsx`},Qv=new Set([`bin`,`rel`]);$(`\\dots`,function(e){var t=`\\dotso`,n=e.expandAfterFuture().text;return n in Zv?t=Zv[n]:(n.slice(0,4)===`\\not`||n in Om.math&&Qv.has(Om.math[n].group))&&(t=`\\dotsb`),t});var $v={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};$(`\\dotso`,function(e){return e.future().text in $v?`\\ldots\\,`:`\\ldots`}),$(`\\dotsc`,function(e){var t=e.future().text;return t in $v&&t!==`,`?`\\ldots\\,`:`\\ldots`}),$(`\\cdots`,function(e){return e.future().text in $v?`\\@cdots\\,`:`\\@cdots`}),$(`\\dotsb`,`\\cdots`),$(`\\dotsm`,`\\cdots`),$(`\\dotsi`,`\\!\\cdots`),$(`\\dotsx`,`\\ldots\\,`),$(`\\DOTSI`,`\\relax`),$(`\\DOTSB`,`\\relax`),$(`\\DOTSX`,`\\relax`),$(`\\tmspace`,`\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax`),$(`\\,`,`\\tmspace+{3mu}{.1667em}`),$(`\\thinspace`,`\\,`),$(`\\>`,`\\mskip{4mu}`),$(`\\:`,`\\tmspace+{4mu}{.2222em}`),$(`\\medspace`,`\\:`),$(`\\;`,`\\tmspace+{5mu}{.2777em}`),$(`\\thickspace`,`\\;`),$(`\\!`,`\\tmspace-{3mu}{.1667em}`),$(`\\negthinspace`,`\\!`),$(`\\negmedspace`,`\\tmspace-{4mu}{.2222em}`),$(`\\negthickspace`,`\\tmspace-{5mu}{.277em}`),$(`\\enspace`,`\\kern.5em `),$(`\\enskip`,`\\hskip.5em\\relax`),$(`\\quad`,`\\hskip1em\\relax`),$(`\\qquad`,`\\hskip2em\\relax`),$(`\\tag`,`\\@ifstar\\tag@literal\\tag@paren`),$(`\\tag@paren`,`\\tag@literal{({#1})}`),$(`\\tag@literal`,e=>{if(e.macros.get(`\\df@tag`))throw new V(`Multiple \\tag`);return`\\gdef\\df@tag{\\text{#1}}`}),$(`\\bmod`,`\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}`),$(`\\pod`,`\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)`),$(`\\pmod`,`\\pod{{\\rm mod}\\mkern6mu#1}`),$(`\\mod`,`\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1`),$(`\\newline`,`\\\\\\relax`),$(`\\TeX`,`\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}`);var ey=H(xm[`Main-Regular`][84][1]-.7*xm[`Main-Regular`][65][1]);$(`\\LaTeX`,`\\textrm{\\html@mathml{`+(`L\\kern-.36em\\raisebox{`+ey+`}{\\scriptstyle A}`)+`\\kern-.15em\\TeX}{LaTeX}}`),$(`\\KaTeX`,`\\textrm{\\html@mathml{`+(`K\\kern-.17em\\raisebox{`+ey+`}{\\scriptstyle A}`)+`\\kern-.15em\\TeX}{KaTeX}}`),$(`\\hspace`,`\\@ifstar\\@hspacer\\@hspace`),$(`\\@hspace`,`\\hskip #1\\relax`),$(`\\@hspacer`,`\\rule{0pt}{0pt}\\hskip #1\\relax`),$(`\\ordinarycolon`,`:`),$(`\\vcentcolon`,`\\mathrel{\\mathop\\ordinarycolon}`),$(`\\dblcolon`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}`),$(`\\coloneqq`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}`),$(`\\Coloneqq`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}`),$(`\\coloneq`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}`),$(`\\Coloneq`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}`),$(`\\eqqcolon`,`\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}`),$(`\\Eqqcolon`,`\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}`),$(`\\eqcolon`,`\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}`),$(`\\Eqcolon`,`\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}`),$(`\\colonapprox`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}`),$(`\\Colonapprox`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}`),$(`\\colonsim`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}`),$(`\\Colonsim`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}`),$(`∷`,`\\dblcolon`),$(`∹`,`\\eqcolon`),$(`≔`,`\\coloneqq`),$(`≕`,`\\eqqcolon`),$(`⩴`,`\\Coloneqq`),$(`\\ratio`,`\\vcentcolon`),$(`\\coloncolon`,`\\dblcolon`),$(`\\colonequals`,`\\coloneqq`),$(`\\coloncolonequals`,`\\Coloneqq`),$(`\\equalscolon`,`\\eqqcolon`),$(`\\equalscoloncolon`,`\\Eqqcolon`),$(`\\colonminus`,`\\coloneq`),$(`\\coloncolonminus`,`\\Coloneq`),$(`\\minuscolon`,`\\eqcolon`),$(`\\minuscoloncolon`,`\\Eqcolon`),$(`\\coloncolonapprox`,`\\Colonapprox`),$(`\\coloncolonsim`,`\\Colonsim`),$(`\\simcolon`,`\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}`),$(`\\simcoloncolon`,`\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}`),$(`\\approxcolon`,`\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}`),$(`\\approxcoloncolon`,`\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}`),$(`\\notni`,"\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),$(`\\limsup`,`\\DOTSB\\operatorname*{lim\\,sup}`),$(`\\liminf`,`\\DOTSB\\operatorname*{lim\\,inf}`),$(`\\injlim`,`\\DOTSB\\operatorname*{inj\\,lim}`),$(`\\projlim`,`\\DOTSB\\operatorname*{proj\\,lim}`),$(`\\varlimsup`,`\\DOTSB\\operatorname*{\\overline{lim}}`),$(`\\varliminf`,`\\DOTSB\\operatorname*{\\underline{lim}}`),$(`\\varinjlim`,`\\DOTSB\\operatorname*{\\underrightarrow{lim}}`),$(`\\varprojlim`,`\\DOTSB\\operatorname*{\\underleftarrow{lim}}`),$(`\\gvertneqq`,`\\html@mathml{\\@gvertneqq}{≩}`),$(`\\lvertneqq`,`\\html@mathml{\\@lvertneqq}{≨}`),$(`\\ngeqq`,`\\html@mathml{\\@ngeqq}{≱}`),$(`\\ngeqslant`,`\\html@mathml{\\@ngeqslant}{≱}`),$(`\\nleqq`,`\\html@mathml{\\@nleqq}{≰}`),$(`\\nleqslant`,`\\html@mathml{\\@nleqslant}{≰}`),$(`\\nshortmid`,`\\html@mathml{\\@nshortmid}{∤}`),$(`\\nshortparallel`,`\\html@mathml{\\@nshortparallel}{∦}`),$(`\\nsubseteqq`,`\\html@mathml{\\@nsubseteqq}{⊈}`),$(`\\nsupseteqq`,`\\html@mathml{\\@nsupseteqq}{⊉}`),$(`\\varsubsetneq`,`\\html@mathml{\\@varsubsetneq}{⊊}`),$(`\\varsubsetneqq`,`\\html@mathml{\\@varsubsetneqq}{⫋}`),$(`\\varsupsetneq`,`\\html@mathml{\\@varsupsetneq}{⊋}`),$(`\\varsupsetneqq`,`\\html@mathml{\\@varsupsetneqq}{⫌}`),$(`\\imath`,`\\html@mathml{\\@imath}{ı}`),$(`\\jmath`,`\\html@mathml{\\@jmath}{ȷ}`),$(`\\llbracket`,"\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),$(`\\rrbracket`,"\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),$(`⟦`,`\\llbracket`),$(`⟧`,`\\rrbracket`),$(`\\lBrace`,"\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),$(`\\rBrace`,"\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),$(`⦃`,`\\lBrace`),$(`⦄`,`\\rBrace`),$(`\\minuso`,"\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"),$(`⦵`,`\\minuso`),$(`\\darr`,`\\downarrow`),$(`\\dArr`,`\\Downarrow`),$(`\\Darr`,`\\Downarrow`),$(`\\lang`,`\\langle`),$(`\\rang`,`\\rangle`),$(`\\uarr`,`\\uparrow`),$(`\\uArr`,`\\Uparrow`),$(`\\Uarr`,`\\Uparrow`),$(`\\N`,`\\mathbb{N}`),$(`\\R`,`\\mathbb{R}`),$(`\\Z`,`\\mathbb{Z}`),$(`\\alef`,`\\aleph`),$(`\\alefsym`,`\\aleph`),$(`\\Alpha`,`\\mathrm{A}`),$(`\\Beta`,`\\mathrm{B}`),$(`\\bull`,`\\bullet`),$(`\\Chi`,`\\mathrm{X}`),$(`\\clubs`,`\\clubsuit`),$(`\\cnums`,`\\mathbb{C}`),$(`\\Complex`,`\\mathbb{C}`),$(`\\Dagger`,`\\ddagger`),$(`\\diamonds`,`\\diamondsuit`),$(`\\empty`,`\\emptyset`),$(`\\Epsilon`,`\\mathrm{E}`),$(`\\Eta`,`\\mathrm{H}`),$(`\\exist`,`\\exists`),$(`\\harr`,`\\leftrightarrow`),$(`\\hArr`,`\\Leftrightarrow`),$(`\\Harr`,`\\Leftrightarrow`),$(`\\hearts`,`\\heartsuit`),$(`\\image`,`\\Im`),$(`\\infin`,`\\infty`),$(`\\Iota`,`\\mathrm{I}`),$(`\\isin`,`\\in`),$(`\\Kappa`,`\\mathrm{K}`),$(`\\larr`,`\\leftarrow`),$(`\\lArr`,`\\Leftarrow`),$(`\\Larr`,`\\Leftarrow`),$(`\\lrarr`,`\\leftrightarrow`),$(`\\lrArr`,`\\Leftrightarrow`),$(`\\Lrarr`,`\\Leftrightarrow`),$(`\\Mu`,`\\mathrm{M}`),$(`\\natnums`,`\\mathbb{N}`),$(`\\Nu`,`\\mathrm{N}`),$(`\\Omicron`,`\\mathrm{O}`),$(`\\plusmn`,`\\pm`),$(`\\rarr`,`\\rightarrow`),$(`\\rArr`,`\\Rightarrow`),$(`\\Rarr`,`\\Rightarrow`),$(`\\real`,`\\Re`),$(`\\reals`,`\\mathbb{R}`),$(`\\Reals`,`\\mathbb{R}`),$(`\\Rho`,`\\mathrm{P}`),$(`\\sdot`,`\\cdot`),$(`\\sect`,`\\S`),$(`\\spades`,`\\spadesuit`),$(`\\sub`,`\\subset`),$(`\\sube`,`\\subseteq`),$(`\\supe`,`\\supseteq`),$(`\\Tau`,`\\mathrm{T}`),$(`\\thetasym`,`\\vartheta`),$(`\\weierp`,`\\wp`),$(`\\Zeta`,`\\mathrm{Z}`),$(`\\argmin`,`\\DOTSB\\operatorname*{arg\\,min}`),$(`\\argmax`,`\\DOTSB\\operatorname*{arg\\,max}`),$(`\\plim`,`\\DOTSB\\mathop{\\operatorname{plim}}\\limits`),$(`\\bra`,`\\mathinner{\\langle{#1}|}`),$(`\\ket`,`\\mathinner{|{#1}\\rangle}`),$(`\\braket`,`\\mathinner{\\langle{#1}\\rangle}`),$(`\\Bra`,`\\left\\langle#1\\right|`),$(`\\Ket`,`\\left|#1\\right\\rangle`);var ty=e=>t=>{var n=t.consumeArg().tokens,r=t.consumeArg().tokens,i=t.consumeArg().tokens,a=t.consumeArg().tokens,o=t.macros.get(`|`),s=t.macros.get(`\\|`);t.macros.beginGroup();var c=t=>n=>{e&&(n.macros.set(`|`,o),i.length&&n.macros.set(`\\|`,s));var a=t;return!t&&i.length&&n.future().text===`|`&&(n.popToken(),a=!0),{tokens:a?i:r,numArgs:0}};t.macros.set(`|`,c(!1)),i.length&&t.macros.set(`\\|`,c(!0));var l=t.consumeArg().tokens,u=t.expandTokens([...a,...l,...n]);return t.macros.endGroup(),{tokens:u.reverse(),numArgs:0}};$(`\\bra@ket`,ty(!1)),$(`\\bra@set`,ty(!0)),$(`\\Braket`,`\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}`),$(`\\Set`,`\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}`),$(`\\set`,`\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}`),$(`\\angln`,`{\\angl n}`),$(`\\blue`,`\\textcolor{##6495ed}{#1}`),$(`\\orange`,`\\textcolor{##ffa500}{#1}`),$(`\\pink`,`\\textcolor{##ff00af}{#1}`),$(`\\red`,`\\textcolor{##df0030}{#1}`),$(`\\green`,`\\textcolor{##28ae7b}{#1}`),$(`\\gray`,`\\textcolor{gray}{#1}`),$(`\\purple`,`\\textcolor{##9d38bd}{#1}`),$(`\\blueA`,`\\textcolor{##ccfaff}{#1}`),$(`\\blueB`,`\\textcolor{##80f6ff}{#1}`),$(`\\blueC`,`\\textcolor{##63d9ea}{#1}`),$(`\\blueD`,`\\textcolor{##11accd}{#1}`),$(`\\blueE`,`\\textcolor{##0c7f99}{#1}`),$(`\\tealA`,`\\textcolor{##94fff5}{#1}`),$(`\\tealB`,`\\textcolor{##26edd5}{#1}`),$(`\\tealC`,`\\textcolor{##01d1c1}{#1}`),$(`\\tealD`,`\\textcolor{##01a995}{#1}`),$(`\\tealE`,`\\textcolor{##208170}{#1}`),$(`\\greenA`,`\\textcolor{##b6ffb0}{#1}`),$(`\\greenB`,`\\textcolor{##8af281}{#1}`),$(`\\greenC`,`\\textcolor{##74cf70}{#1}`),$(`\\greenD`,`\\textcolor{##1fab54}{#1}`),$(`\\greenE`,`\\textcolor{##0d923f}{#1}`),$(`\\goldA`,`\\textcolor{##ffd0a9}{#1}`),$(`\\goldB`,`\\textcolor{##ffbb71}{#1}`),$(`\\goldC`,`\\textcolor{##ff9c39}{#1}`),$(`\\goldD`,`\\textcolor{##e07d10}{#1}`),$(`\\goldE`,`\\textcolor{##a75a05}{#1}`),$(`\\redA`,`\\textcolor{##fca9a9}{#1}`),$(`\\redB`,`\\textcolor{##ff8482}{#1}`),$(`\\redC`,`\\textcolor{##f9685d}{#1}`),$(`\\redD`,`\\textcolor{##e84d39}{#1}`),$(`\\redE`,`\\textcolor{##bc2612}{#1}`),$(`\\maroonA`,`\\textcolor{##ffbde0}{#1}`),$(`\\maroonB`,`\\textcolor{##ff92c6}{#1}`),$(`\\maroonC`,`\\textcolor{##ed5fa6}{#1}`),$(`\\maroonD`,`\\textcolor{##ca337c}{#1}`),$(`\\maroonE`,`\\textcolor{##9e034e}{#1}`),$(`\\purpleA`,`\\textcolor{##ddd7ff}{#1}`),$(`\\purpleB`,`\\textcolor{##c6b9fc}{#1}`),$(`\\purpleC`,`\\textcolor{##aa87ff}{#1}`),$(`\\purpleD`,`\\textcolor{##7854ab}{#1}`),$(`\\purpleE`,`\\textcolor{##543b78}{#1}`),$(`\\mintA`,`\\textcolor{##f5f9e8}{#1}`),$(`\\mintB`,`\\textcolor{##edf2df}{#1}`),$(`\\mintC`,`\\textcolor{##e0e5cc}{#1}`),$(`\\grayA`,`\\textcolor{##f6f7f7}{#1}`),$(`\\grayB`,`\\textcolor{##f0f1f2}{#1}`),$(`\\grayC`,`\\textcolor{##e3e5e6}{#1}`),$(`\\grayD`,`\\textcolor{##d6d8da}{#1}`),$(`\\grayE`,`\\textcolor{##babec2}{#1}`),$(`\\grayF`,`\\textcolor{##888d93}{#1}`),$(`\\grayG`,`\\textcolor{##626569}{#1}`),$(`\\grayH`,`\\textcolor{##3b3e40}{#1}`),$(`\\grayI`,`\\textcolor{##21242c}{#1}`),$(`\\kaBlue`,`\\textcolor{##314453}{#1}`),$(`\\kaGreen`,`\\textcolor{##71B307}{#1}`);var ny={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0},ry=class{constructor(e,t,n){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=t,this.expansionCount=0,this.feed(e),this.macros=new qv(Jv,t.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new Kv(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var t,n,r;if(e){if(this.consumeSpaces(),this.future().text!==`[`)return null;t=this.popToken(),{tokens:r,end:n}=this.consumeArg([`]`])}else ({tokens:r,start:t,end:n}=this.consumeArg());return this.pushToken(new q_(`EOF`,n.loc)),this.pushTokens(r),new q_(``,K_.range(t,n))}consumeSpaces(){for(;this.future().text===` `;)this.stack.pop()}consumeArg(e){var t=[],n=e&&e.length>0;n||this.consumeSpaces();var r=this.future(),i,a=0,o=0;do{if(i=this.popToken(),t.push(i),i.text===`{`)++a;else if(i.text===`}`){if(--a,a===-1)throw new V(`Extra }`,i)}else if(i.text===`EOF`)throw new V(`Unexpected end of input in a macro argument, expected '`+(e&&n?e[o]:`}`)+`'`,i);if(e&&n)if((a===0||a===1&&e[o]===`{`)&&i.text===e[o]){if(++o,o===e.length){t.splice(-o,o);break}}else o=0}while(a!==0||n);return r.text===`{`&&t[t.length-1].text===`}`&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:r,end:i}}consumeArgs(e,t){if(t){if(t.length!==e+1)throw new V(`The length of delimiters doesn't match the number of args!`);for(var n=t[0],r=0;r<n.length;r++){var i=this.popToken();if(n[r]!==i.text)throw new V(`Use of the macro doesn't match its definition`,i)}}for(var a=[],o=0;o<e;o++)a.push(this.consumeArg(t&&t[o+1]).tokens);return a}countExpansion(e){if(this.expansionCount+=e,this.expansionCount>this.settings.maxExpand)throw new V(`Too many expansions: infinite loop or need to increase maxExpand setting`)}expandOnce(e){var t=this.popToken(),n=t.text,r=t.noexpand?null:this._getExpansion(n);if(r==null||e&&r.unexpandable){if(e&&r==null&&n[0]===`\\`&&!this.isDefined(n))throw new V(`Undefined control sequence: `+n);return this.pushToken(t),!1}this.countExpansion(1);var i=r.tokens,a=this.consumeArgs(r.numArgs,r.delimiters);if(r.numArgs){i=i.slice();for(var o=i.length-1;o>=0;--o){var s=i[o];if(s.text===`#`){if(o===0)throw new V(`Incomplete placeholder at end of macro body`,s);if(s=i[--o],s.text===`#`)i.splice(o+1,1);else if(/^[1-9]$/.test(s.text))i.splice(o,2,...a[s.text-1]);else throw new V(`Not a valid argument number`,s)}}}return this.pushTokens(i),i.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var e=this.stack.pop();return e.treatAsRelax&&(e.text=`\\relax`),e}}expandMacro(e){return this.macros.has(e)?this.expandTokens([new q_(e)]):void 0}expandTokens(e){var t=[],n=this.stack.length;for(this.pushTokens(e);this.stack.length>n;)if(this.expandOnce(!0)===!1){var r=this.stack.pop();r.treatAsRelax&&=(r.noexpand=!1,!1),t.push(r)}return this.countExpansion(t.length),t}expandMacroAsText(e){var t=this.expandMacro(e);return t&&t.map(e=>e.text).join(``)}_getExpansion(e){var t=this.macros.get(e);if(t==null)return t;if(e.length===1){var n=this.lexer.catcodes[e];if(n!=null&&n!==13)return}var r=typeof t==`function`?t(this):t;if(typeof r==`string`){var i=0;if(r.includes(`#`))for(var a=r.replace(/##/g,``);a.includes(`#`+(i+1));)++i;for(var o=new Kv(r,this.settings),s=[],c=o.lex();c.text!==`EOF`;)s.push(c),c=o.lex();return s.reverse(),{tokens:s,numArgs:i}}return r}isDefined(e){return this.macros.has(e)||Lv.hasOwnProperty(e)||Om.math.hasOwnProperty(e)||Om.text.hasOwnProperty(e)||ny.hasOwnProperty(e)}isExpandable(e){var t=this.macros.get(e);return t==null?Lv.hasOwnProperty(e)&&!Lv[e].primitive:typeof t==`string`||typeof t==`function`||!t.unexpandable}},iy=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,ay=Object.freeze({"₊":`+`,"₋":`-`,"₌":`=`,"₍":`(`,"₎":`)`,"₀":`0`,"₁":`1`,"₂":`2`,"₃":`3`,"₄":`4`,"₅":`5`,"₆":`6`,"₇":`7`,"₈":`8`,"₉":`9`,ₐ:`a`,ₑ:`e`,ₕ:`h`,ᵢ:`i`,ⱼ:`j`,ₖ:`k`,ₗ:`l`,ₘ:`m`,ₙ:`n`,ₒ:`o`,ₚ:`p`,ᵣ:`r`,ₛ:`s`,ₜ:`t`,ᵤ:`u`,ᵥ:`v`,ₓ:`x`,ᵦ:`β`,ᵧ:`γ`,ᵨ:`ρ`,ᵩ:`ϕ`,ᵪ:`χ`,"⁺":`+`,"⁻":`-`,"⁼":`=`,"⁽":`(`,"⁾":`)`,"⁰":`0`,"¹":`1`,"²":`2`,"³":`3`,"⁴":`4`,"⁵":`5`,"⁶":`6`,"⁷":`7`,"⁸":`8`,"⁹":`9`,ᴬ:`A`,ᴮ:`B`,ᴰ:`D`,ᴱ:`E`,ᴳ:`G`,ᴴ:`H`,ᴵ:`I`,ᴶ:`J`,ᴷ:`K`,ᴸ:`L`,ᴹ:`M`,ᴺ:`N`,ᴼ:`O`,ᴾ:`P`,ᴿ:`R`,ᵀ:`T`,ᵁ:`U`,ⱽ:`V`,ᵂ:`W`,ᵃ:`a`,ᵇ:`b`,ᶜ:`c`,ᵈ:`d`,ᵉ:`e`,ᶠ:`f`,ᵍ:`g`,ʰ:`h`,ⁱ:`i`,ʲ:`j`,ᵏ:`k`,ˡ:`l`,ᵐ:`m`,ⁿ:`n`,ᵒ:`o`,ᵖ:`p`,ʳ:`r`,ˢ:`s`,ᵗ:`t`,ᵘ:`u`,ᵛ:`v`,ʷ:`w`,ˣ:`x`,ʸ:`y`,ᶻ:`z`,ᵝ:`β`,ᵞ:`γ`,ᵟ:`δ`,ᵠ:`ϕ`,ᵡ:`χ`,ᶿ:`θ`}),oy={"́":{text:`\\'`,math:`\\acute`},"̀":{text:"\\`",math:`\\grave`},"̈":{text:`\\"`,math:`\\ddot`},"̃":{text:`\\~`,math:`\\tilde`},"̄":{text:`\\=`,math:`\\bar`},"̆":{text:`\\u`,math:`\\breve`},"̌":{text:`\\v`,math:`\\check`},"̂":{text:`\\^`,math:`\\hat`},"̇":{text:`\\.`,math:`\\dot`},"̊":{text:`\\r`,math:`\\mathring`},"̋":{text:`\\H`},"̧":{text:`\\c`}},sy={á:`á`,à:`à`,ä:`ä`,ǟ:`ǟ`,ã:`ã`,ā:`ā`,ă:`ă`,ắ:`ắ`,ằ:`ằ`,ẵ:`ẵ`,ǎ:`ǎ`,â:`â`,ấ:`ấ`,ầ:`ầ`,ẫ:`ẫ`,ȧ:`ȧ`,ǡ:`ǡ`,å:`å`,ǻ:`ǻ`,ḃ:`ḃ`,ć:`ć`,ḉ:`ḉ`,č:`č`,ĉ:`ĉ`,ċ:`ċ`,ç:`ç`,ď:`ď`,ḋ:`ḋ`,ḑ:`ḑ`,é:`é`,è:`è`,ë:`ë`,ẽ:`ẽ`,ē:`ē`,ḗ:`ḗ`,ḕ:`ḕ`,ĕ:`ĕ`,ḝ:`ḝ`,ě:`ě`,ê:`ê`,ế:`ế`,ề:`ề`,ễ:`ễ`,ė:`ė`,ȩ:`ȩ`,ḟ:`ḟ`,ǵ:`ǵ`,ḡ:`ḡ`,ğ:`ğ`,ǧ:`ǧ`,ĝ:`ĝ`,ġ:`ġ`,ģ:`ģ`,ḧ:`ḧ`,ȟ:`ȟ`,ĥ:`ĥ`,ḣ:`ḣ`,ḩ:`ḩ`,í:`í`,ì:`ì`,ï:`ï`,ḯ:`ḯ`,ĩ:`ĩ`,ī:`ī`,ĭ:`ĭ`,ǐ:`ǐ`,î:`î`,ǰ:`ǰ`,ĵ:`ĵ`,ḱ:`ḱ`,ǩ:`ǩ`,ķ:`ķ`,ĺ:`ĺ`,ľ:`ľ`,ļ:`ļ`,ḿ:`ḿ`,ṁ:`ṁ`,ń:`ń`,ǹ:`ǹ`,ñ:`ñ`,ň:`ň`,ṅ:`ṅ`,ņ:`ņ`,ó:`ó`,ò:`ò`,ö:`ö`,ȫ:`ȫ`,õ:`õ`,ṍ:`ṍ`,ṏ:`ṏ`,ȭ:`ȭ`,ō:`ō`,ṓ:`ṓ`,ṑ:`ṑ`,ŏ:`ŏ`,ǒ:`ǒ`,ô:`ô`,ố:`ố`,ồ:`ồ`,ỗ:`ỗ`,ȯ:`ȯ`,ȱ:`ȱ`,ő:`ő`,ṕ:`ṕ`,ṗ:`ṗ`,ŕ:`ŕ`,ř:`ř`,ṙ:`ṙ`,ŗ:`ŗ`,ś:`ś`,ṥ:`ṥ`,š:`š`,ṧ:`ṧ`,ŝ:`ŝ`,ṡ:`ṡ`,ş:`ş`,ẗ:`ẗ`,ť:`ť`,ṫ:`ṫ`,ţ:`ţ`,ú:`ú`,ù:`ù`,ü:`ü`,ǘ:`ǘ`,ǜ:`ǜ`,ǖ:`ǖ`,ǚ:`ǚ`,ũ:`ũ`,ṹ:`ṹ`,ū:`ū`,ṻ:`ṻ`,ŭ:`ŭ`,ǔ:`ǔ`,û:`û`,ů:`ů`,ű:`ű`,ṽ:`ṽ`,ẃ:`ẃ`,ẁ:`ẁ`,ẅ:`ẅ`,ŵ:`ŵ`,ẇ:`ẇ`,ẘ:`ẘ`,ẍ:`ẍ`,ẋ:`ẋ`,ý:`ý`,ỳ:`ỳ`,ÿ:`ÿ`,ỹ:`ỹ`,ȳ:`ȳ`,ŷ:`ŷ`,ẏ:`ẏ`,ẙ:`ẙ`,ź:`ź`,ž:`ž`,ẑ:`ẑ`,ż:`ż`,Á:`Á`,À:`À`,Ä:`Ä`,Ǟ:`Ǟ`,Ã:`Ã`,Ā:`Ā`,Ă:`Ă`,Ắ:`Ắ`,Ằ:`Ằ`,Ẵ:`Ẵ`,Ǎ:`Ǎ`,Â:`Â`,Ấ:`Ấ`,Ầ:`Ầ`,Ẫ:`Ẫ`,Ȧ:`Ȧ`,Ǡ:`Ǡ`,Å:`Å`,Ǻ:`Ǻ`,Ḃ:`Ḃ`,Ć:`Ć`,Ḉ:`Ḉ`,Č:`Č`,Ĉ:`Ĉ`,Ċ:`Ċ`,Ç:`Ç`,Ď:`Ď`,Ḋ:`Ḋ`,Ḑ:`Ḑ`,É:`É`,È:`È`,Ë:`Ë`,Ẽ:`Ẽ`,Ē:`Ē`,Ḗ:`Ḗ`,Ḕ:`Ḕ`,Ĕ:`Ĕ`,Ḝ:`Ḝ`,Ě:`Ě`,Ê:`Ê`,Ế:`Ế`,Ề:`Ề`,Ễ:`Ễ`,Ė:`Ė`,Ȩ:`Ȩ`,Ḟ:`Ḟ`,Ǵ:`Ǵ`,Ḡ:`Ḡ`,Ğ:`Ğ`,Ǧ:`Ǧ`,Ĝ:`Ĝ`,Ġ:`Ġ`,Ģ:`Ģ`,Ḧ:`Ḧ`,Ȟ:`Ȟ`,Ĥ:`Ĥ`,Ḣ:`Ḣ`,Ḩ:`Ḩ`,Í:`Í`,Ì:`Ì`,Ï:`Ï`,Ḯ:`Ḯ`,Ĩ:`Ĩ`,Ī:`Ī`,Ĭ:`Ĭ`,Ǐ:`Ǐ`,Î:`Î`,İ:`İ`,Ĵ:`Ĵ`,Ḱ:`Ḱ`,Ǩ:`Ǩ`,Ķ:`Ķ`,Ĺ:`Ĺ`,Ľ:`Ľ`,Ļ:`Ļ`,Ḿ:`Ḿ`,Ṁ:`Ṁ`,Ń:`Ń`,Ǹ:`Ǹ`,Ñ:`Ñ`,Ň:`Ň`,Ṅ:`Ṅ`,Ņ:`Ņ`,Ó:`Ó`,Ò:`Ò`,Ö:`Ö`,Ȫ:`Ȫ`,Õ:`Õ`,Ṍ:`Ṍ`,Ṏ:`Ṏ`,Ȭ:`Ȭ`,Ō:`Ō`,Ṓ:`Ṓ`,Ṑ:`Ṑ`,Ŏ:`Ŏ`,Ǒ:`Ǒ`,Ô:`Ô`,Ố:`Ố`,Ồ:`Ồ`,Ỗ:`Ỗ`,Ȯ:`Ȯ`,Ȱ:`Ȱ`,Ő:`Ő`,Ṕ:`Ṕ`,Ṗ:`Ṗ`,Ŕ:`Ŕ`,Ř:`Ř`,Ṙ:`Ṙ`,Ŗ:`Ŗ`,Ś:`Ś`,Ṥ:`Ṥ`,Š:`Š`,Ṧ:`Ṧ`,Ŝ:`Ŝ`,Ṡ:`Ṡ`,Ş:`Ş`,Ť:`Ť`,Ṫ:`Ṫ`,Ţ:`Ţ`,Ú:`Ú`,Ù:`Ù`,Ü:`Ü`,Ǘ:`Ǘ`,Ǜ:`Ǜ`,Ǖ:`Ǖ`,Ǚ:`Ǚ`,Ũ:`Ũ`,Ṹ:`Ṹ`,Ū:`Ū`,Ṻ:`Ṻ`,Ŭ:`Ŭ`,Ǔ:`Ǔ`,Û:`Û`,Ů:`Ů`,Ű:`Ű`,Ṽ:`Ṽ`,Ẃ:`Ẃ`,Ẁ:`Ẁ`,Ẅ:`Ẅ`,Ŵ:`Ŵ`,Ẇ:`Ẇ`,Ẍ:`Ẍ`,Ẋ:`Ẋ`,Ý:`Ý`,Ỳ:`Ỳ`,Ÿ:`Ÿ`,Ỹ:`Ỹ`,Ȳ:`Ȳ`,Ŷ:`Ŷ`,Ẏ:`Ẏ`,Ź:`Ź`,Ž:`Ž`,Ẑ:`Ẑ`,Ż:`Ż`,ά:`ά`,ὰ:`ὰ`,ᾱ:`ᾱ`,ᾰ:`ᾰ`,έ:`έ`,ὲ:`ὲ`,ή:`ή`,ὴ:`ὴ`,ί:`ί`,ὶ:`ὶ`,ϊ:`ϊ`,ΐ:`ΐ`,ῒ:`ῒ`,ῑ:`ῑ`,ῐ:`ῐ`,ό:`ό`,ὸ:`ὸ`,ύ:`ύ`,ὺ:`ὺ`,ϋ:`ϋ`,ΰ:`ΰ`,ῢ:`ῢ`,ῡ:`ῡ`,ῠ:`ῠ`,ώ:`ώ`,ὼ:`ὼ`,Ύ:`Ύ`,Ὺ:`Ὺ`,Ϋ:`Ϋ`,Ῡ:`Ῡ`,Ῠ:`Ῠ`,Ώ:`Ώ`,Ὼ:`Ὼ`},cy=class e{constructor(e,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode=`math`,this.gullet=new ry(e,t,this.mode),this.settings=t,this.leftrightDepth=0,this.nextToken=null}expect(e,t){if(t===void 0&&(t=!0),this.fetch().text!==e)throw new V(`Expected '`+e+`', got '`+this.fetch().text+`'`,this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken??=this.gullet.expandNextToken(),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set(`\\color`,`\\textcolor`);try{var e=this.parseExpression(!1);return this.expect(`EOF`),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var t=this.nextToken;this.consume(),this.gullet.pushToken(new q_(`}`)),this.gullet.pushTokens(e);var n=this.parseExpression(!1);return this.expect(`}`),this.nextToken=t,n}parseExpression(t,n){for(var r=[];;){this.mode===`math`&&this.consumeSpaces();var i=this.fetch();if(e.endOfExpression.has(i.text)||n&&i.text===n||t&&Lv[i.text]&&Lv[i.text].infix)break;var a=this.parseAtom(n);if(!a)break;a.type!==`internal`&&r.push(a)}return this.mode===`text`&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(e){for(var t=-1,n,r=0;r<e.length;r++){var i=e[r];if(i.type===`infix`){if(t!==-1)throw new V(`only one infix operator per group`,i.token);t=r,n=i.replaceWith}}if(t!==-1&&n){var a,o,s=e.slice(0,t),c=e.slice(t+1);return a=s.length===1&&s[0].type===`ordgroup`?s[0]:{type:`ordgroup`,mode:this.mode,body:s},o=c.length===1&&c[0].type===`ordgroup`?c[0]:{type:`ordgroup`,mode:this.mode,body:c},[n===`\\\\abovefrac`?this.callFunction(n,[a,e[t],o],[]):this.callFunction(n,[a,o],[])]}else return e}handleSupSubscript(e){var t=this.fetch(),n=t.text;this.consume(),this.consumeSpaces();var r;do r=this.parseGroup(e);while(r?.type===`internal`);if(!r)throw new V(`Expected group after '`+n+`'`,t);return r}formatUnsupportedCmd(e){for(var t=[],n=0;n<e.length;n++)t.push({type:`textord`,mode:`text`,text:e[n]});var r={type:`text`,mode:this.mode,body:t};return{type:`color`,mode:this.mode,color:this.settings.errorColor,body:[r]}}parseAtom(e){var t=this.parseGroup(`atom`,e);if(t?.type===`internal`||this.mode===`text`)return t;for(var n,r;;){this.consumeSpaces();var i=this.fetch();if(i.text===`\\limits`||i.text===`\\nolimits`){if(t&&t.type===`op`)t.limits=i.text===`\\limits`,t.alwaysHandleSupSub=!0;else if(t&&t.type===`operatorname`)t.alwaysHandleSupSub&&(t.limits=i.text===`\\limits`);else throw new V(`Limit controls must follow a math operator`,i);this.consume()}else if(i.text===`^`){if(n)throw new V(`Double superscript`,i);n=this.handleSupSubscript(`superscript`)}else if(i.text===`_`){if(r)throw new V(`Double subscript`,i);r=this.handleSupSubscript(`subscript`)}else if(i.text===`'`){if(n)throw new V(`Double superscript`,i);var a={type:`textord`,mode:this.mode,text:`\\prime`},o=[a];for(this.consume();this.fetch().text===`'`;)o.push(a),this.consume();this.fetch().text===`^`&&o.push(this.handleSupSubscript(`superscript`)),n={type:`ordgroup`,mode:this.mode,body:o}}else if(ay[i.text]){var s=iy.test(i.text),c=[];for(c.push(new q_(ay[i.text])),this.consume();;){var l=this.fetch().text;if(!ay[l]||iy.test(l)!==s)break;c.unshift(new q_(ay[l])),this.consume()}var u=this.subparse(c);s?r={type:`ordgroup`,mode:`math`,body:u}:n={type:`ordgroup`,mode:`math`,body:u}}else break}return n||r?{type:`supsub`,mode:this.mode,base:t,sup:n,sub:r}:t}parseFunction(e,t){var n=this.fetch(),r=n.text,i=Lv[r];if(!i)return null;if(this.consume(),t&&t!==`atom`&&!i.allowedInArgument)throw new V(`Got function '`+r+`' with no arguments`+(t?` as `+t:``),n);if(this.mode===`text`&&!i.allowedInText)throw new V(`Can't use function '`+r+`' in text mode`,n);if(this.mode===`math`&&i.allowedInMath===!1)throw new V(`Can't use function '`+r+`' in math mode`,n);var{args:a,optArgs:o}=this.parseArguments(r,i);return this.callFunction(r,a,o,n,e)}callFunction(e,t,n,r,i){var a={funcName:e,parser:this,token:r,breakOnTokenText:i},o=Lv[e];if(o&&o.handler)return o.handler(a,t,n);throw new V(`No function handler for `+e)}parseArguments(e,t){var n=t.numArgs+t.numOptionalArgs;if(n===0)return{args:[],optArgs:[]};for(var r=[],i=[],a=0;a<n;a++){var o=t.argTypes&&t.argTypes[a],s=a<t.numOptionalArgs;(`primitive`in t&&t.primitive&&o==null||t.type===`sqrt`&&a===1&&i[0]==null)&&(o=`primitive`);var c=this.parseGroupOfType(`argument to '`+e+`'`,o,s);if(s)i.push(c);else if(c!=null)r.push(c);else throw new V(`Null argument, please report this as a bug`)}return{args:r,optArgs:i}}parseGroupOfType(e,t,n){switch(t){case`color`:return this.parseColorGroup(n);case`size`:return this.parseSizeGroup(n);case`url`:return this.parseUrlGroup(n);case`math`:case`text`:return this.parseArgumentGroup(n,t);case`hbox`:var r=this.parseArgumentGroup(n,`text`);return r==null?null:{type:`styling`,mode:r.mode,body:[r],style:`text`,resetFont:!0};case`raw`:var i=this.parseStringGroup(`raw`,n);return i==null?null:{type:`raw`,mode:`text`,string:i.text};case`primitive`:if(n)throw new V(`A primitive argument cannot be optional`);var a=this.parseGroup(e);if(a==null)throw new V(`Expected group as `+e,this.fetch());return a;case`original`:case null:case void 0:return this.parseArgumentGroup(n);default:throw new V(`Unknown group type as `+e,this.fetch())}}consumeSpaces(){for(;this.fetch().text===` `;)this.consume()}parseStringGroup(e,t){var n=this.gullet.scanArgument(t);if(n==null)return null;for(var r=``,i;(i=this.fetch()).text!==`EOF`;)r+=i.text,this.consume();return this.consume(),n.text=r,n}parseRegexGroup(e,t){for(var n=this.fetch(),r=n,i=``,a;(a=this.fetch()).text!==`EOF`&&e.test(i+a.text);)r=a,i+=r.text,this.consume();if(i===``)throw new V(`Invalid `+t+`: '`+n.text+`'`,n);return n.range(r,i)}parseColorGroup(e){var t=this.parseStringGroup(`color`,e);if(t==null)return null;var n=/^(#[a-f0-9]{3,4}|#[a-f0-9]{6}|#[a-f0-9]{8}|[a-f0-9]{6}|[a-z]+)$/i.exec(t.text);if(!n)throw new V(`Invalid color: '`+t.text+`'`,t);var r=n[0];return/^[0-9a-f]{6}$/i.test(r)&&(r=`#`+r),{type:`color-token`,mode:this.mode,color:r}}parseSizeGroup(e){var t,n=!1;if(this.gullet.consumeSpaces(),t=!e&&this.gullet.future().text!==`{`?this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,`size`):this.parseStringGroup(`size`,e),!t)return null;!e&&t.text.length===0&&(t.text=`0pt`,n=!0);var r=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t.text);if(!r)throw new V(`Invalid size: '`+t.text+`'`,t);var i={number:+(r[1]+r[2]),unit:r[3]};if(!nm(i))throw new V(`Invalid unit: '`+i.unit+`'`,t);return{type:`size`,mode:this.mode,value:i,isBlank:n}}parseUrlGroup(e){this.gullet.lexer.setCatcode(`%`,13),this.gullet.lexer.setCatcode(`~`,12);var t=this.parseStringGroup(`url`,e);if(this.gullet.lexer.setCatcode(`%`,14),this.gullet.lexer.setCatcode(`~`,13),t==null)return null;var n=t.text.replace(/\\([#$%&~_^{}])/g,`$1`);return{type:`url`,mode:this.mode,url:n}}parseArgumentGroup(e,t){var n=this.gullet.scanArgument(e);if(n==null)return null;var r=this.mode;t&&this.switchMode(t),this.gullet.beginGroup();var i=this.parseExpression(!1,`EOF`);this.expect(`EOF`),this.gullet.endGroup();var a={type:`ordgroup`,mode:this.mode,loc:n.loc,body:i};return t&&this.switchMode(r),a}parseGroup(e,t){var n=this.fetch(),r=n.text,i;if(r===`{`||r===`\\begingroup`){this.consume();var a=r===`{`?`}`:`\\endgroup`;this.gullet.beginGroup();var o=this.parseExpression(!1,a),s=this.fetch();this.expect(a),this.gullet.endGroup(),i={type:`ordgroup`,mode:this.mode,loc:K_.range(n,s),body:o,semisimple:r===`\\begingroup`||void 0}}else if(i=this.parseFunction(t,e)||this.parseSymbol(),i==null&&r[0]===`\\`&&!ny.hasOwnProperty(r)){if(this.settings.throwOnError)throw new V(`Undefined control sequence: `+r,n);i=this.formatUnsupportedCmd(r),this.consume()}return i}formLigatures(e){for(var t=e.length-1,n=0;n<t;++n){var r=e[n];if(r.type===`textord`){var i=r.text,a=e[n+1];if(!(!a||a.type!==`textord`)){if(i===`-`&&a.text===`-`){var o=e[n+2];n+1<t&&o&&o.type===`textord`&&o.text===`-`?(e.splice(n,3,{type:`textord`,mode:`text`,loc:K_.range(r,o),text:`---`}),t-=2):(e.splice(n,2,{type:`textord`,mode:`text`,loc:K_.range(r,a),text:`--`}),--t)}(i===`'`||i==="`")&&a.text===i&&(e.splice(n,2,{type:`textord`,mode:`text`,loc:K_.range(r,a),text:i+i}),--t)}}}}parseSymbol(){var e=this.fetch(),t=e.text;if(/^\\verb[^a-zA-Z]/.test(t)){this.consume();var n=t.slice(5),r=n.charAt(0)===`*`;if(r&&(n=n.slice(1)),n.length<2||n.charAt(0)!==n.slice(-1))throw new V(`\\verb assertion failed --
290
+ please report what input caused this bug`);return n=n.slice(1,-1),{type:`verb`,mode:`text`,body:n,star:r}}sy.hasOwnProperty(t[0])&&!Om[this.mode][t[0]]&&(this.settings.strict&&this.mode===`math`&&this.settings.reportNonstrict(`unicodeTextInMathMode`,`Accented Unicode text character "`+t[0]+`" used in math mode`,e),t=sy[t[0]]+t.slice(1));var i=Wv.exec(t);i&&(t=t.substring(0,i.index),t===`i`?t=`ı`:t===`j`&&(t=`ȷ`));var a;if(Om[this.mode][t]){this.settings.strict&&this.mode===`math`&&$m.includes(t)&&this.settings.reportNonstrict(`unicodeTextInMathMode`,`Latin-1/Unicode text character "`+t[0]+`" used in math mode`,e);var o=Om[this.mode][t].group,s=K_.range(e);a=Lg(o)?{type:`atom`,mode:this.mode,family:o,loc:s,text:t}:{type:o,mode:this.mode,loc:s,text:t}}else if(t.charCodeAt(0)>=128)this.settings.strict&&(Rp(t.charCodeAt(0))?this.mode===`math`&&this.settings.reportNonstrict(`unicodeTextInMathMode`,`Unicode text character "`+t[0]+`" used in math mode`,e):this.settings.reportNonstrict(`unknownSymbol`,`Unrecognized Unicode character "`+t[0]+`"`+(` (`+t.charCodeAt(0)+`)`),e)),a={type:`textord`,mode:`text`,loc:K_.range(e),text:t};else return null;if(this.consume(),i)for(var c=0;c<i[0].length;c++){var l=i[0][c];if(!oy[l])throw new V(`Unknown accent ' `+l+`'`,e);var u=oy[l][this.mode]||oy[l].text;if(!u)throw new V(`Accent `+l+` unsupported in `+this.mode+` mode`,e);a={type:`accent`,mode:this.mode,loc:K_.range(e),label:u,isStretchy:!1,isShifty:!0,base:a}}return a}};cy.endOfExpression=new Set([`}`,`\\endgroup`,`\\end`,`\\right`,`&`]);var ly=function(e,t){if(!(typeof e==`string`||e instanceof String))throw TypeError(`KaTeX can only parse string typed expression`);var n=new cy(e,t);delete n.gullet.macros.current[`\\df@tag`];var r=n.parse();if(delete n.gullet.macros.current[`\\current@color`],delete n.gullet.macros.current[`\\color`],n.gullet.macros.get(`\\df@tag`)){if(!t.displayMode)throw new V(`\\tag works only in display equations`);r=[{type:`tag`,mode:`text`,body:r,tag:n.subparse([new q_(`\\df@tag`)])}]}return r},uy=function(e,t,n){t.textContent=``;var r=my(e,n).toNode();t.appendChild(r)};typeof document<`u`&&document.compatMode!==`CSS1Compat`&&(typeof console<`u`&&console.warn(`Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype.`),uy=function(){throw new V(`KaTeX doesn't work in quirks mode.`)});var dy=function(e,t){return my(e,t).toMarkup()},fy=function(e,t){return ly(e,new _p(t))},py=function(e,t,n){if(n.throwOnError||!(e instanceof V))throw e;var r=X([`katex-error`],[new mm(t)]);return r.setAttribute(`title`,e.toString()),r.setAttribute(`style`,`color:`+n.errorColor),r},my=function(e,t){var n=new _p(t);try{return Dg(ly(e,n),e,n)}catch(t){return py(t,e,n)}},hy={version:`0.16.47`,render:uy,renderToString:dy,ParseError:V,SETTINGS_SCHEMA:pp,__parse:fy,__renderToDomTree:my,__renderToHTMLTree:function(e,t){var n=new _p(t);try{return Og(ly(e,n),e,n)}catch(t){return py(t,e,n)}},__setFontMetrics:wm,__defineSymbol:U,__defineFunction:Z,__defineMacro:$,__domTree:{Span:um,Anchor:dm,SymbolNode:mm,SvgNode:hm,PathNode:gm,LineNode:_m}},gy={},_y=[];function vy(e){let t=e||gy;return function(e,n){nd(e,`element`,function(e,r){let i=Array.isArray(e.properties.className)?e.properties.className:_y,a=i.includes(`language-math`),o=i.includes(`math-display`),s=i.includes(`math-inline`),c=o;if(!a&&!o&&!s)return;let l=r[r.length-1],u=e;if(e.tagName===`code`&&a&&l&&l.type===`element`&&l.tagName===`pre`&&(u=l,l=r[r.length-2],c=!0),!l)return;let d=Jf(u,{whitespace:`pre`}),f;try{f=hy.renderToString(d,{...t,displayMode:c,throwOnError:!0})}catch(i){let a=i,o=a.name.toLowerCase();n.message(`Could not render math with KaTeX`,{ancestors:[...r,e],cause:a,place:e.position,ruleId:o,source:`rehype-katex`});try{f=hy.renderToString(d,{...t,displayMode:c,strict:`ignore`,throwOnError:!1})}catch{f=[{type:`element`,tagName:`span`,properties:{className:[`katex-error`],style:`color:`+(t.errorColor||`#cc0000`),title:String(i)},children:[{type:`text`,value:d}]}]}}typeof f==`string`&&(f=jf(f,{fragment:!0}).children);let p=l.children.indexOf(u);return l.children.splice(p,1,...f),td})}}function yy(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function by(e,t,n){let r=Ku((n||{}).ignore||[]),i=xy(t),a=-1;for(;++a<i.length;)nd(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 xy(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([Sy(e[0]),Cy(e[1])])}return t}function Sy(e){return typeof e==`string`?new RegExp(yy(e),`g`):e}function Cy(e){return typeof e==`function`?e:function(){return e}}function wy(e){by(e,[/\r?\n|\r/g,Ty])}function Ty(){return{type:`break`}}function Ey(){return function(e){wy(e)}}function Dy(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 Oy=`phrasing`,ky=[`autolink`,`link`,`image`,`label`];function Ay(){return{transforms:[Ry],enter:{literalAutolink:My,literalAutolinkEmail:Ny,literalAutolinkHttp:Ny,literalAutolinkWww:Ny},exit:{literalAutolink:Ly,literalAutolinkEmail:Iy,literalAutolinkHttp:Py,literalAutolinkWww:Fy}}}function jy(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:Oy,notInConstruct:ky},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:Oy,notInConstruct:ky},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:Oy,notInConstruct:ky}]}}function My(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function Ny(e){this.config.enter.autolinkProtocol.call(this,e)}function Py(e){this.config.exit.autolinkProtocol.call(this,e)}function Fy(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 Iy(e){this.config.exit.autolinkEmail.call(this,e)}function Ly(e){this.exit(e)}function Ry(e){by(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,zy],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,By]],{ignore:[`link`,`linkReference`]})}function zy(e,t,n,r,i){let a=``;if(!Uy(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!Vy(n)))return!1;let o=Hy(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 By(e,t,n,r){return!Uy(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function Vy(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 Hy(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=Dy(e,`(`),a=Dy(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 Uy(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||Cs(n)||Ss(n))&&(!t||n!==47)}$y.peek=Qy;function Wy(){this.buffer()}function Gy(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function Ky(){this.buffer()}function qy(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function Jy(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ds(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Yy(e){this.exit(e)}function Xy(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ds(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Zy(e){this.exit(e)}function Qy(){return`[`}function $y(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 eb(){return{enter:{gfmFootnoteCallString:Wy,gfmFootnoteCall:Gy,gfmFootnoteDefinitionLabelString:Ky,gfmFootnoteDefinition:qy},exit:{gfmFootnoteCallString:Jy,gfmFootnoteCall:Yy,gfmFootnoteDefinitionLabelString:Xy,gfmFootnoteDefinition:Zy}}}function tb(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:$y},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?`
291
+ `:` `)+r.indentLines(r.containerFlow(e,a.current()),t?rb:nb))),s(),o}}function nb(e,t,n){return t===0?e:rb(e,t,n)}function rb(e,t,n){return(n?``:` `)+e}var ib=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];lb.peek=ub;function ab(){return{canContainEols:[`delete`],enter:{strikethrough:sb},exit:{strikethrough:cb}}}function ob(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:ib}],handlers:{delete:lb}}}function sb(e){this.enter({type:`delete`,children:[]},e)}function cb(e){this.exit(e)}function lb(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 ub(){return`~`}function db(e){return e.length}function fb(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||db,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=pb(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]=mb(r[d]);else{let e=mb(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(`
292
+ `)}function pb(e){return e==null?``:String(e)}function mb(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 hb(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()),gb);return i(),o}function gb(e,t,n){return`>`+(n?``:` `)+e}function _b(e,t){return vb(e,t.inConstruct,!0)&&!vb(e,t.notInConstruct,!1)}function vb(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 yb(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
293
+ `&&_b(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
294
+ `}function bb(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 xb(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 Sb(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function Cb(e,t,n,r){let i=Sb(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(xb(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,wb);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(bb(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:`
295
+ `,encode:["`"],...s.current()})),t()}return u+=s.move(`
296
+ `),a&&(u+=s.move(a+`
297
+ `)),u+=s.move(c),l(),u}function wb(e,t,n){return(n?``:` `)+e}function Tb(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Eb(e,t,n,r){let i=Tb(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?` `:`
298
+ `,...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 Db(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Ob(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function kb(e,t,n){let r=Ns(e),i=Ns(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}}Ab.peek=jb;function Ab(e,t,n,r){let i=Db(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=kb(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=Ob(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=kb(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+Ob(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function jb(e,t,n){return n.options.emphasis||`*`}function Mb(e,t){let n=!1;return id(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)&&Qo(e)&&(t.options.setext||n))}function Nb(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(Mb(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
299
+ `,after:`
300
+ `});return r(),t(),o+`
301
+ `+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
302
+ `))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
303
+ `,...a.current()});return/^[\t ]/.test(l)&&(l=Ob(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}Pb.peek=Fb;function Pb(e){return e.value||``}function Fb(){return`<`}Ib.peek=Lb;function Ib(e,t,n,r){let i=Tb(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 Lb(){return`!`}Rb.peek=zb;function Rb(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 zb(){return`!`}Bb.peek=Vb;function Bb(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 Vb(){return"`"}function Hb(e,t){let n=Qo(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))}Ub.peek=Wb;function Ub(e,t,n,r){let i=Tb(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(Hb(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 Wb(e,t,n){return Hb(e,n)?`<`:`[`}Gb.peek=Kb;function Gb(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 Kb(){return`[`}function qb(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 Jb(e){let t=qb(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 Yb(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Xb(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 Zb(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?Yb(n):qb(n),s=e.ordered?o===`.`?`)`:`.`:Jb(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),Xb(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 Qb(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 $b(e,t,n,r){let i=Qb(n),a=n.bulletCurrent||qb(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 ex(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var tx=Ku([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function nx(e,t,n,r){return(e.children.some(function(e){return tx(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function rx(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}ix.peek=ax;function ix(e,t,n,r){let i=rx(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=kb(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=Ob(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=kb(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+Ob(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function ax(e,t,n){return n.options.strong||`*`}function ox(e,t,n,r){return n.safe(e.value,r)}function sx(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 cx(e,t,n){let r=(Xb(n)+(n.options.ruleSpaces?` `:``)).repeat(sx(n));return n.options.ruleSpaces?r.slice(0,-1):r}var lx={blockquote:hb,break:yb,code:Cb,definition:Eb,emphasis:Ab,hardBreak:yb,heading:Nb,html:Pb,image:Ib,imageReference:Rb,inlineCode:Bb,link:Ub,linkReference:Gb,list:Zb,listItem:$b,paragraph:ex,root:nx,strong:ix,text:ox,thematicBreak:cx};function ux(){return{enter:{table:dx,tableData:hx,tableHeader:hx,tableRow:px},exit:{codeText:gx,table:fx,tableData:mx,tableHeader:mx,tableRow:mx}}}function dx(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 fx(e){this.exit(e),this.data.inTable=void 0}function px(e){this.enter({type:`tableRow`,children:[]},e)}function mx(e){this.exit(e)}function hx(e){this.enter({type:`tableCell`,children:[]},e)}function gx(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,_x));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function _x(e,t){return t===`|`?t:e}function vx(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
304
+ `,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(`
305
+ `))}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 fb(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=lx.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function yx(){return{exit:{taskListCheckValueChecked:xx,taskListCheckValueUnchecked:xx,paragraph:Sx}}}function bx(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:Cx}}}function xx(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function Sx(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 Cx(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=lx.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 wx(){return[Ay(),eb(),ab(),ux(),yx()]}function Tx(e){return{extensions:[jy(),tb(e),ob(),vx(e),bx()]}}var Ex={tokenize:Bx,partial:!0},Dx={tokenize:Vx,partial:!0},Ox={tokenize:Hx,partial:!0},kx={tokenize:Ux,partial:!0},Ax={tokenize:Wx,partial:!0},jx={name:`wwwAutolink`,tokenize:Rx,previous:Gx},Mx={name:`protocolAutolink`,tokenize:zx,previous:Kx},Nx={name:`emailAutolink`,tokenize:Lx,previous:qx},Px={};function Fx(){return{text:Px}}for(var Ix=48;Ix<123;)Px[Ix]=Nx,Ix++,Ix===58?Ix=65:Ix===91&&(Ix=97);Px[43]=Nx,Px[45]=Nx,Px[46]=Nx,Px[95]=Nx,Px[72]=[Nx,Mx],Px[104]=[Nx,Mx],Px[87]=[Nx,jx],Px[119]=[Nx,jx];function Lx(e,t,n){let r=this,i,a;return o;function o(t){return!Jx(t)||!qx.call(r,r.previous)||Yx(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return Jx(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(Ax,u,l)(t):t===45||t===95||ps(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&&fs(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function Rx(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!Gx.call(r,r.previous)||Yx(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(Ex,e.attempt(Dx,e.attempt(Ox,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function zx(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&Kx.call(r,r.previous)&&!Yx(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(fs(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||hs(t)||bs(t)||Cs(t)||Ss(t)?n(t):e.attempt(Dx,e.attempt(Ox,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function Bx(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 Vx(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(kx,c,s)(t):t===null||bs(t)||Cs(t)||t!==45&&Ss(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 Hx(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(kx,t,a)(o):o===null||bs(o)||Cs(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function Ux(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||bs(o)||Cs(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||bs(e)||Cs(e)?t(e):r(e)}function a(e){return fs(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):fs(t)?(e.consume(t),o):n(t)}}function Wx(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return ps(e)?n(e):t(e)}}function Gx(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||bs(e)}function Kx(e){return!fs(e)}function qx(e){return!(e===47||Jx(e))}function Jx(e){return e===43||e===45||e===46||e===95||ps(e)}function Yx(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}var Xx={tokenize:iS,partial:!0};function Zx(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:tS,continuation:{tokenize:nS},exit:rS}},text:{91:{name:`gfmFootnoteCall`,tokenize:eS},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:Qx,resolveTo:$x}}}}function Qx(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=ds(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 $x(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 eS(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||bs(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(ds(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return bs(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 tS(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||bs(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=ds(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return bs(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),Es(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function nS(e,t,n){return e.check(Vs,t,e.attempt(Xx,t,n))}function rS(e){e.exit(`gfmFootnoteDefinition`)}function iS(e,t,n){let r=this;return Es(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 aS(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&&is(o,o.length,0,Ps(s,e.slice(r+1,n),t)),is(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),is(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=Ns(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=Ns(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var oS=class{constructor(){this.map=[]}add(e,t,n){sS(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 sS(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 cS(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 lS(){return{flow:{null:{name:`table`,tokenize:uS,resolveAll:dS}}}}function uS(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):ys(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):xs(t)?Es(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||bs(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,xs(t)?Es(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 xs(t)?Es(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||ys(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 xs(t)?Es(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||ys(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||ys(n)?(e.exit(`tableRow`),t(n)):xs(n)?Es(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||bs(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 dS(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 oS;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(pS(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=fS(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=fS(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=fS(f,t,o,i,n,d)):(o[0]=o[1],d=fS(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&pS(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=cS(t.events,n))}return e}function fS(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},mS(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=mS(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=mS(t.events,n[2]),a=mS(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({},mS(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function pS(e,t,n,r,i){let a=[],o=mS(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 mS(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var hS={name:`tasklistCheck`,tokenize:_S};function gS(){return{text:{91:hS}}}function _S(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 bs(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 ys(r)?t(r):xs(r)?e.check({tokenize:vS},t,n)(r):n(r)}}function vS(e,t,n){return Es(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function yS(e){return ss([Fx(),Zx(),aS(e),lS(),gS()])}var bS={};function xS(e){let t=this,n=e||bS,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(yS(n)),a.push(wx()),o.push(Tx(n))}function SS(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:a},exit:{mathFlow:i,mathFlowFence:r,mathFlowFenceMeta:n,mathFlowValue:s,mathText:o,mathTextData:s}};function e(e){this.enter({type:`math`,meta:null,value:``,data:{hName:`pre`,hChildren:[{type:`element`,tagName:`code`,properties:{className:[`language-math`,`math-display`]},children:[]}]}},e)}function t(){this.buffer()}function n(){let e=this.resume(),t=this.stack[this.stack.length-1];t.type,t.meta=e}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(e){let t=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),n=this.stack[this.stack.length-1];n.type,this.exit(e),n.value=t;let r=n.data.hChildren[0];r.type,r.tagName,r.children.push({type:`text`,value:t}),this.data.mathFlowInside=void 0}function a(e){this.enter({type:`inlineMath`,value:``,data:{hName:`code`,hProperties:{className:[`language-math`,`math-inline`]},hChildren:[]}},e),this.buffer()}function o(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,this.exit(e),n.value=t,n.data.hChildren.push({type:`text`,value:t})}function s(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}}function CS(e){let t=(e||{}).singleDollarTextMath;return t??=!0,r.peek=i,{unsafe:[{character:`\r`,inConstruct:`mathFlowMeta`},{character:`
306
+ `,inConstruct:`mathFlowMeta`},{character:`$`,after:t?void 0:`\\$`,inConstruct:`phrasing`},{character:`$`,inConstruct:`mathFlowMeta`},{atBreak:!0,character:`$`,after:`\\$`}],handlers:{math:n,inlineMath:r}};function n(e,t,n,r){let i=e.value||``,a=n.createTracker(r),o=`$`.repeat(Math.max(bb(i,`$`)+1,2)),s=n.enter(`mathFlow`),c=a.move(o);if(e.meta){let t=n.enter(`mathFlowMeta`);c+=a.move(n.safe(e.meta,{after:`
307
+ `,before:c,encode:[`$`],...a.current()})),t()}return c+=a.move(`
308
+ `),i&&(c+=a.move(i+`
309
+ `)),c+=a.move(o),s(),c}function r(e,n,r){let i=e.value||``,a=1;for(t||a++;RegExp(`(^|[^$])`+`\\$`.repeat(a)+`([^$]|$)`).test(i);)a++;let o=`$`.repeat(a);/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^\$|\$$/.test(i))&&(i=` `+i+` `);let s=-1;for(;++s<r.unsafe.length;){let e=r.unsafe[s];if(!e.atBreak)continue;let t=r.compilePattern(e),n;for(;n=t.exec(i);){let e=n.index;i.codePointAt(e)===10&&i.codePointAt(e-1)===13&&e--,i=i.slice(0,e)+` `+i.slice(n.index+1)}}return o+i+o}function i(){return`$`}}var wS={tokenize:ES,concrete:!0,name:`mathFlow`},TS={tokenize:DS,partial:!0};function ES(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){return e.enter(`mathFlow`),e.enter(`mathFlowFence`),e.enter(`mathFlowFenceSequence`),c(t)}function c(t){return t===36?(e.consume(t),o++,c):o<2?n(t):(e.exit(`mathFlowFenceSequence`),Es(e,l,`whitespace`)(t))}function l(t){return t===null||ys(t)?d(t):(e.enter(`mathFlowFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===null||ys(t)?(e.exit(`chunkString`),e.exit(`mathFlowFenceMeta`),d(t)):t===36?n(t):(e.consume(t),u)}function d(n){return e.exit(`mathFlowFence`),r.interrupt?t(n):e.attempt(TS,f,g)(n)}function f(t){return e.attempt({tokenize:_,partial:!0},g,p)(t)}function p(t){return(a?Es(e,m,`linePrefix`,a+1):m)(t)}function m(t){return t===null?g(t):ys(t)?e.attempt(TS,f,g)(t):(e.enter(`mathFlowValue`),h(t))}function h(t){return t===null||ys(t)?(e.exit(`mathFlowValue`),m(t)):(e.consume(t),h)}function g(n){return e.exit(`mathFlow`),t(n)}function _(e,t,n){let i=0;return Es(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4);function a(t){return e.enter(`mathFlowFence`),e.enter(`mathFlowFenceSequence`),s(t)}function s(t){return t===36?(i++,e.consume(t),s):i<o?n(t):(e.exit(`mathFlowFenceSequence`),Es(e,c,`whitespace`)(t))}function c(r){return r===null||ys(r)?(e.exit(`mathFlowFence`),t(r)):n(r)}}}function DS(e,t,n){let r=this;return i;function i(n){return n===null?t(n):(e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function OS(e){let t=(e||{}).singleDollarTextMath;return t??=!0,{tokenize:n,resolve:kS,previous:AS,name:`mathText`};function n(e,n,r){let i=0,a,o;return s;function s(t){return e.enter(`mathText`),e.enter(`mathTextSequence`),c(t)}function c(n){return n===36?(e.consume(n),i++,c):i<2&&!t?r(n):(e.exit(`mathTextSequence`),l(n))}function l(t){return t===null?r(t):t===36?(o=e.enter(`mathTextSequence`),a=0,d(t)):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),l):ys(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),l):(e.enter(`mathTextData`),u(t))}function u(t){return t===null||t===32||t===36||ys(t)?(e.exit(`mathTextData`),l(t)):(e.consume(t),u)}function d(t){return t===36?(e.consume(t),a++,d):a===i?(e.exit(`mathTextSequence`),e.exit(`mathText`),n(t)):(o.type=`mathTextData`,u(t))}}}function kS(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===`mathTextData`){e[t][1].type=`mathTextPadding`,e[n][1].type=`mathTextPadding`,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=`mathTextData`,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 AS(e){return e!==36||this.events[this.events.length-1][1].type===`characterEscape`}function jS(e){return{flow:{36:wS},text:{36:OS(e)}}}var MS={};function NS(e){let t=this,n=e||MS,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(jS(n)),a.push(SS()),o.push(CS(n))}var PS=[{id:`dark`,label:`Dark (default)`,mode:`dark`},{id:`light`,label:`Light`,mode:`light`},{id:`dracula`,label:`Dracula`,mode:`dark`},{id:`solarized-dark`,label:`Solarized Dark`,mode:`dark`},{id:`catppuccin-mocha`,label:`Catppuccin Mocha`,mode:`dark`}],FS=`forge.theme`;function IS(e){return typeof e==`string`&&PS.some(t=>t.id===e)}function LS(){try{let e=localStorage.getItem(FS);if(IS(e))return e}catch{}return`dark`}function RS(e){try{localStorage.setItem(FS,e)}catch{}}var zS={dark:`#0a0a0a`,light:`#ffffff`,dracula:`#191a21`,"solarized-dark":`#002b36`,"catppuccin-mocha":`#11111b`};function BS(e){if(typeof document>`u`)return;let t=document.querySelector(`meta[name="theme-color"]`);t!==null&&t.setAttribute(`content`,zS[e]??zS.dark)}function VS(e){typeof document>`u`||(document.documentElement.dataset.theme=e,BS(e))}function HS(){let e=LS();return VS(e),e}var US=ft(e=>({theme:LS(),setTheme:t=>{VS(t),RS(t),e({theme:t})}}));function WS(e){return PS.find(t=>t.id===e)??PS[0]}function GS(e,t){if(typeof getComputedStyle>`u`)return t;let n=getComputedStyle(document.documentElement).getPropertyValue(e).trim();return n.length>0?n:t}function KS({code:e}){let[t,n]=(0,v.useState)(!1);return(0,R.jsx)(`button`,{type:`button`,onClick:()=>{if(e.length===0)return;let t=()=>{n(!0),window.setTimeout(()=>n(!1),1200)},r=navigator.clipboard?.writeText?.bind(navigator.clipboard);if(r!==void 0){r(e).then(t).catch(i);return}i();function i(){try{let n=document.createElement(`textarea`);n.value=e,n.style.position=`fixed`,n.style.opacity=`0`,document.body.appendChild(n),n.select(),document.execCommand(`copy`),document.body.removeChild(n),t()}catch{}}},className:`absolute right-1 top-1 inline-flex min-h-11 min-w-11 items-center justify-center rounded bg-neutral-800/80 p-1 text-neutral-400 transition-opacity hover:text-neutral-100 focus:opacity-100 md:min-h-0 md:min-w-0 md:opacity-0 md:group-hover:opacity-100`,title:`Copy code block`,"aria-label":`Copy code block`,children:t?(0,R.jsx)(ue,{size:14}):(0,R.jsx)(ye,{size:14})})}var qS={h1:({children:e})=>(0,R.jsx)(`h1`,{className:`mb-1 mt-3 text-base font-semibold first:mt-0`,children:e}),h2:({children:e})=>(0,R.jsx)(`h2`,{className:`mb-1 mt-3 text-sm font-semibold first:mt-0`,children:e}),h3:({children:e})=>(0,R.jsx)(`h3`,{className:`mb-1 mt-2 text-sm font-semibold first:mt-0`,children:e}),h4:({children:e})=>(0,R.jsx)(`h4`,{className:`mb-1 mt-2 text-xs font-semibold first:mt-0`,children:e}),h5:({children:e})=>(0,R.jsx)(`h5`,{className:`mb-1 mt-2 text-xs font-semibold first:mt-0`,children:e}),h6:({children:e})=>(0,R.jsx)(`h6`,{className:`mb-1 mt-2 text-xs font-semibold first:mt-0`,children:e}),p:({children:e})=>(0,R.jsx)(`p`,{className:`my-2 first:mt-0 last:mb-0`,children:e}),ul:({children:e})=>(0,R.jsx)(`ul`,{className:`my-2 ml-5 list-disc space-y-1 first:mt-0`,children:e}),ol:({children:e})=>(0,R.jsx)(`ol`,{className:`my-2 ml-5 list-decimal space-y-1 first:mt-0`,children:e}),li:({children:e})=>(0,R.jsx)(`li`,{className:`leading-snug`,children:e}),blockquote:({children:e})=>(0,R.jsx)(`blockquote`,{className:`my-2 border-l-2 border-neutral-700 pl-3 text-neutral-400`,children:e}),table:({children:e})=>(0,R.jsx)(`div`,{className:`my-2 overflow-x-auto`,children:(0,R.jsx)(`table`,{className:`min-w-full border-collapse text-xs`,children:e})}),th:({children:e})=>(0,R.jsx)(`th`,{className:`border border-neutral-800 px-2 py-1 text-left font-semibold`,children:e}),td:({children:e})=>(0,R.jsx)(`td`,{className:`border border-neutral-800 px-2 py-1 align-top`,children:e}),a:({children:e,href:t})=>(0,R.jsx)(`a`,{href:t,target:`_blank`,rel:`noopener noreferrer`,className:`text-blue-400 underline hover:text-blue-300 light:text-blue-700 light:hover:text-blue-900`,children:e}),hr:()=>(0,R.jsx)(`hr`,{className:`my-3 border-neutral-800`}),strong:({children:e})=>(0,R.jsx)(`strong`,{className:`font-semibold`,children:e}),em:({children:e})=>(0,R.jsx)(`em`,{className:`italic`,children:e}),code:({className:e,children:t,...n})=>{let r=WS(US(e=>e.theme)).mode===`light`,i=/language-([\w-]+)/.exec(e??``),a=String(t??``).replace(/\n$/,``);if(!(i!==null||a.includes(`
310
+ `)))return(0,R.jsx)(`code`,{className:`rounded bg-neutral-800 px-1 py-0.5 font-mono text-[0.9em] text-neutral-100`,...n,children:t});let o=i?.[1]??`text`,s=r?Ri.vsLight:Ri.vsDark,c=r?`#f8fafc`:`#0d0d0d`;return(0,R.jsxs)(`div`,{className:`group relative`,children:[(0,R.jsx)(KS,{code:a}),(0,R.jsx)(ha,{code:a,language:o,theme:s,children:({style:e,tokens:t,getLineProps:n,getTokenProps:r})=>(0,R.jsx)(`pre`,{className:`overflow-x-auto rounded border border-neutral-800 p-2 font-mono text-[12px]`,style:{...e,background:c},children:t.map((e,t)=>(0,R.jsx)(`div`,{...n({line:e}),children:e.map((e,t)=>(0,R.jsx)(`span`,{...r({token:e})},t))},t))})})]})},pre:({children:e})=>(0,R.jsx)(R.Fragment,{children:e})};function JS({text:e,size:t=`sm`,chatStyleBreaks:n=!1}){let r=t===`xs`?`text-xs`:`text-sm`,i=n?[xS,NS,Ey]:[xS,NS];return(0,R.jsx)(`div`,{className:`${r} break-words [overflow-wrap:anywhere]`,children:(0,R.jsx)(nf,{remarkPlugins:i,rehypePlugins:[vy],components:qS,children:e})})}function YS({event:e,renderArchived:t}){let[n,r]=(0,v.useState)(!1),i=e.summary.split(`
311
+ `)[0]?.trim()??``,a=i.length>160?i.slice(0,157)+`…`:i,o=new Date(e.timestamp),s=`${o.toLocaleDateString()} ${o.toLocaleTimeString()}`,c=e.archivedMessages.length;return(0,R.jsxs)(`div`,{className:`my-2 rounded-md border border-dashed border-amber-700/50 bg-amber-900/10 light:border-amber-300 light:bg-amber-50`,children:[(0,R.jsxs)(`button`,{type:`button`,onClick:()=>r(e=>!e),className:`flex w-full items-center gap-2 px-3 py-2 text-left text-xs text-amber-200/90 hover:bg-amber-900/20 light:text-amber-800 light:hover:bg-amber-100`,title:n?`Hide archived messages`:`Expand ${c} archived message${c===1?``:`s`}`,children:[n?(0,R.jsx)(de,{size:12}):(0,R.jsx)(pe,{size:12}),(0,R.jsx)(je,{size:12,className:`text-amber-400 light:text-amber-700`}),(0,R.jsx)(`span`,{className:`flex-1 truncate`,children:a.length>0?a:`Compaction`}),(0,R.jsxs)(`span`,{className:`shrink-0 font-mono text-[10px] text-amber-300/70 light:text-amber-700/80`,children:[c,` msg · `,e.tokensBefore.toLocaleString(),` tok · `,s]})]}),n&&(0,R.jsxs)(`div`,{className:`border-t border-dashed border-amber-700/50 px-3 py-3 light:border-amber-300`,children:[e.summary.length>0&&(0,R.jsx)(`div`,{className:`mb-3 whitespace-pre-wrap rounded bg-amber-900/15 px-2 py-1 text-[11px] italic text-amber-100/80 light:bg-amber-100 light:text-amber-800`,children:e.summary}),(0,R.jsx)(`div`,{className:`space-y-3 opacity-80`,children:t()})]})]})}function XS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ZS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?XS(Object(n),!0).forEach((function(t){QS(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):XS(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function QS(e,t,n){return(t=function(e){var t=function(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}(e,`string`);return typeof t==`symbol`?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $S(e,t){if(e==null)return{};var n,r,i=function(e,t){if(e==null)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function eC(e,t){return rC(e)||function(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}(e,t)||aC(e,t)||sC()}function tC(e){return rC(e)||iC(e)||aC(e)||sC()}function nC(e){return function(e){if(Array.isArray(e))return oC(e)}(e)||iC(e)||aC(e)||function(){throw TypeError(`Invalid attempt to spread non-iterable instance.
312
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function rC(e){if(Array.isArray(e))return e}function iC(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function aC(e,t){if(e){if(typeof e==`string`)return oC(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?oC(e,t):void 0}}function oC(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function sC(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
313
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function cC(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=aC(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
314
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}var lC=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};function uC(e,t){return e(t={exports:{}},t.exports),t.exports}var dC=uC((function(e){(function(){var t={}.hasOwnProperty;function n(){for(var e=[],r=0;r<arguments.length;r++){var i=arguments[r];if(i){var a=typeof i;if(a===`string`||a===`number`)e.push(i);else if(Array.isArray(i)){if(i.length){var o=n.apply(null,i);o&&e.push(o)}}else if(a===`object`){if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes(`[native code]`)){e.push(i.toString());continue}for(var s in i)t.call(i,s)&&i[s]&&e.push(s)}}}return e.join(` `)}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})),fC={hunkClassName:``,lineClassName:``,gutterClassName:``,codeClassName:``,monotonous:!1,gutterType:`default`,viewType:`split`,widgets:{},hideGutter:!1,selectedChanges:[],generateAnchorID:function(){},generateLineClassName:function(){},renderGutter:function(e){var t=e.renderDefault;return(0,e.wrapInAnchor)(t())},codeEvents:{},gutterEvents:{}},pC=(0,v.createContext)(fC),mC=pC.Provider,hC=function(){return(0,v.useContext)(pC)},gC=uC((function(e,t){(function(t){function n(e){var t=e.slice(11),n=null,r=null;switch(t.indexOf(`"`)){case-1:n=(o=t.split(` `))[0].slice(2),r=o[1].slice(2);break;case 0:var i=t.indexOf(`"`,2);n=t.slice(3,i);var a=t.indexOf(`"`,i+1);r=a<0?t.slice(i+4):t.slice(a+3,-1);break;default:var o;n=(o=t.split(` `))[0].slice(2),r=o[1].slice(3,-1)}return{oldPath:n,newPath:r}}e.exports={parse:function(e){for(var t,r,i,a,o,s=[],c=2,l=e.split(`
315
+ `),u=l.length,d=0;d<u;){var f=l[d];if(f.indexOf(`diff --git`)===0){t={hunks:[],oldEndingNewLine:!0,newEndingNewLine:!0,oldPath:(o=n(f)).oldPath,newPath:o.newPath},s.push(t);var p,m=null;simiLoop:for(;p=l[++d];){var h=p.indexOf(` `),g=h>-1?p.slice(0,h):g;switch(g){case`diff`:d--;break simiLoop;case`deleted`:case`new`:var _=p.slice(h+1);_.indexOf(`file mode`)===0&&(t[g===`new`?`newMode`:`oldMode`]=_.slice(10));break;case`similarity`:t.similarity=parseInt(p.split(` `)[2],10);break;case`index`:var v=p.slice(h+1).split(` `),y=v[0].split(`..`);t.oldRevision=y[0],t.newRevision=y[1],v[1]&&(t.oldMode=t.newMode=v[1]);break;case`copy`:case`rename`:var b=p.slice(h+1);b.indexOf(`from`)===0?t.oldPath=b.slice(5):t.newPath=b.slice(3),m=g;break;case`---`:var x=p.slice(h+1),S=l[++d].slice(4);x===`/dev/null`?(S=S.slice(2),m=`add`):S===`/dev/null`?(x=x.slice(2),m=`delete`):(m=`modify`,x=x.slice(2),S=S.slice(2)),x&&(t.oldPath=x),S&&(t.newPath=S),c=5;break simiLoop}}t.type=m||`modify`}else if(f.indexOf(`Binary`)===0)t.isBinary=!0,t.type=f.indexOf(`/dev/null and`)>=0?`add`:f.indexOf(`and /dev/null`)>=0?`delete`:`modify`,c=2,t=null;else if(c===5)if(f.indexOf(`@@`)===0){var C=/^@@\s+-([0-9]+)(,([0-9]+))?\s+\+([0-9]+)(,([0-9]+))?/.exec(f);r={content:f,oldStart:C[1]-0,newStart:C[4]-0,oldLines:C[3]-0||1,newLines:C[6]-0||1,changes:[]},t.hunks.push(r),i=r.oldStart,a=r.newStart}else{var w=f.slice(0,1),T={content:f.slice(1)};switch(w){case`+`:T.type=`insert`,T.isInsert=!0,T.lineNumber=a,a++;break;case`-`:T.type=`delete`,T.isDelete=!0,T.lineNumber=i,i++;break;case` `:T.type=`normal`,T.isNormal=!0,T.oldLineNumber=i,T.newLineNumber=a,i++,a++;break;case`\\`:var E=r.changes[r.changes.length-1];E.isDelete||(t.newEndingNewLine=!1),E.isInsert||(t.oldEndingNewLine=!1)}T.type&&r.changes.push(T)}d++}return s}}})()}));function _C(e){return e.type===`insert`}function vC(e){return e.type===`delete`}function yC(e){return e.type===`normal`}function bC(e,t){var n=t.nearbySequences===`zip`?function(e){return eC(e.reduce((function(e,t,n){var r=eC(e,3),i=r[0],a=r[1],o=r[2];return a?_C(t)&&o>=0?(i.splice(o+1,0,t),[i,t,o+2]):(i.push(t),[i,t,vC(t)&&vC(a)?o:n]):(i.push(t),[i,t,vC(t)?n:-1])}),[[],null,-1]),1)[0]}(e.changes):e.changes;return ZS(ZS({},e),{},{isPlain:!1,changes:n})}function xC(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=function(e){if(e.startsWith(`diff --git`))return e;var t=e.indexOf(`
316
+ `),n=e.indexOf(`
317
+ `,t+1),r=e.slice(0,t),i=e.slice(t+1,n),a=r.split(` `).slice(1,-3).join(` `),o=i.split(` `).slice(1,-3).join(` `);return[`diff --git a/${a} b/${o}`,`index 1111111..2222222 100644`,`--- a/${a}`,`+++ b/${o}`,e.slice(n+1)].join(`
318
+ `)}(e.trimStart());return gC.parse(n).map((function(e){return function(e,t){var n=e.hunks.map((function(e){return bC(e,t)}));return ZS(ZS({},e),{},{hunks:n})}(e,t)}))}function SC(e){return e[0]}function CC(e){return e[e.length-1]}function wC(e){return[`${e}Start`,`${e}Lines`]}function TC(e){return e===`old`?function(e){return _C(e)?-1:yC(e)?e.oldLineNumber:e.lineNumber}:function(e){return vC(e)?-1:yC(e)?e.newLineNumber:e.lineNumber}}function EC(e,t){return function(n,r){var i=n[e],a=i+n[t];return r>=i&&r<a}}function DC(e,t){return function(n,r,i){var a=n[e]+n[t],o=r[e];return i>=a&&i<o}}function OC(e){var t=TC(e),n=function(e){var t=eC(wC(e),2),n=EC(t[0],t[1]);return function(e,t){return e.find((function(e){return n(e,t)}))}}(e);return function(e,r){var i=n(e,r);if(i)return i.changes.find((function(e){return t(e)===r}))}}function kC(e){var t=e===`old`?`new`:`old`,n=eC(wC(e),2),r=n[0],i=n[1],a=eC(wC(t),2),o=a[0],s=a[1],c=TC(e),l=TC(t),u=EC(r,i),d=DC(r,i);return function(e,t){var n=SC(e);if(t<n[r]){var a=n[r]-t;return n[o]-a}var f=CC(e);if(f[r]+f[i]<=t){var p=t-f[r]-f[i];return f[o]+f[s]+p}for(var m=0;m<e.length;m++){var h=e[m],g=e[m+1];if(u(h,t)){var _=h.changes.findIndex((function(e){return c(e)===t})),v=h.changes[_];if(yC(v))return l(v);var y=vC(v)?_+1:_-1,b=h.changes[y];if(!b)return-1;var x=_C(v)?`delete`:`insert`;return b.type===x?l(b):-1}if(d(h,g,t)){var S=t-h[r]-h[i];return h[o]+h[s]+S}}throw Error(`Unexpected line position ${t}`)}}var AC=function(){this.__data__=[],this.size=0},jC=function(e,t){return e===t||e!=e&&t!=t},MC=function(e,t){for(var n=e.length;n--;)if(jC(e[n][0],t))return n;return-1},NC=Array.prototype.splice,PC=function(e){var t=this.__data__,n=MC(t,e);return!(n<0)&&(n==t.length-1?t.pop():NC.call(t,n,1),--this.size,!0)},FC=function(e){var t=this.__data__,n=MC(t,e);return n<0?void 0:t[n][1]},IC=function(e){return MC(this.__data__,e)>-1},LC=function(e,t){var n=this.__data__,r=MC(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function RC(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}RC.prototype.clear=AC,RC.prototype.delete=PC,RC.prototype.get=FC,RC.prototype.has=IC,RC.prototype.set=LC;var zC=RC,BC=function(){this.__data__=new zC,this.size=0},VC=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},HC=function(e){return this.__data__.get(e)},UC=function(e){return this.__data__.has(e)},WC=typeof lC==`object`&&lC&&lC.Object===Object&&lC,GC=typeof self==`object`&&self&&self.Object===Object&&self,KC=WC||GC||Function(`return this`)(),qC=KC.Symbol,JC=Object.prototype,YC=JC.hasOwnProperty,XC=JC.toString,ZC=qC?qC.toStringTag:void 0,QC=function(e){var t=YC.call(e,ZC),n=e[ZC];try{e[ZC]=void 0;var r=!0}catch{}var i=XC.call(e);return r&&(t?e[ZC]=n:delete e[ZC]),i},$C=Object.prototype.toString,ew=function(e){return $C.call(e)},tw=qC?qC.toStringTag:void 0,nw=function(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:tw&&tw in Object(e)?QC(e):ew(e)},rw=function(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)},iw=function(e){if(!rw(e))return!1;var t=nw(e);return t==`[object Function]`||t==`[object GeneratorFunction]`||t==`[object AsyncFunction]`||t==`[object Proxy]`},aw=KC[`__core-js_shared__`],ow=function(){var e=/[^.]+$/.exec(aw&&aw.keys&&aw.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}(),sw=function(e){return!!ow&&ow in e},cw=Function.prototype.toString,lw=function(e){if(e!=null){try{return cw.call(e)}catch{}try{return e+``}catch{}}return``},uw=/^\[object .+?Constructor\]$/,dw=Function.prototype,fw=Object.prototype,pw=dw.toString,mw=fw.hasOwnProperty,hw=RegExp(`^`+pw.call(mw).replace(/[\\^$.*+?()[\]{}|]/g,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`),gw=function(e){return!(!rw(e)||sw(e))&&(iw(e)?hw:uw).test(lw(e))},_w=function(e,t){return e?.[t]},vw=function(e,t){var n=_w(e,t);return gw(n)?n:void 0},yw=vw(KC,`Map`),bw=vw(Object,`create`),xw=function(){this.__data__=bw?bw(null):{},this.size=0},Sw=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t},Cw=Object.prototype.hasOwnProperty,ww=function(e){var t=this.__data__;if(bw){var n=t[e];return n===`__lodash_hash_undefined__`?void 0:n}return Cw.call(t,e)?t[e]:void 0},Tw=Object.prototype.hasOwnProperty,Ew=function(e){var t=this.__data__;return bw?t[e]!==void 0:Tw.call(t,e)},Dw=function(e,t){var n=this.__data__;return this.size+=+!this.has(e),n[e]=bw&&t===void 0?`__lodash_hash_undefined__`:t,this};function Ow(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Ow.prototype.clear=xw,Ow.prototype.delete=Sw,Ow.prototype.get=ww,Ow.prototype.has=Ew,Ow.prototype.set=Dw;var kw=Ow,Aw=function(){this.size=0,this.__data__={hash:new kw,map:new(yw||zC),string:new kw}},jw=function(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null},Mw=function(e,t){var n=e.__data__;return jw(t)?n[typeof t==`string`?`string`:`hash`]:n.map},Nw=function(e){var t=Mw(this,e).delete(e);return this.size-=+!!t,t},Pw=function(e){return Mw(this,e).get(e)},Fw=function(e){return Mw(this,e).has(e)},Iw=function(e,t){var n=Mw(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function Lw(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Lw.prototype.clear=Aw,Lw.prototype.delete=Nw,Lw.prototype.get=Pw,Lw.prototype.has=Fw,Lw.prototype.set=Iw;var Rw=Lw,zw=function(e,t){var n=this.__data__;if(n instanceof zC){var r=n.__data__;if(!yw||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Rw(r)}return n.set(e,t),this.size=n.size,this};function Bw(e){var t=this.__data__=new zC(e);this.size=t.size}Bw.prototype.clear=BC,Bw.prototype.delete=VC,Bw.prototype.get=HC,Bw.prototype.has=UC,Bw.prototype.set=zw;var Vw=Bw,Hw=function(e){return this.__data__.set(e,`__lodash_hash_undefined__`),this},Uw=function(e){return this.__data__.has(e)};function Ww(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new Rw;++t<n;)this.add(e[t])}Ww.prototype.add=Ww.prototype.push=Hw,Ww.prototype.has=Uw;var Gw=Ww,Kw=function(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1},qw=function(e,t){return e.has(t)},Jw=function(e,t,n,r,i,a){var o=1&n,s=e.length,c=t.length;if(s!=c&&!(o&&c>s))return!1;var l=a.get(e),u=a.get(t);if(l&&u)return l==t&&u==e;var d=-1,f=!0,p=2&n?new Gw:void 0;for(a.set(e,t),a.set(t,e);++d<s;){var m=e[d],h=t[d];if(r)var g=o?r(h,m,d,t,e,a):r(m,h,d,e,t,a);if(g!==void 0){if(g)continue;f=!1;break}if(p){if(!Kw(t,(function(e,t){if(!qw(p,t)&&(m===e||i(m,e,n,r,a)))return p.push(t)}))){f=!1;break}}else if(m!==h&&!i(m,h,n,r,a)){f=!1;break}}return a.delete(e),a.delete(t),f},Yw=KC.Uint8Array,Xw=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n},Zw=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n},Qw=qC?qC.prototype:void 0,$w=Qw?Qw.valueOf:void 0,eT=function(e,t,n,r,i,a,o){switch(n){case`[object DataView]`:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case`[object ArrayBuffer]`:return!(e.byteLength!=t.byteLength||!a(new Yw(e),new Yw(t)));case`[object Boolean]`:case`[object Date]`:case`[object Number]`:return jC(+e,+t);case`[object Error]`:return e.name==t.name&&e.message==t.message;case`[object RegExp]`:case`[object String]`:return e==t+``;case`[object Map]`:var s=Xw;case`[object Set]`:var c=1&r;if(s||=Zw,e.size!=t.size&&!c)return!1;var l=o.get(e);if(l)return l==t;r|=2,o.set(e,t);var u=Jw(s(e),s(t),r,i,a,o);return o.delete(e),u;case`[object Symbol]`:if($w)return $w.call(e)==$w.call(t)}return!1},tT=function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e},nT=Array.isArray,rT=function(e,t,n){var r=t(e);return nT(e)?r:tT(r,n(e))},iT=function(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a},aT=function(){return[]},oT=Object.prototype.propertyIsEnumerable,sT=Object.getOwnPropertySymbols,cT=sT?function(e){return e==null?[]:(e=Object(e),iT(sT(e),(function(t){return oT.call(e,t)})))}:aT,lT=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r},uT=function(e){return typeof e==`object`&&!!e},dT=function(e){return uT(e)&&nw(e)==`[object Arguments]`},fT=Object.prototype,pT=fT.hasOwnProperty,mT=fT.propertyIsEnumerable,hT=dT(function(){return arguments}())?dT:function(e){return uT(e)&&pT.call(e,`callee`)&&!mT.call(e,`callee`)},gT=function(){return!1},_T=uC((function(e,t){var n=t&&!t.nodeType&&t,r=n&&e&&!e.nodeType&&e,i=r&&r.exports===n?KC.Buffer:void 0;e.exports=(i?i.isBuffer:void 0)||gT})),vT=/^(?:0|[1-9]\d*)$/,yT=function(e,t){var n=typeof e;return!!(t??=9007199254740991)&&(n==`number`||n!=`symbol`&&vT.test(e))&&e>-1&&e%1==0&&e<t},bT=function(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=9007199254740991},xT={};xT[`[object Float32Array]`]=xT[`[object Float64Array]`]=xT[`[object Int8Array]`]=xT[`[object Int16Array]`]=xT[`[object Int32Array]`]=xT[`[object Uint8Array]`]=xT[`[object Uint8ClampedArray]`]=xT[`[object Uint16Array]`]=xT[`[object Uint32Array]`]=!0,xT[`[object Arguments]`]=xT[`[object Array]`]=xT[`[object ArrayBuffer]`]=xT[`[object Boolean]`]=xT[`[object DataView]`]=xT[`[object Date]`]=xT[`[object Error]`]=xT[`[object Function]`]=xT[`[object Map]`]=xT[`[object Number]`]=xT[`[object Object]`]=xT[`[object RegExp]`]=xT[`[object Set]`]=xT[`[object String]`]=xT[`[object WeakMap]`]=!1;var ST=function(e){return uT(e)&&bT(e.length)&&!!xT[nw(e)]},CT=function(e){return function(t){return e(t)}},wT=uC((function(e,t){var n=t&&!t.nodeType&&t,r=n&&e&&!e.nodeType&&e,i=r&&r.exports===n&&WC.process;e.exports=function(){try{return r&&r.require&&r.require(`util`).types||i&&i.binding&&i.binding(`util`)}catch{}}()})),TT=wT&&wT.isTypedArray,ET=TT?CT(TT):ST,DT=Object.prototype.hasOwnProperty,OT=function(e,t){var n=nT(e),r=!n&&hT(e),i=!n&&!r&&_T(e),a=!n&&!r&&!i&&ET(e),o=n||r||i||a,s=o?lT(e.length,String):[],c=s.length;for(var l in e)!t&&!DT.call(e,l)||o&&(l==`length`||i&&(l==`offset`||l==`parent`)||a&&(l==`buffer`||l==`byteLength`||l==`byteOffset`)||yT(l,c))||s.push(l);return s},kT=Object.prototype,AT=function(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||kT)},jT=function(e,t){return function(n){return e(t(n))}}(Object.keys,Object),MT=Object.prototype.hasOwnProperty,NT=function(e){if(!AT(e))return jT(e);var t=[];for(var n in Object(e))MT.call(e,n)&&n!=`constructor`&&t.push(n);return t},PT=function(e){return e!=null&&bT(e.length)&&!iw(e)},FT=function(e){return PT(e)?OT(e):NT(e)},IT=function(e){return rT(e,FT,cT)},LT=Object.prototype.hasOwnProperty,RT=function(e,t,n,r,i,a){var o=1&n,s=IT(e),c=s.length;if(c!=IT(t).length&&!o)return!1;for(var l=c;l--;){var u=s[l];if(!(o?u in t:LT.call(t,u)))return!1}var d=a.get(e),f=a.get(t);if(d&&f)return d==t&&f==e;var p=!0;a.set(e,t),a.set(t,e);for(var m=o;++l<c;){var h=e[u=s[l]],g=t[u];if(r)var _=o?r(g,h,u,t,e,a):r(h,g,u,e,t,a);if(!(_===void 0?h===g||i(h,g,n,r,a):_)){p=!1;break}m||=u==`constructor`}if(p&&!m){var v=e.constructor,y=t.constructor;v==y||!(`constructor`in e)||!(`constructor`in t)||typeof v==`function`&&v instanceof v&&typeof y==`function`&&y instanceof y||(p=!1)}return a.delete(e),a.delete(t),p},zT=vw(KC,`DataView`),BT=vw(KC,`Promise`),VT=vw(KC,`Set`),HT=vw(KC,`WeakMap`),UT=lw(zT),WT=lw(yw),GT=lw(BT),KT=lw(VT),qT=lw(HT),JT=nw;(zT&&JT(new zT(new ArrayBuffer(1)))!=`[object DataView]`||yw&&JT(new yw)!=`[object Map]`||BT&&JT(BT.resolve())!=`[object Promise]`||VT&&JT(new VT)!=`[object Set]`||HT&&JT(new HT)!=`[object WeakMap]`)&&(JT=function(e){var t=nw(e),n=t==`[object Object]`?e.constructor:void 0,r=n?lw(n):``;if(r)switch(r){case UT:return`[object DataView]`;case WT:return`[object Map]`;case GT:return`[object Promise]`;case KT:return`[object Set]`;case qT:return`[object WeakMap]`}return t});var YT=JT,XT=`[object Object]`,ZT=Object.prototype.hasOwnProperty,QT=function(e,t,n,r,i,a){var o=nT(e),s=nT(t),c=o?`[object Array]`:YT(e),l=s?`[object Array]`:YT(t),u=(c=c==`[object Arguments]`?XT:c)==XT,d=(l=l==`[object Arguments]`?XT:l)==XT,f=c==l;if(f&&_T(e)){if(!_T(t))return!1;o=!0,u=!1}if(f&&!u)return a||=new Vw,o||ET(e)?Jw(e,t,n,r,i,a):eT(e,t,c,n,r,i,a);if(!(1&n)){var p=u&&ZT.call(e,`__wrapped__`),m=d&&ZT.call(t,`__wrapped__`);if(p||m){var h=p?e.value():e,g=m?t.value():t;return a||=new Vw,i(h,g,n,r,a)}}return!!f&&(a||=new Vw,RT(e,t,n,r,i,a))},$T=function e(t,n,r,i,a){return t===n||(t==null||n==null||!uT(t)&&!uT(n)?t!=t&&n!=n:QT(t,n,r,i,e,a))},eE=function(e,t,n,r){var i=n.length,a=i,o=!r;if(e==null)return!a;for(e=Object(e);i--;){var s=n[i];if(o&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i<a;){var c=(s=n[i])[0],l=e[c],u=s[1];if(o&&s[2]){if(l===void 0&&!(c in e))return!1}else{var d=new Vw;if(r)var f=r(l,u,c,e,t,d);if(!(f===void 0?$T(u,l,3,r,d):f))return!1}}return!0},tE=function(e){return e==e&&!rw(e)},nE=function(e){for(var t=FT(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,tE(i)]}return t},rE=function(e,t){return function(n){return n!=null&&n[e]===t&&(t!==void 0||e in Object(n))}},iE=function(e){var t=nE(e);return t.length==1&&t[0][2]?rE(t[0][0],t[0][1]):function(n){return n===e||eE(n,e,t)}},aE=function(e){return typeof e==`symbol`||uT(e)&&nw(e)==`[object Symbol]`},oE=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,sE=/^\w*$/,cE=function(e,t){if(nT(e))return!1;var n=typeof e;return!(n!=`number`&&n!=`symbol`&&n!=`boolean`&&e!=null&&!aE(e))||sE.test(e)||!oE.test(e)||t!=null&&e in Object(t)};function lE(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(`Expected a function`);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(lE.Cache||Rw),n}lE.Cache=Rw;var uE=lE,dE=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,fE=/\\(\\)?/g,pE=function(e){var t=uE(e,(function(e){return n.size===500&&n.clear(),e})),n=t.cache;return t}((function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(dE,(function(e,n,r,i){t.push(r?i.replace(fE,`$1`):n||e)})),t})),mE=function(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i},hE=qC?qC.prototype:void 0,gE=hE?hE.toString:void 0,_E=function e(t){if(typeof t==`string`)return t;if(nT(t))return mE(t,e)+``;if(aE(t))return gE?gE.call(t):``;var n=t+``;return n==`0`&&1/t==-1/0?`-0`:n},vE=function(e){return e==null?``:_E(e)},yE=function(e,t){return nT(e)?e:cE(e,t)?[e]:pE(vE(e))},bE=function(e){if(typeof e==`string`||aE(e))return e;var t=e+``;return t==`0`&&1/e==-1/0?`-0`:t},xE=function(e,t){for(var n=0,r=(t=yE(t,e)).length;e!=null&&n<r;)e=e[bE(t[n++])];return n&&n==r?e:void 0},SE=function(e,t,n){var r=e==null?void 0:xE(e,t);return r===void 0?n:r},CE=function(e,t){return e!=null&&t in Object(e)},wE=function(e,t,n){for(var r=-1,i=(t=yE(t,e)).length,a=!1;++r<i;){var o=bE(t[r]);if(!(a=e!=null&&n(e,o)))break;e=e[o]}return a||++r!=i?a:!!(i=e==null?0:e.length)&&bT(i)&&yT(o,i)&&(nT(e)||hT(e))},TE=function(e,t){return e!=null&&wE(e,t,CE)},EE=function(e,t){return cE(e)&&tE(t)?rE(bE(e),t):function(n){var r=SE(n,e);return r===void 0&&r===t?TE(n,e):$T(t,r,3)}},DE=function(e){return e},OE=function(e){return function(t){return t?.[e]}},kE=function(e){return function(t){return xE(t,e)}},AE=function(e){return cE(e)?OE(bE(e)):kE(e)},jE=function(e){return typeof e==`function`?e:e==null?DE:typeof e==`object`?nT(e)?EE(e[0],e[1]):iE(e):AE(e)};function ME(e){if(!e)throw Error(`change is not provided`);return yC(e)?`N${e.oldLineNumber}`:`${_C(e)?`I`:`D`}${e.lineNumber}`}kC(`old`);var NE=TC(`old`),PE=TC(`new`);OC(`old`),OC(`new`),kC(`new`),kC(`old`);var FE=function(){try{var e=vw(Object,`defineProperty`);return e({},``,{}),e}catch{}}(),IE=function(e,t,n){t==`__proto__`&&FE?FE(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},LE=function(e){return function(t,n,r){for(var i=-1,a=Object(t),o=r(t),s=o.length;s--;){var c=o[e?s:++i];if(!1===n(a[c],c,a))break}return t}}(),RE=function(e,t){return e&&LE(e,t,FT)},zE=function(e,t){var n={};return t=jE(t),RE(e,(function(e,r,i){IE(n,r,t(e,r,i))})),n},BE=[`changeKey`,`text`,`tokens`,`renderToken`],VE=function e(t,n){var r=t.type,i=t.value,a=t.markType,o=t.properties,s=t.className,c=t.children,l=function(t){return(0,R.jsx)(`span`,{className:t,children:i||c&&c.map(e)},n)};switch(r){case`text`:return i;case`mark`:return l(`diff-code-mark diff-code-mark-${a}`);case`edit`:return l(`diff-code-edit`);default:var u=o&&o.className;return l(dC(s||u))}};function HE(e){if(!Array.isArray(e))return!0;if(e.length>1)return!1;if(e.length===1){var t=eC(e,1)[0];return t.type===`text`&&!t.value}return!0}function UE(e){var t=e.changeKey,n=e.text,r=e.tokens,i=e.renderToken,a=$S(e,BE),o=i?function(e,t){return i(e,VE,t)}:VE;return(0,R.jsx)(`td`,ZS(ZS({},a),{},{"data-change-key":t,children:r?HE(r)?` `:r.map(o):n||` `}))}var WE=(0,v.memo)(UE);function GE(e,t){return function(){var n=t===`old`?NE(e):PE(e);return n===-1?void 0:n}}function KE(e,t){return function(n){return e&&n?(0,R.jsx)(`a`,{href:t?`#`+t:void 0,children:n}):n}}function qE(e,t){return t?function(n){e(),t(n)}:e}function JE(e,t,n,r){return(0,v.useMemo)((function(){var i=zE(e,(function(e){return function(n){return e&&e(t,n)}}));return i.onMouseEnter=qE(n,i.onMouseEnter),i.onMouseLeave=qE(r,i.onMouseLeave),i}),[e,n,r,t])}function YE(e,t,n,r,i,a,o,s,c){var l={change:t,side:r,inHoverState:s,renderDefault:GE(t,r),wrapInAnchor:KE(i,a)};return(0,R.jsx)(`td`,ZS(ZS({className:e},o),{},{"data-change-key":n,children:c(l)}))}function XE(e){var t,n,r,i=e.change,a=e.selected,o=e.tokens,s=e.className,c=e.generateLineClassName,l=e.gutterClassName,u=e.codeClassName,d=e.gutterEvents,f=e.codeEvents,p=e.hideGutter,m=e.gutterAnchor,h=e.generateAnchorID,g=e.renderToken,_=e.renderGutter,y=i.type,b=i.content,x=ME(i),S=eC((t=eC((0,v.useState)(!1),2),n=t[0],r=t[1],[n,(0,v.useCallback)((function(){return r(!0)}),[]),(0,v.useCallback)((function(){return r(!1)}),[])]),3),C=S[0],w=S[1],T=S[2],E=(0,v.useMemo)((function(){return{change:i}}),[i]),D=JE(d,E,w,T),O=JE(f,E,w,T),k=h(i),ee=c({changes:[i],defaultGenerate:function(){return s}}),te=dC(`diff-gutter`,`diff-gutter-${y}`,l,{"diff-gutter-selected":a}),ne=dC(`diff-code`,`diff-code-${y}`,u,{"diff-code-selected":a});return(0,R.jsxs)(`tr`,{id:k,className:dC(`diff-line`,ee),children:[!p&&YE(te,i,x,`old`,m,k,D,C,_),!p&&YE(te,i,x,`new`,m,k,D,C,_),(0,R.jsx)(WE,ZS({className:ne,changeKey:x,text:b,tokens:o,renderToken:g},O))]})}var ZE=(0,v.memo)(XE);function QE(e){var t=e.hideGutter,n=e.element;return(0,R.jsx)(`tr`,{className:`diff-widget`,children:(0,R.jsx)(`td`,{colSpan:t?1:3,className:`diff-widget-content`,children:n})})}var $E=[`hideGutter`,`selectedChanges`,`tokens`,`lineClassName`],eD=[`hunk`,`widgets`,`className`];function tD(e){var t=e.hunk,n=e.widgets,r=e.className,i=$S(e,eD),a=function(e,t){return e.reduce((function(e,n){var r=ME(n);e.push([`change`,r,n]);var i=t[r];return i&&e.push([`widget`,r,i]),e}),[])}(t.changes,n);return(0,R.jsx)(`tbody`,{className:dC(`diff-hunk`,r),children:a.map((function(e){return function(e,t){var n=eC(e,3),r=n[0],i=n[1],a=n[2],o=t.hideGutter,s=t.selectedChanges,c=t.tokens,l=t.lineClassName,u=$S(t,$E);if(r===`change`){var d=vC(a)?`old`:`new`,f=vC(a)?NE(a):PE(a),p=c?c[d][f-1]:null;return(0,R.jsx)(ZE,ZS({className:l,change:a,hideGutter:o,selected:s.includes(i),tokens:p},u),`change${i}`)}return r===`widget`?(0,R.jsx)(QE,{hideGutter:o,element:a},`widget${i}`):null}(e,i)}))})}var nD=0;function rD(e,t,n,r){var i=(0,v.useCallback)((function(){return t(e)}),[e,t]),a=(0,v.useCallback)((function(){return t(``)}),[t]);return(0,v.useMemo)((function(){var t=zE(r,(function(t){return function(r){return t&&t({side:e,change:n},r)}}));return t.onMouseEnter=qE(i,t.onMouseEnter),t.onMouseLeave=qE(a,t.onMouseLeave),t}),[n,r,i,e,a])}function iD(e){var t=e.change,n=e.side,r=e.selected,i=e.tokens,a=e.gutterClassName,o=e.codeClassName,s=e.gutterEvents,c=e.codeEvents,l=e.anchorID,u=e.gutterAnchor,d=e.gutterAnchorTarget,f=e.hideGutter,p=e.hover,m=e.renderToken,h=e.renderGutter;if(!t){var g=dC(`diff-gutter`,`diff-gutter-omit`,a),_=dC(`diff-code`,`diff-code-omit`,o);return[!f&&(0,R.jsx)(`td`,{className:g},`gutter`),(0,R.jsx)(`td`,{className:_},`code`)]}var v=t.type,y=t.content,b=ME(t),x=n===nD?`old`:`new`,S=ZS({id:l||void 0,className:dC(`diff-gutter`,`diff-gutter-${v}`,QS({"diff-gutter-selected":r},`diff-line-hover-`+x,p),a),children:h({change:t,side:x,inHoverState:p,renderDefault:GE(t,x),wrapInAnchor:KE(u,d)})},s),C=dC(`diff-code`,`diff-code-${v}`,QS({"diff-code-selected":r},`diff-line-hover-`+x,p),o);return[!f&&(0,R.jsx)(`td`,ZS(ZS({},S),{},{"data-change-key":b}),`gutter`),(0,R.jsx)(WE,ZS({className:C,changeKey:b,text:y,tokens:i,renderToken:m},c),`code`)]}function aD(e){var t=e.className,n=e.oldChange,r=e.newChange,i=e.oldSelected,a=e.newSelected,o=e.oldTokens,s=e.newTokens,c=e.monotonous,l=e.gutterClassName,u=e.codeClassName,d=e.gutterEvents,f=e.codeEvents,p=e.hideGutter,m=e.generateAnchorID,h=e.generateLineClassName,g=e.gutterAnchor,_=e.renderToken,y=e.renderGutter,b=eC((0,v.useState)(``),2),x=b[0],S=b[1],C=rD(`old`,S,n,d),w=rD(`new`,S,r,d),T=rD(`old`,S,n,f),E=rD(`new`,S,r,f),D=n&&m(n),O=r&&m(r),k=h({changes:[n,r],defaultGenerate:function(){return t}}),ee={monotonous:c,hideGutter:p,gutterClassName:l,codeClassName:u,gutterEvents:d,codeEvents:f,renderToken:_,renderGutter:y},te=ZS(ZS({},ee),{},{change:n,side:nD,selected:i,tokens:o,gutterEvents:C,codeEvents:T,anchorID:D,gutterAnchor:g,gutterAnchorTarget:D,hover:x===`old`}),ne=ZS(ZS({},ee),{},{change:r,side:1,selected:a,tokens:s,gutterEvents:w,codeEvents:E,anchorID:n===r?null:O,gutterAnchor:g,gutterAnchorTarget:n===r?D:O,hover:x===`new`});return c?(0,R.jsx)(`tr`,{className:dC(`diff-line`,k),children:iD(n?te:ne)}):(0,R.jsxs)(`tr`,{className:dC(`diff-line`,function(e,t){return e&&!t?`diff-line-old-only`:!e&&t?`diff-line-new-only`:e===t?`diff-line-normal`:`diff-line-compare`}(n,r),k),children:[iD(te),iD(ne)]})}var oD=(0,v.memo)(aD);function sD(e){var t=e.hideGutter,n=e.oldElement,r=e.newElement;return e.monotonous?(0,R.jsx)(`tr`,{className:`diff-widget`,children:(0,R.jsx)(`td`,{colSpan:t?1:2,className:`diff-widget-content`,children:n||r})}):n===r?(0,R.jsx)(`tr`,{className:`diff-widget`,children:(0,R.jsx)(`td`,{colSpan:t?2:4,className:`diff-widget-content`,children:n})}):(0,R.jsxs)(`tr`,{className:`diff-widget`,children:[(0,R.jsx)(`td`,{colSpan:t?1:2,className:`diff-widget-content`,children:n}),(0,R.jsx)(`td`,{colSpan:t?1:2,className:`diff-widget-content`,children:r})]})}var cD=[`selectedChanges`,`monotonous`,`hideGutter`,`tokens`,`lineClassName`],lD=[`hunk`,`widgets`,`className`];function uD(e,t){return(e?ME(e):`00`)+(t?ME(t):`00`)}function dD(e){var t=e.hunk,n=e.widgets,r=e.className,i=$S(e,lD),a=function(e,t){for(var n=function(e){return e&&t[ME(e)]||null},r=[],i=0;i<e.length;i++){var a=e[i];if(yC(a))r.push([`change`,uD(a,a),a,a]);else if(vC(a)){var o=e[i+1];o&&_C(o)?(i+=1,r.push([`change`,uD(a,o),a,o])):r.push([`change`,uD(a,null),a,null])}else r.push([`change`,uD(null,a),null,a]);var s=r[r.length-1],c=n(s[2]),l=n(s[3]);if(c||l){var u=s[1];r.push([`widget`,u,c,l])}}return r}(t.changes,n);return(0,R.jsx)(`tbody`,{className:dC(`diff-hunk`,r),children:a.map((function(e){return function(e,t){var n=eC(e,4),r=n[0],i=n[1],a=n[2],o=n[3],s=t.selectedChanges,c=t.monotonous,l=t.hideGutter,u=t.tokens,d=t.lineClassName,f=$S(t,cD);return r===`change`?(0,R.jsx)(oD,ZS({className:d,oldChange:a,newChange:o,monotonous:c,hideGutter:l,oldSelected:!!a&&s.includes(ME(a)),newSelected:!!o&&s.includes(ME(o)),oldTokens:a&&u?u.old[NE(a)-1]:null,newTokens:o&&u?u.new[PE(o)-1]:null},f),`change${i}`):r===`widget`?(0,R.jsx)(sD,{monotonous:c,hideGutter:l,oldElement:a,newElement:o},`widget${i}`):null}(e,i)}))})}var fD=[`gutterType`,`hunkClassName`];function pD(e){var t=e.hunk,n=hC(),r=n.gutterType,i=n.hunkClassName,a=$S(n,fD),o=r===`none`,s=r===`anchor`;return(0,R.jsx)(a.viewType===`unified`?tD:dD,ZS(ZS({},a),{},{hunk:t,hideGutter:o,gutterAnchor:s,className:i}))}function mD(){}function hD(e,t){var n=t?`auto`:`none`;e instanceof HTMLElement&&e.style.userSelect!==n&&(e.style.userSelect=n)}function gD(e){return e.map((function(e){return(0,R.jsx)(pD,{hunk:e},function(e){return`-${e.oldStart},${e.oldLines} +${e.newStart},${e.newLines}`}(e))}))}function _D(e){var t=e.diffType,n=e.hunks,r=e.optimizeSelection,i=e.className,a=e.hunkClassName,o=a===void 0?fC.hunkClassName:a,s=e.lineClassName,c=s===void 0?fC.lineClassName:s,l=e.generateLineClassName,u=l===void 0?fC.generateLineClassName:l,d=e.gutterClassName,f=d===void 0?fC.gutterClassName:d,p=e.codeClassName,m=p===void 0?fC.codeClassName:p,h=e.gutterType,g=h===void 0?fC.gutterType:h,_=e.viewType,y=_===void 0?fC.viewType:_,b=e.gutterEvents,x=b===void 0?fC.gutterEvents:b,S=e.codeEvents,C=S===void 0?fC.codeEvents:S,w=e.generateAnchorID,T=w===void 0?fC.generateAnchorID:w,E=e.selectedChanges,D=E===void 0?fC.selectedChanges:E,O=e.widgets,k=O===void 0?fC.widgets:O,ee=e.renderGutter,te=ee===void 0?fC.renderGutter:ee,ne=e.tokens,re=e.renderToken,ie=e.children,ae=ie===void 0?gD:ie,A=(0,v.useRef)(null),oe=(0,v.useCallback)((function(e){var t=e.target;if(e.button===0){var n=function(e,t){for(var n=e;n&&n!==document.documentElement&&!n.classList.contains(t);)n=n.parentElement;return n===document.documentElement?null:n}(t,`diff-code`);if(n&&n.parentElement){var r=window.getSelection();r&&r.removeAllRanges();var i=nC(n.parentElement.children).indexOf(n);if(i===1||i===3){var a,o=cC(A.current?A.current.querySelectorAll(`.diff-line`):[]);try{for(o.s();!(a=o.n()).done;){var s=a.value.children;hD(s[1],i===1),hD(s[3],i===3)}}catch(e){o.e(e)}finally{o.f()}}}}}),[]),j=g===`none`,se=t===`add`||t===`delete`,ce=y===`split`&&!se&&r?oe:mD,le=(0,v.useMemo)((function(){return(0,R.jsxs)(`colgroup`,y===`unified`?{children:[!j&&(0,R.jsx)(`col`,{className:`diff-gutter-col`}),!j&&(0,R.jsx)(`col`,{className:`diff-gutter-col`}),(0,R.jsx)(`col`,{})]}:se?{children:[!j&&(0,R.jsx)(`col`,{className:`diff-gutter-col`}),(0,R.jsx)(`col`,{})]}:{children:[!j&&(0,R.jsx)(`col`,{className:`diff-gutter-col`}),(0,R.jsx)(`col`,{}),!j&&(0,R.jsx)(`col`,{className:`diff-gutter-col`}),(0,R.jsx)(`col`,{})]})}),[y,se,j]);return(0,R.jsx)(mC,{value:(0,v.useMemo)((function(){return{hunkClassName:o,lineClassName:c,generateLineClassName:u,gutterClassName:f,codeClassName:m,monotonous:se,hideGutter:j,viewType:y,gutterType:g,codeEvents:C,gutterEvents:x,generateAnchorID:T,selectedChanges:D,widgets:k,renderGutter:te,tokens:ne,renderToken:re}}),[m,C,T,f,x,g,j,o,c,u,se,te,re,D,ne,y,k]),children:(0,R.jsxs)(`table`,{ref:A,className:dC(`diff`,`diff-${y}`,i),onMouseDown:ce,children:[le,ae(n)]})})}var vD=(0,v.memo)(_D);function yD(e){var t=e.hideGutter,n=e.monotonous,r=e.className,i=e.gutterClassName,a=e.contentClassName,o=e.children,s=dC(`diff-decoration`,r),c=dC(`diff-decoration-gutter`,i),l=dC(`diff-decoration-content`,a),u=(t?2:4)/(n?2:1),d=u-+!t;if(v.Children.count(o)===1)return(0,R.jsx)(`tbody`,{className:s,children:(0,R.jsx)(`tr`,{children:(0,R.jsx)(`td`,{colSpan:u,className:l,children:o})})});var f=eC(o,2),p=f[0],m=f[1];return(0,R.jsx)(`tbody`,{className:s,children:(0,R.jsxs)(`tr`,{children:[!t&&(0,R.jsx)(`td`,{className:c,children:p}),(0,R.jsx)(`td`,{colSpan:d,className:l,children:m})]})})}function bD(e){var t=e.hideGutter,n=e.className,r=e.gutterClassName,i=e.contentClassName,a=e.children,o=dC(`diff-decoration`,n),s=dC(`diff-decoration-gutter`,r),c=dC(`diff-decoration-content`,i);if(v.Children.count(a)===1)return(0,R.jsx)(`tbody`,{className:o,children:(0,R.jsx)(`tr`,{children:(0,R.jsx)(`td`,{colSpan:t?1:3,className:c,children:a})})});var l=eC(a,2),u=l[0],d=l[1];return(0,R.jsx)(`tbody`,{className:o,children:(0,R.jsxs)(`tr`,{children:[!t&&(0,R.jsx)(`td`,{colSpan:2,className:s,children:u}),(0,R.jsx)(`td`,{className:c,children:d})]})})}function xD(e){var t=e.className,n=t===void 0?``:t,r=e.gutterClassName,i=r===void 0?``:r,a=e.contentClassName,o=a===void 0?``:a,s=e.children,c=hC(),l=c.viewType,u=c.gutterType,d=c.monotonous,f=l===`split`?yD:bD;v.Children.count(s);var p=u===`none`;return(0,R.jsx)(f,{hideGutter:p,monotonous:d,className:n,gutterClassName:i,contentClassName:o,children:s})}var SD=function(e,t,n,r){for(var i=-1,a=e==null?0:e.length;++i<a;){var o=e[i];t(r,o,n(o),e)}return r},CD=function(e,t){return function(n,r){if(n==null)return n;if(!PT(n))return e(n,r);for(var i=n.length,a=t?i:-1,o=Object(n);(t?a--:++a<i)&&!1!==r(o[a],a,o););return n}}(RE),wD=function(e,t,n,r){return CD(e,(function(e,i,a){t(r,e,n(e),a)})),r},TD=function(e,t){return function(n,r){var i=nT(n)?SD:wD,a=t?t():{};return i(n,e,jE(r),a)}}((function(e,t,n){IE(e,n,t)})),ED=qC?qC.isConcatSpreadable:void 0,DD=function(e){return nT(e)||hT(e)||!!(ED&&e&&e[ED])},OD=function e(t,n,r,i,a){var o=-1,s=t.length;for(r||=DD,a||=[];++o<s;){var c=t[o];n>0&&r(c)?n>1?e(c,n-1,r,i,a):tT(a,c):i||(a[a.length]=c)}return a},kD=function(e,t){var n=-1,r=PT(e)?Array(e.length):[];return CD(e,(function(e,i,a){r[++n]=t(e,i,a)})),r},AD=function(e,t){return(nT(e)?mE:kD)(e,jE(t))},jD=function(e,t){return OD(AD(e,t),1)};function MD(e,t){var n=t.newStart;return eC(t.changes.reduce((function(e,t){var n=eC(e,2),r=n[0],i=n[1];return vC(t)?(r.splice(i,1),[r,i]):(_C(t)&&r.splice(i,0,t.content),[r,i+1])}),[e,n-1]),1)[0]}function ND(e,t,n){if(!e.length)return[];var r=t===`old`?NE:PE,i=TD(e,r),a=r(e[e.length-1]);return Array.from({length:a}).map((function(e,t){return n(i[t+1])}))}function PD(e){var t=eC(function(e){return jD(e,(function(e){return e.changes})).reduce((function(e,t){var n=eC(e,2),r=n[0],i=n[1];return yC(t)?(r.push(t),i.push(t)):vC(t)?r.push(t):i.push(t),[r,i]}),[[],[]])}(e),2),n=t[0],r=t[1],i=function(e){return e?e.content:``};return[ND(n,`old`,i).join(`
319
+ `),ND(r,`new`,i).join(`
320
+ `)]}function FD(e){return{type:`root`,children:e}}function ID(e,t){if(t.oldSource){var n=function(e,t){return t.reduce(MD,e.split(`
321
+ `)).join(`
322
+ `)}(t.oldSource,e),r=t.highlight?function(e){return t.refractor.highlight(e,t.language)}:function(e){return[{type:`text`,value:e}]};return[FD(r(t.oldSource)),FD(r(n))]}var i=eC(PD(e),2),a=i[0],o=i[1],s=t.highlight?function(e){return FD(t.refractor.highlight(e,t.language))}:function(e){return FD([{type:`text`,value:e}])};return[s(a),s(o)]}function LD(e){return e.map((function(e){return ZS({},e)}))}function RD(e,t){return[].concat(nC(LD(e.slice(0,-1))),[t])}function zD(e){return e.type===`text`}function BD(e){var t=e[e.length-1];if(zD(t))return t;throw Error(`Invalid token path with leaf of type ${t.type}`)}var VD=[`children`];function HD(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(e.children){var r=e.children,i=$S(e,VD);n.push(i);var a,o=cC(r);try{for(o.s();!(a=o.n()).done;)HD(a.value,t,n)}catch(e){o.e(e)}finally{o.f()}n.pop()}else t.push(LD([].concat(nC(n.slice(1)),[e])));return t}function UD(e){return e.reduce((function(e,t){var n=e[e.length-1],r=tC(function(e){var t=BD(e);return t.value.includes(`
323
+ `)?t.value.split(`
324
+ `).map((function(n){return RD(e,ZS(ZS({},t),{},{value:n}))})):[e]}(t)),i=r[0],a=r.slice(1);return[].concat(nC(e.slice(0,-1)),[[].concat(nC(n),[i])],nC(a.map((function(e){return[e]}))))}),[[]])}function WD(e){return UD(HD(e))}var GD=function(e,t,n){var r=(n=typeof n==`function`?n:void 0)?n(e,t):void 0;return r===void 0?$T(e,t,void 0,n):!!r},KD=function(e,t){return $T(e,t)},qD=function(e){var t=e==null?0:e.length;return t?e[t-1]:void 0};function JD(e,t){if(!e.children)throw Error(`parent node missing children property`);var n,r,i=qD(e.children);return i&&(r=t,(n=i).type===r.type&&(n.type===`text`||n.children&&r.children&&GD(n,r,(function(e,t,n){return n===`chlidren`||KD(e,t)}))))?e.children[e.children.length-1]=function(e,t){return`value`in e&&`value`in t?ZS(ZS({},e),{},{value:`${e.value}${t.value}`}):e}(i,t):e.children.push(t),e.children[e.children.length-1]}function YD(e){var t,n={type:`root`,children:[]},r=cC(e);try{var i=function(){var e=t.value;e.reduce((function(t,n,r){return JD(t,r===e.length-1?ZS({},n):ZS(ZS({},n),{},{children:[]}))}),n)};for(r.s();!(t=r.n()).done;)i()}catch(e){r.e(e)}finally{r.f()}return n}var XD=uC((function(e){var t=function(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32};t.Diff=function(e,t){return[e,t]},t.prototype.diff_main=function(e,n,r,i){i===void 0&&(i=this.Diff_Timeout<=0?Number.MAX_VALUE:new Date().getTime()+1e3*this.Diff_Timeout);var a=i;if(e==null||n==null)throw Error(`Null input. (diff_main)`);if(e==n)return e?[new t.Diff(0,e)]:[];r===void 0&&(r=!0);var o=r,s=this.diff_commonPrefix(e,n),c=e.substring(0,s);e=e.substring(s),n=n.substring(s),s=this.diff_commonSuffix(e,n);var l=e.substring(e.length-s);e=e.substring(0,e.length-s),n=n.substring(0,n.length-s);var u=this.diff_compute_(e,n,o,a);return c&&u.unshift(new t.Diff(0,c)),l&&u.push(new t.Diff(0,l)),this.diff_cleanupMerge(u),u},t.prototype.diff_compute_=function(e,n,r,i){var a;if(!e)return[new t.Diff(1,n)];if(!n)return[new t.Diff(-1,e)];var o=e.length>n.length?e:n,s=e.length>n.length?n:e,c=o.indexOf(s);if(c!=-1)return a=[new t.Diff(1,o.substring(0,c)),new t.Diff(0,s),new t.Diff(1,o.substring(c+s.length))],e.length>n.length&&(a[0][0]=a[2][0]=-1),a;if(s.length==1)return[new t.Diff(-1,e),new t.Diff(1,n)];var l=this.diff_halfMatch_(e,n);if(l){var u=l[0],d=l[1],f=l[2],p=l[3],m=l[4],h=this.diff_main(u,f,r,i),g=this.diff_main(d,p,r,i);return h.concat([new t.Diff(0,m)],g)}return r&&e.length>100&&n.length>100?this.diff_lineMode_(e,n,i):this.diff_bisect_(e,n,i)},t.prototype.diff_lineMode_=function(e,n,r){var i=this.diff_linesToChars_(e,n);e=i.chars1,n=i.chars2;var a=i.lineArray,o=this.diff_main(e,n,!1,r);this.diff_charsToLines_(o,a),this.diff_cleanupSemantic(o),o.push(new t.Diff(0,``));for(var s=0,c=0,l=0,u=``,d=``;s<o.length;){switch(o[s][0]){case 1:l++,d+=o[s][1];break;case-1:c++,u+=o[s][1];break;case 0:if(c>=1&&l>=1){o.splice(s-c-l,c+l),s=s-c-l;for(var f=this.diff_main(u,d,!1,r),p=f.length-1;p>=0;p--)o.splice(s,0,f[p]);s+=f.length}l=0,c=0,u=``,d=``}s++}return o.pop(),o},t.prototype.diff_bisect_=function(e,n,r){for(var i=e.length,a=n.length,o=Math.ceil((i+a)/2),s=o,c=2*o,l=Array(c),u=Array(c),d=0;d<c;d++)l[d]=-1,u[d]=-1;l[s+1]=0,u[s+1]=0;for(var f=i-a,p=f%2!=0,m=0,h=0,g=0,_=0,v=0;v<o&&!(new Date().getTime()>r);v++){for(var y=-v+m;y<=v-h;y+=2){for(var b=s+y,x=(E=y==-v||y!=v&&l[b-1]<l[b+1]?l[b+1]:l[b-1]+1)-y;E<i&&x<a&&e.charAt(E)==n.charAt(x);)E++,x++;if(l[b]=E,E>i)h+=2;else if(x>a)m+=2;else if(p&&(w=s+f-y)>=0&&w<c&&u[w]!=-1&&E>=(C=i-u[w]))return this.diff_bisectSplit_(e,n,E,x,r)}for(var S=-v+g;S<=v-_;S+=2){for(var C,w=s+S,T=(C=S==-v||S!=v&&u[w-1]<u[w+1]?u[w+1]:u[w-1]+1)-S;C<i&&T<a&&e.charAt(i-C-1)==n.charAt(a-T-1);)C++,T++;if(u[w]=C,C>i)_+=2;else if(T>a)g+=2;else if(!p&&(b=s+f-S)>=0&&b<c&&l[b]!=-1){var E;if(x=s+(E=l[b])-b,E>=(C=i-C))return this.diff_bisectSplit_(e,n,E,x,r)}}}return[new t.Diff(-1,e),new t.Diff(1,n)]},t.prototype.diff_bisectSplit_=function(e,t,n,r,i){var a=e.substring(0,n),o=t.substring(0,r),s=e.substring(n),c=t.substring(r),l=this.diff_main(a,o,!1,i),u=this.diff_main(s,c,!1,i);return l.concat(u)},t.prototype.diff_linesToChars_=function(e,t){var n=[],r={};function i(e){for(var t=``,i=0,o=-1,s=n.length;o<e.length-1;){(o=e.indexOf(`
325
+ `,i))==-1&&(o=e.length-1);var c=e.substring(i,o+1);(r.hasOwnProperty?r.hasOwnProperty(c):r[c]!==void 0)?t+=String.fromCharCode(r[c]):(s==a&&(c=e.substring(i),o=e.length),t+=String.fromCharCode(s),r[c]=s,n[s++]=c),i=o+1}return t}n[0]=``;var a=4e4,o=i(e);return a=65535,{chars1:o,chars2:i(t),lineArray:n}},t.prototype.diff_charsToLines_=function(e,t){for(var n=0;n<e.length;n++){for(var r=e[n][1],i=[],a=0;a<r.length;a++)i[a]=t[r.charCodeAt(a)];e[n][1]=i.join(``)}},t.prototype.diff_commonPrefix=function(e,t){if(!e||!t||e.charAt(0)!=t.charAt(0))return 0;for(var n=0,r=Math.min(e.length,t.length),i=r,a=0;n<i;)e.substring(a,i)==t.substring(a,i)?a=n=i:r=i,i=Math.floor((r-n)/2+n);return i},t.prototype.diff_commonSuffix=function(e,t){if(!e||!t||e.charAt(e.length-1)!=t.charAt(t.length-1))return 0;for(var n=0,r=Math.min(e.length,t.length),i=r,a=0;n<i;)e.substring(e.length-i,e.length-a)==t.substring(t.length-i,t.length-a)?a=n=i:r=i,i=Math.floor((r-n)/2+n);return i},t.prototype.diff_commonOverlap_=function(e,t){var n=e.length,r=t.length;if(n==0||r==0)return 0;n>r?e=e.substring(n-r):n<r&&(t=t.substring(0,n));var i=Math.min(n,r);if(e==t)return i;for(var a=0,o=1;;){var s=e.substring(i-o),c=t.indexOf(s);if(c==-1)return a;o+=c,c!=0&&e.substring(i-o)!=t.substring(0,o)||(a=o,o++)}},t.prototype.diff_halfMatch_=function(e,t){if(this.Diff_Timeout<=0)return null;var n=e.length>t.length?e:t,r=e.length>t.length?t:e;if(n.length<4||2*r.length<n.length)return null;var i=this;function a(e,t,n){for(var r,a,o,s,c=e.substring(n,n+Math.floor(e.length/4)),l=-1,u=``;(l=t.indexOf(c,l+1))!=-1;){var d=i.diff_commonPrefix(e.substring(n),t.substring(l)),f=i.diff_commonSuffix(e.substring(0,n),t.substring(0,l));u.length<f+d&&(u=t.substring(l-f,l)+t.substring(l,l+d),r=e.substring(0,n-f),a=e.substring(n+d),o=t.substring(0,l-f),s=t.substring(l+d))}return 2*u.length>=e.length?[r,a,o,s,u]:null}var o,s,c,l,u,d=a(n,r,Math.ceil(n.length/4)),f=a(n,r,Math.ceil(n.length/2));return d||f?(o=f?d&&d[4].length>f[4].length?d:f:d,e.length>t.length?(s=o[0],c=o[1],l=o[2],u=o[3]):(l=o[0],u=o[1],s=o[2],c=o[3]),[s,c,l,u,o[4]]):null},t.prototype.diff_cleanupSemantic=function(e){for(var n=!1,r=[],i=0,a=null,o=0,s=0,c=0,l=0,u=0;o<e.length;)e[o][0]==0?(r[i++]=o,s=l,c=u,l=0,u=0,a=e[o][1]):(e[o][0]==1?l+=e[o][1].length:u+=e[o][1].length,a&&a.length<=Math.max(s,c)&&a.length<=Math.max(l,u)&&(e.splice(r[i-1],0,new t.Diff(-1,a)),e[r[i-1]+1][0]=1,i--,o=--i>0?r[i-1]:-1,s=0,c=0,l=0,u=0,a=null,n=!0)),o++;for(n&&this.diff_cleanupMerge(e),this.diff_cleanupSemanticLossless(e),o=1;o<e.length;){if(e[o-1][0]==-1&&e[o][0]==1){var d=e[o-1][1],f=e[o][1],p=this.diff_commonOverlap_(d,f),m=this.diff_commonOverlap_(f,d);p>=m?(p>=d.length/2||p>=f.length/2)&&(e.splice(o,0,new t.Diff(0,f.substring(0,p))),e[o-1][1]=d.substring(0,d.length-p),e[o+1][1]=f.substring(p),o++):(m>=d.length/2||m>=f.length/2)&&(e.splice(o,0,new t.Diff(0,d.substring(0,m))),e[o-1][0]=1,e[o-1][1]=f.substring(0,f.length-m),e[o+1][0]=-1,e[o+1][1]=d.substring(m),o++),o++}o++}},t.prototype.diff_cleanupSemanticLossless=function(e){function n(e,n){if(!e||!n)return 6;var r=e.charAt(e.length-1),i=n.charAt(0),a=r.match(t.nonAlphaNumericRegex_),o=i.match(t.nonAlphaNumericRegex_),s=a&&r.match(t.whitespaceRegex_),c=o&&i.match(t.whitespaceRegex_),l=s&&r.match(t.linebreakRegex_),u=c&&i.match(t.linebreakRegex_),d=l&&e.match(t.blanklineEndRegex_),f=u&&n.match(t.blanklineStartRegex_);return d||f?5:l||u?4:a&&!s&&c?3:s||c?2:a||o?1:0}for(var r=1;r<e.length-1;){if(e[r-1][0]==0&&e[r+1][0]==0){var i=e[r-1][1],a=e[r][1],o=e[r+1][1],s=this.diff_commonSuffix(i,a);if(s){var c=a.substring(a.length-s);i=i.substring(0,i.length-s),a=c+a.substring(0,a.length-s),o=c+o}for(var l=i,u=a,d=o,f=n(i,a)+n(a,o);a.charAt(0)===o.charAt(0);){i+=a.charAt(0),a=a.substring(1)+o.charAt(0),o=o.substring(1);var p=n(i,a)+n(a,o);p>=f&&(f=p,l=i,u=a,d=o)}e[r-1][1]!=l&&(l?e[r-1][1]=l:(e.splice(r-1,1),r--),e[r][1]=u,d?e[r+1][1]=d:(e.splice(r+1,1),r--))}r++}},t.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,t.whitespaceRegex_=/\s/,t.linebreakRegex_=/[\r\n]/,t.blanklineEndRegex_=/\n\r?\n$/,t.blanklineStartRegex_=/^\r?\n\r?\n/,t.prototype.diff_cleanupEfficiency=function(e){for(var n=!1,r=[],i=0,a=null,o=0,s=!1,c=!1,l=!1,u=!1;o<e.length;)e[o][0]==0?(e[o][1].length<this.Diff_EditCost&&(l||u)?(r[i++]=o,s=l,c=u,a=e[o][1]):(i=0,a=null),l=u=!1):(e[o][0]==-1?u=!0:l=!0,a&&(s&&c&&l&&u||a.length<this.Diff_EditCost/2&&s+c+l+u==3)&&(e.splice(r[i-1],0,new t.Diff(-1,a)),e[r[i-1]+1][0]=1,i--,a=null,s&&c?(l=u=!0,i=0):(o=--i>0?r[i-1]:-1,l=u=!1),n=!0)),o++;n&&this.diff_cleanupMerge(e)},t.prototype.diff_cleanupMerge=function(e){e.push(new t.Diff(0,``));for(var n,r=0,i=0,a=0,o=``,s=``;r<e.length;)switch(e[r][0]){case 1:a++,s+=e[r][1],r++;break;case-1:i++,o+=e[r][1],r++;break;case 0:i+a>1?(i!==0&&a!==0&&((n=this.diff_commonPrefix(s,o))!==0&&(r-i-a>0&&e[r-i-a-1][0]==0?e[r-i-a-1][1]+=s.substring(0,n):(e.splice(0,0,new t.Diff(0,s.substring(0,n))),r++),s=s.substring(n),o=o.substring(n)),(n=this.diff_commonSuffix(s,o))!==0&&(e[r][1]=s.substring(s.length-n)+e[r][1],s=s.substring(0,s.length-n),o=o.substring(0,o.length-n))),r-=i+a,e.splice(r,i+a),o.length&&(e.splice(r,0,new t.Diff(-1,o)),r++),s.length&&(e.splice(r,0,new t.Diff(1,s)),r++),r++):r!==0&&e[r-1][0]==0?(e[r-1][1]+=e[r][1],e.splice(r,1)):r++,a=0,i=0,o=``,s=``}e[e.length-1][1]===``&&e.pop();var c=!1;for(r=1;r<e.length-1;)e[r-1][0]==0&&e[r+1][0]==0&&(e[r][1].substring(e[r][1].length-e[r-1][1].length)==e[r-1][1]?(e[r][1]=e[r-1][1]+e[r][1].substring(0,e[r][1].length-e[r-1][1].length),e[r+1][1]=e[r-1][1]+e[r+1][1],e.splice(r-1,1),c=!0):e[r][1].substring(0,e[r+1][1].length)==e[r+1][1]&&(e[r-1][1]+=e[r+1][1],e[r][1]=e[r][1].substring(e[r+1][1].length)+e[r+1][1],e.splice(r+1,1),c=!0)),r++;c&&this.diff_cleanupMerge(e)},t.prototype.diff_xIndex=function(e,t){var n,r=0,i=0,a=0,o=0;for(n=0;n<e.length&&(e[n][0]!==1&&(r+=e[n][1].length),e[n][0]!==-1&&(i+=e[n][1].length),!(r>t));n++)a=r,o=i;return e.length!=n&&e[n][0]===-1?o:o+(t-a)},t.prototype.diff_prettyHtml=function(e){for(var t=[],n=/&/g,r=/</g,i=/>/g,a=/\n/g,o=0;o<e.length;o++){var s=e[o][0],c=e[o][1].replace(n,`&amp;`).replace(r,`&lt;`).replace(i,`&gt;`).replace(a,`&para;<br>`);switch(s){case 1:t[o]=`<ins style="background:#e6ffe6;">`+c+`</ins>`;break;case-1:t[o]=`<del style="background:#ffe6e6;">`+c+`</del>`;break;case 0:t[o]=`<span>`+c+`</span>`}}return t.join(``)},t.prototype.diff_text1=function(e){for(var t=[],n=0;n<e.length;n++)e[n][0]!==1&&(t[n]=e[n][1]);return t.join(``)},t.prototype.diff_text2=function(e){for(var t=[],n=0;n<e.length;n++)e[n][0]!==-1&&(t[n]=e[n][1]);return t.join(``)},t.prototype.diff_levenshtein=function(e){for(var t=0,n=0,r=0,i=0;i<e.length;i++){var a=e[i][0],o=e[i][1];switch(a){case 1:n+=o.length;break;case-1:r+=o.length;break;case 0:t+=Math.max(n,r),n=0,r=0}}return t+=Math.max(n,r)},t.prototype.diff_toDelta=function(e){for(var t=[],n=0;n<e.length;n++)switch(e[n][0]){case 1:t[n]=`+`+encodeURI(e[n][1]);break;case-1:t[n]=`-`+e[n][1].length;break;case 0:t[n]=`=`+e[n][1].length}return t.join(` `).replace(/%20/g,` `)},t.prototype.diff_fromDelta=function(e,n){for(var r=[],i=0,a=0,o=n.split(/\t/g),s=0;s<o.length;s++){var c=o[s].substring(1);switch(o[s].charAt(0)){case`+`:try{r[i++]=new t.Diff(1,decodeURI(c))}catch{throw Error(`Illegal escape in diff_fromDelta: `+c)}break;case`-`:case`=`:var l=parseInt(c,10);if(isNaN(l)||l<0)throw Error(`Invalid number in diff_fromDelta: `+c);var u=e.substring(a,a+=l);o[s].charAt(0)==`=`?r[i++]=new t.Diff(0,u):r[i++]=new t.Diff(-1,u);break;default:if(o[s])throw Error(`Invalid diff operation in diff_fromDelta: `+o[s])}}if(a!=e.length)throw Error(`Delta length (`+a+`) does not equal source text length (`+e.length+`).`);return r},t.prototype.match_main=function(e,t,n){if(e==null||t==null||n==null)throw Error(`Null input. (match_main)`);return n=Math.max(0,Math.min(n,e.length)),e==t?0:e.length?e.substring(n,n+t.length)==t?n:this.match_bitap_(e,t,n):-1},t.prototype.match_bitap_=function(e,t,n){if(t.length>this.Match_MaxBits)throw Error(`Pattern too long for this browser.`);var r=this.match_alphabet_(t),i=this;function a(e,r){var a=e/t.length,o=Math.abs(n-r);return i.Match_Distance?a+o/i.Match_Distance:o?1:a}var o=this.Match_Threshold,s=e.indexOf(t,n);s!=-1&&(o=Math.min(a(0,s),o),(s=e.lastIndexOf(t,n+t.length))!=-1&&(o=Math.min(a(0,s),o)));var c,l,u=1<<t.length-1;s=-1;for(var d,f=t.length+e.length,p=0;p<t.length;p++){for(c=0,l=f;c<l;)a(p,n+l)<=o?c=l:f=l,l=Math.floor((f-c)/2+c);f=l;var m=Math.max(1,n-l+1),h=Math.min(n+l,e.length)+t.length,g=Array(h+2);g[h+1]=(1<<p)-1;for(var _=h;_>=m;_--){var v=r[e.charAt(_-1)];if(g[_]=p===0?(g[_+1]<<1|1)&v:(g[_+1]<<1|1)&v|(d[_+1]|d[_])<<1|1|d[_+1],g[_]&u){var y=a(p,_-1);if(y<=o){if(o=y,!((s=_-1)>n))break;m=Math.max(1,2*n-s)}}}if(a(p+1,n)>o)break;d=g}return s},t.prototype.match_alphabet_=function(e){for(var t={},n=0;n<e.length;n++)t[e.charAt(n)]=0;for(n=0;n<e.length;n++)t[e.charAt(n)]|=1<<e.length-n-1;return t},t.prototype.patch_addContext_=function(e,n){if(n.length!=0){if(e.start2===null)throw Error(`patch not initialized`);for(var r=n.substring(e.start2,e.start2+e.length1),i=0;n.indexOf(r)!=n.lastIndexOf(r)&&r.length<this.Match_MaxBits-this.Patch_Margin-this.Patch_Margin;)i+=this.Patch_Margin,r=n.substring(e.start2-i,e.start2+e.length1+i);i+=this.Patch_Margin;var a=n.substring(e.start2-i,e.start2);a&&e.diffs.unshift(new t.Diff(0,a));var o=n.substring(e.start2+e.length1,e.start2+e.length1+i);o&&e.diffs.push(new t.Diff(0,o)),e.start1-=a.length,e.start2-=a.length,e.length1+=a.length+o.length,e.length2+=a.length+o.length}},t.prototype.patch_make=function(e,n,r){var i,a;if(typeof e==`string`&&typeof n==`string`&&r===void 0)i=e,(a=this.diff_main(i,n,!0)).length>2&&(this.diff_cleanupSemantic(a),this.diff_cleanupEfficiency(a));else if(e&&typeof e==`object`&&n===void 0&&r===void 0)a=e,i=this.diff_text1(a);else if(typeof e==`string`&&n&&typeof n==`object`&&r===void 0)i=e,a=n;else{if(typeof e!=`string`||typeof n!=`string`||!r||typeof r!=`object`)throw Error(`Unknown call format to patch_make.`);i=e,a=r}if(a.length===0)return[];for(var o=[],s=new t.patch_obj,c=0,l=0,u=0,d=i,f=i,p=0;p<a.length;p++){var m=a[p][0],h=a[p][1];switch(c||m===0||(s.start1=l,s.start2=u),m){case 1:s.diffs[c++]=a[p],s.length2+=h.length,f=f.substring(0,u)+h+f.substring(u);break;case-1:s.length1+=h.length,s.diffs[c++]=a[p],f=f.substring(0,u)+f.substring(u+h.length);break;case 0:h.length<=2*this.Patch_Margin&&c&&a.length!=p+1?(s.diffs[c++]=a[p],s.length1+=h.length,s.length2+=h.length):h.length>=2*this.Patch_Margin&&c&&(this.patch_addContext_(s,d),o.push(s),s=new t.patch_obj,c=0,d=f,l=u)}m!==1&&(l+=h.length),m!==-1&&(u+=h.length)}return c&&(this.patch_addContext_(s,d),o.push(s)),o},t.prototype.patch_deepCopy=function(e){for(var n=[],r=0;r<e.length;r++){var i=e[r],a=new t.patch_obj;a.diffs=[];for(var o=0;o<i.diffs.length;o++)a.diffs[o]=new t.Diff(i.diffs[o][0],i.diffs[o][1]);a.start1=i.start1,a.start2=i.start2,a.length1=i.length1,a.length2=i.length2,n[r]=a}return n},t.prototype.patch_apply=function(e,t){if(e.length==0)return[t,[]];e=this.patch_deepCopy(e);var n=this.patch_addPadding(e);t=n+t+n,this.patch_splitMax(e);for(var r=0,i=[],a=0;a<e.length;a++){var o,s,c=e[a].start2+r,l=this.diff_text1(e[a].diffs),u=-1;if(l.length>this.Match_MaxBits?(o=this.match_main(t,l.substring(0,this.Match_MaxBits),c))!=-1&&((u=this.match_main(t,l.substring(l.length-this.Match_MaxBits),c+l.length-this.Match_MaxBits))==-1||o>=u)&&(o=-1):o=this.match_main(t,l,c),o==-1)i[a]=!1,r-=e[a].length2-e[a].length1;else if(i[a]=!0,r=o-c,l==(s=u==-1?t.substring(o,o+l.length):t.substring(o,u+this.Match_MaxBits)))t=t.substring(0,o)+this.diff_text2(e[a].diffs)+t.substring(o+l.length);else{var d=this.diff_main(l,s,!1);if(l.length>this.Match_MaxBits&&this.diff_levenshtein(d)/l.length>this.Patch_DeleteThreshold)i[a]=!1;else{this.diff_cleanupSemanticLossless(d);for(var f,p=0,m=0;m<e[a].diffs.length;m++){var h=e[a].diffs[m];h[0]!==0&&(f=this.diff_xIndex(d,p)),h[0]===1?t=t.substring(0,o+f)+h[1]+t.substring(o+f):h[0]===-1&&(t=t.substring(0,o+f)+t.substring(o+this.diff_xIndex(d,p+h[1].length))),h[0]!==-1&&(p+=h[1].length)}}}}return[t=t.substring(n.length,t.length-n.length),i]},t.prototype.patch_addPadding=function(e){for(var n=this.Patch_Margin,r=``,i=1;i<=n;i++)r+=String.fromCharCode(i);for(i=0;i<e.length;i++)e[i].start1+=n,e[i].start2+=n;var a=e[0],o=a.diffs;if(o.length==0||o[0][0]!=0)o.unshift(new t.Diff(0,r)),a.start1-=n,a.start2-=n,a.length1+=n,a.length2+=n;else if(n>o[0][1].length){var s=n-o[0][1].length;o[0][1]=r.substring(o[0][1].length)+o[0][1],a.start1-=s,a.start2-=s,a.length1+=s,a.length2+=s}return(o=(a=e[e.length-1]).diffs).length==0||o[o.length-1][0]!=0?(o.push(new t.Diff(0,r)),a.length1+=n,a.length2+=n):n>o[o.length-1][1].length&&(s=n-o[o.length-1][1].length,o[o.length-1][1]+=r.substring(0,s),a.length1+=s,a.length2+=s),r},t.prototype.patch_splitMax=function(e){for(var n=this.Match_MaxBits,r=0;r<e.length;r++)if(!(e[r].length1<=n)){var i=e[r];e.splice(r--,1);for(var a=i.start1,o=i.start2,s=``;i.diffs.length!==0;){var c=new t.patch_obj,l=!0;for(c.start1=a-s.length,c.start2=o-s.length,s!==``&&(c.length1=c.length2=s.length,c.diffs.push(new t.Diff(0,s)));i.diffs.length!==0&&c.length1<n-this.Patch_Margin;){var u=i.diffs[0][0],d=i.diffs[0][1];u===1?(c.length2+=d.length,o+=d.length,c.diffs.push(i.diffs.shift()),l=!1):u===-1&&c.diffs.length==1&&c.diffs[0][0]==0&&d.length>2*n?(c.length1+=d.length,a+=d.length,l=!1,c.diffs.push(new t.Diff(u,d)),i.diffs.shift()):(d=d.substring(0,n-c.length1-this.Patch_Margin),c.length1+=d.length,a+=d.length,u===0?(c.length2+=d.length,o+=d.length):l=!1,c.diffs.push(new t.Diff(u,d)),d==i.diffs[0][1]?i.diffs.shift():i.diffs[0][1]=i.diffs[0][1].substring(d.length))}s=(s=this.diff_text2(c.diffs)).substring(s.length-this.Patch_Margin);var f=this.diff_text1(i.diffs).substring(0,this.Patch_Margin);f!==``&&(c.length1+=f.length,c.length2+=f.length,c.diffs.length!==0&&c.diffs[c.diffs.length-1][0]===0?c.diffs[c.diffs.length-1][1]+=f:c.diffs.push(new t.Diff(0,f))),l||e.splice(++r,0,c)}}},t.prototype.patch_toText=function(e){for(var t=[],n=0;n<e.length;n++)t[n]=e[n];return t.join(``)},t.prototype.patch_fromText=function(e){var n=[];if(!e)return n;for(var r=e.split(`
326
+ `),i=0,a=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;i<r.length;){var o=r[i].match(a);if(!o)throw Error(`Invalid patch string: `+r[i]);var s=new t.patch_obj;for(n.push(s),s.start1=parseInt(o[1],10),o[2]===``?(s.start1--,s.length1=1):o[2]==`0`?s.length1=0:(s.start1--,s.length1=parseInt(o[2],10)),s.start2=parseInt(o[3],10),o[4]===``?(s.start2--,s.length2=1):o[4]==`0`?s.length2=0:(s.start2--,s.length2=parseInt(o[4],10)),i++;i<r.length;){var c=r[i].charAt(0);try{var l=decodeURI(r[i].substring(1))}catch{throw Error(`Illegal escape in patch_fromText: `+l)}if(c==`-`)s.diffs.push(new t.Diff(-1,l));else if(c==`+`)s.diffs.push(new t.Diff(1,l));else if(c==` `)s.diffs.push(new t.Diff(0,l));else{if(c==`@`)break;if(c!==``)throw Error(`Invalid patch mode "`+c+`" in: `+l)}i++}}return n},(t.patch_obj=function(){this.diffs=[],this.start1=null,this.start2=null,this.length1=0,this.length2=0}).prototype.toString=function(){for(var e,t=[`@@ -`+(this.length1===0?this.start1+`,0`:this.length1==1?this.start1+1:this.start1+1+`,`+this.length1)+` +`+(this.length2===0?this.start2+`,0`:this.length2==1?this.start2+1:this.start2+1+`,`+this.length2)+` @@
327
+ `],n=0;n<this.diffs.length;n++){switch(this.diffs[n][0]){case 1:e=`+`;break;case-1:e=`-`;break;case 0:e=` `}t[n+1]=e+encodeURI(this.diffs[n][1])+`
328
+ `}return t.join(``).replace(/%20/g,` `)},e.exports=t,e.exports.diff_match_patch=t,e.exports.DIFF_DELETE=-1,e.exports.DIFF_INSERT=1,e.exports.DIFF_EQUAL=0}));XD.DIFF_EQUAL,XD.DIFF_DELETE,XD.DIFF_INSERT;var ZD=[`enhancers`],QD=function(e){var t,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.enhancers,i=r===void 0?[]:r,a=eC(ID(e,$S(n,ZD)),2),o=a[0],s=a[1],c=[WD(o),WD(s)],l=eC((t=[c[0],c[1]],i.reduce((function(e,t){return t(e)}),t)),2),u=l[0],d=l[1],f=[u.map(YD),d.map(YD)],p=f[1];return{old:f[0].map((function(e){return e.children??[]})),new:p.map((function(e){return e.children??[]}))}},$D=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),eO={0:`�`,128:`€`,130:`‚`,131:`ƒ`,132:`„`,133:`…`,134:`†`,135:`‡`,136:`ˆ`,137:`‰`,138:`Š`,139:`‹`,140:`Œ`,142:`Ž`,145:`‘`,146:`’`,147:`“`,148:`”`,149:`•`,150:`–`,151:`—`,152:`˜`,153:`™`,154:`š`,155:`›`,156:`œ`,158:`ž`,159:`Ÿ`};function tO(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=48&&t<=57}function nO(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}function rO(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}function iO(e){return rO(e)||tO(e)}var aO=[``,`Named character references must be terminated by a semicolon`,`Numeric character references must be terminated by a semicolon`,`Named character references cannot be empty`,`Numeric character references cannot be empty`,`Named character references must be known`,`Numeric character references cannot be disallowed`,`Numeric character references cannot be outside the permissible Unicode range`];function oO(e,t){let n=t||{},r=typeof n.additional==`string`?n.additional.charCodeAt(0):n.additional,i=[],a=0,o=-1,s=``,c,l;n.position&&(`start`in n.position||`indent`in n.position?(l=n.position.indent,c=n.position.start):c=n.position);let u=(c?c.line:0)||1,d=(c?c.column:0)||1,f=m(),p;for(a--;++a<=e.length;)if(p===10&&(d=(l?l[o]:0)||1),p=e.charCodeAt(a),p===38){let t=e.charCodeAt(a+1);if(t===9||t===10||t===12||t===32||t===38||t===60||Number.isNaN(t)||r&&t===r){s+=String.fromCharCode(p),d++;continue}let o=a+1,c=o,l=o,u;if(t===35){l=++c;let t=e.charCodeAt(l);t===88||t===120?(u=`hexadecimal`,l=++c):u=`decimal`}else u=`named`;let _=``,v=``,y=``,b=u===`named`?iO:u===`decimal`?tO:nO;for(l--;++l<=e.length;){let t=e.charCodeAt(l);if(!b(t))break;y+=String.fromCharCode(t),u===`named`&&$D.includes(y)&&(_=y,v=rs(y))}let x=e.charCodeAt(l)===59;if(x){l++;let e=u===`named`?rs(y):!1;e&&(_=y,v=e)}let S=1+l-o,C=``;if(!(!x&&n.nonTerminated===!1))if(!y)u!==`named`&&h(4,S);else if(u===`named`){if(x&&!v)h(5,1);else if(_!==y&&(l=c+_.length,S=1+l-c,x=!1),!x){let t=_?1:3;if(n.attribute){let n=e.charCodeAt(l);n===61?(h(t,S),v=``):iO(n)?v=``:h(t,S)}else h(t,S)}C=v}else{x||h(2,S);let e=Number.parseInt(y,u===`hexadecimal`?16:10);if(sO(e))h(7,S),C=`�`;else if(e in eO)h(6,S),C=eO[e];else{let t=``;cO(e)&&h(6,S),e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10|55296),e=56320|e&1023),C=t+String.fromCharCode(e)}}if(C){g(),f=m(),a=l-1,d+=l-o+1,i.push(C);let t=m();t.offset++,n.reference&&n.reference.call(n.referenceContext||void 0,C,{start:f,end:t},e.slice(o-1,l)),f=t}else y=e.slice(o-1,l),s+=y,d+=y.length,a=l-1}else p===10&&(u++,o++,d=0),Number.isNaN(p)?g():(s+=String.fromCharCode(p),d++);return i.join(``);function m(){return{line:u,column:d,offset:a+((c?c.offset:0)||0)}}function h(e,t){let r;n.warning&&(r=m(),r.column+=t,r.offset+=t,n.warning.call(n.warningContext||void 0,aO[e],r,e))}function g(){s&&=(i.push(s),n.text&&n.text.call(n.textContext||void 0,s,{start:f,end:m()}),``)}}function sO(e){return e>=55296&&e<=57343||e>1114111}function cO(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)==65535||(e&65535)==65534}var lO=0,uO={},dO={util:{type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,`__id`,{value:++lO}),e.__id},clone:function e(t,n){n||={};var r,i;switch(dO.util.type(t)){case`Object`:if(i=dO.util.objId(t),n[i])return n[i];for(var a in r={},n[i]=r,t)t.hasOwnProperty(a)&&(r[a]=e(t[a],n));return r;case`Array`:return i=dO.util.objId(t),n[i]?n[i]:(r=[],n[i]=r,t.forEach(function(t,i){r[i]=e(t,n)}),r);default:return t}}},languages:{plain:uO,plaintext:uO,text:uO,txt:uO,extend:function(e,t){var n=dO.util.clone(dO.languages[e]);for(var r in t)n[r]=t[r];return n},insertBefore:function(e,t,n,r){r||=dO.languages;var i=r[e],a={};for(var o in i)if(i.hasOwnProperty(o)){if(o==t)for(var s in n)n.hasOwnProperty(s)&&(a[s]=n[s]);n.hasOwnProperty(o)||(a[o]=i[o])}var c=r[e];return r[e]=a,dO.languages.DFS(dO.languages,function(t,n){n===c&&t!=e&&(this[t]=a)}),a},DFS:function e(t,n,r,i){i||={};var a=dO.util.objId;for(var o in t)if(t.hasOwnProperty(o)){n.call(t,o,t[o],r||o);var s=t[o],c=dO.util.type(s);c===`Object`&&!i[a(s)]?(i[a(s)]=!0,e(s,n,null,i)):c===`Array`&&!i[a(s)]&&(i[a(s)]=!0,e(s,n,o,i))}}},plugins:{},highlight:function(e,t,n){var r={code:e,grammar:t,language:n};if(dO.hooks.run(`before-tokenize`,r),!r.grammar)throw Error(`The language "`+r.language+`" has no grammar.`);return r.tokens=dO.tokenize(r.code,r.grammar),dO.hooks.run(`after-tokenize`,r),fO.stringify(dO.util.encode(r.tokens),r.language)},tokenize:function(e,t){var n=t.rest;if(n){for(var r in n)t[r]=n[r];delete t.rest}var i=new hO;return gO(i,i.head,e),mO(e,i,t,i.head,0),vO(i)},hooks:{all:{},add:function(e,t){var n=dO.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=dO.hooks.all[e];if(!(!n||!n.length))for(var r=0,i;i=n[r++];)i(t)}},Token:fO};function fO(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=(r||``).length|0}function pO(e,t,n,r){e.lastIndex=t;var i=e.exec(n);if(i&&r&&i[1]){var a=i[1].length;i.index+=a,i[0]=i[0].slice(a)}return i}function mO(e,t,n,r,i,a){for(var o in n)if(!(!n.hasOwnProperty(o)||!n[o])){var s=n[o];s=Array.isArray(s)?s:[s];for(var c=0;c<s.length;++c){if(a&&a.cause==o+`,`+c)return;var l=s[c],u=l.inside,d=!!l.lookbehind,f=!!l.greedy,p=l.alias;if(f&&!l.pattern.global){var m=l.pattern.toString().match(/[imsuy]*$/)[0];l.pattern=RegExp(l.pattern.source,m+`g`)}for(var h=l.pattern||l,g=r.next,_=i;g!==t.tail&&!(a&&_>=a.reach);_+=g.value.length,g=g.next){var v=g.value;if(t.length>e.length)return;if(!(v instanceof fO)){var y=1,b;if(f){if(b=pO(h,_,e,d),!b||b.index>=e.length)break;var x=b.index,S=b.index+b[0].length,C=_;for(C+=g.value.length;x>=C;)g=g.next,C+=g.value.length;if(C-=g.value.length,_=C,g.value instanceof fO)continue;for(var w=g;w!==t.tail&&(C<S||typeof w.value==`string`);w=w.next)y++,C+=w.value.length;y--,v=e.slice(_,C),b.index-=_}else if(b=pO(h,0,v,d),!b)continue;var x=b.index,T=b[0],E=v.slice(0,x),D=v.slice(x+T.length),O=_+v.length;a&&O>a.reach&&(a.reach=O);var k=g.prev;E&&(k=gO(t,k,E),_+=E.length),_O(t,k,y);var ee=new fO(o,u?dO.tokenize(T,u):T,p,T);if(g=gO(t,k,ee),D&&gO(t,g,D),y>1){var te={cause:o+`,`+c,reach:O};mO(e,t,n,g.prev,_,te),a&&te.reach>a.reach&&(a.reach=te.reach)}}}}}}function hO(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function gO(e,t,n){var r=t.next,i={value:n,prev:t,next:r};return t.next=i,r.prev=i,e.length++,i}function _O(e,t,n){for(var r=t.next,i=0;i<n&&r!==e.tail;i++)r=r.next;t.next=r,r.prev=t,e.length-=i}function vO(e){for(var t=[],n=e.head.next;n!==e.tail;)t.push(n.value),n=n.next;return t}var yO=dO;function bO(){}bO.prototype=yO;var xO=new bO;xO.highlight=SO,xO.register=CO,xO.alias=wO,xO.registered=TO,xO.listLanguages=EO,xO.util.encode=OO,xO.Token.stringify=DO;function SO(e,t){if(typeof e!=`string`)throw TypeError("Expected `string` for `value`, got `"+e+"`");let n,r;if(t&&typeof t==`object`)n=t;else{if(r=t,typeof r!=`string`)throw TypeError("Expected `string` for `name`, got `"+r+"`");if(Object.hasOwn(xO.languages,r))n=xO.languages[r];else throw Error("Unknown language: `"+r+"` is not registered")}return{type:`root`,children:yO.highlight.call(xO,e,n,r)}}function CO(e){if(typeof e!=`function`||!e.displayName)throw Error("Expected `function` for `syntax`, got `"+e+"`");Object.hasOwn(xO.languages,e.displayName)||e(xO)}function wO(e,t){let n=xO.languages,r={};typeof e==`string`?t&&(r[e]=t):r=e;let i;for(i in r)if(Object.hasOwn(r,i)){let e=r[i],t=typeof e==`string`?[e]:e,a=-1;for(;++a<t.length;)n[t[a]]=n[i]}}function TO(e){if(typeof e!=`string`)throw TypeError("Expected `string` for `aliasOrLanguage`, got `"+e+"`");return Object.hasOwn(xO.languages,e)}function EO(){let e=xO.languages,t=[],n;for(n in e)Object.hasOwn(e,n)&&typeof e[n]==`object`&&t.push(n);return t}function DO(e,t){if(typeof e==`string`)return{type:`text`,value:e};if(Array.isArray(e)){let n=[],r=-1;for(;++r<e.length;)e[r]!==null&&e[r]!==void 0&&e[r]!==``&&n.push(DO(e[r],t));return n}let n={attributes:{},classes:[`token`,e.type],content:DO(e.content,t),language:t,tag:`span`,type:e.type};return e.alias&&n.classes.push(...typeof e.alias==`string`?[e.alias]:e.alias),xO.hooks.run(`wrap`,n),vf(n.tag+`.`+n.classes.join(`.`),kO(n.attributes),n.content)}function OO(e){return e}function kO(e){let t;for(t in e)Object.hasOwn(e,t)&&(e[t]=oO(e[t]));return e}AO.displayName=`bash`,AO.aliases=[`sh`,`shell`];function AO(e){(function(e){var t=`\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b`,n={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:`punctuation`,inside:null},r={bash:n,environment:{pattern:RegExp(`\\$`+t),alias:`constant`},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp(`(\\{)`+t),lookbehind:!0,alias:`constant`}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};e.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:`important`},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:`function`},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:`function`}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:`variable`,lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp(`(^|[\\s;|&]|[<>]\\()`+t),lookbehind:!0,alias:`constant`}},alias:`variable`,lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:`variable`,lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:r},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:n}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:r},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:r.entity}}],environment:{pattern:RegExp(`\\$?`+t),alias:`constant`},variable:r.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:`class-name`},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:`important`},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:`important`}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},n.inside=e.languages.bash;for(var i=[`comment`,`function-name`,`for-or-select`,`assign-left`,`parameter`,`string`,`environment`,`function`,`keyword`,`builtin`,`boolean`,`file-descriptor`,`operator`,`punctuation`,`number`],a=r.variable[1].inside,o=0;o<i.length;o++)a[i[o]]=e.languages.bash[i[o]];e.languages.sh=e.languages.bash,e.languages.shell=e.languages.bash})(e)}jO.displayName=`clike`,jO.aliases=[];function jO(e){e.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}}MO.displayName=`c`,MO.aliases=[];function MO(e){e.register(jO),e.languages.c=e.languages.extend(`clike`,{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),e.languages.insertBefore(`c`,`string`,{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),e.languages.insertBefore(`c`,`string`,{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:`property`,inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},e.languages.c.string],char:e.languages.c.char,comment:e.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:`function`}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:`keyword`},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:e.languages.c}}}}),e.languages.insertBefore(`c`,`function`,{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete e.languages.c.boolean}NO.displayName=`cpp`,NO.aliases=[];function NO(e){e.register(MO),(function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=`\\b(?!<keyword>)\\w+(?:\\s*\\.\\s*\\w+)*\\b`.replace(/<keyword>/g,function(){return t.source});e.languages.cpp=e.languages.extend(`c`,{"class-name":[{pattern:RegExp(`(\\b(?:class|concept|enum|struct|typename)\\s+)(?!<keyword>)\\w+`.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore(`cpp`,`string`,{module:{pattern:RegExp(`(\\b(?:import|module)\\s+)(?:"(?:\\\\(?:\\r\\n|[\\s\\S])|[^"\\\\\\r\\n])*"|<[^<>\\r\\n]*>|`+`<mod-name>(?:\\s*:\\s*<mod-name>)?|:\\s*<mod-name>`.replace(/<mod-name>/g,function(){return n})+`)`),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:`string`,greedy:!0}}),e.languages.insertBefore(`cpp`,`keyword`,{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:`class-name`,inside:e.languages.cpp}}}}),e.languages.insertBefore(`cpp`,`operator`,{"double-colon":{pattern:/::/,alias:`punctuation`}}),e.languages.insertBefore(`cpp`,`class-name`,{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend(`cpp`,{})}}),e.languages.insertBefore(`inside`,`double-colon`,{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp[`base-clause`])})(e)}PO.displayName=`css`,PO.aliases=[];function PO(e){(function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp(`@[\\w-](?:[^;{\\s"']|\\s+(?!\\s)|`+t.source+`)*?(?:;|(?=\\s*\\{))`),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:`selector`},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp(`\\burl\\((?:`+t.source+`|(?:[^\\\\\\r\\n()"']|\\\\[\\s\\S])*)\\)`,`i`),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp(`^`+t.source+`$`),alias:`url`}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+`)*(?=\\s*\\{)`),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined(`style`,`css`),n.tag.addAttribute(`style`,`css`))})(e)}FO.displayName=`go`,FO.aliases=[];function FO(e){e.register(jO),e.languages.go=e.languages.extend(`clike`,{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),e.languages.insertBefore(`go`,`string`,{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete e.languages.go[`class-name`]}IO.displayName=`java`,IO.aliases=[];function IO(e){e.register(jO),(function(e){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,n=`(?:[a-z]\\w*\\s*\\.\\s*)*(?:[A-Z]\\w*\\s*\\.\\s*)*`,r={pattern:RegExp(`(^|[^\\w.])`+n+`[A-Z](?:[\\d_A-Z]*[a-z]\\w*)?\\b`),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};e.languages.java=e.languages.extend(`clike`,{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[r,{pattern:RegExp(`(^|[^\\w.])`+n+`[A-Z]\\w*(?=\\s+\\w+\\s*[;,=()]|\\s*(?:\\[[\\s,]*\\]\\s*)?::\\s*new\\b)`),lookbehind:!0,inside:r.inside},{pattern:RegExp(`(\\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\\s+)`+n+`[A-Z]\\w*\\b`),lookbehind:!0,inside:r.inside}],keyword:t,function:[e.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),e.languages.insertBefore(`java`,`string`,{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:`string`},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),e.languages.insertBefore(`java`,`class-name`,{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:`punctuation`},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":r,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(`(\\bimport\\s+)`+n+`(?:[A-Z]\\w*|\\*)(?=\\s*;)`),lookbehind:!0,inside:{namespace:r.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(`(\\bimport\\s+static\\s+)`+n+`(?:\\w+|\\*)(?=\\s*;)`),lookbehind:!0,alias:`static`,inside:{namespace:r.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(`(\\b(?:exports|import(?:\\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\\s+)(?!<keyword>)[a-z]\\w*(?:\\.[a-z]\\w*)*\\.?`.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(e)}LO.displayName=`javascript`,LO.aliases=[`js`];function LO(e){e.register(jO),e.languages.javascript=e.languages.extend(`clike`,{"class-name":[e.languages.clike[`class-name`],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(`(^|[^\\w$])(?:NaN|Infinity|0[bB][01]+(?:_[01]+)*n?|0[oO][0-7]+(?:_[0-7]+)*n?|0[xX][\\dA-Fa-f]+(?:_[\\dA-Fa-f]+)*n?|\\d+(?:_\\d+)*n|(?:\\d+(?:_\\d+)*(?:\\.(?:\\d+(?:_\\d+)*)?)?|\\.\\d+(?:_\\d+)*)(?:[Ee][+-]?\\d+(?:_\\d+)*)?)(?![\\w$])`),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),e.languages.javascript[`class-name`][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,e.languages.insertBefore(`javascript`,`keyword`,{regex:{pattern:RegExp(`((?:^|[^$\\w\\xA0-\\uFFFF."'\\])\\s]|\\b(?:return|yield))\\s*)\\/(?:(?:\\[(?:[^\\]\\\\\\r\\n]|\\\\.)*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}|(?:\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.)*\\])*\\])*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}v[dgimyus]{0,7})(?=(?:\\s|\\/\\*(?:[^*]|\\*(?!\\/))*\\*\\/)*(?:$|[\\r\\n,.;:})\\]]|\\/\\/))`),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:`language-regex`,inside:e.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:`function`},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:e.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:e.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:e.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:e.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),e.languages.insertBefore(`javascript`,`string`,{hashbang:{pattern:/^#!.*/,greedy:!0,alias:`comment`},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:`string`},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:`punctuation`},rest:e.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:`property`}}),e.languages.insertBefore(`javascript`,`operator`,{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:`property`}}),e.languages.markup&&(e.languages.markup.tag.addInlined(`script`,`javascript`),e.languages.markup.tag.addAttribute(`on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)`,`javascript`)),e.languages.js=e.languages.javascript}RO.displayName=`json`,RO.aliases=[`webmanifest`];function RO(e){e.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:`keyword`}},e.languages.webmanifest=e.languages.json}zO.displayName=`markup`,zO.aliases=[`atom`,`html`,`mathml`,`rss`,`ssml`,`svg`,`xml`];function zO(e){e.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:`attr-equals`},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:`named-entity`},/&#x?[\da-f]{1,8};/i]},e.languages.markup.tag.inside[`attr-value`].inside.entity=e.languages.markup.entity,e.languages.markup.doctype.inside[`internal-subset`].inside=e.languages.markup,e.hooks.add(`wrap`,function(e){e.type===`entity`&&(e.attributes.title=e.content.value.replace(/&amp;/,`&`))}),Object.defineProperty(e.languages.markup.tag,`addInlined`,{value:function(t,n){var r={};r[`language-`+n]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:e.languages[n]},r.cdata=/^<!\[CDATA\[|\]\]>$/i;var i={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:r}};i[`language-`+n]={pattern:/[\s\S]+/,inside:e.languages[n]};var a={};a[t]={pattern:RegExp(`(<__[^>]*>)(?:<!\\[CDATA\\[(?:[^\\]]|\\](?!\\]>))*\\]\\]>|(?!<!\\[CDATA\\[)[\\s\\S])*?(?=<\\/__>)`.replace(/__/g,function(){return t}),`i`),lookbehind:!0,greedy:!0,inside:i},e.languages.insertBefore(`markup`,`cdata`,a)}}),Object.defineProperty(e.languages.markup.tag,`addAttribute`,{value:function(t,n){e.languages.markup.tag.inside[`special-attr`].push({pattern:RegExp(`(^|["'\\s])(?:`+t+`)\\s*=\\s*(?:"[^"]*"|'[^']*'|[^\\s'">=]+(?=[\\s>]))`,`i`),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[n,`language-`+n],inside:e.languages[n]},punctuation:[{pattern:/^=/,alias:`attr-equals`},/"|'/]}}}})}}),e.languages.html=e.languages.markup,e.languages.mathml=e.languages.markup,e.languages.svg=e.languages.markup,e.languages.xml=e.languages.extend(`markup`,{}),e.languages.ssml=e.languages.xml,e.languages.atom=e.languages.xml,e.languages.rss=e.languages.xml}BO.displayName=`markdown`,BO.aliases=[`md`];function BO(e){e.register(zO),(function(e){var t=`(?:\\\\.|[^\\\\\\n\\r]|(?:\\n|\\r\\n?)(?![\\r\\n]))`;function n(e){return e=e.replace(/<inner>/g,function(){return t}),RegExp(`((?:^|[^\\\\])(?:\\\\{2})*)(?:`+e+`)`)}var r="(?:\\\\.|``(?:[^`\\r\\n]|`(?!`))+``|`[^`\\r\\n]+`|[^\\\\|\\r\\n`])+",i=`\\|?__(?:\\|__)+\\|?(?:(?:\\n|\\r\\n?)|(?![\\s\\S]))`.replace(/__/g,function(){return r}),a=`\\|?[ \\t]*:?-{3,}:?[ \\t]*(?:\\|[ \\t]*:?-{3,}:?[ \\t]*)+\\|?(?:\\n|\\r\\n?)`;e.languages.markdown=e.languages.extend(`markup`,{}),e.languages.insertBefore(`markdown`,`prolog`,{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:[`yaml`,`language-yaml`],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:`punctuation`},table:{pattern:RegExp(`^`+i+a+`(?:`+i+`)*`,`m`),inside:{"table-data-rows":{pattern:RegExp(`^(`+i+a+`)(?:`+i+`)*$`),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp(`^(`+i+`)`+a+`$`),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp(`^`+i+`$`),inside:{"table-header":{pattern:RegExp(r),alias:`important`,inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:`keyword`},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:`important`,inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:`important`,inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:`punctuation`},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:`punctuation`},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:`url`},bold:{pattern:n(`\\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\\b|\\*\\*(?:(?!\\*)<inner>|\\*(?:(?!\\*)<inner>)+\\*)+\\*\\*`),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(`\\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\\b|\\*(?:(?!\\*)<inner>|\\*\\*(?:(?!\\*)<inner>)+\\*\\*)+\\*`),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(`(~~?)(?:(?!~)<inner>)+\\2`),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:[`code`,`keyword`]},url:{pattern:n(`!?\\[(?:(?!\\])<inner>)+\\](?:\\([^\\s)]+(?:[\\t ]+"(?:\\\\.|[^"\\\\])*")?\\)|[ \\t]?\\[(?:(?!\\])<inner>)+\\])`),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),[`url`,`bold`,`italic`,`strike`].forEach(function(t){[`url`,`bold`,`italic`,`strike`,`code-snippet`].forEach(function(n){t!==n&&(e.languages.markdown[t].inside.content.inside[n]=e.languages.markdown[n])})}),e.hooks.add(`after-tokenize`,function(e){if(e.language!==`markdown`&&e.language!==`md`)return;function t(e){if(!(!e||typeof e==`string`))for(var n=0,r=e.length;n<r;n++){var i=e[n];if(i.type!==`code`){t(i.content);continue}var a=i.content[1],o=i.content[3];if(a&&o&&a.type===`code-language`&&o.type===`code-block`&&typeof a.content==`string`){var s=a.content.replace(/\b#/g,`sharp`).replace(/\b\+\+/g,`pp`);s=(/[a-z][\w-]*/i.exec(s)||[``])[0].toLowerCase();var c=`language-`+s;o.alias?typeof o.alias==`string`?o.alias=[o.alias,c]:o.alias.push(c):o.alias=[c]}}}t(e.tokens)}),e.hooks.add(`wrap`,function(t){if(t.type===`code-block`){for(var n=``,r=0,i=t.classes.length;r<i;r++){var a=t.classes[r],o=/language-(.+)/.exec(a);if(o){n=o[1];break}}var s=e.languages[n];if(s)t.content=e.highlight(t.content.value,s,n);else if(n&&n!==`none`&&e.plugins.autoloader){var c=`md-`+new Date().valueOf()+`-`+Math.floor(Math.random()*0x2386f26fc10000);t.attributes.id=c,e.plugins.autoloader.loadLanguages(n,function(){var t=document.getElementById(c);t&&(t.innerHTML=e.highlight(t.textContent,e.languages[n],n))})}}}),RegExp(e.languages.markup.tag.pattern.source,`gi`),String.fromCodePoint||String.fromCharCode,e.languages.md=e.languages.markdown})(e)}VO.displayName=`python`,VO.aliases=[`py`];function VO(e){e.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:`punctuation`},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:`string`},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:[`annotation`,`punctuation`],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},e.languages.python[`string-interpolation`].inside.interpolation.inside.rest=e.languages.python,e.languages.py=e.languages.python}HO.displayName=`ruby`,HO.aliases=[`rb`];function HO(e){e.register(jO),(function(e){e.languages.ruby=e.languages.extend(`clike`,{comment:{pattern:/#.*|^=begin\s[\s\S]*?^=end/m,greedy:!0},"class-name":{pattern:/(\b(?:class|module)\s+|\bcatch\s+\()[\w.\\]+|\b[A-Z_]\w*(?=\s*\.\s*new\b)/,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:BEGIN|END|alias|and|begin|break|case|class|def|define_method|defined|do|each|else|elsif|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|private|protected|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/,operator:/\.{2,3}|&\.|===|<?=>|[!=]?~|(?:&&|\|\||<<|>>|\*\*|[+\-*/%<>!^&|=])=?|[?:]/,punctuation:/[(){}[\].,;]/}),e.languages.insertBefore(`ruby`,`operator`,{"double-colon":{pattern:/::/,alias:`punctuation`}});var t={pattern:/((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,lookbehind:!0,inside:{content:{pattern:/^(#\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:e.languages.ruby},delimiter:{pattern:/^#\{|\}$/,alias:`punctuation`}}};delete e.languages.ruby.function;var n=`(?:`+[`([^a-zA-Z0-9\\s{(\\[<=])(?:(?!\\1)[^\\\\]|\\\\[\\s\\S])*\\1`,`\\((?:[^()\\\\]|\\\\[\\s\\S]|\\((?:[^()\\\\]|\\\\[\\s\\S])*\\))*\\)`,`\\{(?:[^{}\\\\]|\\\\[\\s\\S]|\\{(?:[^{}\\\\]|\\\\[\\s\\S])*\\})*\\}`,`\\[(?:[^\\[\\]\\\\]|\\\\[\\s\\S]|\\[(?:[^\\[\\]\\\\]|\\\\[\\s\\S])*\\])*\\]`,`<(?:[^<>\\\\]|\\\\[\\s\\S]|<(?:[^<>\\\\]|\\\\[\\s\\S])*>)*>`].join(`|`)+`)`,r=`(?:"(?:\\\\.|[^"\\\\\\r\\n])*"|(?:\\b[a-zA-Z_]\\w*|[^\\s\\0-\\x7F]+)[?!]?|\\$.)`;e.languages.insertBefore(`ruby`,`keyword`,{"regex-literal":[{pattern:RegExp(`%r`+n+`[egimnosux]{0,6}`),greedy:!0,inside:{interpolation:t,regex:/[\s\S]+/}},{pattern:/(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,lookbehind:!0,greedy:!0,inside:{interpolation:t,regex:/[\s\S]+/}}],variable:/[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,symbol:[{pattern:RegExp(`(^|[^:]):`+r),lookbehind:!0,greedy:!0},{pattern:RegExp(`([\\r\\n{(,][ \\t]*)`+r+`(?=:(?!:))`),lookbehind:!0,greedy:!0}],"method-definition":{pattern:/(\bdef\s+)\w+(?:\s*\.\s*\w+)?/,lookbehind:!0,inside:{function:/\b\w+$/,keyword:/^self\b/,"class-name":/^\w+/,punctuation:/\./}}}),e.languages.insertBefore(`ruby`,`string`,{"string-literal":[{pattern:RegExp(`%[qQiIwWs]?`+n),greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}},{pattern:/("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}},{pattern:/<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:`heredoc-string`,greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?[a-z_]\w*|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?/}},interpolation:t,string:/[\s\S]+/}},{pattern:/<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:`heredoc-string`,greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?'[a-z_]\w*'|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?'|'$/}},string:/[\s\S]+/}}],"command-literal":[{pattern:RegExp(`%x`+n),greedy:!0,inside:{interpolation:t,command:{pattern:/[\s\S]+/,alias:`string`}}},{pattern:/`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,greedy:!0,inside:{interpolation:t,command:{pattern:/[\s\S]+/,alias:`string`}}}]}),delete e.languages.ruby.string,e.languages.insertBefore(`ruby`,`number`,{builtin:/\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Fixnum|Float|Hash|IO|Integer|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|Stat|String|Struct|Symbol|TMS|Thread|ThreadGroup|Time|TrueClass)\b/,constant:/\b[A-Z][A-Z0-9_]*(?:[?!]|\b)/}),e.languages.rb=e.languages.ruby})(e)}UO.displayName=`rust`,UO.aliases=[];function UO(e){(function(e){for(var t=`\\/\\*(?:[^*/]|\\*(?!\\/)|\\/(?!\\*)|<self>)*\\*\\/`,n=0;n<2;n++)t=t.replace(/<self>/g,function(){return t});t=t.replace(/<self>/g,function(){return`[^\\s\\S]`}),e.languages.rust={comment:[{pattern:RegExp(`(^|[^\\\\])`+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:`attr-name`,inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:`punctuation`},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:`symbol`},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:`punctuation`},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:`function`},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:`class-name`},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:`namespace`},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:`namespace`,inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:`property`},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},e.languages.rust[`closure-params`].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string})(e)}WO.displayName=`sql`,WO.aliases=[];function WO(e){e.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/}}GO.displayName=`jsx`,GO.aliases=[];function GO(e){e.register(LO),e.register(zO),(function(e){var t=e.util.clone(e.languages.javascript),n=`(?:\\s|\\/\\/.*(?!.)|\\/\\*(?:[^*]|\\*(?!\\/))\\*\\/)`,r=`(?:\\{(?:\\{(?:\\{[^{}]*\\}|[^{}])*\\}|[^{}])*\\})`,i=`(?:\\{<S>*\\.{3}(?:[^{}]|<BRACES>)*\\})`;function a(e,t){return e=e.replace(/<S>/g,function(){return n}).replace(/<BRACES>/g,function(){return r}).replace(/<SPREAD>/g,function(){return i}),RegExp(e,t)}i=a(i).source,e.languages.jsx=e.languages.extend(`markup`,t),e.languages.jsx.tag.pattern=a(`<\\/?(?:[\\w.:-]+(?:<S>+(?:[\\w.:$-]+(?:=(?:"(?:\\\\[\\s\\S]|[^\\\\"])*"|'(?:\\\\[\\s\\S]|[^\\\\'])*'|[^\\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\\/?)?>`),e.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,e.languages.jsx.tag.inside[`attr-value`].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,e.languages.jsx.tag.inside.tag.inside[`class-name`]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,e.languages.jsx.tag.inside.comment=t.comment,e.languages.insertBefore(`inside`,`attr-name`,{spread:{pattern:a(`<SPREAD>`),inside:e.languages.jsx}},e.languages.jsx.tag),e.languages.insertBefore(`inside`,`special-attr`,{script:{pattern:a(`=<BRACES>`),alias:`language-javascript`,inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:`punctuation`},rest:e.languages.jsx}}},e.languages.jsx.tag);var o=function(e){return e?typeof e==`string`?e:typeof e.content==`string`?e.content:e.content.map(o).join(``):``},s=function(t){for(var n=[],r=0;r<t.length;r++){var i=t[r],a=!1;if(typeof i!=`string`&&(i.type===`tag`&&i.content[0]&&i.content[0].type===`tag`?i.content[0].content[0].content===`</`?n.length>0&&n[n.length-1].tagName===o(i.content[0].content[1])&&n.pop():i.content[i.content.length-1].content===`/>`||n.push({tagName:o(i.content[0].content[1]),openedBraces:0}):n.length>0&&i.type===`punctuation`&&i.content===`{`?n[n.length-1].openedBraces++:n.length>0&&n[n.length-1].openedBraces>0&&i.type===`punctuation`&&i.content===`}`?n[n.length-1].openedBraces--:a=!0),(a||typeof i==`string`)&&n.length>0&&n[n.length-1].openedBraces===0){var c=o(i);r<t.length-1&&(typeof t[r+1]==`string`||t[r+1].type===`plain-text`)&&(c+=o(t[r+1]),t.splice(r+1,1)),r>0&&(typeof t[r-1]==`string`||t[r-1].type===`plain-text`)&&(c=o(t[r-1])+c,t.splice(r-1,1),r--),t[r]=new e.Token(`plain-text`,c,null,c)}i.content&&typeof i.content!=`string`&&s(i.content)}};e.hooks.add(`after-tokenize`,function(e){e.language!==`jsx`&&e.language!==`tsx`||s(e.tokens)})})(e)}KO.displayName=`typescript`,KO.aliases=[`ts`];function KO(e){e.register(LO),(function(e){e.languages.typescript=e.languages.extend(`javascript`,{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript[`literal-property`];var t=e.languages.extend(`typescript`,{});delete t[`class-name`],e.languages.typescript[`class-name`].inside=t,e.languages.insertBefore(`typescript`,`function`,{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:`operator`},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:`class-name`,inside:t}}}}),e.languages.ts=e.languages.typescript})(e)}qO.displayName=`tsx`,qO.aliases=[];function qO(e){e.register(GO),e.register(KO),(function(e){var t=e.util.clone(e.languages.typescript);e.languages.tsx=e.languages.extend(`jsx`,t),delete e.languages.tsx.parameter,delete e.languages.tsx[`literal-property`];var n=e.languages.tsx.tag;n.pattern=RegExp(`(^|[^\\w$]|(?=<\\/))(?:`+n.pattern.source+`)`,n.pattern.flags),n.lookbehind=!0})(e)}JO.displayName=`yaml`,JO.aliases=[`yml`];function JO(e){(function(e){var t=/[*&][^\s[\]{},]+/,n=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,r=`(?:`+n.source+`(?:[ ]+`+t.source+`)?|`+t.source+`(?:[ ]+`+n.source+`)?)`,i=`(?:[^\\s\\x00-\\x08\\x0e-\\x1f!"#%&'*,\\-:>?@[\\]\`{|}\\x7f-\\x84\\x86-\\x9f\\ud800-\\udfff\\ufffe\\uffff]|[?:-]<PLAIN>)(?:[ \\t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*`.replace(/<PLAIN>/g,function(){return`[^\\s\\x00-\\x08\\x0e-\\x1f,[\\]{}\\x7f-\\x84\\x86-\\x9f\\ud800-\\udfff\\ufffe\\uffff]`}),a=`"(?:[^"\\\\\\r\\n]|\\\\.)*"|'(?:[^'\\\\\\r\\n]|\\\\.)*'`;function o(e,t){t=(t||``).replace(/m/g,``)+`m`;var n=`([:\\-,[{]\\s*(?:\\s<<prop>>[ \\t]+)?)(?:<<value>>)(?=[ \\t]*(?:$|,|\\]|\\}|(?:[\\r\\n]\\s*)?#))`.replace(/<<prop>>/g,function(){return r}).replace(/<<value>>/g,function(){return e});return RegExp(n,t)}e.languages.yaml={scalar:{pattern:RegExp(`([\\-:]\\s*(?:\\s<<prop>>[ \\t]+)?[|>])[ \\t]*(?:((?:\\r?\\n|\\r)[ \\t]+)\\S[^\\r\\n]*(?:\\2[^\\r\\n]+)*)`.replace(/<<prop>>/g,function(){return r})),lookbehind:!0,alias:`string`},comment:/#.*/,key:{pattern:RegExp(`((?:^|[:\\-,[{\\r\\n?])[ \\t]*(?:<<prop>>[ \\t]+)?)<<key>>(?=\\s*:\\s)`.replace(/<<prop>>/g,function(){return r}).replace(/<<key>>/g,function(){return`(?:`+i+`|`+a+`)`})),lookbehind:!0,greedy:!0,alias:`atrule`},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:`important`},datetime:{pattern:o(`\\d{4}-\\d\\d?-\\d\\d?(?:[tT]|[ \\t]+)\\d\\d?:\\d{2}:\\d{2}(?:\\.\\d*)?(?:[ \\t]*(?:Z|[-+]\\d\\d?(?::\\d{2})?))?|\\d{4}-\\d{2}-\\d{2}|\\d\\d?:\\d{2}(?::\\d{2}(?:\\.\\d*)?)?`),lookbehind:!0,alias:`number`},boolean:{pattern:o(`false|true`,`i`),lookbehind:!0,alias:`important`},null:{pattern:o(`null|~`,`i`),lookbehind:!0,alias:`important`},string:{pattern:o(a),lookbehind:!0,greedy:!0},number:{pattern:o(`[+-]?(?:0x[\\da-f]+|0o[0-7]+|(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:e[+-]?\\d+)?|\\.inf|\\.nan)`,`i`),lookbehind:!0},tag:n,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml})(e)}xO.register(AO),xO.register(NO),xO.register(PO),xO.register(FO),xO.register(IO),xO.register(LO),xO.register(RO),xO.register(BO),xO.register(zO),xO.register(VO),xO.register(HO),xO.register(UO),xO.register(WO),xO.register(qO),xO.register(KO),xO.register(JO);var YO=new Set([`bash`,`cpp`,`css`,`go`,`java`,`javascript`,`json`,`markdown`,`markup`,`python`,`ruby`,`rust`,`sql`,`tsx`,`typescript`,`yaml`]),XO={ts:`typescript`,tsx:`tsx`,js:`javascript`,mjs:`javascript`,cjs:`javascript`,jsx:`tsx`,rs:`rust`,go:`go`,c:`cpp`,h:`cpp`,cpp:`cpp`,cc:`cpp`,hpp:`cpp`,java:`java`,py:`python`,rb:`ruby`,sh:`bash`,bash:`bash`,zsh:`bash`,json:`json`,yaml:`yaml`,yml:`yaml`,md:`markdown`,markdown:`markdown`,html:`markup`,htm:`markup`,xml:`markup`,svg:`markup`,css:`css`,scss:`css`,sql:`sql`};function ZO(e){if(e===void 0)return;let t=e.lastIndexOf(`.`);if(t===-1)return;let n=XO[e.slice(t+1).toLowerCase()];if(!(n===void 0||!YO.has(n)))return n}function QO(e,t){if(t!==void 0)try{return QD(e,{highlight:!0,refractor:xO,language:t})}catch{return}}var $O=800,ek=({change:e,side:t})=>{if(t===`old`)return null;let n=e.type===`normal`?e.newLineNumber:e.lineNumber;return n===void 0?null:(0,R.jsx)(`span`,{children:n})},tk=({change:e,side:t})=>e.type===`normal`?(0,R.jsx)(`span`,{children:t===`old`?e.oldLineNumber:e.newLineNumber}):e.type===`insert`&&t===`new`||e.type===`delete`&&t===`old`?(0,R.jsx)(`span`,{children:e.lineNumber}):null;function nk({diff:e,viewType:t=`unified`,onHunkAction:n,hunkActionLabel:r,hunkActionDisabled:i}){let a=[],o=`fallback`,s=ok(e);if(s!==void 0){let e=sk(s);ck(e)&&(a=e,o=`pi`)}if(o===`fallback`){let t=sk(e);ck(t)&&(a=t,o=`raw`)}if(o===`fallback`&&lk(e)){let t=sk(ak+e.replace(/^\n+/,``));ck(t)&&(a=t,o=`synthetic`)}if(o===`fallback`)return typeof console<`u`&&console.warn(`[DiffBlock] parseDiff produced no hunks; rendering colored fallback. Diff prefix:`,e.slice(0,200)),(0,R.jsx)(uk,{diff:e});let c=t===`split`?tk:ek;return(0,R.jsx)(`div`,{className:`pi-diff-block ${t===`split`?`pi-diff-split`:`pi-diff-unified`} overflow-auto px-2 pb-2 text-[11px]`,children:a.map(e=>(0,R.jsx)(rk,{file:e,viewType:t,renderGutter:c,onHunkAction:n,hunkActionLabel:r,hunkActionDisabled:i},`${e.oldPath??``}:${e.newPath??``}`))})}function rk({file:e,viewType:t,renderGutter:n,onHunkAction:r,hunkActionLabel:i,hunkActionDisabled:a}){let[o,s]=(0,v.useState)(!1),c=ZO((e.newPath??e.oldPath??``).replace(/^[ab]\//,``)),l=e.hunks.reduce((e,t)=>e+t.changes.length,0),u=l>$O&&!o,d=u?ik(e.hunks,$O):e.hunks,f=QO(d,c);return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(vD,{viewType:t,diffType:e.type,hunks:d,renderGutter:n,tokens:f??null,children:e=>{let t=[];return e.forEach((e,n)=>{r!==void 0&&t.push((0,R.jsx)(xD,{children:(0,R.jsxs)(`div`,{className:`relative flex items-center justify-between gap-2 border-y border-blue-700/30 bg-blue-950/30 py-px leading-none light:border-blue-300 light:bg-blue-50`,children:[(0,R.jsxs)(`span`,{className:`sticky left-0 z-10 bg-blue-950 px-2 py-px text-[9px] uppercase tracking-wider text-blue-400 light:bg-blue-100 light:text-blue-700`,children:[`Hunk `,n+1]}),(0,R.jsx)(`button`,{type:`button`,onClick:()=>r(n),disabled:a===!0,className:`sticky right-1 z-10 rounded border border-blue-500/60 bg-blue-900 px-1.5 py-px text-[10px] text-blue-100 hover:border-blue-400 hover:bg-blue-800 disabled:cursor-not-allowed disabled:opacity-50 light:border-blue-500 light:bg-blue-200 light:text-blue-900 light:hover:border-blue-600 light:hover:bg-blue-300`,children:i??`Apply hunk`})]})},`dec-${e.content}`)),t.push((0,R.jsx)(pD,{hunk:e},e.content))}),t}}),u&&(0,R.jsxs)(`button`,{onClick:()=>s(!0),className:`my-1 w-full rounded border border-neutral-700 bg-neutral-900/60 px-3 py-1 text-[11px] text-neutral-300 hover:border-neutral-500 hover:bg-neutral-900`,title:`Showing ~${$O} of ${l} lines — large diffs slow the renderer; click to render the rest.`,children:[`Show all (`,l,` lines, `,e.hunks.length,` hunks)`]})]})}function ik(e,t){let n=[],r=0;for(let i of e)if(n.length>0&&r+i.changes.length>t||(n.push(i),r+=i.changes.length,r>=t))break;return n}var ak=`--- a/file
329
+ +++ b/file
330
+ `;function ok(e){let t=e.split(`
331
+ `),n=/^([+\- ]) *(\d+)(?: (.*))?$/,r=/^ +\.\.\.$/,i=[],a,o=0,s=()=>{a!==void 0&&a.body.length>0&&i.push(a),a=void 0};for(let e of t){if(e.length===0)continue;if(r.test(e)){s();continue}let t=n.exec(e);if(t===null)return;o+=1;let i=t[1],c=Number.parseInt(t[2]??``,10),l=t[3]??``;a===void 0&&(a={oldStart:c,newStart:c,oldCount:0,newCount:0,body:[]}),i===` `?(a.body.push(` `+l),a.oldCount+=1,a.newCount+=1):i===`-`?(a.body.push(`-`+l),a.oldCount+=1):(a.body.push(`+`+l),a.newCount+=1)}if(s(),!(o===0||i.length===0))return ak+i.map(e=>`@@ -${e.oldStart},${e.oldCount} +${e.newStart},${e.newCount} @@\n`+e.body.join(`
332
+ `)).join(`
333
+ `)+`
334
+ `}function sk(e){try{return xC(e)}catch{return[]}}function ck(e){return e.length>0&&e.some(e=>e.hunks.length>0)}function lk(e){let t=/^@@ /m.test(e),n=/^--- /m.test(e)&&/^\+\+\+ /m.test(e);return t&&!n}function uk({diff:e}){return(0,R.jsx)(`pre`,{className:`overflow-auto px-3 pb-2 font-mono text-[11px] leading-tight`,children:e.split(`
335
+ `).map((e,t)=>(0,R.jsx)(`div`,{className:dk(e),children:e.length===0?`\xA0`:e},t))})}function dk(e){return e.startsWith(`+++`)||e.startsWith(`---`)?`text-neutral-500`:e.startsWith(`@@`)?`bg-neutral-900 text-cyan-400 light:text-cyan-700`:e.startsWith(`+`)?`bg-emerald-950/60 text-emerald-200 light:bg-emerald-50 light:text-emerald-800`:e.startsWith(`-`)?`bg-red-950/60 text-red-200 light:bg-red-50 light:text-red-800`:`text-neutral-400`}var fk=`pi-forge/model/`,pk=`pi-forge/sessionTree.view`;function mk({sessionId:e,projectId:t,onClose:n}){let r=L(t=>t.streamingBySession[e]??!1),i=L(e=>e.setActiveSession),a=L(e=>e.loadSessionsForProject),o=L(e=>e.reloadMessages),s=L(e=>e.setPendingDraft),c=L(t=>t.agentEndCountBySession[e]??0),[l,u]=(0,v.useState)(void 0),[d,f]=(0,v.useState)(!0),[p,m]=(0,v.useState)(void 0),[h,g]=(0,v.useState)(!1),[_,y]=(0,v.useState)(void 0),b=async()=>{f(!0),m(void 0);try{u(await I.getSessionTree(e))}catch(e){m(e instanceof M?e.code:e.message)}finally{f(!1)}};(0,v.useEffect)(()=>{b()},[e]),(0,v.useEffect)(()=>{c!==0&&b()},[c]);let x=(0,v.useMemo)(()=>l===void 0?[]:Ck(l),[l]),[S,C]=(0,v.useState)(()=>{try{return localStorage.getItem(pk)===`list`?`list`:`graph`}catch{return`graph`}}),w=e=>{C(e);try{localStorage.setItem(pk,e)}catch{}},T=e=>{if(h||l?.leafId===e)return;let t=xk(l,e);if(r||t){y({entryId:e,abandonsBranch:t,isStreaming:r});return}E(e,{})},E=async(t,n)=>{g(!0),m(void 0);try{await I.navigateSession(e,t,n),await b(),o(e)}catch(e){m(e instanceof M?e.code:e.message)}finally{g(!1)}},D=async(r,o={})=>{if(!h){g(!0),m(void 0);try{let c=o.parentId!==void 0&&o.parentId!==null?o.parentId:r,l=await I.forkSession(e,c);try{let t=localStorage.getItem(fk+e);t!==null&&t.length>0&&localStorage.setItem(fk+l.sessionId,t)}catch{}o.editDraft!==void 0&&o.editDraft.length>0&&s(l.sessionId,o.editDraft),await a(t),i(l.sessionId),n()}catch(e){m(e instanceof M?e.code:e.message),g(!1)}}};return(0,R.jsxs)(`div`,{className:`fixed inset-0 z-40 flex items-center justify-center bg-black/60 px-4 py-8`,onClick:n,children:[(0,R.jsxs)(`div`,{onClick:e=>e.stopPropagation(),className:`flex h-[min(90vh,900px)] w-[min(95vw,1400px)] flex-col overflow-hidden rounded-lg border border-neutral-800 bg-neutral-950 shadow-2xl`,children:[(0,R.jsxs)(`header`,{className:`flex items-center justify-between border-b border-neutral-800 px-4 py-2.5`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(Oe,{size:14,className:`text-neutral-400`}),(0,R.jsx)(`h2`,{className:`text-sm font-semibold text-neutral-100`,children:`Session tree`}),h&&(0,R.jsx)(Ne,{size:11,className:`animate-spin text-neutral-500`})]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,R.jsxs)(`div`,{className:`mr-1 flex overflow-hidden rounded border border-neutral-700`,children:[(0,R.jsx)(`button`,{onClick:()=>w(`list`),className:`px-2 py-0.5 text-[10px] uppercase tracking-wider ${S===`list`?`bg-neutral-700 text-neutral-100`:`text-neutral-400 hover:bg-neutral-800`}`,title:`Vertical list view`,children:`List`}),(0,R.jsx)(`button`,{onClick:()=>w(`graph`),className:`px-2 py-0.5 text-[10px] uppercase tracking-wider ${S===`graph`?`bg-neutral-700 text-neutral-100`:`text-neutral-400 hover:bg-neutral-800`}`,title:`Branching graph view (turn-grouped)`,children:`Graph`})]}),(0,R.jsx)(`button`,{onClick:()=>void b(),disabled:d||h,className:`rounded p-1 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-200 disabled:opacity-40`,title:`Refresh tree`,children:(0,R.jsx)(Ue,{size:13,className:d?`animate-spin`:``})}),(0,R.jsx)(`button`,{onClick:n,className:`rounded p-2 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-200`,title:`Close (Esc)`,children:(0,R.jsx)(rt,{size:20})})]})]}),p!==void 0&&(0,R.jsx)(`div`,{className:`border-b border-red-700/40 bg-red-900/20 px-4 py-1.5 text-xs text-red-300 light:border-red-300 light:bg-red-50 light:text-red-700`,children:p}),(0,R.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-2 py-2`,children:[d&&l===void 0&&(0,R.jsx)(`div`,{className:`px-4 py-6 text-center text-xs italic text-neutral-500`,children:`Loading tree…`}),!d&&x.length===0&&(0,R.jsx)(`div`,{className:`px-4 py-6 text-center text-xs italic text-neutral-500`,children:`No entries yet.`}),S===`list`?(0,R.jsx)(`ul`,{className:`space-y-0.5`,children:x.map(e=>(0,R.jsx)(bk,{node:e,disabled:h,onNavigate:()=>void T(e.id),onFork:()=>void D(e.id,{...e.type===`message`&&e.role===`user`?{editDraft:e.preview??``,parentId:e.parentId}:{}})},e.id))}):l===void 0?null:(0,R.jsx)(Nk,{tree:l,disabled:h,onNavigate:e=>T(e),onForkAfterTurn:e=>void D(e)})]}),(0,R.jsxs)(`footer`,{className:`flex items-center justify-between border-t border-neutral-800 bg-neutral-900/40 px-4 py-2 text-[10px] text-neutral-500`,children:[(0,R.jsx)(`span`,{children:`Click a row to navigate · fork icon on user messages to branch from that point`}),l!==void 0&&(0,R.jsxs)(`span`,{children:[l.entries.length,` `,l.entries.length===1?`entry`:`entries`]})]})]}),(0,R.jsx)(hk,{state:_,onCancel:()=>y(void 0),onConfirm:e=>{if(_===void 0)return;let{entryId:t}=_;y(void 0),E(t,e)}})]})}function hk({state:e,onCancel:t,onConfirm:n}){let[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(!1),[s,c]=(0,v.useState)(``),l=(0,v.useRef)(null);(0,v.useEffect)(()=>{e!==void 0&&(i(``),o(!1),c(``))},[e]);let u=e!==void 0,d=e?.abandonsBranch===!0,f=()=>{let e={},t=r.trim();if(t.length>0&&(e.label=t),a){e.summarize=!0;let t=s.trim();t.length>0&&(e.customInstructions=t)}n(e)};return(0,R.jsx)(di,{open:u,onClose:t,title:`Navigate session leaf`,width:d?`max-w-md`:`max-w-sm`,...d?{initialFocusRef:l}:{},children:(0,R.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),f()},className:`flex flex-col gap-3 px-4 py-3 text-xs text-neutral-200`,children:[e?.isStreaming===!0&&(0,R.jsx)(`p`,{className:`rounded border border-amber-700/50 bg-amber-900/20 px-2 py-1.5 text-amber-200 light:border-amber-300 light:bg-amber-50 light:text-amber-800`,children:`The agent is currently running. Navigating will abort the in-progress turn.`}),d?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`p`,{className:`text-neutral-400`,children:`You’re leaving the current branch behind. The tip stays on the tree (you can navigate back to it any time), but you can also bookmark + summarize it before moving on.`}),(0,R.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,R.jsxs)(`span`,{className:`text-neutral-500`,children:[`Label for the abandoned branch tip`,` `,(0,R.jsx)(`span`,{className:`text-neutral-600`,children:`(optional)`})]}),(0,R.jsx)(`input`,{ref:l,type:`text`,value:r,onChange:e=>i(e.target.value),placeholder:`e.g. wrong-approach`,maxLength:200,className:`rounded border border-neutral-700 bg-neutral-950 px-2 py-1 text-neutral-100 outline-none focus:border-neutral-500`})]}),(0,R.jsxs)(`label`,{className:`flex items-start gap-2 rounded border border-neutral-800 bg-neutral-950 px-2 py-1.5`,children:[(0,R.jsx)(`input`,{type:`checkbox`,checked:a,onChange:e=>o(e.target.checked),className:`mt-0.5 h-3 w-3`}),(0,R.jsxs)(`span`,{className:`flex-1 text-neutral-300`,children:[`Have pi write a `,(0,R.jsx)(`code`,{className:`font-mono text-[11px]`,children:`branch_summary`}),` entry capturing what this branch did. Costs one extra LLM call.`]})]}),a&&(0,R.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,R.jsxs)(`span`,{className:`text-neutral-500`,children:[`Custom summarizer instructions`,` `,(0,R.jsx)(`span`,{className:`text-neutral-600`,children:`(optional)`})]}),(0,R.jsx)(`textarea`,{value:s,onChange:e=>c(e.target.value),rows:3,placeholder:`e.g. Focus on what files were changed and why`,className:`rounded border border-neutral-700 bg-neutral-950 px-2 py-1 font-mono text-[11px] text-neutral-100 outline-none focus:border-neutral-500`})]})]}):(0,R.jsx)(`p`,{className:`text-neutral-400`,children:`Confirm navigation?`}),(0,R.jsxs)(`footer`,{className:`flex justify-end gap-2 pt-1`,children:[(0,R.jsx)(`button`,{type:`button`,onClick:t,className:`rounded-md border border-neutral-700 px-3 py-1 text-xs text-neutral-200 hover:bg-neutral-800`,children:`Cancel`}),(0,R.jsx)(`button`,{type:`submit`,className:`rounded-md px-3 py-1 text-xs font-medium ${e?.isStreaming===!0?`bg-amber-600 text-amber-50 hover:bg-amber-500 light:bg-amber-500 light:text-white light:hover:bg-amber-600`:`bg-neutral-100 text-neutral-900 hover:bg-white`}`,children:e?.isStreaming===!0?`Abort & navigate`:`Navigate`})]})]})})}var gk=4,_k=18,vk=10,yk=8;function bk({node:e,disabled:t,onNavigate:n,onFork:r}){let i=Math.min(e.depth,gk)*_k+Math.min(e.branchLevel,yk)*vk,a=e.type===`message`&&e.role===`user`,o=!e.onActivePath,s=Ek(e);return(0,R.jsx)(`li`,{className:`group min-w-0`,style:{paddingLeft:`${i}px`},children:(0,R.jsxs)(`div`,{className:`flex min-w-0 items-start gap-1.5 rounded border px-2 py-1.5 ${e.isLeaf?`border-emerald-700/60 bg-emerald-900/10`:e.onActivePath?`border-neutral-700 bg-neutral-900/40`:`border-neutral-800/50 bg-transparent`} ${o?`opacity-60`:``}`,style:e.branchLevel>0?{boxShadow:`inset 3px 0 0 ${Tk(e.branchLevel)}`}:void 0,children:[(0,R.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5 pt-0.5`,children:[e.isLeaf?(0,R.jsx)(`span`,{className:`inline-block w-[22px]`,"aria-hidden":`true`}):(0,R.jsx)(`button`,{onClick:n,disabled:t,className:`rounded p-1 text-neutral-500 hover:bg-neutral-800 hover:text-neutral-100 disabled:opacity-40`,title:`Navigate the session leaf to this entry`,children:(0,R.jsx)(ze,{size:11})}),a?(0,R.jsx)(`button`,{onClick:r,disabled:t,className:`rounded p-1 text-neutral-500 hover:bg-neutral-800 hover:text-emerald-300 disabled:opacity-40 light:hover:text-emerald-700`,title:`Fork BEFORE this message — opens a new session with the message text loaded into the input for editing.`,children:(0,R.jsx)(Oe,{size:11})}):(0,R.jsx)(`span`,{className:`inline-block w-[22px]`,"aria-hidden":`true`})]}),(0,R.jsxs)(`button`,{onClick:n,disabled:t||e.isLeaf,className:`flex min-w-0 flex-1 flex-col items-start gap-0.5 text-left disabled:cursor-default`,title:e.isLeaf?`Current leaf`:`Navigate the session leaf to this entry`,children:[(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,R.jsx)(`span`,{className:`rounded px-1.5 py-0.5 text-[9px] uppercase tracking-wider ${e.role===`user`?`bg-sky-900/40 text-sky-300 light:bg-sky-100 light:text-sky-800`:e.role===`assistant`?`bg-violet-900/40 text-violet-300 light:bg-violet-100 light:text-violet-800`:e.type===`branch_summary`?`bg-amber-900/40 text-amber-300 light:bg-amber-100 light:text-amber-800`:e.type===`compaction`?`bg-fuchsia-900/40 text-fuchsia-300 light:bg-fuchsia-100 light:text-fuchsia-800`:`bg-neutral-800 text-neutral-400`}`,children:s}),e.isBranchHead&&(0,R.jsxs)(`span`,{className:`rounded px-1.5 py-0.5 text-[9px] uppercase tracking-wider`,style:{background:`${Tk(e.branchLevel)}33`,color:Tk(e.branchLevel)},title:`First entry of a divergent branch`,children:[`branch `,e.branchLevel]}),e.label!==void 0&&e.label.length>0&&(0,R.jsxs)(`span`,{className:`rounded bg-neutral-800 px-1.5 py-0.5 text-[9px] text-neutral-300`,children:[`★ `,e.label]}),e.isLeaf&&(0,R.jsx)(`span`,{className:`rounded bg-emerald-900/40 px-1.5 py-0.5 text-[9px] text-emerald-300 light:bg-emerald-100 light:text-emerald-800`,children:`leaf`}),e.siblings>1&&(0,R.jsxs)(`span`,{className:`text-[9px] text-amber-400 light:text-amber-700`,title:`${e.siblings} branches diverge from this point`,children:[`⑂ `,e.siblings]}),(0,R.jsx)(`span`,{className:`text-[9px] text-neutral-600`,children:new Date(e.timestamp).toLocaleString()})]}),e.preview!==void 0&&(0,R.jsx)(`p`,{className:`w-full truncate text-[11px] text-neutral-300`,children:e.preview})]})]})})}function xk(e,t){if(e===void 0||e.leafId===null||e.leafId===t)return!1;let n=new Map(e.entries.map(e=>[e.id,e])),r=e.leafId;for(;r!==null;){if(r===t)return!1;r=n.get(r)?.parentId??null}return!0}function Sk(e){return e.type!==`message`||e.role===`user`?0:e.role===`tool`?2:1}function Ck(e){let t=new Map;for(let n of e.entries){let e=t.get(n.parentId);e===void 0?t.set(n.parentId,[n]):e.push(n)}for(let e of t.values())e.sort((e,t)=>e.timestamp.localeCompare(t.timestamp));let n=new Set(e.branchIds),r=[],i=(a,o)=>{let s=t.get(a);if(s===void 0)return;let c=s.length;s.forEach((t,a)=>{let s=a===0?o:o+1,l=a>0&&s>0;r.push({...t,depth:Sk(t),branchLevel:s,onActivePath:n.has(t.id),isLeaf:e.leafId===t.id,siblings:c,isBranchHead:l}),i(t.id,s)})};return i(null,0),r}var wk=[`#f59e0b`,`#0ea5e9`,`#ec4899`,`#10b981`,`#8b5cf6`,`#f97316`];function Tk(e){return e<=0?`transparent`:wk[(e-1)%wk.length]}function Ek(e){return e.type===`message`?e.role??`message`:e.type===`thinking_level_change`?`thinking`:e.type===`model_change`?`model`:e.type===`compaction`?`compact`:e.type===`branch_summary`?`branch`:e.type===`label`?`label`:e.type===`session_info`?`info`:e.type===`custom`?`custom`:e.type===`custom_message`?`extension`:e.type}var Dk=220,Ok=78,kk=64,Ak=28,jk=24;function Mk(e){let t=new Map(e.entries.map(e=>[e.id,e])),n=new Map;for(let t of e.entries){let e=n.get(t.parentId);e===void 0?n.set(t.parentId,[t]):e.push(t)}for(let e of n.values())e.sort((e,t)=>e.timestamp.localeCompare(t.timestamp));let r=new Map,i=e=>{let n=r.get(e.id);if(n!==void 0)return n;if(e.type===`message`&&e.role===`user`||e.parentId===null)return r.set(e.id,e.id),e.id;let a=t.get(e.parentId);if(a===void 0)return r.set(e.id,e.id),e.id;let o=i(a);return r.set(e.id,o),o};for(let t of e.entries)i(t);let a=new Map;for(let t of e.entries){if(r.get(t.id)!==t.id)continue;let e=t.type===`message`&&t.role===`user`;a.set(t.id,{id:t.id,parentId:null,col:0,row:0,isOnActivePath:!1,isLeafTurn:!1,hasMultipleChildren:!1,childCount:0,roleLabel:e?`user`:Ek(t),preview:t.preview??``,insideCounts:{assistant:0,tool:0,thinking:0,meta:0},isUserAnchor:e,anchorParentId:t.parentId,lastEntryId:t.id,timestamp:t.timestamp})}for(let n of e.entries){let e=r.get(n.id),i=a.get(e);if(i===void 0)continue;let o=t.get(i.lastEntryId);(o===void 0||n.timestamp.localeCompare(o.timestamp)>0)&&(i.lastEntryId=n.id),e!==n.id&&(n.type===`message`&&n.role===`assistant`?i.insideCounts.assistant+=1:n.type===`message`&&(n.role===`tool`||n.role===`toolResult`)?i.insideCounts.tool+=1:(n.type===`message`&&n.role,i.insideCounts.meta+=1))}for(let e of a.values()){if(e.anchorParentId===null)continue;let t=r.get(e.anchorParentId);t!==void 0&&t!==e.id&&(e.parentId=t)}let o=new Map;for(let e of a.values()){let t=o.get(e.parentId);t===void 0?o.set(e.parentId,[e]):t.push(e)}for(let e of o.values())e.sort((e,t)=>e.timestamp.localeCompare(t.timestamp));for(let e of a.values()){let t=o.get(e.id)??[];e.childCount=t.length,e.hasMultipleChildren=t.length>1}let s=new Set(e.branchIds),c=e.leafId===null?void 0:r.get(e.leafId);for(let e of a.values())e.isOnActivePath=s.has(e.id),e.isLeafTurn=c===e.id;let l=0,u=new Map,d=(e,t)=>{(o.get(e)??[]).forEach((e,n)=>{let r;n===0?r=t:(r=l,l+=1),e.col=r,u.set(e.id,r),d(e.id,r)})};(o.get(null)??[]).forEach((e,t)=>{t===0?(e.col=0,l=Math.max(l,1)):(e.col=l,l+=1),u.set(e.id,e.col),d(e.id,e.col)});let f=(e,t)=>{let n=t.get(e.id);if(n!==void 0)return n;if(e.parentId===null)return t.set(e.id,0),0;let r=a.get(e.parentId);if(r===void 0)return t.set(e.id,0),0;let i=f(r,t)+1;return t.set(e.id,i),i},p=new Map;for(let e of a.values())e.row=f(e,p);return[...a.values()].sort((e,t)=>e.row===t.row?e.col-t.col:e.row-t.row)}function Nk({tree:e,disabled:t,onNavigate:n,onForkAfterTurn:r}){let i=(0,v.useMemo)(()=>Mk(e),[e]),a=(0,v.useMemo)(()=>{if(i.length===0)return{width:0,height:0};let e=i.reduce((e,t)=>Math.max(e,t.col),0),t=i.reduce((e,t)=>Math.max(e,t.row),0);return{width:jk*2+(e+1)*Dk+e*kk,height:jk*2+(t+1)*Ok+t*Ak}},[i]);if(i.length===0)return(0,R.jsx)(`div`,{className:`px-4 py-6 text-center text-xs italic text-neutral-500`,children:`No turns to render.`});let o=e=>jk+e*(Dk+kk),s=e=>jk+e*(Ok+Ak),c=new Map(i.map(e=>[e.id,e]));return(0,R.jsxs)(`div`,{className:`relative`,style:{width:`${a.width}px`,height:`${a.height}px`},children:[(0,R.jsx)(`svg`,{"aria-hidden":`true`,className:`pointer-events-none absolute left-0 top-0`,width:a.width,height:a.height,children:i.map(e=>{if(e.parentId===null)return null;let t=c.get(e.parentId);if(t===void 0)return null;let n=o(t.col)+Dk/2,r=s(t.row)+Ok,i=o(e.col)+Dk/2,a=s(e.row),l=e.isOnActivePath&&t.isOnActivePath;return(0,R.jsx)(`path`,{d:n===i?`M ${n} ${r} L ${i} ${a}`:(()=>{let e=r+(a-r)/2,t=i>n,o=t?n+8:n-8,s=t?i-8:i+8;return[`M ${n} ${r}`,`L ${n} ${e-8}`,`Q ${n} ${e} ${o} ${e}`,`L ${s} ${e}`,`Q ${i} ${e} ${i} ${e+8}`,`L ${i} ${a}`].join(` `)})(),fill:`none`,stroke:l?`#a3a3a3`:`#404040`,strokeWidth:l?1.5:1,strokeOpacity:l?.85:.5},e.id)})}),i.map(e=>(0,R.jsx)(Pk,{turn:e,x:o(e.col),y:s(e.row),disabled:t,onNavigate:()=>n(e.lastEntryId),onForkAfterTurn:()=>r(e.lastEntryId)},e.id))]})}function Pk({turn:e,x:t,y:n,disabled:r,onNavigate:i,onForkAfterTurn:a}){let o=!e.isOnActivePath;return(0,R.jsx)(`div`,{className:`absolute overflow-hidden rounded-lg border ${e.isLeafTurn?`border-emerald-700/70 bg-emerald-900/15`:e.isOnActivePath?`border-neutral-600 bg-neutral-900`:`border-neutral-800 bg-neutral-950`} ${o?`opacity-60`:``}`,style:{left:`${t}px`,top:`${n}px`,width:`${Dk}px`,height:`${Ok}px`},children:(0,R.jsxs)(`button`,{onClick:i,disabled:r||e.isLeafTurn,className:`flex h-full w-full flex-col items-stretch gap-1 px-2 py-1.5 text-left disabled:cursor-default`,title:e.isLeafTurn?`Current leaf turn`:`Navigate to this turn`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,R.jsx)(`span`,{className:`rounded px-1.5 py-0.5 text-[9px] uppercase tracking-wider ${e.roleLabel===`user`?`bg-sky-900/40 text-sky-300 light:bg-sky-100 light:text-sky-800`:e.roleLabel===`compact`?`bg-fuchsia-900/40 text-fuchsia-300 light:bg-fuchsia-100 light:text-fuchsia-800`:e.roleLabel===`branch`?`bg-amber-900/40 text-amber-300 light:bg-amber-100 light:text-amber-800`:`bg-neutral-800 text-neutral-400`}`,children:e.roleLabel}),e.isLeafTurn&&(0,R.jsx)(`span`,{className:`rounded bg-emerald-900/40 px-1.5 py-0.5 text-[9px] text-emerald-300 light:bg-emerald-100 light:text-emerald-800`,children:`leaf`}),e.hasMultipleChildren&&(0,R.jsxs)(`span`,{className:`text-[9px] text-amber-400 light:text-amber-700`,title:`${e.childCount} branches diverge from here`,children:[`⑂ `,e.childCount]}),(0,R.jsx)(`button`,{onClick:e=>{e.stopPropagation(),a()},disabled:r,className:`ml-auto rounded p-0.5 text-neutral-500 hover:bg-neutral-800 hover:text-emerald-300 disabled:opacity-40 light:hover:text-emerald-700`,title:`Fork AFTER this turn — opens a new session that includes this turn's full output, ready for the next prompt.`,children:(0,R.jsx)(Oe,{size:11})})]}),(0,R.jsx)(`p`,{className:`line-clamp-2 flex-1 text-[11px] text-neutral-200`,children:e.preview.length>0?e.preview:(0,R.jsx)(`em`,{className:`text-neutral-500`,children:`(no text)`})}),(0,R.jsxs)(`div`,{className:`flex items-center gap-2 text-[9px] text-neutral-500`,children:[e.insideCounts.assistant>0&&(0,R.jsxs)(`span`,{title:`Assistant messages within this turn`,children:[e.insideCounts.assistant,`a`]}),e.insideCounts.tool>0&&(0,R.jsxs)(`span`,{title:`Tool results within this turn`,children:[e.insideCounts.tool,`t`]}),e.insideCounts.thinking>0&&(0,R.jsxs)(`span`,{title:`Thinking blocks`,children:[e.insideCounts.thinking,`th`]}),e.insideCounts.meta>0&&(0,R.jsxs)(`span`,{title:`Meta entries (model_change, branch_summary, etc.)`,children:[e.insideCounts.meta,`m`]}),(0,R.jsx)(`span`,{className:`ml-auto`,children:new Date(e.timestamp).toLocaleTimeString()})]})]})})}var Fk=ft(e=>({pendingInsert:void 0,setPendingInsert:(t,n)=>e({pendingInsert:{sessionId:t,text:n}}),consumePendingInsert:()=>e({pendingInsert:void 0})}));function Ik(e){return typeof e.command==`string`&&e.command.length>0}function Lk(e){return typeof e.text==`string`&&e.text.length>0}function Rk(){return typeof crypto<`u`&&typeof crypto.randomUUID==`function`?crypto.randomUUID():`run-${Date.now()}-${Math.random().toString(36).slice(2)}`}function zk({sessionId:e,projectId:t}){let n=Qr(e=>e.loaded),r=Qr(e=>e.actions),i=Zr(e=>e.minimal),a=$r(e=>e.addRun),o=$r(e=>e.updateRun),s=$r(e=>e.runs),c=L(e=>e.sendPrompt),l=Fk(e=>e.setPendingInsert),[u,d]=(0,v.useState)(!1),f=(0,v.useRef)(null);(0,v.useEffect)(()=>{if(!u)return;let e=e=>{f.current!==null&&(f.current.contains(e.target)||d(!1))};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[u]);let p=r.filter(e=>!(e.enabled===!1||i&&Ik(e))),m=new Map,h=0;for(let e of s)e.status===`running`&&(h+=1,m.set(e.actionId,(m.get(e.actionId)??0)+1));if(!n||p.length===0)return null;let g=n=>{let r=Rk(),i=new AbortController;a({runId:r,sessionId:e,actionId:n.id,actionName:n.name,startedAt:Date.now(),status:`running`,abort:()=>{try{i.abort()}catch{}}}),I.runQuickAction(n.id,t).then(e=>{o(r,{status:i.signal.aborted?`aborted`:`done`,result:e})}).catch(e=>{o(r,{status:`done`,error:e instanceof M?`${e.code}: ${e.message}`:e.message})})},_=t=>{let n=t.text??``;n.length!==0&&((t.mode??`send`)===`insert`?l(e,n):c(e,n))},y=e=>{d(!1),Ik(e)?g(e):Lk(e)&&_(e)};return(0,R.jsxs)(`div`,{ref:f,className:`relative`,children:[(0,R.jsxs)(`button`,{type:`button`,onClick:()=>d(e=>!e),"aria-haspopup":`menu`,"aria-expanded":u,className:`flex items-center gap-1 rounded px-1.5 py-0.5 text-[10px] uppercase tracking-wider text-neutral-400 hover:bg-neutral-800 hover:text-neutral-200 light:text-neutral-600 light:hover:bg-neutral-200 light:hover:text-neutral-900`,title:`Run a saved quick action`,children:[(0,R.jsx)(it,{size:11}),`Actions`,h>0&&(0,R.jsxs)(`span`,{className:`ml-0.5 flex items-center gap-0.5 rounded bg-amber-700/40 px-1 text-[9px] normal-case text-amber-100 light:bg-amber-200 light:text-amber-900`,title:`${h} action${h===1?``:`s`} running`,children:[(0,R.jsx)(Ne,{size:9,className:`animate-spin`}),h]}),(0,R.jsx)(de,{size:11})]}),u&&(0,R.jsx)(`div`,{role:`menu`,className:`absolute left-0 top-full z-30 mt-1 min-w-[14rem] max-w-[20rem] rounded-md border border-neutral-700 bg-neutral-900 py-1 shadow-xl light:border-neutral-300 light:bg-white`,children:p.map(e=>{let t=Ik(e),n=t?Xe:Le,r=m.get(e.id)??0;return(0,R.jsxs)(`button`,{role:`menuitem`,onClick:()=>y(e),className:`flex w-full items-center gap-2 px-3 py-1.5 text-left text-xs text-neutral-200 hover:bg-neutral-800 light:text-neutral-800 light:hover:bg-neutral-100`,title:t?e.command??``:`${e.mode===`insert`?`Insert`:`Send`}: ${e.text??``}`,children:[(0,R.jsx)(n,{size:12,className:t?`text-amber-400 light:text-amber-700`:`text-sky-400 light:text-sky-700`}),(0,R.jsx)(`span`,{className:`flex-1 truncate`,children:e.name}),r>0&&(0,R.jsx)(Ne,{size:11,className:`animate-spin text-amber-400 light:text-amber-700`})]},e.id)})})]})}function Bk(e){return e<1e3?`${e} ms`:`${(e/1e3).toFixed(1)} s`}function Vk({run:e}){let t=$r(e=>e.removeRun),n=Fk(e=>e.setPendingInsert),[r,i]=(0,v.useState)(!1),a=e.result,o=e.status===`running`,s=e.error!==void 0,c=a?.success===!0&&!s,l=a?.exitCode??null,u=o?`border-l-amber-500 light:border-l-amber-600`:c?`border-l-emerald-500 light:border-l-emerald-600`:`border-l-red-500 light:border-l-red-600`,d=o?`running`:s?`error`:a?.timedOut===!0?`timed out`:e.status===`aborted`?`aborted`:l===0?`exit 0`:`exit ${l??`?`}`,f=()=>{if(a===void 0)return``;let t=[`Ran quick action: ${e.actionName}`,``];return a.stdout.length>0&&t.push("```",a.stdout.replace(/\s+$/,``),"```"),a.stderr.length>0&&t.push(``,`stderr:`,"```",a.stderr.replace(/\s+$/,``),"```"),a.exitCode!==null&&a.exitCode!==0&&t.push(``,`exit code: ${a.exitCode}`),t.join(`
336
+ `)};return(0,R.jsxs)(`div`,{className:`rounded-lg border border-neutral-800 border-l-4 bg-neutral-900/40 px-3 py-2 text-xs light:border-neutral-300 light:bg-neutral-50 ${u}`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(Xe,{size:12,className:`text-neutral-500 light:text-neutral-600`}),(0,R.jsx)(`span`,{className:`font-mono text-neutral-300 light:text-neutral-800`,children:e.actionName}),(0,R.jsx)(`span`,{className:`text-neutral-500 light:text-neutral-600`,children:`·`}),o?(0,R.jsxs)(`span`,{className:`flex items-center gap-1 text-amber-400 light:text-amber-700`,children:[(0,R.jsx)(Ne,{size:11,className:`animate-spin`}),d]}):c?(0,R.jsxs)(`span`,{className:`flex items-center gap-1 text-emerald-400 light:text-emerald-700`,children:[(0,R.jsx)(ue,{size:11}),d]}):(0,R.jsxs)(`span`,{className:`flex items-center gap-1 text-red-400 light:text-red-700`,children:[(0,R.jsx)(rt,{size:11}),d]}),a!==void 0&&(0,R.jsxs)(`span`,{className:`text-neutral-500 light:text-neutral-600`,children:[`· `,Bk(a.durationMs)]}),a?.truncated===!0&&(0,R.jsx)(`span`,{className:`rounded bg-amber-700/40 px-1 text-[10px] text-amber-100 light:bg-amber-200 light:text-amber-900`,title:`Output exceeded the per-stream cap and was cut off`,children:`truncated`}),(0,R.jsx)(`div`,{className:`flex-1`}),o?(0,R.jsx)(`button`,{type:`button`,onClick:()=>{e.abort(),$r.getState().updateRun(e.runId,{status:`aborted`})},className:`rounded px-1.5 py-0.5 text-[10px] uppercase tracking-wider text-neutral-400 hover:bg-neutral-800 hover:text-neutral-200 light:text-neutral-600 light:hover:bg-neutral-200`,title:`Stop waiting on this run (server-side abort coming later)`,children:`Stop`}):(0,R.jsxs)(R.Fragment,{children:[a!==void 0&&(a.stdout.length>0||a.stderr.length>0)&&(0,R.jsxs)(`button`,{type:`button`,onClick:()=>n(e.sessionId,f()),className:`flex items-center gap-1 rounded px-1.5 py-0.5 text-[10px] uppercase tracking-wider text-sky-400 hover:bg-neutral-800 hover:text-sky-200 light:text-sky-700 light:hover:bg-neutral-200 light:hover:text-sky-900`,title:`Insert the captured output into the composer for your next prompt`,children:[(0,R.jsx)(Ie,{size:11}),`Use as context`]}),(0,R.jsx)(`button`,{type:`button`,onClick:()=>t(e.runId),className:`rounded px-1.5 py-0.5 text-[10px] uppercase tracking-wider text-neutral-500 hover:bg-neutral-800 hover:text-neutral-200 light:text-neutral-500 light:hover:bg-neutral-200 light:hover:text-neutral-900`,title:`Dismiss`,children:`Dismiss`})]})]}),a!==void 0&&(a.stdout.length>0||a.stderr.length>0||a.exitCode!==0)||s?(0,R.jsx)(`button`,{type:`button`,onClick:()=>i(e=>!e),className:`mt-1 cursor-pointer text-[10px] uppercase tracking-wider text-neutral-500 hover:text-neutral-300 light:text-neutral-600 light:hover:text-neutral-900`,children:r?`Hide output`:`Show output`}):null,r&&(0,R.jsxs)(`div`,{className:`mt-2 space-y-2`,children:[s&&(0,R.jsx)(`pre`,{className:`overflow-auto whitespace-pre-wrap rounded bg-neutral-950 px-2 py-1 font-mono text-[11px] text-red-300 light:bg-red-50 light:text-red-800`,children:e.error}),a!==void 0&&a.stdout.length>0&&(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`div`,{className:`mb-0.5 text-[10px] uppercase tracking-wider text-neutral-500 light:text-neutral-600`,children:`stdout`}),(0,R.jsx)(`pre`,{className:`max-h-72 overflow-auto whitespace-pre-wrap rounded bg-neutral-950 px-2 py-1 font-mono text-[11px] text-neutral-200 light:bg-white light:text-neutral-800`,children:a.stdout})]}),a!==void 0&&a.stderr.length>0&&(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`div`,{className:`mb-0.5 text-[10px] uppercase tracking-wider text-neutral-500 light:text-neutral-600`,children:`stderr`}),(0,R.jsx)(`pre`,{className:`max-h-72 overflow-auto whitespace-pre-wrap rounded bg-neutral-950 px-2 py-1 font-mono text-[11px] text-red-300 light:bg-red-50 light:text-red-800`,children:a.stderr})]})]})]})}var Hk=new Set([`single`,`parallel`,`chain`,`management`]);function Uk(e){if(!e.endsWith(`.jsonl`))return;let t=Math.max(e.lastIndexOf(`/`),e.lastIndexOf(`\\`)),n=(t>=0?e.slice(t+1):e).slice(0,-6);if(n.length!==0)return n}function Wk(e){if(typeof e!=`object`||!e)return{mode:`unknown`,results:[]};let t=e,n=Hk.has(t.mode)?t.mode:`unknown`,r=typeof t.runId==`string`&&t.runId.length>0?t.runId:void 0,i=t.context===`fresh`||t.context===`fork`?t.context:void 0,a=[];if(Array.isArray(t.results))for(let e of t.results){if(typeof e!=`object`||!e)continue;let t=e,n={agent:typeof t.agent==`string`?t.agent:`agent`,task:typeof t.task==`string`?t.task:``,exitCode:typeof t.exitCode==`number`?t.exitCode:0};if(typeof t.sessionFile==`string`&&t.sessionFile.length>0){n.sessionFile=t.sessionFile;let e=Uk(t.sessionFile);e!==void 0&&(n.sessionId=e)}typeof t.finalOutput==`string`&&t.finalOutput.length>0&&(n.finalOutput=t.finalOutput),a.push(n)}return{mode:n,...r===void 0?{}:{runId:r},...i===void 0?{}:{context:i},results:a}}var Gk=(0,v.createContext)({viewType:`unified`,setViewType:()=>void 0}),Kk=`forge.chat.viewType`;function qk(){try{return localStorage.getItem(Kk)===`split`?`split`:`unified`}catch{return`unified`}}function Jk({sessionId:e}){let t=L(t=>t.messagesBySession[e]??kr),n=L(t=>t.compactionsBySession[e]??Ar),r=L(t=>t.streamingTextBySession[e]??``),i=L(t=>t.streamingBySession[e]??!1),a=L(t=>t.activeToolBySession[e]),o=L(t=>t.bannerBySession[e]),s=L(t=>t.queuedBySession[e]),c=L(e=>e.openStream),l=L(e=>e.closeStream),u=L(t=>t.pendingScrollByMessageIndex[e]),d=L(e=>e.consumePendingScroll),f=$r(e=>e.runs),p=(0,v.useMemo)(()=>f.filter(t=>t.sessionId===e),[f,e]),[m,h]=(0,v.useState)(qk),g=e=>{h(e);try{localStorage.setItem(Kk,e)}catch{}},_=tr(),[y,b]=(0,v.useState)(!1),x=ot(),[S,C]=(0,v.useState)(!1),[w,T]=(0,v.useState)(void 0),E=(0,v.useRef)(null);(0,v.useEffect)(()=>{if(!S)return;let e=e=>{E.current!==null&&(E.current.contains(e.target)||C(!1))};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[S]);let D=async t=>{C(!1),T(void 0);try{let{blob:n,filename:r}=await I.exportSession(e,t),i=URL.createObjectURL(n),a=document.createElement(`a`);a.href=i,a.download=r,document.body.appendChild(a),a.click(),a.remove(),window.setTimeout(()=>URL.revokeObjectURL(i),1e3)}catch(e){T(e instanceof M?`${e.code} (${e.status})`:e instanceof Error?e.message:`export_failed`),window.setTimeout(()=>T(void 0),4e3)}};(0,v.useEffect)(()=>(c(e),()=>{l(e)}),[e,c,l]);let O=(0,v.useRef)(null),k=(0,v.useRef)(!0),ee=()=>{let e=O.current;e!==null&&(k.current=e.scrollHeight-e.scrollTop-e.clientHeight<=96)};(0,v.useEffect)(()=>{let e=O.current;e!==null&&k.current&&(e.scrollTop=e.scrollHeight)},[t,r,i]);let te=(0,v.useRef)(0);return(0,v.useEffect)(()=>{let e=t.reduce((e,t)=>t.role===`user`?e+1:e,0);if(e>te.current){let e=O.current;e!==null&&(e.scrollTop=e.scrollHeight),k.current=!0}te.current=e},[t]),(0,v.useEffect)(()=>{if(u===void 0||t.length<=u)return;let n=O.current;if(n===null)return;let r=n.querySelector(`[data-message-index="${u}"]`);r!==null&&(r.scrollIntoView({block:`center`,behavior:`smooth`}),k.current=!1,d(e))},[u,t.length,e,d]),(0,R.jsxs)(Gk.Provider,{value:{viewType:m,setViewType:g},children:[(0,R.jsxs)(`div`,{className:`flex flex-1 flex-col overflow-hidden`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-1 border-b border-neutral-800 bg-neutral-900/30 px-3 py-1`,children:[(0,R.jsx)(`div`,{className:`flex items-center gap-1`,children:_!==void 0&&(0,R.jsx)(zk,{sessionId:e,projectId:_.id})}),(0,R.jsxs)(`div`,{className:`flex items-center gap-1`,children:[!x&&(0,R.jsxs)(`div`,{ref:E,className:`relative`,children:[(0,R.jsxs)(`button`,{onClick:()=>C(e=>!e),"aria-haspopup":`menu`,"aria-expanded":S,className:`flex items-center gap-1 rounded px-1.5 py-0.5 text-[10px] uppercase tracking-wider text-neutral-400 hover:bg-neutral-800 hover:text-neutral-200`,title:`Export this conversation`,children:[(0,R.jsx)(be,{size:11}),`Export`]}),S&&(0,R.jsxs)(`div`,{role:`menu`,className:`absolute right-0 top-full z-30 mt-1 min-w-[12rem] rounded-md border border-neutral-700 bg-neutral-900 py-1 shadow-xl`,children:[(0,R.jsxs)(`button`,{role:`menuitem`,onClick:()=>void D(`markdown`),className:`block w-full px-3 py-1.5 text-left text-xs text-neutral-200 hover:bg-neutral-800`,children:[`Markdown `,(0,R.jsx)(`span`,{className:`text-neutral-500`,children:`(.md)`})]}),(0,R.jsxs)(`button`,{role:`menuitem`,onClick:()=>void D(`jsonl`),className:`block w-full px-3 py-1.5 text-left text-xs text-neutral-200 hover:bg-neutral-800`,children:[`Raw JSONL `,(0,R.jsx)(`span`,{className:`text-neutral-500`,children:`(.jsonl)`})]})]})]}),w!==void 0&&(0,R.jsxs)(`span`,{className:`text-[10px] text-amber-400 light:text-amber-700`,role:`status`,children:[`Export failed: `,w]}),(0,R.jsxs)(`button`,{onClick:()=>b(!0),className:`flex items-center gap-1 rounded px-1.5 py-0.5 text-[10px] uppercase tracking-wider text-neutral-400 hover:bg-neutral-800 hover:text-neutral-200`,title:`Open session tree (navigate / fork from any prior point)`,children:[(0,R.jsx)(Oe,{size:11}),`Tree`]})]})]}),o!==void 0&&(0,R.jsx)(`div`,{className:`border-b border-amber-700/40 bg-amber-900/20 px-6 py-2 text-xs text-amber-200 light:border-amber-300 light:bg-amber-50 light:text-amber-800`,children:o}),(0,R.jsxs)(`div`,{ref:O,onScroll:ee,className:`flex-1 overflow-y-auto px-6 py-4`,children:[t.length===0&&r.length===0&&!i&&(0,R.jsx)(`p`,{className:`mt-12 text-center text-sm text-neutral-500`,children:`No messages yet. Send a prompt to get started.`}),(0,R.jsxs)(`div`,{className:`chat-message-list mx-auto max-w-3xl space-y-4`,children:[(()=>{let e=new Map,r=new Set;for(let n of t)n.role===`toolResult`&&typeof n.toolCallId==`string`&&e.set(n.toolCallId,n);for(let e of t)if(!(e.role!==`assistant`||!Array.isArray(e.content)))for(let t of e.content)t.type===`toolCall`&&typeof t.id==`string`&&r.add(t.id);let i=new Map;for(let e of n){let t=i.get(e.insertBeforeIndex)??[];t.push(e),i.set(e.insertBeforeIndex,t)}let a=t=>t.archivedMessages.map((t,n)=>(0,R.jsx)(eA,{message:t,toolResultsById:e},n)),o=[],s=e=>{let t=i.get(e);if(t!==void 0)for(let e of t)o.push((0,R.jsx)(YS,{event:e,renderArchived:()=>a(e)},`compaction-${e.id}`))},c=n.length>0?n[n.length-1]:void 0,l=c?.insertBeforeIndex??0;return t.forEach((t,n)=>{s(n),!(t.role===`toolResult`&&typeof t.toolCallId==`string`&&r.has(t.toolCallId))&&t.role!==`compactionSummary`&&(c!==void 0&&n>=1&&n<l||o.push((0,R.jsx)(`div`,{"data-message-index":n,children:(0,R.jsx)(eA,{message:t,toolResultsById:e})},n)))}),s(t.length),o})(),r.length>0&&(0,R.jsxs)(`div`,{className:`message-bubble rounded-lg border border-neutral-800 bg-neutral-900 px-4 py-3`,children:[(0,R.jsx)(`div`,{className:`mb-1 text-[10px] uppercase tracking-wider text-neutral-500`,children:`assistant (streaming)`}),(0,R.jsxs)(`div`,{className:`text-neutral-100`,children:[(0,R.jsx)(JS,{text:r}),(0,R.jsx)(`span`,{className:`ml-1 inline-block h-3 w-1.5 animate-pulse bg-neutral-300 align-text-bottom`})]})]}),i&&r.length===0&&(0,R.jsx)(Xk,{tool:a}),s!==void 0&&(0,R.jsx)(Yk,{queued:s}),p.map(e=>(0,R.jsx)(Vk,{run:e},e.runId))]})]})]}),y&&_!==void 0&&(0,R.jsx)(mk,{sessionId:e,projectId:_.id,onClose:()=>b(!1)})]})}function Yk({queued:e}){let t=[];for(let n of e.steering)t.push({kind:`steer`,text:n});for(let n of e.followUp)t.push({kind:`followUp`,text:n});return t.length===0?null:(0,R.jsxs)(`div`,{className:`rounded-md border border-neutral-800 bg-neutral-900/40 px-3 py-2`,children:[(0,R.jsxs)(`div`,{className:`mb-1 text-[10px] uppercase tracking-wider text-neutral-500`,children:[`queued (`,t.length,`)`]}),(0,R.jsx)(`ul`,{className:`space-y-1`,children:t.map(e=>(0,R.jsxs)(`li`,{className:`flex items-baseline gap-2 text-xs text-neutral-300`,children:[(0,R.jsx)(`span`,{className:e.kind===`steer`?`shrink-0 rounded bg-amber-900/30 px-1.5 py-0.5 text-[9px] uppercase tracking-wider text-amber-300 light:bg-amber-100 light:text-amber-800`:`shrink-0 rounded bg-neutral-800 px-1.5 py-0.5 text-[9px] uppercase tracking-wider text-neutral-400`,title:e.kind===`steer`?`Delivered at the agent's next decision point (often mid-tool)`:`Delivered after the agent goes fully idle`,children:e.kind===`steer`?`steer`:`follow-up`}),(0,R.jsx)(`span`,{className:`truncate`,children:e.text})]},`${e.kind}:${e.text}`))})]})}function Xk({tool:e}){return e===void 0?(0,R.jsxs)(`div`,{className:`flex items-center gap-2 text-xs italic text-neutral-500`,"aria-live":`polite`,"aria-label":`Agent is thinking`,children:[(0,R.jsx)(`span`,{children:`Thinking`}),(0,R.jsxs)(`span`,{className:`pi-thinking-dots`,"aria-hidden":`true`,children:[(0,R.jsx)(`span`,{children:`.`}),(0,R.jsx)(`span`,{children:`.`}),(0,R.jsx)(`span`,{children:`.`})]})]}):(0,R.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-neutral-400`,children:[(0,R.jsx)(`span`,{className:`inline-block h-1.5 w-1.5 animate-pulse rounded-full bg-neutral-400`}),(0,R.jsx)(`span`,{className:`text-neutral-500`,children:`running`}),(0,R.jsx)(`code`,{className:`rounded bg-neutral-800 px-1.5 py-0.5 font-mono text-[11px] text-neutral-200`,children:e.name}),e.summary!==void 0&&(0,R.jsx)(`code`,{className:`truncate rounded bg-neutral-900 px-1.5 py-0.5 font-mono text-[11px] text-neutral-300`,title:e.summary,children:e.summary})]})}function Zk({diff:e,filename:t,adds:n,dels:r}){let{viewType:i,setViewType:a}=(0,v.useContext)(Gk);return(0,R.jsxs)(`details`,{className:`group rounded border border-neutral-800 bg-neutral-950 text-xs`,children:[(0,R.jsxs)(`summary`,{className:`flex cursor-pointer items-center justify-between gap-2 px-3 py-2 text-neutral-300`,children:[(0,R.jsxs)(`span`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,R.jsxs)(`span`,{className:`text-neutral-500`,children:[`edit`,t===void 0?``:` `]}),t!==void 0&&(0,R.jsx)(`span`,{className:`truncate font-mono`,children:t}),(0,R.jsxs)(`span`,{className:`ml-2 text-emerald-400 light:text-emerald-700`,children:[`+`,n]}),(0,R.jsxs)(`span`,{className:`ml-1 text-red-400 light:text-red-700`,children:[`−`,r]})]}),(0,R.jsx)(`button`,{onClick:e=>{e.preventDefault(),e.stopPropagation(),a(i===`split`?`unified`:`split`)},className:`rounded p-0.5 text-neutral-500 hover:bg-neutral-800 hover:text-neutral-200`,title:i===`split`?`Switch chat diffs to unified view`:`Switch chat diffs to side-by-side view`,children:i===`split`?(0,R.jsx)(Ge,{size:11}):(0,R.jsx)(ve,{size:11})})]}),(0,R.jsx)(nk,{diff:e,viewType:i})]})}function Qk(e){let t=[],n=e.replace(/\n?(`{3,})(\w*)\s+file:\s+([^\n]+)\n([\s\S]*?)\n\1\n?/g,(e,n,r,i,a)=>(t.push({kind:`inline`,path:i.trim(),lang:r,content:a}),``)),r=/(^|\s)@(?:"([^"\n]+)"|([^\s]+?))(?=[?,;:!)\]]?(?:\s|$))/g,i;for(;(i=r.exec(n))!==null;){let e=(i[2]??i[3]??``).trim();e.length!==0&&(t.some(t=>t.kind===`inline`&&t.path===e)||t.push({kind:`defer`,path:e}))}return n=n.replace(/\n{3,}/g,`
337
+
338
+ `).trim(),{stripped:n,refs:t}}function $k({ref:e}){let[t,n]=(0,v.useState)(!1),r=e.kind===`inline`;return(0,R.jsxs)(`div`,{className:`overflow-hidden rounded border bg-neutral-900 ${r?`border-neutral-700`:`border-emerald-700/60 bg-emerald-900/15`}`,children:[(0,R.jsxs)(`button`,{type:`button`,onClick:()=>r&&n(e=>!e),disabled:!r,className:`flex min-h-11 w-full items-center gap-1.5 px-2 py-1 text-left text-[11px] md:min-h-0 ${r?`text-neutral-200 hover:bg-neutral-800`:`cursor-default text-emerald-200 light:text-emerald-800`}`,title:r?`${e.path} — click to ${t?`collapse`:`expand`}`:`${e.path} — model will load this on demand using its read tool (file is larger than the inline threshold)`,children:[r?t?(0,R.jsx)(de,{size:12}):(0,R.jsx)(pe,{size:12}):(0,R.jsx)(ce,{size:12,className:`text-emerald-300/80 light:text-emerald-700`}),(0,R.jsx)(Se,{size:12,className:r?`text-neutral-400`:`text-emerald-300/80`}),(0,R.jsx)(`span`,{className:`font-mono`,children:e.path}),r&&(0,R.jsx)(`span`,{className:`text-[10px] text-neutral-500`,children:e.content.length<1024?`${e.content.length} B`:`${(e.content.length/1024).toFixed(1)} KB`}),!r&&(0,R.jsx)(`span`,{className:`text-[10px] text-emerald-300/70 light:text-emerald-700/80`,children:`on demand`})]}),r&&t&&(0,R.jsx)(`pre`,{className:`max-h-72 overflow-auto border-t border-neutral-800 bg-neutral-950 px-3 py-2 font-mono text-[11px] leading-relaxed text-neutral-300`,children:e.content})]})}function eA({message:e,toolResultsById:t}){let[n,r]=(0,v.useState)(!1);if(e.role===`user`){let{stripped:t,refs:i}=Qk(gA(e)),a=Array.isArray(e.content)?e.content:[],o=[],s=[];for(let e=0;e<a.length;e++){let t=a[e];if(t.type===`image`){let n=typeof t.data==`string`?t.data:``,r=typeof t.mimeType==`string`?t.mimeType:`image/png`,i=t.__blobUrl===!0?n:`data:${r};base64,${n}`;n.length>0&&o.push({src:i,key:`img-${e}`})}else if(t.type===`file`){let n={name:typeof t.filename==`string`?t.filename:`attachment`,key:`file-${e}`};typeof t.size==`number`&&(n.size=t.size),s.push(n)}}return(0,R.jsxs)(`div`,{className:`message-bubble group rounded-lg bg-neutral-800 px-4 py-3`,"data-message-role":`user`,children:[(0,R.jsxs)(`div`,{className:`mb-1 flex items-center justify-between`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(`span`,{className:`text-[10px] uppercase tracking-wider text-neutral-400`,children:`you`}),(0,R.jsx)(hA,{ts:e.timestamp})]}),t.length>0&&(0,R.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,R.jsx)(uA,{getText:()=>t,title:`Copy message text`}),(0,R.jsx)(fA,{showRaw:n,onToggle:r})]})]}),t.length>0&&(0,R.jsx)(`div`,{className:`text-neutral-100`,children:n?(0,R.jsx)(pA,{text:t}):(0,R.jsx)(JS,{text:t,chatStyleBreaks:!0})}),i.length>0&&(0,R.jsx)(`div`,{className:`mt-2 flex flex-col gap-1`,children:i.map((e,t)=>(0,R.jsx)($k,{ref:e},`fileref-${t}-${e.path}`))}),o.length>0&&(0,R.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:o.map(e=>(0,R.jsx)(`img`,{src:e.src,alt:``,className:`max-h-48 max-w-full rounded border border-neutral-700`},e.key))}),s.length>0&&(0,R.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:s.map(e=>(0,R.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded border border-neutral-700 bg-neutral-900 px-2 py-1 text-[11px] text-neutral-300`,title:e.name,children:[(0,R.jsx)(`span`,{className:`font-mono`,children:e.name}),e.size!==void 0&&(0,R.jsx)(`span`,{className:`text-[10px] text-neutral-500`,children:e.size<1024?`${e.size} B`:e.size<1024*1024?`${(e.size/1024).toFixed(1)} KB`:`${(e.size/(1024*1024)).toFixed(1)} MB`})]},e.key))})]})}if(e.role===`assistant`){let i=Array.isArray(e.content)?e.content:[],a=i.some(e=>e.type===`text`);return(0,R.jsxs)(`div`,{className:`message-bubble group rounded-lg border border-neutral-800 bg-neutral-900 px-4 py-3`,"data-message-role":`assistant`,children:[(0,R.jsxs)(`div`,{className:`mb-1 flex items-center justify-between`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(`span`,{className:`text-[10px] uppercase tracking-wider text-neutral-500`,children:`assistant`}),(0,R.jsx)(hA,{ts:e.timestamp})]}),a&&(0,R.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,R.jsx)(uA,{getText:()=>dA(i),title:`Copy all text from this assistant message`}),(0,R.jsx)(fA,{showRaw:n,onToggle:r})]})]}),(0,R.jsx)(`div`,{className:`space-y-2 text-sm text-neutral-100`,children:tA(i,t,n)})]})}return e.role===`toolResult`?(0,R.jsx)(aA,{message:e}):e.role===`bashExecution`||e.type===`bashExecution`||e.customType===`bashExecution`?(0,R.jsx)(lA,{message:e}):(0,R.jsxs)(`details`,{className:`rounded-lg border border-neutral-800 bg-neutral-900/40 px-3 py-2 text-xs text-neutral-400`,children:[(0,R.jsxs)(`summary`,{className:`cursor-pointer`,children:[`unknown message (`,String(e.role??e.type??`?`),`)`]}),(0,R.jsx)(`pre`,{className:`mt-2 overflow-auto whitespace-pre-wrap text-[10px] text-neutral-500`,children:JSON.stringify(e,null,2)})]})}function tA(e,t,n){let r=[],i=0;for(;i<e.length;){let a=e[i];if(a.type===`toolCall`&&a.name===`todo`){let n=i,a=[];for(;i<e.length;){let n=e[i];if(n?.type!==`toolCall`||n.name!==`todo`)break;let r=typeof n.id==`string`?n.id:void 0,o=r===void 0?void 0:t?.get(r);a.push({block:n,result:o}),i+=1}if(a.length===1){let e=a[0];r.push((0,R.jsx)(iA,{block:e.block,result:e.result},n))}else r.push((0,R.jsx)(nA,{entries:a},`todo-batch-${n}`));continue}let o={block:a,showRaw:n};t!==void 0&&(o.toolResultsById=t),r.push((0,R.jsx)(rA,{...o},i)),i+=1}return r}function nA({entries:e}){let t=[...e].reverse().find(e=>e.result!==void 0)?.result?.details??void 0,n=Array.isArray(t?.tasks)?t.tasks.length:0,r=e.filter(e=>e.result===void 0).length,i=e.some(e=>e.result?.isError===!0),a=e.map(e=>(Array.isArray(e.result?.content)?e.result.content:[]).find(e=>{let t=e;return t.type===`text`&&typeof t.text==`string`})?.text??`(no output)`);return(0,R.jsxs)(`details`,{className:`group rounded border border-neutral-800 bg-neutral-950 text-xs`,children:[(0,R.jsxs)(`summary`,{className:`flex cursor-pointer items-center justify-between gap-2 px-3 py-2 text-neutral-300`,children:[(0,R.jsxs)(`span`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,R.jsx)(`span`,{className:`text-neutral-500`,children:`→`}),(0,R.jsx)(`span`,{className:`font-mono`,children:`todo`}),(0,R.jsxs)(`span`,{className:`text-neutral-500`,children:[`×`,e.length,` `,e.length===1?`call`:`calls`]}),(0,R.jsx)(`span`,{className:`ml-2 truncate text-neutral-400`,children:n===0?`no tasks`:`${n} ${n===1?`task`:`tasks`} after batch`})]}),(0,R.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[r>0&&(0,R.jsxs)(`span`,{className:`rounded bg-neutral-800 px-1.5 py-0.5 text-[10px] uppercase tracking-wider text-neutral-400`,children:[r,` running…`]}),i&&(0,R.jsx)(`span`,{className:`rounded bg-red-900/30 px-1.5 py-0.5 text-[10px] uppercase tracking-wider text-red-300 light:bg-red-100 light:text-red-800`,children:`error`})]})]}),(0,R.jsx)(`div`,{className:`space-y-1 border-t border-neutral-800/60 px-3 py-2 font-mono text-[11px] text-neutral-400`,children:a.map((e,t)=>(0,R.jsxs)(`div`,{className:`flex items-baseline gap-2`,children:[(0,R.jsxs)(`span`,{className:`shrink-0 text-neutral-600`,children:[`#`,t+1]}),(0,R.jsx)(`span`,{className:`whitespace-pre-wrap break-words text-neutral-300`,children:e})]},t))})]})}function rA({block:e,toolResultsById:t,showRaw:n=!1}){let r=e.type;if(r===`text`&&typeof e.text==`string`)return n?(0,R.jsx)(pA,{text:e.text}):(0,R.jsx)(JS,{text:e.text});if(r===`thinking`&&typeof e.thinking==`string`)return(0,R.jsxs)(`details`,{className:`rounded border border-neutral-800 px-2 py-1 text-xs text-neutral-400`,children:[(0,R.jsx)(`summary`,{className:`cursor-pointer`,children:`Thinking…`}),(0,R.jsx)(`pre`,{className:`mt-1 whitespace-pre-wrap break-words font-sans text-[12px]`,children:e.thinking})]});if(r===`toolCall`){let n=typeof e.id==`string`?e.id:void 0;return(0,R.jsx)(iA,{block:e,result:n===void 0?void 0:t?.get(n)})}return(0,R.jsxs)(`details`,{className:`text-xs text-neutral-500`,children:[(0,R.jsxs)(`summary`,{className:`cursor-pointer`,children:[`block (`,String(r??`?`),`)`]}),(0,R.jsx)(`pre`,{className:`mt-1 overflow-auto whitespace-pre-wrap text-[10px]`,children:JSON.stringify(e,null,2)})]})}function iA({block:e,result:t}){let n=String(e.name??`tool`),r=e.input??e.arguments??{},i=typeof r==`string`?r:JSON.stringify(r,null,2),a=t?.isError===!0,o=Array.isArray(t?.content)?t?.content:[],s=mA(r)?r:void 0,c=n===`bash`&&typeof s?.command==`string`?s.command:(n===`read`||n===`write`||n===`edit`)&&typeof s?.path==`string`?s.path:void 0,l=o.filter(e=>{let t=e;return t.type===`text`&&typeof t.text==`string`}).map(e=>e.text).join(`
339
+ `),u=n===`edit`&&t!==void 0?(()=>{let e=t.details?.diff;return typeof e==`string`?e:l})():void 0,d=n===`edit`&&t!==void 0?_A(t):void 0,f=u===void 0?void 0:vA(u);return n===`subagent`?(0,R.jsx)(oA,{argsText:i,input:s,result:t,isError:a,outputText:l}):(0,R.jsxs)(`div`,{className:`rounded border ${t===void 0?`border-neutral-700`:a?`border-red-700/50`:`border-neutral-800`} bg-neutral-950 text-xs`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-2 text-neutral-300`,children:[(0,R.jsxs)(`div`,{className:`min-w-0 flex-1 truncate`,children:[(0,R.jsx)(`span`,{className:`text-neutral-500`,children:`→ `}),(0,R.jsx)(`span`,{className:`font-mono`,children:n}),c!==void 0&&(0,R.jsx)(`span`,{className:`ml-2 truncate font-mono text-neutral-400`,title:c,children:c})]}),(0,R.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[t===void 0&&(0,R.jsx)(`span`,{className:`rounded bg-neutral-800 px-1.5 py-0.5 text-[10px] uppercase tracking-wider text-neutral-400`,children:`running…`}),a&&(0,R.jsx)(`span`,{className:`rounded bg-red-900/30 px-1.5 py-0.5 text-[10px] uppercase tracking-wider text-red-300 light:bg-red-100 light:text-red-800`,children:`error`})]})]}),i.length>0&&(0,R.jsxs)(`details`,{className:`border-t border-neutral-800/60`,children:[(0,R.jsx)(`summary`,{className:`cursor-pointer px-3 py-1.5 text-[11px] text-neutral-500 hover:text-neutral-300`,children:`Input`}),(0,R.jsx)(`pre`,{className:`overflow-auto px-3 pb-2 font-mono text-[11px] text-neutral-400`,children:i})]}),t!==void 0&&(0,R.jsxs)(`details`,{className:`border-t border-neutral-800/60`,children:[(0,R.jsxs)(`summary`,{className:`cursor-pointer px-3 py-1.5 text-[11px] text-neutral-500 hover:text-neutral-300`,children:[`Output`,f!==void 0&&(0,R.jsxs)(`span`,{className:`ml-2 font-mono text-[10px]`,children:[(0,R.jsxs)(`span`,{className:`text-emerald-400 light:text-emerald-700`,children:[`+`,f.adds]}),` `,(0,R.jsxs)(`span`,{className:`text-red-400 light:text-red-700`,children:[`-`,f.dels]})]}),d!==void 0&&(0,R.jsx)(`span`,{className:`ml-2 font-mono text-[10px] text-neutral-500`,children:d})]}),u!==void 0&&f!==void 0?(0,R.jsx)(`div`,{className:`px-3 pb-2`,children:(0,R.jsx)(Zk,{diff:u,filename:d,adds:f.adds,dels:f.dels})}):(0,R.jsx)(`pre`,{className:`max-h-96 overflow-auto px-3 pb-2 font-mono text-[11px] text-neutral-300`,children:l.length>0?l:`(empty)`})]})]})}function aA({message:e}){let t=String(e.toolName??`tool`),n=e.isError===!0,r=(Array.isArray(e.content)?e.content:[]).filter(e=>{let t=e;return t.type===`text`&&typeof t.text==`string`}).map(e=>e.text).join(`
340
+ `);if(t===`edit`){let t=e.details,n=typeof t?.diff==`string`?t.diff:r,i=_A(e),{adds:a,dels:o}=vA(n);return(0,R.jsx)(Zk,{diff:n,filename:i,adds:a,dels:o})}if(t===`read`){let t=_A(e);return(0,R.jsxs)(`details`,{className:`rounded border border-neutral-800 bg-neutral-950 text-xs`,children:[(0,R.jsxs)(`summary`,{className:`cursor-pointer px-3 py-2 text-neutral-300`,children:[(0,R.jsxs)(`span`,{className:`text-neutral-500`,children:[`read`,t===void 0?``:` `]}),t!==void 0&&(0,R.jsx)(`span`,{className:`font-mono`,children:t})]}),(0,R.jsx)(`pre`,{className:`overflow-auto px-3 pb-2 font-mono text-[11px] text-neutral-400`,children:r})]})}if(t===`bash`){let t=yA(e);return(0,R.jsxs)(`div`,{className:`rounded border ${n?`border-red-700/40`:`border-neutral-800`} bg-neutral-950 text-xs`,children:[(0,R.jsxs)(`div`,{className:`px-3 py-2 text-neutral-400`,children:[(0,R.jsxs)(`span`,{className:`text-neutral-500`,children:[`bash`,t===void 0?` output`:` → `]}),t!==void 0&&(0,R.jsx)(`span`,{className:`font-mono`,children:t})]}),(0,R.jsx)(`pre`,{className:`max-h-64 overflow-auto px-3 pb-2 font-mono text-[11px] text-neutral-300`,children:r})]})}if(t===`write`){let t=_A(e);return(0,R.jsxs)(`details`,{className:`rounded border border-neutral-800 bg-neutral-950 text-xs`,children:[(0,R.jsxs)(`summary`,{className:`cursor-pointer px-3 py-2 text-neutral-300`,children:[(0,R.jsxs)(`span`,{className:`text-neutral-500`,children:[`write`,t===void 0?``:` `]}),t!==void 0&&(0,R.jsx)(`span`,{className:`font-mono`,children:t}),(0,R.jsxs)(`span`,{className:`ml-2 text-neutral-500`,children:[`(`,r.split(`
341
+ `).length,` lines)`]})]}),(0,R.jsx)(`pre`,{className:`overflow-auto px-3 pb-2 font-mono text-[11px] text-neutral-400`,children:r})]})}return t===`subagent`?(0,R.jsx)(sA,{message:e,argsText:``,outputText:r,isError:n}):(0,R.jsxs)(`details`,{className:`rounded border ${n?`border-red-700/40 light:border-red-300`:`border-neutral-800`} bg-neutral-950 text-xs`,children:[(0,R.jsxs)(`summary`,{className:`cursor-pointer px-3 py-2 text-neutral-300`,children:[(0,R.jsx)(`span`,{className:`text-neutral-500`,children:t}),n&&(0,R.jsx)(`span`,{className:`ml-2 text-red-400 light:text-red-700`,children:`error`})]}),(0,R.jsx)(`pre`,{className:`overflow-auto px-3 pb-2 font-mono text-[11px] text-neutral-400`,children:r})]})}function oA({argsText:e,input:t,result:n,isError:r,outputText:i}){if(n!==void 0)return(0,R.jsx)(sA,{message:n,argsText:e,outputText:i,isError:r});let a;if(t!==void 0){let e=typeof t.agent==`string`?t.agent:void 0,n=typeof t.task==`string`?t.task:void 0,r=typeof t.action==`string`?t.action:void 0,i=Array.isArray(t.tasks)?t.tasks.length:void 0,o=Array.isArray(t.chain)?t.chain.length:void 0;r===void 0?i===void 0?o===void 0?e!==void 0&&n!==void 0?a=`${e} — ${n}`:e!==void 0&&(a=e):a=`${o}-step chain`:a=`${i} parallel task${i===1?``:`s`}`:a=`action: ${r}`}return(0,R.jsx)(`div`,{className:`overflow-hidden rounded border border-l-2 border-sky-700/50 border-l-sky-400 bg-sky-950/15 text-xs light:border-sky-300 light:border-l-sky-600 light:bg-sky-50`,children:(0,R.jsx)(`div`,{className:`flex items-center justify-between gap-2 px-2.5 py-1.5`,children:(0,R.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,R.jsx)(nt,{size:11,className:`shrink-0 text-sky-300 light:text-sky-700`}),(0,R.jsx)(`span`,{className:`truncate font-medium text-sky-100 light:text-sky-900`,children:`Sub-agent running…`}),a!==void 0&&(0,R.jsx)(`span`,{className:`ml-1 truncate font-mono text-[11px] text-sky-200/70 light:text-sky-800/80`,title:a,children:a})]})})})}function sA({message:e,argsText:t,outputText:n,isError:r}){let i=L(e=>e.setActiveSession),a=er(e=>e.setActive),o=L(e=>e.byProject),s=(0,v.useMemo)(()=>{let e=new Map;for(let t of Object.values(o))for(let n of t)typeof n.path==`string`&&n.path.length>0&&e.set(n.path,{sessionId:n.sessionId,projectId:n.projectId});return e},[o]),c=e=>{if(e===void 0){console.warn(`[subagent] Open clicked but result has no sessionFile`);return}let t=s.get(e);if(console.info(`[subagent] Open clicked`,{sessionFile:e,match:t}),t===void 0){console.warn(`[subagent] Open: sessionFile not found in any project's session list`,e);return}a(t.projectId),i(t.sessionId)},l=Wk(e.details),u=l.mode===`management`,d=l.results.length,f=d===1?`Sub-agent: ${l.results[0].agent}`:d>1?`${d} sub-agents (${l.mode})`:u?`Sub-agent management`:`Sub-agent`;return(0,R.jsxs)(`div`,{className:`overflow-hidden rounded border border-l-2 ${r?`border-red-700/50 border-l-red-400 bg-red-950/15 light:border-red-300 light:border-l-red-600 light:bg-red-50`:`border-sky-700/50 border-l-sky-400 bg-sky-950/15 light:border-sky-300 light:border-l-sky-600 light:bg-sky-50`} text-xs`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-2.5 py-1.5`,children:[(0,R.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,R.jsx)(nt,{size:11,className:`shrink-0 text-sky-300 light:text-sky-700`}),(0,R.jsx)(`span`,{className:`truncate font-medium text-sky-100 light:text-sky-900`,children:f}),l.context!==void 0&&(0,R.jsx)(`span`,{className:`shrink-0 rounded bg-sky-900/40 px-1 py-0.5 text-[9px] font-medium uppercase tracking-wider text-sky-200 light:bg-sky-100 light:text-sky-800`,title:l.context===`fork`?`Forked from parent context`:`Fresh context`,children:l.context}),r&&(0,R.jsx)(`span`,{className:`shrink-0 rounded bg-red-900/40 px-1 py-0.5 text-[9px] font-medium uppercase tracking-wider text-red-200 light:bg-red-100 light:text-red-800`,children:`error`})]}),l.results.length===1&&l.results[0].sessionFile!==void 0&&(0,R.jsxs)(`button`,{onClick:()=>c(l.results[0].sessionFile),className:`inline-flex min-h-11 shrink-0 items-center gap-1 rounded border border-sky-700/60 px-2 py-1 text-[12px] font-medium text-sky-200 hover:border-sky-500 hover:bg-sky-900/30 hover:text-sky-100 light:border-sky-400 light:text-sky-800 light:hover:border-sky-600 light:hover:bg-sky-100 light:hover:text-sky-900 md:min-h-0 md:px-1.5 md:py-0.5 md:text-[10px]`,title:`Open sub-agent session — ${l.results[0].sessionFile}`,children:[(0,R.jsx)(xe,{size:12}),`Open`]})]}),d>1&&(0,R.jsx)(`div`,{className:`space-y-1.5 border-t border-sky-900/30 px-2.5 py-2`,children:l.results.map((e,t)=>(0,R.jsx)(cA,{result:e,onOpenFile:c},e.sessionFile??`${t}-${e.agent}`))}),t.length>0&&(0,R.jsxs)(`details`,{className:`border-t border-sky-900/30`,children:[(0,R.jsx)(`summary`,{className:`cursor-pointer px-2.5 py-1 text-[11px] text-neutral-500 hover:text-neutral-300`,children:`Input`}),(0,R.jsx)(`pre`,{className:`overflow-auto px-2.5 pb-2 font-mono text-[11px] text-neutral-400`,children:t})]}),n.length>0&&(0,R.jsxs)(`details`,{open:r,className:`border-t border-sky-900/30`,children:[(0,R.jsx)(`summary`,{className:`cursor-pointer px-2.5 py-1 text-[11px] text-neutral-500 hover:text-neutral-300`,children:`Output`}),(0,R.jsx)(`pre`,{className:`overflow-auto px-2.5 pb-2 font-mono text-[11px] text-neutral-300 whitespace-pre-wrap`,children:n})]})]})}function cA({result:e,onOpenFile:t}){let n=e.exitCode!==0;return(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-2 rounded border ${n?`border-red-700/40 light:border-red-300`:`border-sky-900/40 light:border-sky-300`} bg-neutral-950/60 px-2 py-1.5`,children:[(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,R.jsxs)(`div`,{className:`flex items-baseline gap-2`,children:[(0,R.jsx)(`span`,{className:`font-mono text-[11px] font-medium text-sky-200 light:text-sky-800`,children:e.agent}),n&&(0,R.jsxs)(`span`,{className:`text-[10px] font-medium text-red-400 light:text-red-700`,children:[`exit `,e.exitCode]})]}),e.task.length>0&&(0,R.jsx)(`div`,{className:`mt-0.5 truncate text-[11px] text-neutral-400`,title:e.task,children:e.task})]}),e.sessionFile!==void 0&&(0,R.jsxs)(`button`,{onClick:()=>t(e.sessionFile),className:`inline-flex shrink-0 items-center gap-1 rounded border border-sky-700/60 px-1.5 py-0.5 text-[10px] font-medium text-sky-200 hover:border-sky-500 hover:bg-sky-900/30 hover:text-sky-100 light:border-sky-400 light:text-sky-800 light:hover:border-sky-600 light:hover:bg-sky-100 light:hover:text-sky-900`,title:e.sessionFile,children:[(0,R.jsx)(xe,{size:10}),`Open`]})]})}function lA({message:e}){let t=String(e.command??``),n=String(e.output??``),r=typeof e.exitCode==`number`?e.exitCode:void 0,i=e.truncated===!0,a=e.cancelled===!0,o=e.excludeFromContext===!0;return(0,R.jsxs)(`div`,{className:`rounded border border-neutral-800 bg-neutral-950 text-xs`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-3 py-2 text-neutral-400`,children:[(0,R.jsxs)(`div`,{className:`min-w-0 flex-1 truncate`,children:[(0,R.jsx)(`span`,{className:`text-neutral-500`,children:`$ `}),(0,R.jsx)(`span`,{className:`font-mono text-neutral-200`,children:t})]}),(0,R.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[o&&(0,R.jsx)(`span`,{className:`rounded bg-neutral-800 px-1.5 py-0.5 text-[10px] uppercase tracking-wider text-neutral-400`,title:`!! prefix — kept out of LLM context on the next turn`,children:`local-only`}),a&&(0,R.jsx)(`span`,{className:`rounded bg-amber-900/40 px-1.5 py-0.5 text-[10px] uppercase tracking-wider text-amber-300 light:bg-amber-100 light:text-amber-800`,children:`timed out`}),i&&!a&&(0,R.jsx)(`span`,{className:`rounded bg-amber-900/40 px-1.5 py-0.5 text-[10px] uppercase tracking-wider text-amber-300 light:bg-amber-100 light:text-amber-800`,children:`truncated`}),r!==void 0&&(0,R.jsxs)(`span`,{className:`rounded px-1.5 py-0.5 text-[10px] font-mono ${r===0?`bg-emerald-900/30 text-emerald-300 light:bg-emerald-100 light:text-emerald-800`:`bg-red-900/30 text-red-300 light:bg-red-100 light:text-red-800`}`,title:r===0?`exit 0`:`exit ${String(r)}`,children:[`exit `,r]})]})]}),n.length>0&&(0,R.jsx)(`pre`,{className:`max-h-64 overflow-auto px-3 pb-2 font-mono text-[11px] text-neutral-300`,children:n})]})}function uA({getText:e,title:t}){let[n,r]=(0,v.useState)(!1),i=()=>{let t=e();if(t.length===0)return;let n=navigator.clipboard?.writeText?.bind(navigator.clipboard);n===void 0?a(t):n(t).then(()=>{r(!0),window.setTimeout(()=>r(!1),1200)}).catch(()=>a(t))},a=e=>{try{let t=document.createElement(`textarea`);t.value=e,t.style.position=`fixed`,t.style.opacity=`0`,document.body.appendChild(t),t.select(),document.execCommand(`copy`),document.body.removeChild(t),r(!0),window.setTimeout(()=>r(!1),1200)}catch{}};return(0,R.jsx)(`button`,{type:`button`,onClick:i,className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 py-0.5 text-neutral-500 hover:bg-neutral-700/40 hover:text-neutral-300 md:min-h-0 md:min-w-0`,title:t,"aria-label":t,children:n?(0,R.jsx)(ue,{size:14}):(0,R.jsx)(ye,{size:14})})}function dA(e){let t=[];for(let n of e)n.type===`text`&&typeof n.text==`string`&&t.push(n.text);return t.join(`
342
+
343
+ `)}function fA({showRaw:e,onToggle:t}){return(0,R.jsx)(`button`,{type:`button`,onClick:()=>t(!e),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 py-0.5 text-[10px] uppercase tracking-wider text-neutral-500 hover:bg-neutral-700/40 hover:text-neutral-300 md:min-h-0 md:min-w-0`,title:e?`Show rendered markdown`:`Show raw text`,children:e?`rendered`:`raw`})}function pA({text:e}){return(0,R.jsx)(`pre`,{className:`whitespace-pre-wrap break-words font-sans text-sm text-neutral-100 [overflow-wrap:anywhere]`,children:e})}function mA(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function hA({ts:e}){if(typeof e!=`number`||!Number.isFinite(e)||e<=0)return null;let t=new Date(e),n=t.toLocaleTimeString([],{hour:`numeric`,minute:`2-digit`});return(0,R.jsx)(`span`,{className:`text-[10px] tabular-nums text-neutral-500 opacity-0 transition-opacity duration-150 group-hover:opacity-100`,title:t.toLocaleString([],{dateStyle:`medium`,timeStyle:`medium`}),children:n})}function gA(e){return typeof e.content==`string`?e.content:Array.isArray(e.content)?e.content.filter(e=>{let t=e;return t.type===`text`&&typeof t.text==`string`}).map(e=>e.text).join(`
344
+ `):``}function _A(e){let t=e.details,n=e.input;for(let e of[t,n])if(e!==void 0){if(typeof e.path==`string`)return e.path;if(typeof e.filename==`string`)return e.filename;if(typeof e.file==`string`)return e.file;if(typeof e.file_path==`string`)return e.file_path}}function vA(e){let t=0,n=0;for(let r of e.split(`
345
+ `))r.startsWith(`+++`)||r.startsWith(`---`)||(r.startsWith(`+`)?t+=1:r.startsWith(`-`)&&(n+=1));return{adds:t,dels:n}}function yA(e){let t=e.details,n=e.input;if(typeof t?.command==`string`)return t.command;if(typeof n?.command==`string`)return n.command}var bA=ft((e,t)=>({settingsRequest:void 0,_settingsSeq:0,openSettings:n=>{let r=t()._settingsSeq+1,i={seq:r};n!==void 0&&(i.tab=n),e({_settingsSeq:r,settingsRequest:i})},clearSettingsRequest:()=>{e({settingsRequest:void 0})},chatInsertRequest:void 0,_chatInsertSeq:0,requestChatInsert:n=>{let r=t()._chatInsertSeq+1;e({_chatInsertSeq:r,chatInsertRequest:{text:n,seq:r}})},clearChatInsertRequest:()=>{e({chatInsertRequest:void 0})},promptsRefreshTrigger:0,bumpPromptsRefresh:()=>{e(e=>({promptsRefreshTrigger:e.promptsRefreshTrigger+1}))},todoPanelOpen:(()=>{try{return localStorage.getItem(`pi-forge/todo-panel-open`)===`true`}catch{return!1}})(),setTodoPanelOpen:t=>{try{localStorage.setItem(`pi-forge/todo-panel-open`,t?`true`:`false`)}catch{}e({todoPanelOpen:t})},openProcessesTabSeq:0,openProcessesTab:()=>e(e=>({openProcessesTabSeq:e.openProcessesTabSeq+1}))}));function xA(e){let t=/(?:^|\s)@(?:"([^"\n]+)"|([^\s]+?))(?=[?,;:!)\]]?(?:\s|$))/g,n=[],r;for(;(r=t.exec(e))!==null;){let e=r[1]??r[2];e!==void 0&&n.push(e)}return n}function SA(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function CA(e){let t=SA(e);return RegExp(`(^|\\s)@(?:"${t}"|${t})\\s?`,`g`)}var wA=100,TA=`forge.input.history.v1:`;function EA(e){try{let t=localStorage.getItem(TA+e);if(t===null)return[];let n=JSON.parse(t);return Array.isArray(n)?n.filter(e=>typeof e==`string`).slice(0,wA):[]}catch{return[]}}function DA(e,t){let n=t.trim();if(n.length!==0)try{let t=EA(e);if(t[0]===n)return;let r=[n,...t].slice(0,wA);localStorage.setItem(TA+e,JSON.stringify(r))}catch{}}function OA(e){let t=[],n;for(let r=e.length-1;r>=0;r--){let i=e[r];if(i?.role!==`user`)continue;let a=``;if(typeof i.content==`string`)a=i.content;else if(Array.isArray(i.content)){let e=[];for(let t of i.content){let n=t;n.type===`text`&&typeof n.text==`string`&&e.push(n.text)}a=e.join(`
346
+ `)}a=a.trim(),a.length!==0&&a!==n&&(t.push(a),n=a)}return t}var kA=`pi-forge/model/`;function AA(e){if(e===void 0)return[];let t=[];for(let n of e.providers)for(let e of n.models)e.hasAuth&&t.push({value:`${n.provider}:${e.id}`,provider:n.provider,modelId:e.id,name:e.name,haystack:`${n.provider} ${e.name} ${e.id}`.toLowerCase()});return t}function jA(e,t){if(t.length===0)return 0;let n=t.toLowerCase(),r=n.split(/\s+/).filter(e=>e.length>0),i=0;for(let t of r){let n=e.haystack.indexOf(t);if(n===-1)return;i+=n}return e.modelId.toLowerCase().startsWith(n)&&(i-=50),e.name.toLowerCase().startsWith(n)&&(i-=30),e.provider.toLowerCase()===n&&(i-=20),i}var MA=600;function NA({sessionId:e}){let t=L(t=>t.streamingBySession[e]??!1),n=Zr(e=>e.minimal),r=L(t=>t.bannerBySession[e]),i=r!==void 0&&r.startsWith(`Retrying (`),a=L(e=>e.sendPrompt),o=L(e=>e.sendSteer),s=L(e=>e.reloadMessages),c=L(e=>e.abortSession),l=L(e=>e.error),[u,d]=(0,v.useState)(``),[f,p]=(0,v.useState)(!1),m=vr(gr(t=>_r(t,e))),h=bA(e=>e.todoPanelOpen),g=bA(e=>e.setTodoPanelOpen),_=Er(Cr(t=>wr(t,e))),y=bA(e=>e.openProcessesTab),b=tr(),x=(0,v.useRef)(null),S=ot(),C=`pi-forge:chat-input-height`,w=()=>({min:60,max:Math.floor(window.innerHeight*.6)}),[T,E]=(0,v.useState)(()=>{if(typeof window>`u`)return;let e=window.localStorage.getItem(C);if(e===null)return;let t=Number.parseInt(e,10);if(!Number.isFinite(t))return;let{min:n,max:r}=w();return Math.max(n,Math.min(r,t))}),D=e=>{e.preventDefault();let t=e.currentTarget;t.setPointerCapture(e.pointerId);let n=e.clientY,r=x.current?.getBoundingClientRect().height??60,{min:i,max:a}=w(),o=e=>{let t=n-e.clientY;E(Math.max(i,Math.min(a,r+t)))},s=e=>{t.removeEventListener(`pointermove`,o),t.removeEventListener(`pointerup`,s),t.removeEventListener(`pointercancel`,s);try{t.releasePointerCapture(e.pointerId)}catch{}let n=x.current?.getBoundingClientRect().height;n!==void 0&&Number.isFinite(n)&&window.localStorage.setItem(C,String(Math.round(n)))};t.addEventListener(`pointermove`,o),t.addEventListener(`pointerup`,s),t.addEventListener(`pointercancel`,s)},O=()=>{E(void 0),window.localStorage.removeItem(C)},[k,ee]=(0,v.useState)(void 0),[te,ne]=(0,v.useState)([]),[re,ie]=(0,v.useState)(0),ae=(0,v.useRef)(0),A=bA(e=>e.openSettings),oe=bA(e=>e.chatInsertRequest),j=bA(e=>e.clearChatInsertRequest),le=bA(e=>e.promptsRefreshTrigger),ue=(0,v.useRef)(0),[de,fe]=(0,v.useState)(0),pe=u.startsWith(`/`)&&!u.includes(`
347
+ `),me=pe?u.slice(1).split(/\s/)[0]??``:``,[he,ge]=(0,v.useState)([]);(0,v.useEffect)(()=>{if(b===void 0){ge([]);return}let e=!1;return I.listPrompts(b.id).then(t=>{e||ge(t.prompts.filter(e=>e.effective).map(e=>{let t={name:e.name,description:e.description};return e.argumentHint!==void 0&&(t.argumentHint=e.argumentHint),t}))}).catch(()=>{e||ge([])}),()=>{e=!0}},[b?.id,le]);let _e=Fk(e=>e.pendingInsert),ve=Fk(e=>e.consumePendingInsert);(0,v.useEffect)(()=>{_e!==void 0&&_e.sessionId===e&&(d(e=>e.length===0?_e.text:e+(e.endsWith(`
348
+ `)?``:`
349
+
350
+ `)+_e.text),ve(),setTimeout(()=>{let e=x.current;e!==null&&(e.focus(),e.setSelectionRange(e.value.length,e.value.length))},0))},[_e,e,ve]);let ye=(()=>{if(!t&&!n){if(u.startsWith(`!!`))return`local`;if(u.startsWith(`!`))return`context`}})(),be=(0,v.useMemo)(()=>{let r=[{name:`/compact`,description:`Manually compact the session context`,available:!t,run:async()=>{try{await I.compact(e),s(e)}catch(e){ze(`Compact failed: ${e instanceof M?e.code:e.message}`)}}},{name:`/clear`,description:`Compact context (alias for /compact)`,available:!t,run:async()=>{try{await I.compact(e),s(e)}catch(e){ze(`Clear failed: ${e instanceof M?e.code:e.message}`)}}},{name:`/abort`,description:`Stop the agent (alias for the Abort button)`,available:t,run:()=>c(e)},{name:`/settings`,description:`Open the Settings panel`,available:!0,run:()=>A()},{name:`/skills`,description:`Open Settings → Skills`,available:!0,run:()=>A(`skills`)},{name:`/mcp`,description:`Open Settings → MCP`,available:!0,run:()=>A(`mcp`)},{name:`/providers`,description:`Open Settings → Providers`,available:!0,run:()=>A(`providers`)},{name:`/help`,description:n?"Show what `/` and `@` do in the input":"Show what `/`, `!`, `@` do in the input",available:!0,run:()=>{ze(n?`/<cmd> runs a pi-forge command (compact, abort, settings, …). @<path> references a project file (autocomplete from the popover).`:`/<cmd> runs a pi-forge command (compact, abort, settings, …). !cmd runs bash (output → next LLM context); !!cmd runs bash local-only. @<path> references a project file (autocomplete from the popover).`)}}];for(let e of he){let n=e.argumentHint===void 0?e.description:`${e.description} — args: ${e.argumentHint}`;r.push({name:`/${e.name}`,description:n,available:!t,run:()=>{let t=`/${e.name} `;d(t),requestAnimationFrame(()=>{let e=x.current;e!==null&&(e.focus(),e.setSelectionRange(t.length,t.length))})}})}return r},[t,e,c,s,A,n,he]),xe=(0,v.useMemo)(()=>{let e=me.toLowerCase();return e.length===0?be:be.filter(t=>t.name.slice(1).toLowerCase().startsWith(e))},[be,me]),Se=(0,v.useMemo)(()=>{if(!pe)return!1;let e=u.slice(1).split(/\s/)[0]??``;return e.length===0||!he.some(t=>t.name===e)?!1:u===`/${e}`||u.startsWith(`/${e} `)},[pe,u,he]),Ce=e=>{let t=xe[e??de];t===void 0||!t.available||(d(``),fe(0),t.run())},we=(0,v.useRef)(0),[Te,Ee]=(0,v.useState)([]),De=(0,v.useRef)(new Map),Oe=(0,v.useRef)(null),ke=(0,v.useRef)(null),[je,Ne]=(0,v.useState)(!1),Pe=(0,v.useRef)(null),[Fe,Ie]=(0,v.useState)(void 0),Le=new Set(`doc.xls.ppt.pptx.vsd.vsdx.odt.ods.odp.rtf.zip.tar.gz.bz2.xz.7z.rar.exe.dll.so.dylib.bin.o.a.class.jar.wasm.mp3.mp4.m4a.wav.flac.ogg.avi.mov.wmv.mkv.heic.heif.tiff.tif.bmp.ico.psd.ttf.otf.woff.woff2.eot.sqlite.db.iso.dmg`.split(`.`)),[Re,ze]=(0,v.useState)(void 0),Ve=e=>{ze(void 0);let t=Te,n=[...t],r=t.filter(e=>e.type.startsWith(`image/`)).length;for(let t of e){if(n.length>=8){ze(`Up to 8 attachments per message; "${t.name}" dropped.`);continue}if(t.size>20971520){ze(`"${t.name}" exceeds the 20 MB per-file limit.`);continue}if(t.type.startsWith(`image/`)&&r>=4){ze(`Up to 4 images per message; "${t.name}" dropped.`);continue}let e=t.name.includes(`.`)?t.name.split(`.`).pop()?.toLowerCase():void 0;if(e!==void 0&&Le.has(e)){ze(`"${t.name}" is a binary format that the agent can't read directly. Convert to text/markdown (or to a PNG/JPEG screenshot for diagrams) and try again.`);continue}n.push(t),t.type.startsWith(`image/`)&&(r+=1,De.current.set(t,URL.createObjectURL(t)))}Ee(n)},He=e=>{let t=De.current.get(e);t!==void 0&&(URL.revokeObjectURL(t),De.current.delete(e)),Ee(t=>t.filter(t=>t!==e))},Ue=()=>{for(let e of De.current.values())URL.revokeObjectURL(e);De.current.clear(),Ee([]),ze(void 0)};(0,v.useEffect)(()=>{let e=De.current;return()=>{for(let t of e.values())URL.revokeObjectURL(t);e.clear()}},[]);let Ge=L(t=>t.messagesBySession[e]??kr),[Ke,qe]=(0,v.useState)(0),Je=(0,v.useMemo)(()=>{let t=EA(e),n=OA(Ge),r=new Set,i=[];for(let e of[...t,...n])r.has(e)||(r.add(e),i.push(e));return i},[Ge,e,Ke]),[Ye,Xe]=(0,v.useState)(void 0),Ze=(0,v.useRef)(``);(0,v.useEffect)(()=>{Xe(void 0),Ze.current=``},[e]),(0,v.useEffect)(()=>{we.current=0},[e]);let Qe=kA+e,[$e,et]=(0,v.useState)(void 0),[tt,nt]=(0,v.useState)(void 0),[it,at]=(0,v.useState)(()=>localStorage.getItem(kA+e)??``),[st,ct]=(0,v.useState)(void 0);(0,v.useEffect)(()=>{I.getProviders().then(et).catch(e=>{ct(`models unavailable (${e instanceof M?e.code:e.message})`)}),I.getSettings().then(e=>{nt({provider:typeof e.defaultProvider==`string`?e.defaultProvider:``,modelId:typeof e.defaultModel==`string`?e.defaultModel:``})}).catch(()=>{})},[]),(0,v.useEffect)(()=>{let t=localStorage.getItem(kA+e)??``;if(at(t),ct(void 0),t===``)return;let[n,...r]=t.split(`:`),i=r.join(`:`);if(n===void 0||i.length===0)return;let a=e;I.setModel(a,n,i).catch(t=>{a===e&&ct(`set model failed: ${t instanceof M?t.code:t.message}`)})},[e]);let lt=L(t=>t.pendingDraftBySession[e]),ut=L(e=>e.consumePendingDraft);(0,v.useEffect)(()=>{lt!==void 0&&(d(lt),ut(e))},[lt,e,ut]),(0,v.useEffect)(()=>{if(oe===void 0||oe.seq<=ue.current)return;ue.current=oe.seq;let e=oe.text;d(t=>t.length===0?e:`${t}${/\s$/.test(t)?``:` `}${e}`),requestAnimationFrame(()=>{let e=x.current;if(e===null)return;e.focus();let t=e.value.length;e.setSelectionRange(t,t)}),j()},[oe,j]);let dt=async t=>{if(at(t),t===``){localStorage.removeItem(Qe);return}let[n,...r]=t.split(`:`),i=r.join(`:`);if(!(n===void 0||i.length===0))try{await I.setModel(e,n,i),localStorage.setItem(Qe,t),ct(void 0)}catch(e){ct(`set model failed: ${e instanceof M?e.code:e.message}`)}},ft=async()=>{let r=u.trim();if(!(r.length===0&&Te.length===0||f)){if(r.length>0&&(DA(e,r),qe(e=>e+1)),pe&&!Se){xe.length>0?Ce():ze(`Unknown command "${u.split(/\s/)[0]??u}". Type /help to see commands.`);return}p(!0);try{if(!t&&/^!!?[^!]/.test(r)){if(n){ze(`Bash exec is disabled in this deployment.`);return}let t=r.startsWith(`!!`),i=r.slice(t?2:1).trim();if(i.length===0){ze("Empty bash command. Type something after the `!`.");return}Te.length>0&&(Ue(),ze("Attachments aren't sent with `!` exec. Cleared.")),await I.exec(e,i,{excludeFromContext:t}),s(e),d(``),Xe(void 0),Ze.current=``;return}t?(Te.length>0&&(Ue(),ze(`Attachments aren't sent on steer (mid-turn). Cleared.`)),await o(e,r)):await a(e,r,Te.length>0?Te:void 0),d(``),Ue(),Xe(void 0),Ze.current=``,S&&x.current?.blur()}catch(e){ze(`Command failed: ${e instanceof M?e.code:e.message}`)}finally{p(!1)}}},pt=n=>{if(pe){if(n.key===`Escape`){n.preventDefault(),d(``);return}if(xe.length>0){if(n.key===`ArrowDown`){n.preventDefault(),fe(e=>Math.min(e+1,xe.length-1));return}if(n.key===`ArrowUp`){n.preventDefault(),fe(e=>Math.max(e-1,0));return}if((n.key===`Enter`||n.key===`Tab`)&&!(Se&&n.key===`Enter`&&!n.shiftKey)){n.preventDefault(),Ce();return}}else if(n.key===`Enter`&&!n.shiftKey){n.preventDefault(),ze(`Unknown command "${u.split(/\s/)[0]??u}". Type /help to see commands, or backspace the leading / to send as a prompt.`);return}}if(k!==void 0&&te.length>0){if(n.key===`ArrowDown`){n.preventDefault(),ie(e=>Math.min(e+1,te.length-1));return}if(n.key===`ArrowUp`){n.preventDefault(),ie(e=>Math.max(e-1,0));return}if(n.key===`Enter`||n.key===`Tab`){let e=te[re];if(e!==void 0){n.preventDefault(),gt(e);return}}if(n.key===`Escape`){n.preventDefault(),_t();return}}if(n.key===`Enter`&&!n.shiftKey&&!S){n.preventDefault(),ft();return}if(n.key===`ArrowUp`){let e=Ye!==void 0;if(e||u.length===0){if(Je.length===0)return;n.preventDefault();let t=e?Math.min((Ye??0)+1,Je.length-1):0;e||(Ze.current=u),Xe(t);let r=Je[t];r!==void 0&&d(r)}return}if(n.key===`ArrowDown`){if(Ye===void 0)return;if(n.preventDefault(),Ye>0){let e=Ye-1;Xe(e);let t=Je[e];t!==void 0&&d(t)}else Xe(void 0),d(Ze.current),Ze.current=``;return}if(n.key===`Escape`){if(!t)return;n.preventDefault();let r=Date.now(),i=r-we.current;we.current=r,i<MA&&(we.current=0,c(e))}},mt=e=>{d(e),Ye!==void 0&&(Xe(void 0),Ze.current=``);let t=ht(e,x.current?.selectionStart??e.length);ee(t),t===void 0&&ne([]),ie(0)};function ht(e,t){let n=t-1;for(;n>=0;){let r=e[n];if(r===void 0)break;if(/\s/.test(r))return;if(r===`@`){let r=n===0?` `:e[n-1];return r===void 0||/\s/.test(r)?{start:n,end:t,query:e.slice(n+1,t)}:void 0}--n}}(0,v.useEffect)(()=>{if(k===void 0||b===void 0)return;let e=ae.current+1;ae.current=e;let t=window.setTimeout(()=>{I.completeFiles(b.id,k.query,{limit:20}).then(t=>{ae.current===e&&(ne(t.paths),ie(0))}).catch(()=>{ae.current===e&&ne([])})},100);return()=>window.clearTimeout(t)},[k,b]);let gt=e=>{if(k===void 0)return;let t=u.slice(0,k.start),n=u.slice(k.end),r=`@"${e}"`;d(`${t}${r}${n}`),ee(void 0),ne([]);let i=t.length+r.length;requestAnimationFrame(()=>{let e=x.current;e!==null&&(e.focus(),e.setSelectionRange(i,i))})},_t=()=>{ee(void 0),ne([])},vt=xA(u),yt=e=>{let t=CA(e);d(e=>e.replace(t,(e,t)=>t).trimEnd())};return(0,v.useEffect)(()=>{if(!je)return;let e=e=>{let t=Pe.current;t!==null&&(t.contains(e.target)||Ne(!1))},t=e=>{e.key===`Escape`&&Ne(!1)};return window.addEventListener(`mousedown`,e),window.addEventListener(`touchstart`,e),window.addEventListener(`keydown`,t),()=>{window.removeEventListener(`mousedown`,e),window.removeEventListener(`touchstart`,e),window.removeEventListener(`keydown`,t)}},[je]),(0,v.useEffect)(()=>{if(!S){Fe!==void 0&&Ie(void 0);return}let e=x.current;if(e===null)return;let t=e.style.height;e.style.height=`auto`;let n=e.scrollHeight;e.style.height=t;let r=Math.round(window.innerHeight*.3),i=Math.max(44,Math.min(n,r));i!==Fe&&Ie(i)},[u,S]),(0,R.jsxs)(`div`,{className:`bg-neutral-950`,children:[(0,R.jsx)(`div`,{role:`separator`,"aria-orientation":`horizontal`,"aria-label":`Resize chat input`,onPointerDown:D,className:`group relative hidden h-px cursor-row-resize bg-neutral-800 hover:bg-neutral-600 active:bg-neutral-500 md:block`,children:(0,R.jsx)(`div`,{className:`absolute inset-x-0 -top-1 h-2`})}),(0,R.jsxs)(`div`,{className:`mx-auto max-w-3xl space-y-2 px-3 pt-2 md:px-6 md:py-3`,style:{paddingBottom:`max(0.5rem, env(safe-area-inset-bottom))`},children:[(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,R.jsx)(PA,{providers:$e,defaultModel:tt,value:it,onChange:e=>void dt(e)}),vt.length>0&&(0,R.jsx)(`div`,{className:`flex flex-wrap items-center gap-1`,children:vt.map((e,t)=>(0,R.jsxs)(`span`,{className:`inline-flex max-w-[220px] items-center gap-1 truncate rounded border border-emerald-700/60 bg-emerald-900/20 px-1.5 py-0.5 text-[11px] text-emerald-200`,title:`@${e} — model will use its read tool to load this file when it needs to`,children:[(0,R.jsx)(ce,{size:11,className:`shrink-0`}),(0,R.jsx)(`span`,{className:`truncate font-mono`,children:e}),(0,R.jsx)(`button`,{type:`button`,onClick:()=>yt(e),className:`-mr-0.5 ml-0.5 rounded p-0.5 text-emerald-300/70 hover:bg-emerald-900/40 hover:text-emerald-100`,title:`Remove @${e}`,children:(0,R.jsx)(rt,{size:10})})]},`ref-${t}-${e}`))}),(st!==void 0||T!==void 0||m.total>0||_>0)&&(0,R.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[st!==void 0&&(0,R.jsx)(`span`,{className:`text-[11px] text-red-400`,children:st}),!S&&T!==void 0&&(0,R.jsx)(`button`,{type:`button`,onClick:O,className:`rounded p-1 text-neutral-500 hover:bg-neutral-800 hover:text-neutral-200`,title:`Reset chat input height to default`,"aria-label":`Reset chat input height to default`,children:(0,R.jsx)(We,{size:12})}),_>0&&(0,R.jsxs)(`button`,{type:`button`,onClick:()=>y(),className:`flex items-center gap-1 rounded px-1.5 py-1 text-[11px] text-neutral-400 hover:bg-neutral-800 hover:text-neutral-200 light:text-neutral-600 light:hover:bg-neutral-200 light:hover:text-neutral-900`,title:`${_} background process(es) running — view processes panel`,"aria-label":`View processes panel`,children:[(0,R.jsx)(se,{size:12,className:`text-emerald-400 light:text-emerald-700`}),(0,R.jsx)(`span`,{children:_})]}),m.total>0&&(0,R.jsxs)(`button`,{type:`button`,onClick:()=>g(!h),className:`flex items-center gap-1 rounded px-1.5 py-1 text-[11px] ${h?`bg-amber-900/40 text-amber-200 light:bg-amber-100 light:text-amber-900`:`text-neutral-400 hover:bg-neutral-800 hover:text-neutral-200 light:text-neutral-600 light:hover:bg-neutral-200 light:hover:text-neutral-900`}`,title:h?`Hide todo panel`:`Show todo panel (${m.completed}/${m.total} done${m.inProgress>0?`, ${m.inProgress} in progress`:``})`,"aria-pressed":h,children:[(0,R.jsx)(Me,{size:12}),(0,R.jsxs)(`span`,{children:[m.completed,`/`,m.total]})]})]})]}),l!==void 0&&(0,R.jsxs)(`p`,{className:`text-xs text-red-400`,children:[`Error: `,l]}),Re!==void 0&&(0,R.jsx)(`p`,{className:`text-xs text-amber-400`,children:Re}),Te.length>0&&(0,R.jsx)(FA,{attachments:Te,previewUrls:De.current,onRemove:He}),(0,R.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,R.jsx)(`input`,{ref:Oe,type:`file`,multiple:!0,className:`hidden`,onChange:e=>{e.target.files!==null&&Ve(e.target.files),e.target.value=``}}),S&&(0,R.jsx)(`input`,{ref:ke,type:`file`,accept:`image/*`,multiple:!0,className:`hidden`,onChange:e=>{e.target.files!==null&&Ve(e.target.files),e.target.value=``}}),S?(0,R.jsxs)(`div`,{className:`relative`,ref:Pe,children:[(0,R.jsx)(`button`,{onClick:()=>Ne(e=>!e),disabled:f||t,"aria-label":`Attach`,"aria-expanded":je,className:`inline-flex min-h-11 min-w-11 items-center justify-center self-stretch rounded-md border border-neutral-700 bg-neutral-900 px-2 text-neutral-300 hover:border-neutral-500 hover:text-neutral-100 disabled:cursor-not-allowed disabled:opacity-50`,title:t?`Attachments aren't sent on steer (mid-turn).`:`Attach a photo or a file`,children:(0,R.jsx)(Be,{size:16})}),je&&(0,R.jsxs)(`div`,{className:`absolute bottom-full left-0 z-20 mb-1 flex flex-col overflow-hidden rounded-md border border-neutral-700 bg-neutral-900 shadow-lg`,children:[(0,R.jsxs)(`button`,{onClick:()=>{ke.current?.click(),Ne(!1)},className:`flex min-h-11 items-center gap-2 px-3 text-left text-[14px] text-neutral-200 hover:bg-neutral-800`,children:[(0,R.jsx)(Ae,{size:16,className:`shrink-0 text-neutral-400`}),`Photo`]}),(0,R.jsxs)(`button`,{onClick:()=>{Oe.current?.click(),Ne(!1)},className:`flex min-h-11 items-center gap-2 border-t border-neutral-800 px-3 text-left text-[14px] text-neutral-200 hover:bg-neutral-800`,children:[(0,R.jsx)(Be,{size:16,className:`shrink-0 text-neutral-400`}),`File`]})]})]}):(0,R.jsx)(`button`,{onClick:()=>Oe.current?.click(),disabled:f||t,"aria-label":`Attach files`,className:`inline-flex items-center justify-center self-stretch rounded-md border border-neutral-700 bg-neutral-900 px-2 text-neutral-300 hover:border-neutral-500 hover:text-neutral-100 disabled:cursor-not-allowed disabled:opacity-50`,title:t?`Attachments aren't sent on steer (mid-turn). Wait for the current run to finish.`:`Attach files (images go into model context; text files are prepended to the prompt)`,children:(0,R.jsx)(Be,{size:14})}),(0,R.jsxs)(`div`,{className:`relative flex-1`,children:[pe&&xe.length>0&&(0,R.jsxs)(`div`,{className:`absolute bottom-full left-0 right-0 z-10 mb-1 overflow-hidden rounded-md border border-neutral-700 bg-neutral-900 shadow-lg`,children:[(0,R.jsx)(`div`,{className:`max-h-[60vh] overflow-y-auto py-1 md:max-h-64`,children:xe.map((e,t)=>(0,R.jsx)(`button`,{onMouseDown:n=>{n.preventDefault(),e.available&&(fe(t),Ce(t))},onMouseEnter:()=>fe(t),disabled:!e.available,className:`block w-full px-3 py-2.5 text-left text-[14px] md:py-1 md:text-[12px] ${t===de&&e.available?`bg-neutral-800 text-neutral-100`:`text-neutral-300 hover:bg-neutral-900/80`} ${e.available?``:`opacity-40`}`,title:e.available?e.description:`${e.description} — unavailable right now`,children:(0,R.jsxs)(`div`,{className:`flex flex-col md:block`,children:[(0,R.jsx)(`span`,{className:`font-mono text-neutral-200`,children:e.name}),(0,R.jsx)(`span`,{className:`text-[12px] text-neutral-500 md:ml-2 md:text-[10px]`,children:e.description})]})},e.name))}),(0,R.jsx)(`div`,{className:`hidden border-t border-neutral-800 px-3 py-1 text-[10px] text-neutral-500 md:block`,children:`↑↓ navigate · Enter/Tab run · Esc cancel`})]}),k!==void 0&&te.length>0&&(0,R.jsxs)(`div`,{className:`absolute bottom-full left-0 right-0 z-10 mb-1 overflow-hidden rounded-md border border-neutral-700 bg-neutral-900 shadow-lg`,children:[(0,R.jsx)(`div`,{className:`max-h-[60vh] overflow-y-auto py-1 md:max-h-64`,children:te.map((e,t)=>(0,R.jsx)(`button`,{onMouseDown:t=>{t.preventDefault(),gt(e)},onMouseEnter:()=>ie(t),className:`block w-full truncate px-3 py-2.5 text-left font-mono text-[14px] md:py-1 md:text-[12px] ${t===re?`bg-neutral-800 text-neutral-100`:`text-neutral-300 hover:bg-neutral-900/80`}`,title:e,children:e},e))}),(0,R.jsx)(`div`,{className:`hidden border-t border-neutral-800 px-3 py-1 text-[10px] text-neutral-500 md:block`,children:`↑↓ navigate · Enter/Tab insert · Esc close`})]}),(0,R.jsx)(`textarea`,{ref:x,value:u,onChange:e=>mt(e.target.value),onKeyDown:pt,onBlur:()=>{setTimeout(()=>{x.current!==document.activeElement&&_t()},0)},placeholder:i?`Auto-retry in progress — your message will be queued and sent after the retry completes…`:t?S?`Steer the agent…`:`Steer the agent (Enter to send, Shift+Enter for newline)…`:S?n?"Ask pi — `/` runs commands, `@path` references files…":"Ask pi — `/` runs commands, `!` runs bash, `@path` references files…":n?"Ask pi (Enter to send, Shift+Enter for newline) — `/` runs commands, `@path` references files…":"Ask pi (Enter to send, Shift+Enter for newline) — `/` runs commands, `!` runs bash, `@path` references files…",title:i?`The agent is auto-retrying after a provider error. New messages are queued and delivered when the retry succeeds.`:void 0,rows:S?2:3,style:S&&Fe!==void 0?{height:`${Fe}px`,maxHeight:`30vh`}:!S&&T!==void 0?{height:`${T}px`}:void 0,className:`block w-full resize-none rounded-md border bg-neutral-900 px-3 py-2 text-sm text-neutral-100 outline-none min-h-11 md:min-h-0 ${ye===`local`?`border-amber-500 focus:border-amber-400`:ye===`context`?`border-emerald-500 focus:border-emerald-400`:`border-neutral-700 focus:border-neutral-500`}`}),ye!==void 0&&(0,R.jsx)(`span`,{className:`pointer-events-none absolute right-2 top-2 select-none rounded px-1.5 py-0.5 font-mono text-[10px] uppercase tracking-wide ${ye===`local`?`bg-amber-500/15 text-amber-300`:`bg-emerald-500/15 text-emerald-300`}`,title:ye===`local`?`!! — runs bash; output stays local (excluded from LLM context)`:`! — runs bash; output is added to the next turn's LLM context`,children:ye===`local`?`bash · local`:`bash · context`})]}),(0,R.jsxs)(`div`,{className:`flex flex-col-reverse gap-1 self-stretch md:flex-row md:items-end md:self-auto`,children:[(0,R.jsx)(`button`,{onClick:()=>void ft(),disabled:u.trim().length===0&&Te.length===0||f,className:`flex-1 rounded-md bg-neutral-100 px-4 text-sm font-medium text-neutral-900 disabled:cursor-not-allowed disabled:opacity-50 md:flex-none md:py-2`,title:t?`Send (Pi queues at the next agent break — steer or follow-up depending on agent state)`:`Send (Enter)`,children:`Send`}),t&&(0,R.jsx)(`button`,{onClick:()=>void c(e),className:`flex-1 rounded-md border border-red-700/60 bg-red-950/30 px-3 text-sm font-medium text-red-300 hover:bg-red-900/40 hover:text-red-100 md:flex-none md:py-2`,title:`Stop the agent (or press Esc twice in the textbox)`,children:`Abort`})]})]}),t&&(0,R.jsx)(`p`,{className:`text-[10px] text-neutral-600`,children:`Send queues at the next agent break — Pi picks steer or follow-up. Abort: stop the agent (or press Esc twice in the textbox).`})]})]})}function PA({providers:e,defaultModel:t,value:n,onChange:r}){let i=(0,v.useMemo)(()=>AA(e),[e]),[a,o]=(0,v.useState)(!1),[s,c]=(0,v.useState)(``),[l,u]=(0,v.useState)(0),d=(0,v.useRef)(null),f=(0,v.useRef)(null),p=(0,v.useRef)(null),m=(0,v.useMemo)(()=>{if(s.trim().length===0)return i;let e=[];for(let t of i){let n=jA(t,s);n!==void 0&&e.push({opt:t,score:n})}return e.sort((e,t)=>e.score-t.score),e.map(e=>e.opt)},[i,s]),h=i.find(e=>e.value===n),g=t!==void 0&&t.provider.length>0&&t.modelId.length>0?`${t.provider} / ${t.modelId}`:``,_=h===void 0?g.length>0?`${g} (default)`:`default model`:`${h.provider} / ${h.name}`;(0,v.useEffect)(()=>{if(!a)return;let e=e=>{d.current!==null&&(d.current.contains(e.target)||o(!1))};return window.addEventListener(`mousedown`,e),()=>window.removeEventListener(`mousedown`,e)},[a]),(0,v.useEffect)(()=>{a&&(c(``),u(0),requestAnimationFrame(()=>f.current?.focus()))},[a]),(0,v.useEffect)(()=>{!a||p.current===null||p.current.querySelector(`[data-idx="${l}"]`)?.scrollIntoView({block:`nearest`})},[a,l]);let y=e=>{if(e===-1)r(``);else{let t=m[e];if(t===void 0)return;r(t.value)}o(!1)};return(0,R.jsxs)(`div`,{ref:d,className:`relative`,children:[(0,R.jsxs)(`button`,{onClick:()=>o(e=>!e),disabled:e===void 0,className:`flex max-w-[260px] items-center gap-1 truncate rounded border border-neutral-700 bg-neutral-900 px-2 py-1 text-left text-[11px] text-neutral-200 disabled:opacity-50`,title:`Override the model for this session (click to search)`,children:[(0,R.jsx)(`span`,{className:`text-neutral-500`,children:`model:`}),(0,R.jsx)(`span`,{className:`truncate`,children:_}),(0,R.jsx)(`span`,{className:`ml-1 text-neutral-500`,children:`▾`})]}),a&&(0,R.jsxs)(`div`,{className:`absolute bottom-full left-0 z-10 mb-1 w-[360px] rounded border border-neutral-700 bg-neutral-950 shadow-xl`,children:[(0,R.jsx)(`input`,{ref:f,value:s,onChange:e=>{c(e.target.value),u(0)},onKeyDown:e=>{e.key===`ArrowDown`?(e.preventDefault(),u(e=>Math.min(e+1,m.length-1))):e.key===`ArrowUp`?(e.preventDefault(),u(e=>Math.max(e-1,-1))):e.key===`Enter`?(e.preventDefault(),y(l)):e.key===`Escape`&&(e.preventDefault(),o(!1))},placeholder:`Search provider or model…`,className:`w-full border-b border-neutral-800 bg-transparent px-3 py-2 text-xs text-neutral-100 outline-none`}),(0,R.jsxs)(`div`,{ref:p,className:`max-h-72 overflow-y-auto py-1`,children:[(0,R.jsxs)(`button`,{"data-idx":-1,onMouseEnter:()=>u(-1),onClick:()=>y(-1),className:`flex w-full items-center justify-between px-3 py-1.5 text-left text-xs ${l===-1?`bg-neutral-800 text-neutral-100`:`text-neutral-400`}`,children:[(0,R.jsxs)(`span`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,R.jsx)(`span`,{children:`Use agent default`}),g.length>0&&(0,R.jsx)(`span`,{className:`truncate font-mono text-[10px] text-neutral-500`,children:g})]}),n===``&&(0,R.jsx)(`span`,{className:`text-emerald-400`,children:`●`})]}),m.length===0?(0,R.jsx)(`p`,{className:`px-3 py-2 text-xs italic text-neutral-500`,children:`No models match. Add an API key in Settings → Providers.`}):m.map((e,t)=>(0,R.jsxs)(`button`,{"data-idx":t,onMouseEnter:()=>u(t),onClick:()=>y(t),className:`flex w-full items-center justify-between px-3 py-1.5 text-left text-xs ${t===l?`bg-neutral-800 text-neutral-100`:`text-neutral-300`}`,children:[(0,R.jsxs)(`span`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,R.jsx)(`span`,{className:`text-neutral-500`,children:e.provider}),(0,R.jsx)(`span`,{className:`truncate font-mono`,children:e.name})]}),e.value===n&&(0,R.jsx)(`span`,{className:`text-emerald-400`,children:`●`})]},e.value))]}),(0,R.jsxs)(`div`,{className:`border-t border-neutral-800 px-3 py-1.5 text-[10px] text-neutral-600`,children:[m.length,` of `,i.length,` models — ↑↓ to move, Enter to pick, Esc to close`]})]})]})}function FA({attachments:e,previewUrls:t,onRemove:n}){return(0,R.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:e.map((e,r)=>{let i=e.type.startsWith(`image/`),a=t.get(e);return(0,R.jsxs)(`div`,{className:`group relative flex items-center gap-1.5 rounded-md border border-neutral-700 bg-neutral-900 pr-1 text-xs text-neutral-200`,children:[i&&a!==void 0?(0,R.jsx)(`img`,{src:a,alt:e.name,className:`h-12 w-12 shrink-0 rounded-l-md object-cover`}):(0,R.jsx)(`span`,{className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-l-md bg-neutral-800 text-neutral-400`,children:i?(0,R.jsx)(Ae,{size:14}):(0,R.jsx)(Be,{size:12})}),(0,R.jsxs)(`span`,{className:`flex flex-col py-1 pl-1`,children:[(0,R.jsx)(`span`,{className:`max-w-[160px] truncate font-mono text-[11px]`,title:e.name,children:e.name}),(0,R.jsx)(`span`,{className:`text-[10px] text-neutral-500`,children:IA(e.size)})]}),(0,R.jsx)(`button`,{onClick:()=>n(e),className:`ml-1 rounded p-1 text-neutral-500 hover:bg-neutral-800 hover:text-red-300`,title:`Remove ${e.name}`,children:(0,R.jsx)(rt,{size:16})})]},`${r}-${e.name}`)})})}function IA(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function LA({sessionId:e,alreadyOnChangesTab:t,onOpen:n}){let r=L(t=>t.streamingBySession[e]??!1),i=L(t=>t.agentEndCountBySession[e]??0),[a,o]=(0,v.useState)(0);return(0,v.useEffect)(()=>{o(0)},[e]),(0,v.useEffect)(()=>{if(r)return;let t=!1;return I.getTurnDiff(e).then(e=>{t||o(e.entries.length)}).catch(e=>{t||(e instanceof M&&e.status===404||typeof console<`u`&&console.warn(`[ChangedFilesBadge] turn-diff fetch failed:`,e),o(0))}),()=>{t=!0}},[e,i,r]),a===0||t?null:(0,R.jsx)(`div`,{className:`border-t border-neutral-800 bg-neutral-950 px-6 py-2`,children:(0,R.jsx)(`div`,{className:`mx-auto max-w-3xl`,children:(0,R.jsxs)(`button`,{onClick:n,className:`flex items-center gap-2 rounded-md border border-neutral-700 bg-neutral-900 px-3 py-1.5 text-xs text-neutral-200 hover:border-neutral-500 hover:bg-neutral-800`,title:`Open the Last turn pane to review what the agent just wrote`,children:[(0,R.jsx)(Ce,{size:12}),a===1?`1 file edited`:`${a} files edited`,(0,R.jsx)(`span`,{className:`text-[10px] text-neutral-500`,children:`— review`})]})})})}var RA=3e4,zA=[];function BA(e){return e instanceof M?e.code:e instanceof Error?e.message:String(e)}var VA=ft((e,t)=>({settings:void 0,globalServers:{},byProject:{},loading:!1,error:void 0,pollHandle:void 0,startPolling:()=>{if(t().pollHandle!==void 0)return;let n=()=>{typeof document<`u`&&document.hidden||t().refreshSettings()};n(),e({pollHandle:window.setInterval(n,RA)})},stopPolling:()=>{let n=t().pollHandle;n!==void 0&&(window.clearInterval(n),e({pollHandle:void 0}))},refreshSettings:async()=>{try{e({settings:await I.getMcpSettings(),error:void 0})}catch(t){if(!(t instanceof M)||t.status===401)return;e({error:BA(t)})}},refreshProject:async t=>{if(t===void 0){try{e({globalServers:(await I.listMcpServers()).servers,error:void 0})}catch(t){if(t instanceof M&&t.status===401)return;e({error:BA(t)})}return}e({loading:!0});try{let n=await I.listMcpServers(t);e(e=>{let r={status:n.status,loadedAt:Date.now()};return n.stdioTrust!==void 0&&(r.stdioTrust=n.stdioTrust),{loading:!1,error:void 0,globalServers:n.servers,byProject:{...e.byProject,[t]:r}}})}catch(t){e({loading:!1,error:BA(t)})}},setMcpEnabled:async n=>{let r=t().settings;r!==void 0&&e({settings:{...r,enabled:n}});try{e({settings:await I.setMcpEnabled(n),error:void 0})}catch(t){throw r!==void 0&&e({settings:r}),e({error:BA(t)}),t}},upsertServer:async(n,r)=>{try{await I.upsertMcpServer(n,r),await Promise.all([t().refreshSettings(),...Object.keys(t().byProject).map(e=>t().refreshProject(e))])}catch(t){throw e({error:BA(t)}),t}},deleteServer:async n=>{try{await I.deleteMcpServer(n),await Promise.all([t().refreshSettings(),...Object.keys(t().byProject).map(e=>t().refreshProject(e))])}catch(t){throw e({error:BA(t)}),t}},probeServer:async(n,r)=>{try{await I.probeMcpServer(n,r),await Promise.all([t().refreshSettings(),t().refreshProject(r)])}catch(t){throw e({error:BA(t)}),t}},grantStdioTrust:async n=>{try{await I.grantStdioMcpTrust(n),await t().refreshProject(n)}catch(t){throw e({error:BA(t)}),t}},revokeStdioTrust:async n=>{try{await I.revokeStdioMcpTrust(n),await t().refreshProject(n)}catch(t){throw e({error:BA(t)}),t}}}));function HA({onClose:e,initialTab:t}){let n=Zr(e=>e.minimal),r=(0,v.useMemo)(()=>n?[`skills`,`prompts`,`systemPrompt`,`tools`,`quickActions`,`appearance`,`backup`,`general`]:[`providers`,`agent`,`mcp`,`tools`,`skills`,`prompts`,`systemPrompt`,`quickActions`,`appearance`,`backup`,`general`],[n]),[i,a]=(0,v.useState)(t??(n?`skills`:`providers`));(0,v.useEffect)(()=>{r.includes(i)||a(r[0])},[r,i]),(0,v.useEffect)(()=>{t!==void 0&&r.includes(t)&&a(t)},[t,r]);let[o,s]=(0,v.useState)(void 0);return(0,R.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/60 px-4 py-8`,onClick:e,children:(0,R.jsxs)(`div`,{onClick:e=>e.stopPropagation(),className:`flex h-full max-h-[720px] w-full max-w-6xl flex-col overflow-hidden rounded-lg border border-neutral-800 bg-neutral-950 shadow-2xl`,children:[(0,R.jsxs)(`header`,{className:`flex items-center justify-between border-b border-neutral-800 px-4 py-3`,children:[(0,R.jsx)(`div`,{className:`flex items-center gap-1`,children:r.map(e=>(0,R.jsx)(`button`,{onClick:()=>a(e),className:`rounded px-3 py-1 text-xs ${i===e?`bg-neutral-800 text-neutral-100`:`text-neutral-400 hover:bg-neutral-900 hover:text-neutral-200`}`,children:e===`providers`?`Providers`:e===`agent`?`Agent`:e===`mcp`?`MCP`:e===`tools`?`Tools`:e===`skills`?`Skills`:e===`prompts`?`Prompts`:e===`systemPrompt`?`System Prompt`:e===`quickActions`?`Quick Actions`:e===`appearance`?`Appearance`:e===`backup`?`Backup`:`General`},e))}),(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(`button`,{onClick:()=>{let e=Bt(),t=e===void 0?`/api/docs`:`/api/docs?token=${encodeURIComponent(e.token)}`;window.open(t,`_blank`,`noopener,noreferrer`)},className:`rounded border border-neutral-700 px-2 py-1 text-xs text-neutral-300 hover:border-neutral-500`,title:`Open the OpenAPI / Swagger UI in a new tab. Carries your auth token automatically.`,children:`API Docs ↗`}),(0,R.jsx)(`button`,{onClick:e,className:`rounded border border-neutral-700 px-2 py-1 text-xs text-neutral-300 hover:border-neutral-500`,title:`Close (Esc)`,children:`Close`})]})]}),o!==void 0&&(0,R.jsx)(`div`,{className:`border-b border-red-700/40 bg-red-900/20 px-4 py-2 text-xs text-red-300`,children:o}),(0,R.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-4 py-3 text-sm text-neutral-200`,children:[i===`providers`&&(0,R.jsx)(WA,{onError:s}),i===`agent`&&(0,R.jsx)(KA,{onError:s}),i===`mcp`&&(0,R.jsx)(hj,{onError:s}),i===`tools`&&(0,R.jsx)(ij,{onError:s}),i===`skills`&&(0,R.jsx)($A,{onError:s}),i===`prompts`&&(0,R.jsx)(ej,{onError:s}),i===`systemPrompt`&&(0,R.jsx)(oj,{onError:s}),i===`quickActions`&&(0,R.jsx)(cj,{onError:s}),i===`appearance`&&(0,R.jsx)(lj,{}),i===`backup`&&(0,R.jsx)(dj,{onError:s}),i===`general`&&(0,R.jsx)(Sj,{})]})]})})}function UA(e){return e instanceof M?e.code:e.message}function WA({onError:e}){let[t,n]=(0,v.useState)(void 0),[r,i]=(0,v.useState)(void 0),[a,o]=(0,v.useState)(void 0),[s,c]=(0,v.useState)(``),[l,u]=(0,v.useState)(!1),d=async()=>{e(void 0);try{let[e,t]=await Promise.all([I.getProviders(),I.getAuthSummary()]);n(e),i(t)}catch(t){e(`Failed to load providers: ${UA(t)}`)}};(0,v.useEffect)(()=>{d()},[]);let f=async t=>{if(s.trim().length!==0){u(!0);try{await I.setApiKey(t,s.trim()),o(void 0),c(``),await d()}catch(t){e(`Save key failed: ${UA(t)}`)}finally{u(!1)}}},p=async t=>{if(confirm(`Remove the stored key for "${t}"?`)){u(!0);try{await I.removeApiKey(t),await d()}catch(t){e(`Remove key failed: ${UA(t)}`)}finally{u(!1)}}};return t===void 0?(0,R.jsx)(`p`,{className:`text-xs italic text-neutral-500`,children:`Loading providers…`}):(0,R.jsxs)(`div`,{className:`space-y-3`,children:[(0,R.jsxs)(`p`,{className:`text-xs text-neutral-500`,children:[`Built-in providers and anything in `,(0,R.jsx)(`code`,{className:`font-mono`,children:`models.json`}),`. Stored API keys are presence-only — actual values are never sent to the browser.`]}),t.providers.length===0&&(0,R.jsx)(`p`,{className:`text-xs italic text-neutral-500`,children:`No providers configured.`}),t.providers.map(e=>{let t=r?.providers[e.provider],n=t?.configured===!0,i=a===e.provider;return(0,R.jsxs)(`div`,{className:`rounded border border-neutral-800 bg-neutral-900/40 p-3`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(`span`,{className:`font-mono text-sm text-neutral-100`,children:e.provider}),(0,R.jsx)(`span`,{className:`rounded px-1.5 py-0.5 text-[10px] uppercase tracking-wider ${n?`bg-emerald-900/40 text-emerald-300 light:bg-emerald-100 light:text-emerald-800`:`bg-neutral-800 text-neutral-500`}`,children:n?`key set`:`no key`}),t?.source!==void 0&&(0,R.jsxs)(`span`,{className:`text-[10px] text-neutral-500`,children:[`via `,t.source]})]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-1 text-xs`,children:[!i&&(0,R.jsx)(`button`,{onClick:()=>{o(e.provider),c(``)},className:`rounded border border-neutral-700 px-2 py-0.5 text-neutral-300 hover:border-neutral-500`,children:n?`Replace key`:`Add key`}),n&&!i&&(0,R.jsx)(`button`,{onClick:()=>void p(e.provider),disabled:l,className:`rounded border border-red-700/50 px-2 py-0.5 text-red-300 hover:bg-red-900/20 disabled:opacity-50`,children:`Remove`})]})]}),i&&(0,R.jsxs)(`div`,{className:`mt-2 flex items-center gap-2`,children:[(0,R.jsx)(`input`,{type:`password`,value:s,onChange:e=>c(e.target.value),placeholder:`Paste API key`,autoFocus:!0,className:`flex-1 rounded border border-neutral-700 bg-neutral-950 px-2 py-1 text-xs text-neutral-100 outline-none focus:border-neutral-500`}),(0,R.jsx)(`button`,{onClick:()=>void f(e.provider),disabled:l||s.trim().length===0,className:`rounded bg-neutral-100 px-2 py-1 text-xs font-medium text-neutral-900 disabled:opacity-50`,children:`Save`}),(0,R.jsx)(`button`,{onClick:()=>{o(void 0),c(``)},className:`rounded border border-neutral-700 px-2 py-1 text-xs text-neutral-300`,children:`Cancel`})]}),(0,R.jsxs)(`details`,{className:`mt-2`,children:[(0,R.jsxs)(`summary`,{className:`cursor-pointer text-[11px] text-neutral-500 light:text-neutral-600`,children:[e.models.length,` model`,e.models.length===1?``:`s`]}),(0,R.jsx)(`ul`,{className:`mt-1 space-y-0.5 text-[11px]`,children:e.models.map(e=>(0,R.jsxs)(`li`,{className:`flex justify-between font-mono`,children:[(0,R.jsx)(`span`,{className:e.hasAuth?`text-neutral-300`:`text-neutral-600 light:text-neutral-400`,children:e.name}),(0,R.jsxs)(`span`,{className:`text-neutral-600 light:text-neutral-400`,children:[`ctx `,Math.round(e.contextWindow/1e3),`k`]})]},e.id))})]})]},e.provider)}),(0,R.jsx)(GA,{onError:e})]})}function GA({onError:e}){let[t,n]=(0,v.useState)(void 0),[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(void 0);YA(a,()=>o(void 0));let s=async()=>{try{let e=await I.getModelsJson();n(JSON.stringify(e,null,2))}catch(t){e(`Load models.json failed: ${UA(t)}`)}},c=async()=>{if(t===void 0)return;let n;try{n=JSON.parse(t)}catch{e(`models.json: invalid JSON`);return}if(typeof n!=`object`||!n||typeof n.providers!=`object`||n.providers===null){e(`models.json: top-level must be { "providers": { ... } }`);return}i(!0),o(void 0);try{await I.setModelsJson(n),e(void 0),o(Date.now())}catch(t){e(`Save failed: ${UA(t)}`)}finally{i(!1)}};return(0,R.jsxs)(`details`,{className:`rounded border border-neutral-800 bg-neutral-900/40 p-3`,children:[(0,R.jsx)(`summary`,{className:`cursor-pointer text-xs text-neutral-300`,onClick:()=>{t===void 0&&s()},children:`Custom providers (models.json)`}),(0,R.jsx)(`p`,{className:`mt-1 text-[11px] text-neutral-500`,children:`Raw JSON editor. Add vLLM / LiteLLM / Ollama / OpenAI-compatible endpoints here. The SDK validates on next session creation.`}),t===void 0?(0,R.jsx)(`p`,{className:`mt-2 text-xs italic text-neutral-500`,children:`Loading…`}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`textarea`,{value:t,onChange:e=>n(e.target.value),spellCheck:!1,rows:10,className:`mt-2 w-full rounded border border-neutral-700 bg-neutral-950 px-2 py-1 font-mono text-[11px] text-neutral-100 outline-none focus:border-neutral-500`}),(0,R.jsxs)(`div`,{className:`mt-2 flex items-center justify-end gap-2 text-xs`,children:[a!==void 0&&(0,R.jsx)(`span`,{className:`text-emerald-400 light:text-emerald-700`,"aria-live":`polite`,children:`Saved`}),(0,R.jsx)(`button`,{onClick:()=>void s(),disabled:r,className:`rounded border border-neutral-700 px-2 py-1 text-neutral-300`,children:`Reload`}),(0,R.jsx)(`button`,{onClick:()=>void c(),disabled:r,className:`rounded bg-neutral-100 px-3 py-1 font-medium text-neutral-900 disabled:opacity-50`,children:r?`Saving…`:`Save`})]})]})]})}function KA({onError:e}){let[t,n]=(0,v.useState)(void 0),[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(`form`),s=async()=>{e(void 0);try{n(await I.getSettings())}catch(t){e(`Failed to load settings: ${UA(t)}`)}};(0,v.useEffect)(()=>{s()},[]);let c=e=>{if(t===void 0)return``;let n=t[e];return typeof n==`string`?n:``},l=async t=>{i(!0);try{n(await I.updateSettings(t))}catch(t){e(`Save failed: ${UA(t)}`)}finally{i(!1)}};return t===void 0?(0,R.jsx)(`p`,{className:`text-xs italic text-neutral-500`,children:`Loading settings…`}):a===`json`?(0,R.jsx)(qA,{initial:t,onSave:async r=>{let a={...r};for(let e of Object.keys(t))e in r||(a[e]=null);i(!0);try{n(await I.updateSettings(a)),e(void 0)}catch(t){throw e(`Save failed: ${UA(t)}`),t}finally{i(!1)}},onSwitchToForm:()=>o(`form`),busy:r,onError:e}):(0,R.jsxs)(`div`,{className:`space-y-4`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,R.jsx)(`p`,{className:`text-xs text-neutral-500`,children:`Defaults for new sessions. The form covers common keys; switch to JSON to edit anything the SDK accepts.`}),(0,R.jsx)(`button`,{onClick:()=>o(`json`),className:`rounded border border-neutral-700 px-2 py-0.5 text-[11px] text-neutral-300 hover:border-neutral-500`,children:`Edit as JSON`})]}),(0,R.jsx)(XA,{label:`Default provider`,hint:`e.g. anthropic, openai, google, custom`,children:(0,R.jsx)(ZA,{value:c(`defaultProvider`),onSave:e=>l({defaultProvider:e.length===0?null:e}),disabled:r})}),(0,R.jsx)(XA,{label:`Default model`,hint:`model id from the chosen provider`,children:(0,R.jsx)(ZA,{value:c(`defaultModel`),onSave:e=>l({defaultModel:e.length===0?null:e}),disabled:r})}),(0,R.jsx)(XA,{label:`Thinking level`,hint:`off, low, medium, high (provider-dependent)`,children:(0,R.jsx)(QA,{value:c(`defaultThinkingLevel`),options:[``,`off`,`low`,`medium`,`high`],onSave:e=>l({defaultThinkingLevel:e.length===0?null:e}),disabled:r})}),(0,R.jsx)(XA,{label:`Steering mode`,hint:`how interruptions during streaming are queued`,children:(0,R.jsx)(QA,{value:c(`steeringMode`),options:[``,`steer`,`followUp`],onSave:e=>l({steeringMode:e.length===0?null:e}),disabled:r})}),(0,R.jsx)(XA,{label:`Follow-up mode`,hint:`how queued messages are delivered after agent_end`,children:(0,R.jsx)(QA,{value:c(`followUpMode`),options:[``,`steer`,`followUp`],onSave:e=>l({followUpMode:e.length===0?null:e}),disabled:r})})]})}function qA({initial:e,onSave:t,onSwitchToForm:n,busy:r,onError:i}){let[a,o]=(0,v.useState)(()=>JSON.stringify(e,null,2)),[s,c]=(0,v.useState)(void 0);YA(s,()=>c(void 0));let l=async()=>{let e;try{e=JSON.parse(a)}catch{i(`settings.json: invalid JSON`);return}if(typeof e!=`object`||!e||Array.isArray(e)){i(`settings.json: top-level must be an object`);return}c(void 0);try{await t(e),c(Date.now())}catch{}};return(0,R.jsxs)(`div`,{className:`space-y-2`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,R.jsxs)(`p`,{className:`text-[11px] text-neutral-500`,children:[`Raw `,(0,R.jsx)(`code`,{className:`font-mono`,children:`settings.json`}),`. Keys removed here are deleted on save (mapped to `,(0,R.jsx)(`code`,{className:`font-mono`,children:`null`}),` in the merge patch). The SDK validates on next session creation.`]}),(0,R.jsx)(`button`,{onClick:n,className:`rounded border border-neutral-700 px-2 py-0.5 text-[11px] text-neutral-300 hover:border-neutral-500`,children:`Back to form`})]}),(0,R.jsx)(`textarea`,{value:a,onChange:e=>o(e.target.value),spellCheck:!1,rows:18,className:`w-full rounded border border-neutral-700 bg-neutral-950 px-2 py-1 font-mono text-[11px] text-neutral-100 outline-none focus:border-neutral-500`}),(0,R.jsxs)(`div`,{className:`flex items-center justify-end gap-2 text-xs`,children:[s!==void 0&&(0,R.jsx)(`span`,{className:`text-emerald-400 light:text-emerald-700`,"aria-live":`polite`,children:`Saved`}),(0,R.jsx)(`button`,{onClick:()=>o(JSON.stringify(e,null,2)),disabled:r,className:`rounded border border-neutral-700 px-2 py-1 text-neutral-300`,children:`Reset`}),(0,R.jsx)(`button`,{onClick:()=>void l(),disabled:r,className:`rounded bg-neutral-100 px-3 py-1 font-medium text-neutral-900 disabled:opacity-50`,children:r?`Saving…`:`Save`})]})]})}var JA=2500;function YA(e,t){(0,v.useEffect)(()=>{if(e===void 0)return;let n=window.setTimeout(t,JA);return()=>window.clearTimeout(n)},[e,t])}function XA({label:e,hint:t,children:n}){return(0,R.jsxs)(`div`,{className:`space-y-1`,children:[(0,R.jsx)(`label`,{className:`block text-xs font-medium text-neutral-200`,children:e}),t!==void 0&&(0,R.jsx)(`p`,{className:`text-[11px] text-neutral-500`,children:t}),n]})}function ZA({value:e,onSave:t,disabled:n}){let[r,i]=(0,v.useState)(e);return(0,v.useEffect)(()=>i(e),[e]),(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(`input`,{value:r,onChange:e=>i(e.target.value),disabled:n,className:`flex-1 rounded border border-neutral-700 bg-neutral-950 px-2 py-1 text-xs text-neutral-100 outline-none focus:border-neutral-500`}),(0,R.jsx)(`button`,{onClick:()=>void t(r),disabled:n||r===e,className:`rounded bg-neutral-100 px-2 py-1 text-xs font-medium text-neutral-900 disabled:opacity-50`,children:`Save`})]})}function QA({value:e,options:t,onSave:n,disabled:r}){return(0,R.jsx)(`select`,{value:e,disabled:r,onChange:e=>void n(e.target.value),className:`rounded border border-neutral-700 bg-neutral-950 px-2 py-1 text-xs text-neutral-100`,children:t.map(e=>(0,R.jsx)(`option`,{value:e,children:e.length===0?`(unset)`:e},e))})}function $A({onError:e}){let t=tr(),n=er(e=>e.projects),[r,i]=(0,v.useState)(void 0),[a,o]=(0,v.useState)([]),[s,c]=(0,v.useState)({}),[l,u]=(0,v.useState)({}),[d,f]=(0,v.useState)(!1),p=async()=>{if(t!==void 0){e(void 0);try{let[{skills:e,diagnostics:n},r]=await Promise.all([I.listSkills(t.id),I.listSkillOverrides()]);i(e),o(n),c(r.projects)}catch(t){e(`Failed to load skills: ${UA(t)}`)}}};if((0,v.useEffect)(()=>{p()},[t?.id]),t===void 0)return(0,R.jsx)(`p`,{className:`text-xs italic text-neutral-500`,children:`Pick a project from the header to manage its skills.`});if(r===void 0)return(0,R.jsxs)(`p`,{className:`text-xs italic text-neutral-500`,children:[`Loading skills for `,t.name,`…`]});let m=async(n,r)=>{f(!0);try{let{skills:e}=await I.setSkillEnabled(t.id,n,r,`global`);i(e)}catch(t){e(`Toggle failed: ${UA(t)}`)}finally{f(!1)}},h=async(t,n,r)=>{f(!0);try{r===void 0?await I.clearSkillProjectOverride(t,n):await I.setSkillEnabled(t,n,r===`enabled`,`project`),await p()}catch(t){e(`Override write failed: ${UA(t)}`)}finally{f(!1)}},g=(e,t)=>{let n=s[e];if(n!==void 0){if(n.enable.includes(t))return`enabled`;if(n.disable.includes(t))return`disabled`}};return(0,R.jsxs)(`div`,{className:`space-y-2`,children:[(0,R.jsxs)(`p`,{className:`text-xs text-neutral-500`,children:[`Skills discovered in `,(0,R.jsx)(`code`,{className:`font-mono`,children:`~/.pi/agent/skills/`}),` and`,` `,(0,R.jsxs)(`code`,{className:`font-mono`,children:[t.path,`/.pi/skills/`]}),`. The global toggle writes to pi's `,(0,R.jsx)(`code`,{className:`font-mono`,children:`settings.skills`}),`; per-project overrides write to the pi-forge-private file at`,` `,(0,R.jsx)(`code`,{className:`font-mono`,children:"${FORGE_DATA_DIR}/skills-overrides.json"}),`.`]}),(0,R.jsxs)(`div`,{className:`rounded border border-amber-700/40 bg-amber-900/10 px-3 py-2 text-[11px] text-amber-200 light:border-amber-300 light:bg-amber-50 light:text-amber-800`,children:[`Skill changes apply to the `,(0,R.jsx)(`strong`,{children:`next session`}),` you start in the affected project. Live sessions keep the skill set they booted with — start a new session to use a freshly enabled skill.`]}),a.length>0&&(0,R.jsx)(tj,{diagnostics:a}),r.length===0&&(0,R.jsx)(`p`,{className:`text-xs italic text-neutral-500`,children:`No skills found for this project.`}),r.map(e=>{let r=`${e.source}:${e.name}`,i=l[r]===!0,a=n.map(t=>({project:t,state:g(t.id,e.name)})).filter(e=>e.state!==void 0),o=n.filter(t=>g(t.id,e.name)===void 0);return(0,R.jsxs)(`div`,{className:`rounded border border-neutral-800 bg-neutral-900/40`,children:[(0,R.jsxs)(`div`,{className:`flex items-start gap-3 p-3`,children:[(0,R.jsx)(`span`,{className:`mt-1.5 inline-block h-2.5 w-2.5 rounded-full ${e.effective?`bg-emerald-500`:`bg-neutral-700`}`,title:`Effective for ${t.name}: ${e.effective?`enabled`:`disabled`}`}),(0,R.jsxs)(`div`,{className:`flex-1 space-y-0.5`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[(0,R.jsx)(`span`,{className:`font-mono text-neutral-100`,children:e.name}),(0,R.jsx)(`span`,{className:`rounded bg-neutral-800 px-1.5 py-0.5 text-[10px] uppercase tracking-wider text-neutral-400`,children:e.source}),e.projectOverride!==void 0&&(0,R.jsxs)(`span`,{className:`rounded px-1.5 py-0.5 text-[10px] uppercase tracking-wider ${e.projectOverride===`enabled`?`bg-emerald-900/40 text-emerald-300 light:bg-emerald-100 light:text-emerald-800`:`bg-red-900/40 text-red-300 light:bg-red-100 light:text-red-800`}`,title:`Active project ('${t.name}') has an override`,children:[`Project: `,e.projectOverride]})]}),(0,R.jsx)(`p`,{className:`text-xs text-neutral-400`,children:e.description||`(no description)`}),(0,R.jsx)(`p`,{className:`font-mono text-[10px] text-neutral-600`,children:e.filePath})]}),(0,R.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1 text-xs`,children:[(0,R.jsxs)(`button`,{onClick:()=>void m(e.name,!e.enabled),disabled:d,className:`rounded border px-2 py-0.5 ${e.enabled?`border-emerald-700/50 bg-emerald-900/20 text-emerald-300 light:border-emerald-300 light:bg-emerald-50 light:text-emerald-800`:`border-neutral-700 text-neutral-300 hover:border-neutral-500`}`,title:`Global enable in pi's settings.skills`,children:[`Global: `,e.enabled?`enabled`:`disabled`]}),(0,R.jsx)(`button`,{onClick:()=>u(e=>({...e,[r]:!i})),className:`rounded border border-neutral-700 px-2 py-0.5 text-neutral-300 hover:border-neutral-500`,title:`Show per-project overrides`,children:i?`▾ Overrides`:`▸ Overrides (${a.length})`})]})]}),i&&(0,R.jsxs)(`div`,{className:`border-t border-neutral-800 px-3 py-2`,children:[a.length===0?(0,R.jsx)(`p`,{className:`mb-2 text-[11px] italic text-neutral-500`,children:`No project overrides yet — every project inherits the global state.`}):(0,R.jsx)(`div`,{className:`mb-2 space-y-1`,children:a.map(({project:t,state:n})=>(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-2 rounded bg-neutral-900/60 px-2 py-1 text-xs`,children:[(0,R.jsx)(`span`,{className:`truncate text-neutral-200`,title:t.path,children:t.name}),(0,R.jsx)(nj,{value:n,disabled:d,onChange:n=>void h(t.id,e.name,n)})]},t.id))}),o.length>0&&(0,R.jsx)(rj,{projects:o,disabled:d,onAdd:(t,n)=>void h(t,e.name,n)})]})]},r)})]})}function ej({onError:e}){let t=tr(),n=er(e=>e.projects),r=bA(e=>e.bumpPromptsRefresh),[i,a]=(0,v.useState)(void 0),[o,s]=(0,v.useState)([]),[c,l]=(0,v.useState)({}),[u,d]=(0,v.useState)({}),[f,p]=(0,v.useState)(!1),m=async()=>{if(t!==void 0){e(void 0);try{let[{prompts:e,diagnostics:n},r]=await Promise.all([I.listPrompts(t.id),I.listPromptOverrides()]);a(e),s(n),l(r.projects)}catch(t){e(`Failed to load prompts: ${UA(t)}`)}}};if((0,v.useEffect)(()=>{m()},[t?.id]),t===void 0)return(0,R.jsx)(`p`,{className:`text-xs italic text-neutral-500`,children:`Pick a project from the header to manage its prompts.`});if(i===void 0)return(0,R.jsxs)(`p`,{className:`text-xs italic text-neutral-500`,children:[`Loading prompts for `,t.name,`…`]});let h=async(n,i)=>{p(!0);try{let{prompts:e}=await I.setPromptEnabled(t.id,n,i,`global`);a(e),r()}catch(t){e(`Toggle failed: ${UA(t)}`)}finally{p(!1)}},g=async(t,n,i)=>{p(!0);try{i===void 0?await I.clearPromptProjectOverride(t,n):await I.setPromptEnabled(t,n,i===`enabled`,`project`),await m(),r()}catch(t){e(`Override write failed: ${UA(t)}`)}finally{p(!1)}},_=(e,t)=>{let n=c[e];if(n!==void 0){if(n.enable.includes(t))return`enabled`;if(n.disable.includes(t))return`disabled`}};return(0,R.jsxs)(`div`,{className:`space-y-2`,children:[(0,R.jsxs)(`p`,{className:`text-xs text-neutral-500`,children:[`Pi prompt templates discovered in `,(0,R.jsx)(`code`,{className:`font-mono`,children:`~/.pi/agent/prompts/`}),` `,`and `,(0,R.jsxs)(`code`,{className:`font-mono`,children:[t.path,`/.pi/prompts/`]}),`. Invoke from the chat input via `,(0,R.jsx)(`code`,{className:`font-mono`,children:`/<name>`}),`; the global toggle writes to pi's `,(0,R.jsx)(`code`,{className:`font-mono`,children:`settings.prompts`}),`; per-project overrides write to `,(0,R.jsx)(`code`,{className:`font-mono`,children:"${FORGE_DATA_DIR}/prompts-overrides.json"}),`.`]}),(0,R.jsxs)(`div`,{className:`rounded border border-amber-700/40 bg-amber-900/10 px-3 py-2 text-[11px] text-amber-200 light:border-amber-300 light:bg-amber-50 light:text-amber-800`,children:[`Prompt changes apply to the `,(0,R.jsx)(`strong`,{children:`next session`}),` you start in the affected project. Live sessions keep the prompt set they booted with — start a new session to use a freshly enabled prompt.`]}),o.length>0&&(0,R.jsx)(tj,{diagnostics:o}),i.length===0&&(0,R.jsx)(`p`,{className:`text-xs italic text-neutral-500`,children:`No prompts found for this project.`}),i.map(e=>{let r=`${e.source}:${e.name}`,i=u[r]===!0,a=n.map(t=>({project:t,state:_(t.id,e.name)})).filter(e=>e.state!==void 0),o=n.filter(t=>_(t.id,e.name)===void 0);return(0,R.jsxs)(`div`,{className:`rounded border border-neutral-800 bg-neutral-900/40`,children:[(0,R.jsxs)(`div`,{className:`flex items-start gap-3 p-3`,children:[(0,R.jsx)(`span`,{className:`mt-1.5 inline-block h-2.5 w-2.5 rounded-full ${e.effective?`bg-emerald-500`:`bg-neutral-700`}`,title:`Effective for ${t.name}: ${e.effective?`enabled`:`disabled`}`}),(0,R.jsxs)(`div`,{className:`flex-1 space-y-0.5`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[(0,R.jsxs)(`span`,{className:`font-mono text-neutral-100`,children:[`/`,e.name]}),(0,R.jsx)(`span`,{className:`rounded bg-neutral-800 px-1.5 py-0.5 text-[10px] uppercase tracking-wider text-neutral-400`,children:e.source}),e.argumentHint!==void 0&&(0,R.jsx)(`span`,{className:`rounded bg-neutral-800/60 px-1.5 py-0.5 font-mono text-[10px] text-neutral-300`,title:`Argument hint from the prompt's frontmatter`,children:e.argumentHint}),e.projectOverride!==void 0&&(0,R.jsxs)(`span`,{className:`rounded px-1.5 py-0.5 text-[10px] uppercase tracking-wider ${e.projectOverride===`enabled`?`bg-emerald-900/40 text-emerald-300 light:bg-emerald-100 light:text-emerald-800`:`bg-red-900/40 text-red-300 light:bg-red-100 light:text-red-800`}`,title:`Active project ('${t.name}') has an override`,children:[`Project: `,e.projectOverride]})]}),(0,R.jsx)(`p`,{className:`text-xs text-neutral-400`,children:e.description||`(no description)`}),(0,R.jsx)(`p`,{className:`font-mono text-[10px] text-neutral-600`,children:e.filePath})]}),(0,R.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1 text-xs`,children:[(0,R.jsxs)(`button`,{onClick:()=>void h(e.name,!e.enabled),disabled:f,className:`rounded border px-2 py-0.5 ${e.enabled?`border-emerald-700/50 bg-emerald-900/20 text-emerald-300 light:border-emerald-300 light:bg-emerald-50 light:text-emerald-800`:`border-neutral-700 text-neutral-300 hover:border-neutral-500`}`,title:`Global enable in pi's settings.prompts`,children:[`Global: `,e.enabled?`enabled`:`disabled`]}),(0,R.jsx)(`button`,{onClick:()=>d(e=>({...e,[r]:!i})),className:`rounded border border-neutral-700 px-2 py-0.5 text-neutral-300 hover:border-neutral-500`,title:`Show per-project overrides`,children:i?`▾ Overrides`:`▸ Overrides (${a.length})`})]})]}),i&&(0,R.jsxs)(`div`,{className:`border-t border-neutral-800 px-3 py-2`,children:[a.length===0?(0,R.jsx)(`p`,{className:`mb-2 text-[11px] italic text-neutral-500`,children:`No project overrides yet — every project inherits the global state.`}):(0,R.jsx)(`div`,{className:`mb-2 space-y-1`,children:a.map(({project:t,state:n})=>(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-2 rounded bg-neutral-900/60 px-2 py-1 text-xs`,children:[(0,R.jsx)(`span`,{className:`truncate text-neutral-200`,title:t.path,children:t.name}),(0,R.jsx)(nj,{value:n,disabled:f,onChange:n=>void g(t.id,e.name,n)})]},t.id))}),o.length>0&&(0,R.jsx)(rj,{projects:o,disabled:f,onAdd:(t,n)=>void g(t,e.name,n)})]})]},r)})]})}function tj({diagnostics:e}){return(0,R.jsxs)(`div`,{className:`space-y-1 rounded border border-red-700/40 bg-red-900/10 px-3 py-2 text-[11px] text-red-200`,children:[(0,R.jsxs)(`p`,{className:`font-medium`,children:[e.length,` skill `,e.length===1?`file`:`files`,` were not loaded:`]}),(0,R.jsx)(`ul`,{className:`space-y-1.5`,children:e.map((e,t)=>(0,R.jsxs)(`li`,{className:`border-l-2 border-red-700/60 pl-2`,children:[(0,R.jsxs)(`div`,{className:`text-red-100`,children:[(0,R.jsx)(`span`,{className:`rounded bg-red-900/40 px-1 py-0.5 text-[10px] uppercase tracking-wider text-red-300`,children:e.type}),` `,e.message]}),e.collision!==void 0&&(0,R.jsxs)(`div`,{className:`mt-0.5 font-mono text-[10px] text-red-300/80`,children:[(0,R.jsxs)(`div`,{children:[`loser:\xA0\xA0`,(0,R.jsx)(`span`,{className:`text-red-200`,children:e.collision.loserPath})]}),(0,R.jsxs)(`div`,{children:[`winner:\xA0`,(0,R.jsx)(`span`,{className:`text-red-200`,children:e.collision.winnerPath})]}),(0,R.jsxs)(`div`,{className:`mt-1 text-red-300/70`,children:[`Add `,(0,R.jsxs)(`code`,{className:`rounded bg-red-900/40 px-1`,children:[`name: `,`<unique>`]}),` to the loser's frontmatter, or move it to`,` `,(0,R.jsx)(`code`,{className:`rounded bg-red-900/40 px-1`,children:`<unique>/SKILL.md`}),` so the parent dir name disambiguates.`]})]}),e.collision===void 0&&e.path!==void 0&&(0,R.jsx)(`div`,{className:`mt-0.5 font-mono text-[10px] text-red-300/80`,children:e.path})]},t))})]})}function nj({value:e,disabled:t,onChange:n}){let r=(e,r,i)=>(0,R.jsx)(`button`,{onClick:()=>n(r),disabled:t,className:`rounded px-2 py-0.5 text-[11px] ${i?r===`enabled`?`bg-emerald-900/40 text-emerald-300 light:bg-emerald-100 light:text-emerald-800`:r===`disabled`?`bg-red-900/40 text-red-300 light:bg-red-100 light:text-red-800`:`bg-neutral-800 text-neutral-400`:`text-neutral-500 hover:bg-neutral-800 hover:text-neutral-300`}`,children:e});return(0,R.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5 rounded border border-neutral-700 px-0.5`,children:[r(`Inherit`,void 0,e===void 0),r(`Enabled`,`enabled`,e===`enabled`),r(`Disabled`,`disabled`,e===`disabled`)]})}function rj({projects:e,disabled:t,onAdd:n}){let[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(``);return r?(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1 text-[11px]`,children:[(0,R.jsxs)(`select`,{value:a,onChange:e=>o(e.target.value),className:`rounded border border-neutral-700 bg-neutral-950 px-2 py-0.5 text-neutral-100 outline-none focus:border-neutral-500`,children:[(0,R.jsx)(`option`,{value:``,children:`Pick project…`}),e.map(e=>(0,R.jsx)(`option`,{value:e.id,children:e.name},e.id))]}),(0,R.jsx)(`button`,{onClick:()=>{a.length!==0&&(n(a,`enabled`),i(!1),o(``))},disabled:t||a.length===0,className:`rounded bg-emerald-900/40 px-2 py-0.5 text-emerald-300 disabled:opacity-50 light:bg-emerald-100 light:text-emerald-800`,children:`Enable here`}),(0,R.jsx)(`button`,{onClick:()=>{a.length!==0&&(n(a,`disabled`),i(!1),o(``))},disabled:t||a.length===0,className:`rounded bg-red-900/40 px-2 py-0.5 text-red-300 disabled:opacity-50`,children:`Disable here`}),(0,R.jsx)(`button`,{onClick:()=>{i(!1),o(``)},className:`rounded border border-neutral-700 px-2 py-0.5 text-neutral-400 hover:border-neutral-500`,children:`Cancel`})]}):(0,R.jsx)(`button`,{onClick:()=>i(!0),disabled:t,className:`rounded border border-neutral-700 px-2 py-0.5 text-[11px] text-neutral-300 hover:border-neutral-500`,children:`+ Add override for…`})}function ij({onError:e}){let t=er(e=>e.projects),[n,r]=(0,v.useState)(void 0),[i,a]=(0,v.useState)({}),[o,s]=(0,v.useState)(!1),c=async()=>{e(void 0);try{let[e,t]=await Promise.all([I.listTools(),I.listToolOverrides()]);r(e),a(t.projects)}catch(t){e(`Failed to load tools: ${UA(t)}`)}};(0,v.useEffect)(()=>{c()},[]);let l=async(t,n,r)=>{s(!0);try{await I.setToolEnabled(t,n,r,`global`),await c()}catch(t){e(`Toggle failed: ${UA(t)}`)}finally{s(!1)}},u=async(t,n,r,i)=>{s(!0);try{i===void 0?await I.clearToolProjectOverride(t,r,n):await I.setToolEnabled(t,r,i===`enabled`,`project`,n),await c()}catch(t){e(`Override write failed: ${UA(t)}`)}finally{s(!1)}};return n===void 0?(0,R.jsx)(`p`,{className:`text-xs italic text-neutral-500`,children:`Loading tools…`}):(0,R.jsxs)(`div`,{className:`space-y-4`,children:[(0,R.jsxs)(`p`,{className:`text-xs text-neutral-500`,children:[`Toggle individual built-in tools the agent can call. The global toggle on the right is the default for every project. Use `,(0,R.jsx)(`strong`,{children:`Overrides`}),` to enable/disable a tool per project — explicit project overrides win over the global default. Changes apply to the next session — already-running sessions keep the tool set they started with. MCP server tools live under their respective server in the `,(0,R.jsx)(`strong`,{children:`MCP`}),` tab.`]}),(0,R.jsxs)(`section`,{children:[(0,R.jsx)(`h3`,{className:`mb-2 text-xs font-semibold uppercase tracking-wider text-neutral-400`,children:`Built-in tools`}),(0,R.jsx)(`div`,{className:`space-y-2`,children:n.builtin.map(e=>(0,R.jsx)(aj,{family:`builtin`,name:e.name,fqn:e.name,description:e.description,globalEnabled:e.globalEnabled,projects:t,allOverrides:i,busy:o,onToggleGlobal:t=>void l(`builtin`,e.name,t),onSetProjectOverride:(t,n)=>void u(`builtin`,t,e.name,n)},`builtin:${e.name}`))})]}),n.extension.length>0&&(0,R.jsxs)(`section`,{children:[(0,R.jsx)(`h3`,{className:`mb-2 text-xs font-semibold uppercase tracking-wider text-neutral-400`,children:`Extension tools`}),(0,R.jsxs)(`p`,{className:`mb-2 text-[11px] text-neutral-500`,children:[`Tools registered programmatically by pi extensions installed under`,` `,(0,R.jsx)(`code`,{className:`font-mono`,children:`~/.pi/agent/extensions/`}),` or a project's`,` `,(0,R.jsx)(`code`,{className:`font-mono`,children:`.pi/extensions/`}),`. Disabled tools are dropped from the allowlist passed to the next session — the extension itself remains loaded.`]}),(0,R.jsx)(`div`,{className:`space-y-4`,children:n.extension.map(e=>(0,R.jsxs)(`div`,{className:`space-y-2`,children:[(0,R.jsxs)(`div`,{className:`text-[11px] font-semibold text-neutral-300`,children:[`Package: `,(0,R.jsx)(`code`,{className:`font-mono text-neutral-400`,children:e.packageSource})]}),(0,R.jsx)(`div`,{className:`space-y-2`,children:e.tools.map(n=>(0,R.jsx)(aj,{family:`extension`,name:n.name,fqn:n.name,description:n.description,globalEnabled:n.globalEnabled,projects:t,allOverrides:i,busy:o,onToggleGlobal:e=>void l(`extension`,n.name,e),onSetProjectOverride:(e,t)=>void u(`extension`,e,n.name,t)},`extension:${e.packageSource}:${n.name}`))})]},e.packageSource))})]})]})}function aj({family:e,name:t,fqn:n,description:r,globalEnabled:i,projects:a,allOverrides:o,busy:s,onToggleGlobal:c,onSetProjectOverride:l}){let[u,d]=(0,v.useState)(!1),f=t=>{let r=o[t];if(r===void 0)return;let i=e===`builtin`?r.builtin:e===`mcp`?r.mcp:r.extension;if(i!==void 0){if(i.enable.includes(n))return`enabled`;if(i.disable.includes(n))return`disabled`}},p=a.map(e=>({project:e,state:f(e.id)})).filter(e=>e.state!==void 0),m=a.filter(e=>f(e.id)===void 0);return(0,R.jsxs)(`div`,{className:`rounded border border-neutral-800 bg-neutral-900/40`,children:[(0,R.jsxs)(`div`,{className:`flex items-start gap-3 p-3`,children:[(0,R.jsx)(`span`,{className:`mt-1.5 inline-block h-2.5 w-2.5 rounded-full ${i?`bg-emerald-500`:`bg-neutral-700`}`,title:`Global default: ${i?`enabled`:`disabled`}`}),(0,R.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-0.5`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[(0,R.jsx)(`span`,{className:`font-mono text-neutral-100`,children:t}),n!==t&&(0,R.jsx)(`span`,{className:`font-mono text-[10px] text-neutral-500`,title:`Bridged tool name pi sees on the wire`,children:n})]}),r.length>0&&(0,R.jsx)(`p`,{className:`line-clamp-2 text-[11px] text-neutral-500`,title:r,children:r})]}),(0,R.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1 text-xs`,children:[(0,R.jsxs)(`button`,{onClick:()=>c(!i),disabled:s,className:`rounded border px-2 py-0.5 disabled:opacity-50 ${i?`border-emerald-700/50 bg-emerald-900/20 text-emerald-300 light:border-emerald-300 light:bg-emerald-50 light:text-emerald-800`:`border-neutral-700 text-neutral-300 hover:border-neutral-500`}`,title:`Global default for every project that doesn't override`,children:[`Global: `,i?`enabled`:`disabled`]}),(0,R.jsx)(`button`,{onClick:()=>d(e=>!e),className:`rounded border border-neutral-700 px-2 py-0.5 text-neutral-300 hover:border-neutral-500`,title:`Show per-project overrides`,children:u?`▾ Overrides`:`▸ Overrides (${p.length})`})]})]}),u&&(0,R.jsxs)(`div`,{className:`border-t border-neutral-800 px-3 py-2`,children:[p.length===0?(0,R.jsx)(`p`,{className:`mb-2 text-[11px] italic text-neutral-500`,children:`No project overrides yet — every project inherits the global state.`}):(0,R.jsx)(`div`,{className:`mb-2 space-y-1`,children:p.map(({project:e,state:t})=>(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-2 rounded bg-neutral-900/60 px-2 py-1 text-xs`,children:[(0,R.jsx)(`span`,{className:`truncate text-neutral-200`,title:e.path,children:e.name}),(0,R.jsx)(nj,{value:t,disabled:s,onChange:t=>l(e.id,t)})]},e.id))}),m.length>0&&(0,R.jsx)(rj,{projects:m,disabled:s,onAdd:(e,t)=>l(e,t)}),a.length===0&&(0,R.jsx)(`p`,{className:`text-[11px] italic text-neutral-500`,children:`No projects exist yet. Create a project first to add per-project overrides.`})]})]})}function oj({onError:e}){let t=tr(),[n,r]=(0,v.useState)(void 0),[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(2e4),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(void 0);if((0,v.useEffect)(()=>{if(t===void 0){r(void 0),a(``);return}let n=!1;return e(void 0),(async()=>{try{let e=await I.getProjectSystemPrompt(t.id);if(n)return;r(e.addendum),a(e.addendum),s(e.maxBytes)}catch(t){if(n)return;e(`Failed to load system prompt: ${UA(t)}`)}})(),()=>{n=!0}},[t?.id]),t===void 0)return(0,R.jsx)(`p`,{className:`text-xs italic text-neutral-500`,children:`Pick a project from the header to edit its system prompt addendum.`});if(n===void 0)return(0,R.jsxs)(`p`,{className:`text-xs italic text-neutral-500`,children:[`Loading system prompt for `,t.name,`…`]});let f=new Blob([i]).size,p=f>o,m=i!==n,h=async()=>{if(!p){l(!0),d(void 0),e(void 0);try{let e=await I.setProjectSystemPrompt(t.id,i);r(e.addendum),a(e.addendum),s(e.maxBytes),d(`Saved. Applies to the next session you start in this project.`),window.setTimeout(()=>d(void 0),4e3)}catch(t){e(`Save failed: ${UA(t)}`)}finally{l(!1)}}},g=async()=>{if(confirm(`Clear the system prompt addendum for "${t.name}"?`)){l(!0),d(void 0),e(void 0);try{let e=await I.setProjectSystemPrompt(t.id,``);r(e.addendum),a(e.addendum),s(e.maxBytes),d(`Cleared. Applies to the next session you start in this project.`),window.setTimeout(()=>d(void 0),4e3)}catch(t){e(`Clear failed: ${UA(t)}`)}finally{l(!1)}}};return(0,R.jsxs)(`div`,{className:`space-y-3`,children:[(0,R.jsxs)(`div`,{className:`space-y-1 text-xs text-neutral-400`,children:[(0,R.jsxs)(`p`,{children:[`Free-form text appended to the agent's base system prompt for sessions in`,` `,(0,R.jsx)(`strong`,{className:`text-neutral-200`,children:t.name}),`. Use this to layer project-specific behavior on top of pi's defaults — coding conventions, domain context, persona, etc.`]}),(0,R.jsxs)(`p`,{className:`text-[11px]`,children:[`Append-only — the base prompt (which defines the tool-calling protocol) is not editable. Changes apply to the `,(0,R.jsx)(`strong`,{children:`next session`}),` you start in this project; running sessions keep the prompt they were built with.`]})]}),(0,R.jsx)(`textarea`,{value:i,onChange:e=>a(e.target.value),disabled:c,rows:14,spellCheck:!1,placeholder:"e.g. This project uses TypeScript strict mode and never uses default exports. Always run `npm run check` before declaring a task complete.",className:`w-full resize-y rounded border border-neutral-800 bg-neutral-900 px-3 py-2 font-mono text-xs leading-relaxed text-neutral-100 placeholder:text-neutral-600 focus:border-neutral-600 focus:outline-none disabled:opacity-50`}),(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2 text-[11px]`,children:[(0,R.jsxs)(`span`,{className:p?`text-red-400`:`text-neutral-500`,children:[f.toLocaleString(),` / `,o.toLocaleString(),` bytes`,p&&` — too long, please trim before saving`]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[u!==void 0&&(0,R.jsx)(`span`,{className:`text-green-400`,children:u}),m&&(0,R.jsx)(`button`,{type:`button`,onClick:()=>a(n),disabled:c,className:`rounded border border-neutral-800 px-3 py-1 text-xs text-neutral-300 hover:border-neutral-600 disabled:opacity-50`,children:`Revert`}),n.length>0&&(0,R.jsx)(`button`,{type:`button`,onClick:()=>void g(),disabled:c,className:`rounded border border-neutral-800 px-3 py-1 text-xs text-neutral-300 hover:border-red-500 hover:text-red-300 disabled:opacity-50`,children:`Clear`}),(0,R.jsx)(`button`,{type:`button`,onClick:()=>void h(),disabled:c||p||!m,className:`rounded bg-neutral-100 px-3 py-1 text-xs font-medium text-neutral-900 hover:bg-white disabled:opacity-50`,children:c?`Saving…`:`Save`})]})]})]})}function sj(e){return{name:``,kind:e,enabled:!0,command:``,timeoutSec:`30`,text:``,mode:`send`}}function cj({onError:e}){let t=Zr(e=>e.minimal),n=Qr(e=>e.loaded),r=Qr(e=>e.actions),i=Qr(e=>e.load),a=Qr(e=>e.create),o=Qr(e=>e.update),s=Qr(e=>e.remove),[c,l]=(0,v.useState)(void 0),[u,d]=(0,v.useState)(void 0),[f,p]=(0,v.useState)(!1);(0,v.useEffect)(()=>{e(void 0),n||i()},[i,n,e]);let m=e=>{let t=typeof e.command==`string`&&e.command.length>0;l({id:e.id,name:e.name,kind:t?`command`:`prompt`,enabled:e.enabled!==!1,command:e.command??``,timeoutSec:String(Math.round((e.timeoutMs??3e4)/1e3)),text:e.text??``,mode:e.mode??`send`})},h=async()=>{if(c===void 0)return;let t=c.name.trim();if(t.length===0){e(`Name is required`);return}let n={name:t,enabled:c.enabled};if(c.kind===`command`){let t=c.command.trim();if(t.length===0){e(`Command is required`);return}n.command=t;let r=Number.parseInt(c.timeoutSec,10);Number.isFinite(r)&&r>0&&(n.timeoutMs=r*1e3)}else{let t=c.text.trim();if(t.length===0){e(`Prompt text is required`);return}n.text=t,n.mode=c.mode}p(!0);try{c.id===void 0?await a(n):await o(c.id,n),l(void 0),e(void 0)}catch(t){e(`Save failed: ${UA(t)}`)}finally{p(!1)}},g=async t=>{p(!0);try{await s(t),d(void 0),c?.id===t&&l(void 0)}catch(t){e(`Delete failed: ${UA(t)}`)}finally{p(!1)}};return(0,R.jsxs)(`div`,{className:`space-y-4`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h2`,{className:`text-sm font-semibold text-neutral-100 light:text-neutral-900`,children:`Quick action chips`}),(0,R.jsxs)(`p`,{className:`mt-1 text-xs text-neutral-400 light:text-neutral-600`,children:[`One-click buttons on the chat toolbar. Two kinds:`,` `,(0,R.jsx)(`span`,{className:`text-amber-400 light:text-amber-700`,children:`command`}),` chips run a shell snippet in the active project's folder;`,` `,(0,R.jsx)(`span`,{className:`text-sky-400 light:text-sky-700`,children:`prompt`}),` chips either send a templated prompt to the agent or insert it into the composer so you can tweak it before sending. Chips are stored globally (not per-project) — they're your personal toolbox.`]})]}),t&&(0,R.jsx)(`div`,{className:`rounded border border-amber-700/40 bg-amber-900/20 px-3 py-2 text-xs text-amber-200 light:border-amber-300 light:bg-amber-50 light:text-amber-800`,children:`MINIMAL_UI is enabled. Command chips are listed below but are hidden from the toolbar and the server refuses to run them. Prompt chips are unaffected.`}),(0,R.jsxs)(`div`,{className:`space-y-1`,children:[r.length===0&&n&&(0,R.jsx)(`p`,{className:`text-xs italic text-neutral-500 light:text-neutral-600`,children:`No chips defined yet. Click “New” below to add one.`}),r.map(e=>{let n=typeof e.command==`string`&&e.command.length>0,r=t&&n;return(0,R.jsxs)(`div`,{className:`flex items-center gap-2 rounded border border-neutral-800 bg-neutral-900/40 px-3 py-2 text-xs light:border-neutral-300 light:bg-neutral-50 ${e.enabled===!1?`opacity-60`:``}`,children:[(0,R.jsx)(`span`,{className:`rounded px-1.5 py-0.5 text-[10px] uppercase tracking-wider ${n?`bg-amber-900/40 text-amber-300 light:bg-amber-100 light:text-amber-900`:`bg-sky-900/40 text-sky-300 light:bg-sky-100 light:text-sky-900`}`,children:n?`cmd`:`prompt`}),(0,R.jsx)(`span`,{className:`flex-1 truncate font-medium text-neutral-200 light:text-neutral-900`,children:e.name}),e.enabled===!1&&(0,R.jsx)(`span`,{className:`text-[10px] uppercase tracking-wider text-neutral-500`,children:`disabled`}),r&&(0,R.jsx)(`span`,{className:`text-[10px] uppercase tracking-wider text-amber-400 light:text-amber-700`,children:`hidden by MINIMAL_UI`}),(0,R.jsx)(`button`,{onClick:()=>m(e),className:`rounded border border-neutral-700 px-2 py-0.5 text-[11px] text-neutral-300 hover:border-neutral-500 light:border-neutral-400 light:text-neutral-700`,children:`Edit`}),u===e.id?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`button`,{onClick:()=>void g(e.id),disabled:f,className:`rounded border border-red-700 px-2 py-0.5 text-[11px] text-red-300 hover:bg-red-900/40 light:border-red-400 light:text-red-700`,children:`Confirm`}),(0,R.jsx)(`button`,{onClick:()=>d(void 0),className:`rounded border border-neutral-700 px-2 py-0.5 text-[11px] text-neutral-400 hover:border-neutral-500 light:border-neutral-400 light:text-neutral-600`,children:`Cancel`})]}):(0,R.jsx)(`button`,{onClick:()=>d(e.id),className:`rounded border border-neutral-700 px-2 py-0.5 text-[11px] text-neutral-400 hover:border-red-500 hover:text-red-300 light:border-neutral-400 light:text-neutral-600`,children:`Delete`})]},e.id)})]}),c===void 0&&(0,R.jsx)(`button`,{onClick:()=>l(sj(`prompt`)),className:`rounded border border-neutral-700 px-3 py-1 text-xs text-neutral-200 hover:border-neutral-500 light:border-neutral-400 light:text-neutral-800`,children:`+ New chip`}),c!==void 0&&(0,R.jsxs)(`div`,{className:`space-y-3 rounded border border-neutral-700 bg-neutral-900/60 p-3 light:border-neutral-300 light:bg-white`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`label`,{className:`mb-1 block text-[11px] uppercase tracking-wider text-neutral-400 light:text-neutral-600`,children:`Name`}),(0,R.jsx)(`input`,{value:c.name,onChange:e=>l({...c,name:e.target.value}),placeholder:`e.g. Run tests`,className:`w-full rounded border border-neutral-700 bg-neutral-950 px-2 py-1 text-sm text-neutral-100 light:border-neutral-300 light:bg-white light:text-neutral-900`})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`label`,{className:`mb-1 block text-[11px] uppercase tracking-wider text-neutral-400 light:text-neutral-600`,children:`Kind`}),(0,R.jsxs)(`div`,{className:`flex items-center gap-3 text-xs text-neutral-300 light:text-neutral-800`,children:[(0,R.jsxs)(`label`,{className:`flex items-center gap-1.5`,children:[(0,R.jsx)(`input`,{type:`radio`,checked:c.kind===`prompt`,onChange:()=>l({...c,kind:`prompt`})}),`Prompt`]}),(0,R.jsxs)(`label`,{className:`flex items-center gap-1.5 ${t?`opacity-50`:``}`,title:t?`Command chips are disabled by MINIMAL_UI. The server refuses to run them.`:void 0,children:[(0,R.jsx)(`input`,{type:`radio`,checked:c.kind===`command`,disabled:t,onChange:()=>l({...c,kind:`command`})}),`Command`,t?` (disabled by MINIMAL_UI)`:``]})]})]}),c.kind===`command`?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`label`,{className:`mb-1 block text-[11px] uppercase tracking-wider text-neutral-400 light:text-neutral-600`,children:`Command`}),(0,R.jsx)(`textarea`,{value:c.command,onChange:e=>l({...c,command:e.target.value}),rows:3,placeholder:`npm test`,className:`w-full rounded border border-neutral-700 bg-neutral-950 px-2 py-1 font-mono text-xs text-neutral-100 light:border-neutral-300 light:bg-white light:text-neutral-900`}),(0,R.jsxs)(`p`,{className:`mt-1 text-[11px] text-neutral-500 light:text-neutral-600`,children:[`Runs in the active project's folder via `,(0,R.jsx)(`code`,{children:`/bin/sh -c`}),`. Multi-line is fine (`,(0,R.jsx)(`code`,{children:`&&`}),`, `,(0,R.jsx)(`code`,{children:`;`}),`, etc.). Environment is scrubbed of pi-forge and provider secrets (same as the integrated terminal).`]})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`label`,{className:`mb-1 block text-[11px] uppercase tracking-wider text-neutral-400 light:text-neutral-600`,children:`Timeout (seconds)`}),(0,R.jsx)(`input`,{value:c.timeoutSec,onChange:e=>l({...c,timeoutSec:e.target.value}),placeholder:`30`,className:`w-24 rounded border border-neutral-700 bg-neutral-950 px-2 py-1 text-sm text-neutral-100 light:border-neutral-300 light:bg-white light:text-neutral-900`}),(0,R.jsx)(`p`,{className:`mt-1 text-[11px] text-neutral-500 light:text-neutral-600`,children:`Max 300 (five minutes). Past that, use the integrated terminal.`})]})]}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`label`,{className:`mb-1 block text-[11px] uppercase tracking-wider text-neutral-400 light:text-neutral-600`,children:`Prompt text`}),(0,R.jsx)(`textarea`,{value:c.text,onChange:e=>l({...c,text:e.target.value}),rows:4,placeholder:`Review the staged changes for security issues.`,className:`w-full rounded border border-neutral-700 bg-neutral-950 px-2 py-1 text-xs text-neutral-100 light:border-neutral-300 light:bg-white light:text-neutral-900`})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`label`,{className:`mb-1 block text-[11px] uppercase tracking-wider text-neutral-400 light:text-neutral-600`,children:`Mode`}),(0,R.jsxs)(`div`,{className:`flex items-center gap-3 text-xs text-neutral-300 light:text-neutral-800`,children:[(0,R.jsxs)(`label`,{className:`flex items-center gap-1.5`,children:[(0,R.jsx)(`input`,{type:`radio`,checked:c.mode===`send`,onChange:()=>l({...c,mode:`send`})}),`Send immediately`]}),(0,R.jsxs)(`label`,{className:`flex items-center gap-1.5`,children:[(0,R.jsx)(`input`,{type:`radio`,checked:c.mode===`insert`,onChange:()=>l({...c,mode:`insert`})}),`Insert into composer`]})]})]})]}),(0,R.jsx)(`div`,{children:(0,R.jsxs)(`label`,{className:`flex items-center gap-1.5 text-xs text-neutral-300 light:text-neutral-800`,children:[(0,R.jsx)(`input`,{type:`checkbox`,checked:c.enabled,onChange:e=>l({...c,enabled:e.target.checked})}),`Enabled (visible in the menu)`]})}),(0,R.jsxs)(`div`,{className:`flex items-center gap-2 border-t border-neutral-800 pt-3 light:border-neutral-300`,children:[(0,R.jsx)(`button`,{onClick:()=>void h(),disabled:f,className:`rounded bg-emerald-700 px-3 py-1 text-xs text-white hover:bg-emerald-600 disabled:opacity-50`,children:c.id===void 0?`Create`:`Save`}),(0,R.jsx)(`button`,{onClick:()=>l(void 0),className:`rounded border border-neutral-700 px-3 py-1 text-xs text-neutral-300 hover:border-neutral-500 light:border-neutral-400 light:text-neutral-700`,children:`Cancel`})]})]})]})}function lj(){let e=US(e=>e.theme),t=US(e=>e.setTheme);return(0,R.jsxs)(`div`,{className:`space-y-4`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h2`,{className:`text-sm font-semibold text-neutral-100`,children:`Theme`}),(0,R.jsx)(`p`,{className:`mt-1 text-xs text-neutral-400`,children:`Sets the color palette for the chrome, editor, and terminal. Persisted in this browser only — open in another browser to use a different theme there.`})]}),(0,R.jsx)(`div`,{className:`grid grid-cols-1 gap-2 sm:grid-cols-2`,children:PS.map(n=>(0,R.jsxs)(`button`,{onClick:()=>t(n.id),className:`flex items-center justify-between gap-3 rounded border px-3 py-2 text-left ${n.id===e?`border-neutral-400 bg-neutral-800`:`border-neutral-700 hover:border-neutral-500`}`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`div`,{className:`text-sm text-neutral-100`,children:n.label}),(0,R.jsx)(`div`,{className:`text-[10px] uppercase tracking-wider text-neutral-500`,children:n.mode})]}),(0,R.jsx)(uj,{id:n.id})]},n.id))})]})}function uj({id:e}){return(0,R.jsxs)(`div`,{"data-theme":e,className:`flex h-6 overflow-hidden rounded border border-neutral-700`,children:[(0,R.jsx)(`div`,{className:`w-4 bg-neutral-950`}),(0,R.jsx)(`div`,{className:`w-4 bg-neutral-800`}),(0,R.jsx)(`div`,{className:`w-4 bg-neutral-500`}),(0,R.jsx)(`div`,{className:`w-4 bg-neutral-200`})]})}function dj({onError:e}){let[t,n]=(0,v.useState)(!1),[r,i]=(0,v.useState)(void 0),[a,o]=(0,v.useState)(void 0),s=(0,v.useRef)(null),[c,l]=(0,v.useState)(void 0),[u,d]=(0,v.useState)(void 0),f=(0,v.useRef)(null),p=(0,v.useRef)(null),m=async()=>{e(void 0),n(!0),o(void 0);try{let{blob:e,filename:t,files:n}=await I.exportConfig(),r=URL.createObjectURL(e),a=document.createElement(`a`);a.href=r,a.download=t,document.body.appendChild(a),a.click(),document.body.removeChild(a),requestAnimationFrame(()=>URL.revokeObjectURL(r)),i({filename:t,files:n})}catch(t){e(`Export failed: ${UA(t)}`)}finally{n(!1)}},h=async t=>{e(void 0),n(!0),i(void 0);try{o(await I.importConfig(t))}catch(t){e(`Import failed: ${UA(t)}`)}finally{n(!1),s.current&&(s.current.value=``)}},g=(e,t)=>{let n=URL.createObjectURL(e),r=document.createElement(`a`);r.href=n,r.download=t,document.body.appendChild(r),r.click(),document.body.removeChild(r),requestAnimationFrame(()=>URL.revokeObjectURL(n))},_=async()=>{e(void 0),n(!0),d(void 0),l(void 0);try{let{blob:e,filename:t,fileCount:n}=await I.exportSkills();g(e,t),l({filename:t,fileCount:n})}catch(t){t instanceof M&&t.code===`skills_directory_empty`?l({filename:``,fileCount:0}):e(`Skills export failed: ${UA(t)}`)}finally{n(!1)}},y=async t=>{if(t.length!==0){e(void 0),n(!0),l(void 0);try{d(await I.importSkills(t))}catch(t){e(`Skills import failed: ${UA(t)}`)}finally{n(!1),f.current&&(f.current.value=``),p.current&&(p.current.value=``)}}};return(0,R.jsxs)(`div`,{className:`space-y-6`,children:[(0,R.jsxs)(`section`,{children:[(0,R.jsx)(`h3`,{className:`mb-2 text-sm font-medium text-neutral-100`,children:`Export config`}),(0,R.jsxs)(`p`,{className:`mb-3 text-xs text-neutral-400`,children:[`Downloads a `,(0,R.jsx)(`code`,{className:`font-mono`,children:`.tar.gz`}),` with`,` `,(0,R.jsx)(`code`,{className:`font-mono`,children:`mcp.json`}),`,`,` `,(0,R.jsx)(`code`,{className:`font-mono`,children:`settings.json`}),`,`,` `,(0,R.jsx)(`code`,{className:`font-mono`,children:`models.json`}),`,`,` `,(0,R.jsx)(`code`,{className:`font-mono`,children:`skills-overrides.json`}),`, and`,` `,(0,R.jsx)(`code`,{className:`font-mono`,children:`tool-overrides.json`}),`. Provider auth (`,(0,R.jsx)(`code`,{className:`font-mono`,children:`auth.json`}),` — API keys, OAuth tokens) is`,` `,(0,R.jsx)(`strong`,{children:`not`}),` included; re-authenticate providers after restoring on a new install.`]}),(0,R.jsx)(`button`,{onClick:()=>void m(),disabled:t,className:`rounded border border-neutral-700 bg-neutral-900 px-3 py-1.5 text-xs text-neutral-100 hover:border-neutral-500 disabled:opacity-50`,children:t?`Exporting…`:`Download config archive`}),r!==void 0&&(0,R.jsxs)(`p`,{className:`mt-2 text-xs text-emerald-400 light:text-emerald-700`,children:[`Exported `,(0,R.jsx)(`code`,{className:`font-mono`,children:r.filename}),` (`,r.files.length===0?`no files were on disk`:`included: ${r.files.join(`, `)}`,`)`]})]}),(0,R.jsxs)(`section`,{children:[(0,R.jsx)(`h3`,{className:`mb-2 text-sm font-medium text-neutral-100`,children:`Import config`}),(0,R.jsxs)(`p`,{className:`mb-3 text-xs text-neutral-400`,children:[`Restores a previously-exported archive. Each file is parsed before any disk write — if any file fails validation, `,(0,R.jsx)(`strong`,{children:`nothing`}),` is imported. Existing live agent sessions keep their original settings until restarted.`]}),(0,R.jsx)(`input`,{ref:s,type:`file`,accept:`.gz,.tgz,application/gzip,application/x-gzip`,disabled:t,onChange:e=>{let t=e.target.files?.[0];t!==void 0&&h(t)},className:`block text-xs text-neutral-300 file:mr-3 file:rounded file:border file:border-neutral-700 file:bg-neutral-900 file:px-3 file:py-1.5 file:text-xs file:text-neutral-100 hover:file:border-neutral-500 disabled:opacity-50`}),a!==void 0&&(0,R.jsxs)(`div`,{className:`mt-3 space-y-1 text-xs`,children:[a.imported.length>0&&(0,R.jsxs)(`p`,{className:`text-emerald-400 light:text-emerald-700`,children:[`Imported: `,(0,R.jsx)(`code`,{className:`font-mono`,children:a.imported.join(`, `)})]}),a.skipped.length>0&&(0,R.jsxs)(`p`,{className:`text-amber-400 light:text-amber-700`,children:[`Skipped (not in allow-list):`,` `,(0,R.jsx)(`code`,{className:`font-mono`,children:a.skipped.join(`, `)})]}),a.errors.length>0&&(0,R.jsxs)(`div`,{className:`text-red-400`,children:[(0,R.jsx)(`p`,{children:`Errors — nothing was written:`}),(0,R.jsx)(`ul`,{className:`ml-4 list-disc`,children:a.errors.map(e=>(0,R.jsxs)(`li`,{children:[(0,R.jsx)(`code`,{className:`font-mono`,children:e.file}),`: `,e.reason]},e.file))})]}),a.imported.length===0&&a.errors.length===0&&a.skipped.length===0&&(0,R.jsx)(`p`,{className:`italic text-neutral-500`,children:`Archive was empty.`})]})]}),(0,R.jsxs)(`section`,{children:[(0,R.jsx)(`h3`,{className:`mb-2 text-sm font-medium text-neutral-100`,children:`Export skills`}),(0,R.jsxs)(`p`,{className:`mb-3 text-xs text-neutral-400`,children:[`Downloads a `,(0,R.jsx)(`code`,{className:`font-mono`,children:`.tar.gz`}),` of every file under`,` `,(0,R.jsx)(`code`,{className:`font-mono`,children:`~/.pi/agent/skills/`}),` — both single-file (`,(0,R.jsx)(`code`,{className:`font-mono`,children:`<name>.md`}),`) and directory skills (`,(0,R.jsx)(`code`,{className:`font-mono`,children:`<name>/SKILL.md`}),` + assets) round-trip verbatim.`]}),(0,R.jsx)(`button`,{onClick:()=>void _(),disabled:t,className:`rounded border border-neutral-700 bg-neutral-900 px-3 py-1.5 text-xs text-neutral-100 hover:border-neutral-500 disabled:opacity-50`,children:t?`Working…`:`Download skills archive`}),c!==void 0&&(c.fileCount===0?(0,R.jsx)(`p`,{className:`mt-2 text-xs text-neutral-400`,children:`No skills to export — your skills directory is empty.`}):(0,R.jsxs)(`p`,{className:`mt-2 text-xs text-emerald-400 light:text-emerald-700`,children:[`Exported `,(0,R.jsx)(`code`,{className:`font-mono`,children:c.filename}),` (`,c.fileCount,` file`,c.fileCount===1?``:`s`,` packed)`]}))]}),(0,R.jsxs)(`section`,{children:[(0,R.jsx)(`h3`,{className:`mb-2 text-sm font-medium text-neutral-100`,children:`Import skills`}),(0,R.jsxs)(`p`,{className:`mb-3 text-xs text-neutral-400`,children:[`Restore skills from a previously-exported `,(0,R.jsx)(`code`,{className:`font-mono`,children:`.tar.gz`}),`, OR upload a folder of skill files directly. Existing files at the same path are`,` `,(0,R.jsx)(`strong`,{children:`overwritten`}),`; new files are added. Path traversal and absolute paths are rejected.`]}),(0,R.jsxs)(`div`,{className:`space-y-3`,children:[(0,R.jsxs)(`label`,{className:`block space-y-1`,children:[(0,R.jsx)(`span`,{className:`text-[11px] uppercase tracking-wider text-neutral-500`,children:`From tar.gz`}),(0,R.jsx)(`input`,{ref:f,type:`file`,accept:`.gz,.tgz,application/gzip,application/x-gzip`,disabled:t,onChange:e=>{let t=e.target.files?.[0];t!==void 0&&y([t])},className:`block text-xs text-neutral-300 file:mr-3 file:rounded file:border file:border-neutral-700 file:bg-neutral-900 file:px-3 file:py-1.5 file:text-xs file:text-neutral-100 hover:file:border-neutral-500 disabled:opacity-50`})]}),(0,R.jsxs)(`label`,{className:`block space-y-1`,children:[(0,R.jsx)(`span`,{className:`text-[11px] uppercase tracking-wider text-neutral-500`,children:`From folder (Chromium / WebKit only)`}),(0,R.jsx)(`input`,{ref:p,type:`file`,multiple:!0,webkitdirectory:``,disabled:t,onChange:e=>{let t=e.target.files;t===null||t.length===0||y(Array.from(t))},className:`block text-xs text-neutral-300 file:mr-3 file:rounded file:border file:border-neutral-700 file:bg-neutral-900 file:px-3 file:py-1.5 file:text-xs file:text-neutral-100 hover:file:border-neutral-500 disabled:opacity-50`})]})]}),u!==void 0&&(0,R.jsxs)(`div`,{className:`mt-3 space-y-1 text-xs`,children:[u.imported.length>0&&(0,R.jsxs)(`p`,{className:`text-emerald-400 light:text-emerald-700`,children:[`Imported `,u.imported.length,` file`,u.imported.length===1?``:`s`,`:`,` `,(0,R.jsx)(`code`,{className:`font-mono`,children:u.imported.join(`, `)})]}),u.skipped.length>0&&(0,R.jsxs)(`div`,{className:`text-amber-400 light:text-amber-700`,children:[(0,R.jsxs)(`p`,{children:[`Skipped `,u.skipped.length,` entr`,u.skipped.length===1?`y`:`ies`,`:`]}),(0,R.jsx)(`ul`,{className:`ml-4 list-disc`,children:u.skipped.map(e=>(0,R.jsxs)(`li`,{children:[(0,R.jsx)(`code`,{className:`font-mono`,children:e.name}),` (`,e.reason,`)`]},e.name))})]}),u.imported.length===0&&u.skipped.length===0&&(0,R.jsx)(`p`,{className:`italic text-neutral-500`,children:`No files were imported.`})]})]})]})}var fj=`***REDACTED***`;function pj(){return{name:``,kind:`remote`,enabled:!0,url:``,transport:`auto`,headers:[],command:``,argsText:``,env:[],cwd:``}}function mj(e){return e.split(`
351
+ `).map(e=>e.trim()).filter(e=>e.length>0)}function hj({onError:e}){let t=tr(),n=er(e=>e.projects),r=VA(e=>e.settings),i=VA(e=>e.globalServers),a=VA(e=>e.byProject[t?.id??`__no_project__`]?.status??zA),o=VA(e=>e.byProject[t?.id??`__no_project__`]?.stdioTrust),s=VA(e=>e.refreshProject),c=VA(e=>e.setMcpEnabled),l=VA(e=>e.upsertServer),u=VA(e=>e.deleteServer),d=VA(e=>e.probeServer),f=VA(e=>e.grantStdioTrust),p=VA(e=>e.revokeStdioTrust),[m,h]=(0,v.useState)(void 0),[g,_]=(0,v.useState)(void 0),[y,b]=(0,v.useState)(!1),[x,S]=(0,v.useState)(void 0),[C,w]=(0,v.useState)(new Map),[T,E]=(0,v.useState)({}),[D,O]=(0,v.useState)(new Set),k=async()=>{try{let[e,n]=await Promise.all([I.listTools(t?.id),I.listToolOverrides()]),r=new Map;for(let t of e.mcp)r.set(`${t.scope}:${t.server}`,t.tools);w(r),E(n.projects)}catch(t){e(`Failed to load tool listing: ${UA(t)}`)}};(0,v.useEffect)(()=>{s(t?.id).catch(t=>{e(`Failed to load MCP config: ${UA(t)}`)}),k()},[t?.id]);let ee=async n=>{b(!0);try{await c(n),e(void 0),await s(t?.id)}catch(t){e(`Failed to toggle MCP: ${UA(t)}`)}finally{b(!1)}},te=async(t,n)=>{let r=i[t];if(r!==void 0){b(!0);try{await l(t,{...r,enabled:n}),e(void 0)}catch(t){e(`Failed to update server: ${UA(t)}`)}finally{b(!1)}}},ne=e=>{let t=i[e];t!==void 0&&(_(e),h({name:e,kind:typeof t.command==`string`&&t.command.length>0?`stdio`:`remote`,enabled:t.enabled!==!1,url:t.url??``,transport:t.transport??`auto`,headers:Object.entries(t.headers??{}).map(([e,t])=>({key:e,value:t})),command:t.command??``,argsText:(t.args??[]).join(`
352
+ `),env:Object.entries(t.env??{}).map(([e,t])=>({key:e,value:t})),cwd:t.cwd??``}))},re=()=>{_(void 0),h(pj())},ie=async()=>{if(m===void 0)return;if(m.name.trim().length===0){e(`Name is required.`);return}if(m.kind===`remote`&&m.url.trim().length===0){e(`URL is required for remote servers.`);return}if(m.kind===`stdio`&&m.command.trim().length===0){e(`Command is required for stdio servers.`);return}let t={enabled:m.enabled};if(m.kind===`remote`){t.url=m.url,t.transport=m.transport;let e={};for(let t of m.headers)t.key.trim().length!==0&&(e[t.key]=t.value);Object.keys(e).length>0&&(t.headers=e)}else{t.command=m.command;let e=mj(m.argsText);e.length>0&&(t.args=e);let n={};for(let e of m.env)e.key.trim().length!==0&&(n[e.key]=e.value);Object.keys(n).length>0&&(t.env=n),m.cwd.trim().length>0&&(t.cwd=m.cwd)}b(!0);try{await l(m.name,t),e(void 0),h(void 0),_(void 0)}catch(t){e(`Failed to save server: ${UA(t)}`)}finally{b(!1)}},ae=async t=>{if(window.confirm(`Remove MCP server '${t}' from the global registry?`)){b(!0);try{await u(t),e(void 0)}catch(t){e(`Failed to remove server: ${UA(t)}`)}finally{b(!1)}}},A=async(n,r)=>{S(n);try{await d(n,r===`project`?t?.id:void 0),e(void 0),k()}catch(t){e(`Probe failed for '${n}': ${UA(t)}`)}finally{S(void 0)}},oe=async(t,n)=>{b(!0);try{await I.setToolEnabled(`mcp`,t,n,`global`),await k()}catch(t){e(`Toggle failed: ${UA(t)}`)}finally{b(!1)}},j=async(t,n,r)=>{b(!0);try{r===void 0?await I.clearToolProjectOverride(`mcp`,n,t):await I.setToolEnabled(`mcp`,n,r===`enabled`,`project`,t),await k()}catch(t){e(`Override write failed: ${UA(t)}`)}finally{b(!1)}},se=e=>{O(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})};if(r===void 0)return(0,R.jsx)(`p`,{className:`text-xs italic text-neutral-500`,children:`Loading MCP config…`});let ce=r.enabled,le=a.filter(e=>e.scope===`global`),ue=a.filter(e=>e.scope===`project`);return(0,R.jsxs)(`div`,{className:`space-y-4`,children:[(0,R.jsxs)(`p`,{className:`text-xs text-neutral-500`,children:[`MCP servers extend the agent with custom tools. Servers configured here are loaded by every new session. Project-scoped servers in `,(0,R.jsx)(`code`,{className:`font-mono`,children:`.mcp.json`}),` at the project root are also loaded for sessions in that project (project entries override globals on name collision).`]}),(0,R.jsxs)(`div`,{className:`flex items-center justify-between rounded border border-neutral-800 bg-neutral-900/40 p-3`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`div`,{className:`text-sm font-medium text-neutral-100`,children:`MCP tools`}),(0,R.jsx)(`div`,{className:`text-[11px] text-neutral-500`,children:`Master switch. When off, no MCP tools reach the agent regardless of per-server state.`})]}),(0,R.jsx)(`button`,{onClick:()=>void ee(!ce),disabled:y,className:`rounded border px-3 py-1 text-xs ${ce?`border-emerald-700/50 bg-emerald-900/20 text-emerald-300 light:border-emerald-300 light:bg-emerald-50 light:text-emerald-800`:`border-neutral-700 text-neutral-300 hover:border-neutral-500`}`,children:ce?`Enabled`:`Disabled`})]}),t!==void 0&&(0,R.jsx)(vj,{projectName:t.name,trusted:o?.trusted===!0,gatedCount:a.filter(e=>e.scope===`project`&&e.state===`trust_required`).length,busy:y,onGrant:async()=>{b(!0);try{await f(t.id),e(void 0)}catch(t){e(`Failed to grant trust: ${UA(t)}`)}finally{b(!1)}},onRevoke:async()=>{if(window.confirm(`Revoke stdio MCP trust for "${t.name}"? This disconnects every running project-scoped MCP server.`)){b(!0);try{await p(t.id),e(void 0)}catch(t){e(`Failed to revoke trust: ${UA(t)}`)}finally{b(!1)}}}}),(0,R.jsx)(gj,{title:`Global servers`,emptyHint:`No global MCP servers configured. Click 'Add server' to add one.`,servers:le.map(e=>({status:e,config:i[e.name]})),editable:!0,editingName:g??null,probingName:x??null,toolsByServer:C,expandedServers:D,allOverrides:T,projects:n,busy:y,onToggleExpanded:se,onToggleToolGlobal:(e,t)=>void oe(e,t),onSetProjectToolOverride:(e,t,n)=>void j(e,t,n),onToggle:(e,t)=>void te(e,t),onProbe:e=>void A(e,`global`),onEdit:ne,onRemove:e=>void ae(e)}),t!==void 0&&(0,R.jsx)(gj,{title:`Project servers (${t.name})`,emptyHint:(0,R.jsxs)(R.Fragment,{children:[`No project servers. Add a `,(0,R.jsx)(`code`,{className:`font-mono`,children:`.mcp.json`}),` file at the project root to define some — supports both`,` `,(0,R.jsx)(`code`,{className:`font-mono`,children:`{ servers: {...} }`}),` and the standard`,` `,(0,R.jsx)(`code`,{className:`font-mono`,children:`{ mcpServers: {...} }`}),` shape.`]}),servers:ue.map(e=>({status:e,config:void 0})),editable:!1,probingName:x??null,toolsByServer:C,expandedServers:D,allOverrides:T,projects:n,busy:y,onToggleExpanded:se,onToggleToolGlobal:(e,t)=>void oe(e,t),onSetProjectToolOverride:(e,t,n)=>void j(e,t,n),onProbe:e=>void A(e,`project`)}),m===void 0?(0,R.jsx)(`button`,{onClick:re,className:`rounded-md border border-neutral-700 px-3 py-1 text-xs text-neutral-200 hover:border-neutral-500`,children:`+ Add server`}):(0,R.jsx)(yj,{draft:m,isEditing:g!==void 0,busy:y,onChange:h,onSave:()=>void ie(),onCancel:()=>{h(void 0),_(void 0)}})]})}function gj(e){return(0,R.jsxs)(`section`,{className:`space-y-2`,children:[(0,R.jsx)(`h3`,{className:`text-xs font-semibold uppercase tracking-wider text-neutral-400`,children:e.title}),e.servers.length===0?(0,R.jsx)(`p`,{className:`text-[11px] italic text-neutral-500`,children:e.emptyHint}):(0,R.jsx)(`div`,{className:`space-y-2`,children:e.servers.map(t=>{let n=t.status,r=e.editingName===n.name,i=e.probingName===n.name,a=`${n.scope}:${n.name}`,o=e.toolsByServer.get(a)??[],s=e.expandedServers.has(a),c=o.length>0;return(0,R.jsxs)(`div`,{className:`rounded border ${r?`border-neutral-500 bg-neutral-900`:`border-neutral-800 bg-neutral-900/40`}`,children:[(0,R.jsxs)(`div`,{className:`p-3`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,R.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,R.jsx)(`button`,{type:`button`,onClick:()=>c&&e.onToggleExpanded(a),disabled:!c,className:`flex h-5 w-5 items-center justify-center rounded text-neutral-300 hover:bg-neutral-800 hover:text-neutral-100 disabled:opacity-30`,title:c?s?`Hide tools`:`Show tools`:`No tools to show (server not connected or empty)`,children:s?(0,R.jsx)(de,{size:16}):(0,R.jsx)(pe,{size:16})}),(0,R.jsx)(_j,{state:n.state}),(0,R.jsx)(`span`,{className:`font-mono text-sm text-neutral-100`,children:n.name}),(0,R.jsx)(`span`,{className:`rounded bg-neutral-800 px-1.5 py-0.5 text-[10px] uppercase tracking-wider text-neutral-400`,children:n.transport??`auto`}),(0,R.jsxs)(`span`,{className:`text-[11px] text-neutral-500`,children:[n.toolCount,` tools`]})]}),(0,R.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1 text-xs`,children:[e.editable&&e.onToggle!==void 0&&(0,R.jsx)(`button`,{onClick:()=>e.onToggle?.(n.name,!n.enabled),className:`rounded border px-2 py-0.5 ${n.enabled?`border-emerald-700/50 bg-emerald-900/20 text-emerald-300 light:border-emerald-300 light:bg-emerald-50 light:text-emerald-800`:`border-neutral-700 text-neutral-400 hover:border-neutral-500`}`,children:n.enabled?`Enabled`:`Disabled`}),(0,R.jsx)(`button`,{onClick:()=>e.onProbe(n.name),disabled:i,className:`rounded border border-neutral-700 px-2 py-0.5 text-neutral-300 hover:border-neutral-500 disabled:opacity-50`,title:`Reconnect and refresh tool list`,children:i?`Probing…`:`Probe`}),e.editable&&e.onEdit!==void 0&&(0,R.jsx)(`button`,{onClick:()=>e.onEdit?.(n.name),className:`rounded border border-neutral-700 px-2 py-0.5 text-neutral-300 hover:border-neutral-500`,children:`Edit`}),e.editable&&e.onRemove!==void 0&&(0,R.jsx)(`button`,{onClick:()=>e.onRemove?.(n.name),className:`rounded border border-red-700/50 px-2 py-0.5 text-red-300 hover:bg-red-900/20`,children:`Remove`})]})]}),n.kind===`stdio`?(0,R.jsxs)(`div`,{className:`mt-1 truncate font-mono text-[11px] text-neutral-500`,title:`${n.command??``} ${(n.args??[]).join(` `)}`.trim(),children:[n.command,` `,(n.args??[]).join(` `)]}):(0,R.jsx)(`div`,{className:`mt-1 truncate text-[11px] text-neutral-500`,title:n.url??``,children:n.url}),n.lastError!==void 0&&(0,R.jsx)(`div`,{className:`mt-1 truncate text-[11px] text-red-300 light:text-red-700`,title:n.lastError,children:n.lastError})]}),s&&c&&(0,R.jsxs)(`div`,{className:`space-y-2 border-t border-neutral-800 bg-neutral-950/40 px-3 py-2`,children:[(0,R.jsx)(`div`,{className:`text-[10px] uppercase tracking-wider text-neutral-500`,children:`Tools`}),(0,R.jsx)(`div`,{className:`space-y-2`,children:o.map(t=>(0,R.jsx)(aj,{family:`mcp`,name:t.shortName,fqn:t.name,description:t.description,globalEnabled:t.globalEnabled,projects:e.projects,allOverrides:e.allOverrides,busy:e.busy,onToggleGlobal:n=>e.onToggleToolGlobal(t.name,n),onSetProjectOverride:(n,r)=>e.onSetProjectToolOverride(n,t.name,r)},`mcp:${t.name}`))})]})]},a)})})]})}function _j({state:e}){return(0,R.jsx)(`span`,{className:`h-2 w-2 rounded-full ${e===`connected`?`bg-emerald-500`:e===`connecting`?`bg-amber-400 animate-pulse`:e===`error`?`bg-red-500`:e===`disabled`?`bg-neutral-700`:`bg-neutral-500`}`,title:e})}function vj(e){return e.trusted?(0,R.jsxs)(`div`,{className:`flex items-center justify-between rounded border border-neutral-800 bg-neutral-900/40 px-3 py-1.5 text-[11px] text-neutral-500`,children:[(0,R.jsxs)(`span`,{children:[`Stdio MCP trust granted for`,` `,(0,R.jsx)(`strong`,{className:`text-neutral-300`,children:e.projectName}),`. Project-local stdio MCP servers from `,(0,R.jsx)(`code`,{className:`font-mono`,children:`.mcp.json`}),` will spawn on session create.`]}),(0,R.jsx)(`button`,{onClick:()=>void e.onRevoke(),disabled:e.busy,className:`rounded border border-neutral-700 px-2 py-0.5 text-[10px] text-neutral-400 hover:border-neutral-500 hover:text-neutral-200 disabled:opacity-50`,title:`Disconnects every running project-scoped MCP server`,children:`Revoke`})]}):e.gatedCount===0?null:(0,R.jsxs)(`div`,{className:`rounded border border-amber-700/40 bg-amber-900/20 p-3 text-xs text-amber-200 light:border-amber-300 light:bg-amber-50 light:text-amber-800`,children:[(0,R.jsxs)(`div`,{className:`mb-2 font-medium`,children:[`This project wants to spawn `,e.gatedCount,` stdio MCP server`,e.gatedCount===1?``:`s`,`.`]}),(0,R.jsxs)(`p`,{className:`text-[11px] leading-relaxed`,children:[(0,R.jsx)(`strong`,{children:e.projectName}),`'s `,(0,R.jsx)(`code`,{className:`font-mono`,children:`.mcp.json`}),` declares MCP server`,e.gatedCount===1?``:`s`,` that pi-forge would launch as local subprocess`,e.gatedCount===1?``:`es`,`. Stdio MCP runs arbitrary commands on this machine with whatever env you've passed through — only trust projects whose`,` `,(0,R.jsx)(`code`,{className:`font-mono`,children:`.mcp.json`}),` you've reviewed and approve of. Remote (URL) entries in this project are unaffected by this gate.`]}),(0,R.jsx)(`div`,{className:`mt-2 flex gap-2`,children:(0,R.jsx)(`button`,{onClick:()=>void e.onGrant(),disabled:e.busy,className:`rounded bg-amber-200 px-3 py-1 text-[11px] font-medium text-amber-900 hover:bg-amber-100 disabled:opacity-50 light:bg-amber-600 light:text-amber-50 light:hover:bg-amber-700`,children:e.busy?`Granting…`:`Trust this project`})})]})}function yj(e){let{draft:t,busy:n}=e,r=(n,r)=>{e.onChange({...t,[n]:r})};return(0,R.jsxs)(`div`,{className:`rounded border border-neutral-700 bg-neutral-900 p-3`,children:[(0,R.jsx)(`h4`,{className:`mb-2 text-xs font-semibold uppercase tracking-wider text-neutral-400`,children:e.isEditing?`Edit '${t.name}'`:`Add MCP server`}),(0,R.jsxs)(`div`,{className:`mb-3 flex items-center gap-3 rounded border border-neutral-800 bg-neutral-950 p-2 text-[11px]`,children:[(0,R.jsx)(`span`,{className:`text-neutral-500`,children:`Type`}),(0,R.jsxs)(`label`,{className:`flex items-center gap-1.5 ${e.isEditing?`cursor-not-allowed opacity-60`:`cursor-pointer`}`,children:[(0,R.jsx)(`input`,{type:`radio`,name:`mcp-kind`,checked:t.kind===`remote`,disabled:e.isEditing,onChange:()=>r(`kind`,`remote`)}),(0,R.jsx)(`span`,{children:`Remote URL`})]}),(0,R.jsxs)(`label`,{className:`flex items-center gap-1.5 ${e.isEditing?`cursor-not-allowed opacity-60`:`cursor-pointer`}`,children:[(0,R.jsx)(`input`,{type:`radio`,name:`mcp-kind`,checked:t.kind===`stdio`,disabled:e.isEditing,onChange:()=>r(`kind`,`stdio`)}),(0,R.jsx)(`span`,{children:`Local subprocess (stdio)`})]}),e.isEditing&&(0,R.jsx)(`span`,{className:`text-[10px] italic text-neutral-600`,children:`Locked while editing — delete and re-add to change type.`})]}),(0,R.jsxs)(`div`,{className:`grid grid-cols-[80px_1fr] items-center gap-2 text-xs`,children:[(0,R.jsx)(`label`,{className:`text-neutral-500`,children:`Name`}),(0,R.jsx)(`input`,{value:t.name,onChange:e=>r(`name`,e.target.value),disabled:e.isEditing,placeholder:`my-server`,className:`rounded border border-neutral-700 bg-neutral-950 px-2 py-1 text-neutral-100 outline-none focus:border-neutral-500 disabled:opacity-50`}),t.kind===`remote`?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`label`,{className:`text-neutral-500`,children:`URL`}),(0,R.jsx)(`input`,{value:t.url,onChange:e=>r(`url`,e.target.value),placeholder:`https://mcp.example.com/sse`,className:`rounded border border-neutral-700 bg-neutral-950 px-2 py-1 text-neutral-100 outline-none focus:border-neutral-500`}),(0,R.jsx)(`label`,{className:`text-neutral-500`,children:`Transport`}),(0,R.jsxs)(`select`,{value:t.transport,onChange:e=>r(`transport`,e.target.value),className:`rounded border border-neutral-700 bg-neutral-950 px-2 py-1 text-neutral-100 outline-none focus:border-neutral-500`,children:[(0,R.jsx)(`option`,{value:`auto`,children:`auto (StreamableHTTP, fall back to SSE)`}),(0,R.jsx)(`option`,{value:`streamable-http`,children:`streamable-http`}),(0,R.jsx)(`option`,{value:`sse`,children:`sse`})]})]}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`label`,{className:`text-neutral-500`,children:`Command`}),(0,R.jsx)(`input`,{value:t.command,onChange:e=>r(`command`,e.target.value),placeholder:`npx (or absolute path to a binary)`,className:`rounded border border-neutral-700 bg-neutral-950 px-2 py-1 font-mono text-neutral-100 outline-none focus:border-neutral-500`}),(0,R.jsx)(`label`,{className:`self-start pt-1 text-neutral-500`,children:`Args`}),(0,R.jsx)(`textarea`,{value:t.argsText,onChange:e=>r(`argsText`,e.target.value),placeholder:`-y
353
+ @modelcontextprotocol/server-everything`,rows:3,spellCheck:!1,className:`rounded border border-neutral-700 bg-neutral-950 px-2 py-1 font-mono text-[11px] text-neutral-100 outline-none focus:border-neutral-500`}),(0,R.jsx)(`label`,{className:`text-neutral-500`,children:`cwd`}),(0,R.jsx)(`input`,{value:t.cwd,onChange:e=>r(`cwd`,e.target.value),placeholder:`(blank ↦ default: project path for project servers)`,className:`rounded border border-neutral-700 bg-neutral-950 px-2 py-1 font-mono text-neutral-100 outline-none focus:border-neutral-500`})]}),(0,R.jsx)(`label`,{className:`text-neutral-500`,children:`Enabled`}),(0,R.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(`input`,{type:`checkbox`,checked:t.enabled,onChange:e=>r(`enabled`,e.target.checked)}),(0,R.jsx)(`span`,{className:`text-[11px] text-neutral-500`,children:`Disabled servers don't connect or contribute tools.`})]})]}),t.kind===`remote`?(0,R.jsx)(bj,{label:`Headers`,emptyHint:"No headers. Add `Authorization: Bearer …` here for auth.",keyPlaceholder:`Authorization`,valuePlaceholder:`Bearer …`,rows:t.headers,onChange:e=>r(`headers`,e)}):(0,R.jsx)(bj,{label:`Env`,emptyHint:`No env. Add API keys / config your subprocess needs (PATH / HOME / locale are inherited automatically).`,keyPlaceholder:`GITHUB_TOKEN`,valuePlaceholder:`ghp_…`,rows:t.env,onChange:e=>r(`env`,e)}),(0,R.jsxs)(`div`,{className:`mt-3 flex justify-end gap-2`,children:[(0,R.jsx)(`button`,{onClick:e.onCancel,className:`rounded border border-neutral-700 px-3 py-1 text-xs text-neutral-300 hover:border-neutral-500`,children:`Cancel`}),(0,R.jsx)(`button`,{onClick:e.onSave,disabled:n,className:`rounded bg-neutral-100 px-3 py-1 text-xs font-medium text-neutral-900 disabled:opacity-50`,children:n?`Saving…`:`Save`})]})]})}function bj(e){let{rows:t}=e;return(0,R.jsxs)(`div`,{className:`mt-3`,children:[(0,R.jsxs)(`div`,{className:`mb-1 flex items-center justify-between`,children:[(0,R.jsx)(`h5`,{className:`text-[11px] font-semibold uppercase tracking-wider text-neutral-500`,children:e.label}),(0,R.jsxs)(`button`,{onClick:()=>e.onChange([...t,{key:``,value:``}]),className:`rounded border border-neutral-700 px-2 py-0.5 text-[11px] text-neutral-300 hover:border-neutral-500`,children:[`+ `,e.label.replace(/s$/,``)]})]}),t.length===0&&(0,R.jsx)(`p`,{className:`text-[11px] italic text-neutral-600`,children:e.emptyHint}),t.map((n,r)=>(0,R.jsxs)(`div`,{className:`mb-1 grid grid-cols-[1fr_2fr_auto] gap-1`,children:[(0,R.jsx)(`input`,{value:n.key,onChange:i=>{let a=[...t];a[r]={...n,key:i.target.value},e.onChange(a)},placeholder:e.keyPlaceholder,className:`rounded border border-neutral-700 bg-neutral-950 px-2 py-1 text-[11px] font-mono text-neutral-100 outline-none focus:border-neutral-500`}),(0,R.jsx)(`input`,{value:n.value===fj?``:n.value,onChange:i=>{let a=[...t];a[r]={...n,value:i.target.value},e.onChange(a)},placeholder:n.value===fj?`leave blank to keep stored value`:e.valuePlaceholder,type:`password`,className:`rounded border border-neutral-700 bg-neutral-950 px-2 py-1 text-[11px] font-mono text-neutral-100 outline-none focus:border-neutral-500`}),(0,R.jsx)(`button`,{onClick:()=>e.onChange(t.filter((e,t)=>t!==r)),className:`rounded border border-neutral-700 px-2 text-[11px] text-neutral-400 hover:text-red-300 light:hover:text-red-700`,title:`Remove ${e.label.toLowerCase()}`,children:`×`})]},r)),t.some(e=>e.value===fj)&&(0,R.jsx)(`p`,{className:`mt-1 text-[10px] italic text-neutral-500`,children:`Values with the redaction sentinel keep their stored value when you save.`})]})}var xj=8;function Sj(){let e=Zr(e=>e.version),t=Zr(e=>e.loaded),n=Zr(e=>e.passwordAuthEnabled);return(0,R.jsxs)(`div`,{className:`space-y-6 text-sm text-neutral-300`,children:[(0,R.jsxs)(`header`,{className:`space-y-1`,children:[(0,R.jsx)(`h2`,{className:`text-base font-semibold text-neutral-100`,children:`pi-forge`}),(0,R.jsxs)(`p`,{className:`text-xs text-neutral-500`,children:[`Browser interface for the`,` `,(0,R.jsx)(`a`,{href:`https://github.com/badlogic/pi-mono`,target:`_blank`,rel:`noopener noreferrer`,className:`text-blue-400 underline hover:text-blue-300 light:text-blue-700 light:hover:text-blue-900`,children:`pi coding agent`}),`.`]})]}),(0,R.jsxs)(`section`,{className:`space-y-2`,children:[(0,R.jsx)(`h3`,{className:`text-xs font-semibold uppercase tracking-wider text-neutral-500`,children:`Version`}),(0,R.jsx)(`p`,{className:`font-mono text-sm`,children:t?e.length>0?e:(0,R.jsx)(`span`,{className:`text-neutral-500`,children:`unknown`}):(0,R.jsx)(`span`,{className:`text-neutral-500`,children:`loading…`})})]}),(0,R.jsxs)(`section`,{className:`space-y-2`,children:[(0,R.jsx)(`h3`,{className:`text-xs font-semibold uppercase tracking-wider text-neutral-500`,children:`Links`}),(0,R.jsxs)(`ul`,{className:`space-y-1 text-xs`,children:[(0,R.jsx)(`li`,{children:(0,R.jsx)(`a`,{href:`https://github.com/Devin-Marks/pi-forge`,target:`_blank`,rel:`noopener noreferrer`,className:`text-blue-400 underline hover:text-blue-300 light:text-blue-700 light:hover:text-blue-900`,children:`github.com/Devin-Marks/pi-forge`})}),(0,R.jsx)(`li`,{children:(0,R.jsx)(`a`,{href:`https://github.com/Devin-Marks/pi-forge/blob/main/CHANGELOG.md`,target:`_blank`,rel:`noopener noreferrer`,className:`text-blue-400 underline hover:text-blue-300 light:text-blue-700 light:hover:text-blue-900`,children:`Changelog`})}),(0,R.jsx)(`li`,{children:(0,R.jsx)(`a`,{href:`https://github.com/Devin-Marks/pi-forge/blob/main/SECURITY.md`,target:`_blank`,rel:`noopener noreferrer`,className:`text-blue-400 underline hover:text-blue-300 light:text-blue-700 light:hover:text-blue-900`,children:`Security`})})]})]}),n&&(0,R.jsx)(Cj,{})]})}function Cj(){let e=Yn(e=>e.changePassword),t=Yn(e=>e.changePasswordPending),n=Yn(e=>e.changePasswordError),[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(``),[l,u]=(0,v.useState)(void 0),[d,f]=(0,v.useState)(!1),p=(0,v.useRef)(!1);(0,v.useEffect)(()=>{if(p.current&&!t&&n===void 0){i(``),o(``),c(``),f(!0);let e=window.setTimeout(()=>f(!1),2500);return()=>window.clearTimeout(e)}p.current=t},[t,n]);let m=t=>{if(t.preventDefault(),u(void 0),f(!1),a.length<xj){u(`New password must be at least ${xj} characters.`);return}if(a!==s){u(`New password and confirmation do not match.`);return}if(a===r){u(`New password must differ from the current one.`);return}e(r,a)},h=l??wj(n);return(0,R.jsxs)(`section`,{className:`space-y-2 border-t border-neutral-800 pt-5`,children:[(0,R.jsx)(`h3`,{className:`text-xs font-semibold uppercase tracking-wider text-neutral-500`,children:`Change password`}),(0,R.jsx)(`p`,{className:`text-xs text-neutral-500`,children:`Updates the scrypt hash on disk; existing browser sessions stay signed in.`}),(0,R.jsxs)(`form`,{onSubmit:m,className:`space-y-2`,children:[(0,R.jsxs)(`label`,{className:`block space-y-1`,children:[(0,R.jsx)(`span`,{className:`text-xs text-neutral-400`,children:`Current password`}),(0,R.jsx)(`input`,{type:`password`,value:r,onChange:e=>i(e.target.value),autoComplete:`current-password`,className:`w-full rounded-md border border-neutral-700 bg-neutral-950 px-3 py-1.5 text-sm outline-none focus:border-neutral-500`})]}),(0,R.jsxs)(`label`,{className:`block space-y-1`,children:[(0,R.jsx)(`span`,{className:`text-xs text-neutral-400`,children:`New password`}),(0,R.jsx)(`input`,{type:`password`,value:a,onChange:e=>o(e.target.value),autoComplete:`new-password`,minLength:xj,className:`w-full rounded-md border border-neutral-700 bg-neutral-950 px-3 py-1.5 text-sm outline-none focus:border-neutral-500`})]}),(0,R.jsxs)(`label`,{className:`block space-y-1`,children:[(0,R.jsx)(`span`,{className:`text-xs text-neutral-400`,children:`Confirm new password`}),(0,R.jsx)(`input`,{type:`password`,value:s,onChange:e=>c(e.target.value),autoComplete:`new-password`,minLength:xj,className:`w-full rounded-md border border-neutral-700 bg-neutral-950 px-3 py-1.5 text-sm outline-none focus:border-neutral-500`})]}),h!==void 0&&(0,R.jsx)(`p`,{role:`alert`,className:`text-xs text-red-400`,children:h}),d&&(0,R.jsx)(`p`,{role:`status`,className:`text-xs text-emerald-400 light:text-emerald-700`,children:`Password updated.`}),(0,R.jsx)(`button`,{type:`submit`,disabled:t||r.length===0||a.length===0,className:`rounded-md bg-neutral-100 px-3 py-1.5 text-xs font-medium text-neutral-900 transition hover:bg-white disabled:cursor-not-allowed disabled:opacity-50`,children:t?`Saving…`:`Update password`})]})]})}function wj(e){if(e!==void 0)switch(e){case`invalid_password`:return`Current password is incorrect.`;case`password_unchanged`:return`New password must differ from the current one.`;case`ui_password_not_configured`:return`Password auth is not configured on this server.`;case`auth_required`:return`Session expired — sign in again.`;default:return`Could not change password: ${e}`}}function Tj({sessionId:e}){let t=mr(t=>t.pendingBySession[e]);return t===void 0?null:(0,R.jsx)(Ej,{pending:t},t.requestId)}function Ej({pending:e}){let t=mr(e=>e.clearPending),[n,r]=(0,v.useState)(0),[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)(void 0),[c,l]=(0,v.useState)(()=>e.questions.map(()=>null)),u=e.questions[n];if(u===void 0)return null;let d=e=>{l(t=>{let r=t.slice();return r[n]={...r[n]??{},...e},r})},f=c[n],p=()=>u.multiSelect===!0?f?.multiLabels!==void 0&&f.multiLabels.length>0:f?.selectedLabel!==void 0||f?.customText!==void 0&&f.customText.trim().length>0,m=()=>{let t=[];for(let n=0;n<e.questions.length;n+=1){let r=e.questions[n],i=c[n];if(i!=null){if(r.multiSelect===!0){t.push({questionIndex:n,question:r.question,kind:`multi`,answer:null,...i.multiLabels===void 0?{}:{selected:i.multiLabels}});continue}if(i.selectedLabel!==void 0){let e=r.options.find(e=>e.label===i.selectedLabel);t.push({questionIndex:n,question:r.question,kind:`option`,answer:i.selectedLabel,...e?.preview===void 0?{}:{preview:e.preview}});continue}if(i.customText!==void 0&&i.customText.trim().length>0){t.push({questionIndex:n,question:r.question,kind:`custom`,answer:i.customText.trim()});continue}}}return t},h=async()=>{if(p()){if(n<e.questions.length-1){r(n+1);return}a(!0),s(void 0);try{await I.submitAskUserQuestionAnswer(e.sessionId,{requestId:e.requestId,answers:m()}),t(e.sessionId,e.requestId)}catch(e){s(e instanceof M?`${e.code}: ${e.message}`:e.message),a(!1)}}},g=async()=>{a(!0),s(void 0);try{let r={questionIndex:n,question:u.question,kind:`chat`,answer:`Chat about this`};await I.submitAskUserQuestionAnswer(e.sessionId,{requestId:e.requestId,answers:[r],cancelled:!0}),t(e.sessionId,e.requestId)}catch(e){s(e instanceof M?`${e.code}: ${e.message}`:e.message),a(!1)}};return(0,R.jsx)(`div`,{className:`flex max-h-[60vh] shrink-0 flex-col overflow-hidden border-t border-amber-700/50 bg-neutral-900/40 light:border-amber-400 light:bg-amber-50/60`,children:(0,R.jsxs)(`div`,{className:`flex flex-col overflow-hidden`,children:[(0,R.jsxs)(`header`,{className:`flex items-center gap-2 border-b border-neutral-800 px-4 py-2 light:border-neutral-200`,children:[(0,R.jsx)(`span`,{className:`text-[10px] font-semibold uppercase tracking-wider text-amber-400 light:text-amber-700`,children:`Agent question`}),e.questions.length>1&&(0,R.jsx)(`div`,{className:`ml-2 flex items-center gap-1 text-[10px] uppercase tracking-wider text-neutral-500`,children:e.questions.map((e,t)=>(0,R.jsx)(`span`,{className:`rounded px-1.5 py-0.5 ${t===n?`bg-amber-900/40 text-amber-200 light:bg-amber-100 light:text-amber-900`:c[t]===null?`text-neutral-500`:`bg-neutral-800 text-neutral-300 light:bg-neutral-200 light:text-neutral-700`}`,title:e.question,children:e.header},t))}),(0,R.jsx)(`div`,{className:`flex-1`}),(0,R.jsxs)(`span`,{className:`text-[10px] uppercase tracking-wider text-neutral-500`,children:[n+1,` of `,e.questions.length]})]}),o!==void 0&&(0,R.jsx)(`div`,{className:`border-b border-red-700/40 bg-red-900/20 px-4 py-2 text-xs text-red-300 light:border-red-300 light:bg-red-50 light:text-red-800`,children:o}),(0,R.jsx)(`div`,{className:`flex-1 overflow-y-auto px-4 py-3`,children:(0,R.jsx)(Dj,{question:u,draft:f??null,onChange:e=>d(e)})}),(0,R.jsxs)(`footer`,{className:`flex items-center gap-2 border-t border-neutral-800 px-4 py-2 light:border-neutral-200`,children:[(0,R.jsxs)(`button`,{type:`button`,onClick:()=>void g(),disabled:i,className:`flex items-center gap-1 rounded border border-neutral-700 px-3 py-1 text-xs text-neutral-300 hover:border-neutral-500 disabled:opacity-50 light:border-neutral-400 light:text-neutral-700`,title:`Abandon the structured questionnaire and reply in free-form chat`,children:[(0,R.jsx)(Fe,{size:12}),`Chat about this`]}),(0,R.jsx)(`div`,{className:`flex-1`}),n>0&&(0,R.jsxs)(`button`,{type:`button`,onClick:()=>r(n-1),disabled:i,className:`flex items-center gap-1 rounded border border-neutral-700 px-3 py-1 text-xs text-neutral-300 hover:border-neutral-500 disabled:opacity-50 light:border-neutral-400 light:text-neutral-700`,children:[(0,R.jsx)(fe,{size:12}),`Back`]}),(0,R.jsxs)(`button`,{type:`button`,onClick:()=>void h(),disabled:i||!p(),className:`flex items-center gap-1 rounded bg-emerald-700 px-3 py-1 text-xs text-white hover:bg-emerald-600 disabled:opacity-50`,children:[i?(0,R.jsx)(Ne,{size:12,className:`animate-spin`}):null,n<e.questions.length-1?(0,R.jsxs)(R.Fragment,{children:[`Next `,(0,R.jsx)(pe,{size:12})]}):i?`Submitting…`:`Submit`]})]})]})})}function Dj({question:e,draft:t,onChange:n}){let r=(0,v.useMemo)(()=>e.options.some(e=>typeof e.preview==`string`&&e.preview.length>0),[e.options]),i=e.multiSelect===!0,a=!i&&!r,[o,s]=(0,v.useState)(void 0),c=e.options.find(e=>e.label===o);return(0,v.useEffect)(()=>{r&&o===void 0&&e.options[0]!==void 0&&s(e.options[0].label)},[r,o,e.options]),(0,R.jsxs)(`div`,{className:`space-y-3`,children:[(0,R.jsx)(`h2`,{className:`text-base font-medium text-neutral-100 light:text-neutral-900`,children:e.question}),r&&!i?(0,R.jsxs)(`div`,{className:`grid grid-cols-3 gap-3`,children:[(0,R.jsx)(`div`,{className:`col-span-1 space-y-1`,children:e.options.map(e=>(0,R.jsxs)(`button`,{type:`button`,onClick:()=>{n({selectedLabel:e.label}),s(e.label)},onMouseEnter:()=>s(e.label),className:`w-full rounded border px-2 py-1.5 text-left text-xs ${t?.selectedLabel===e.label?`border-emerald-600 bg-emerald-900/30 text-emerald-100 light:bg-emerald-50 light:text-emerald-900`:o===e.label?`border-neutral-600 bg-neutral-900 text-neutral-100 light:border-neutral-400 light:bg-neutral-100 light:text-neutral-900`:`border-neutral-800 bg-neutral-900/40 text-neutral-300 hover:border-neutral-600 light:border-neutral-300 light:bg-neutral-50 light:text-neutral-700`}`,children:[(0,R.jsx)(`div`,{className:`font-medium`,children:e.label}),(0,R.jsx)(`div`,{className:`mt-0.5 text-[11px] text-neutral-400 light:text-neutral-600`,children:e.description})]},e.label))}),(0,R.jsx)(`div`,{className:`col-span-2 overflow-auto rounded border border-neutral-800 bg-neutral-950 p-3 light:border-neutral-300 light:bg-neutral-50`,children:c?.preview!==void 0&&c.preview.length>0?(0,R.jsx)(`pre`,{className:`whitespace-pre-wrap font-mono text-[11px] text-neutral-200 light:text-neutral-800`,children:c.preview}):(0,R.jsx)(`p`,{className:`text-xs italic text-neutral-500 light:text-neutral-600`,children:`No preview for this option.`})})]}):i?(0,R.jsx)(`div`,{className:`space-y-1`,children:e.options.map(e=>{let r=(t?.multiLabels??[]).includes(e.label);return(0,R.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-2 rounded border px-2 py-1.5 text-xs ${r?`border-emerald-600 bg-emerald-900/30 light:bg-emerald-50`:`border-neutral-800 bg-neutral-900/40 hover:border-neutral-600 light:border-neutral-300 light:bg-neutral-50`}`,children:[(0,R.jsx)(`input`,{type:`checkbox`,checked:r,onChange:()=>{let i=new Set(t?.multiLabels??[]);r?i.delete(e.label):i.add(e.label),n({multiLabels:Array.from(i)})},className:`mt-1`}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`div`,{className:`font-medium text-neutral-100 light:text-neutral-900`,children:e.label}),(0,R.jsx)(`div`,{className:`mt-0.5 text-[11px] text-neutral-400 light:text-neutral-600`,children:e.description})]})]},e.label)})}):(0,R.jsxs)(`div`,{className:`space-y-1`,children:[e.options.map(e=>(0,R.jsxs)(`button`,{type:`button`,onClick:()=>n({selectedLabel:e.label,customText:void 0}),className:`w-full rounded border px-2 py-1.5 text-left text-xs ${t?.selectedLabel===e.label?`border-emerald-600 bg-emerald-900/30 light:bg-emerald-50`:`border-neutral-800 bg-neutral-900/40 hover:border-neutral-600 light:border-neutral-300 light:bg-neutral-50`}`,children:[(0,R.jsx)(`div`,{className:`font-medium text-neutral-100 light:text-neutral-900`,children:e.label}),(0,R.jsx)(`div`,{className:`mt-0.5 text-[11px] text-neutral-400 light:text-neutral-600`,children:e.description})]},e.label)),a&&(0,R.jsxs)(`div`,{className:`pt-2`,children:[(0,R.jsx)(`label`,{className:`mb-1 block text-[10px] uppercase tracking-wider text-neutral-500 light:text-neutral-600`,children:`Type something`}),(0,R.jsx)(`textarea`,{value:t?.customText??``,onChange:e=>n({customText:e.target.value,selectedLabel:void 0}),rows:2,placeholder:`Or type your own answer…`,className:`w-full rounded border border-neutral-700 bg-neutral-950 px-2 py-1 text-xs text-neutral-100 light:border-neutral-300 light:bg-white light:text-neutral-900`})]})]})]})}function Oj({sessionId:e,onClose:t}){let n=gr(t=>_r(t,e)),r=gr(e=>e.set),[i,a]=(0,v.useState)(void 0);(0,v.useEffect)(()=>{let t=!1;return I.listTodos(e).then(n=>{if(t)return;let i=gr.getState().byId[e];(i===void 0||i.tasks.length===0)&&r(e,{tasks:n.tasks,nextId:n.nextId})}).catch(e=>{t||a(e instanceof M?e.code:e.message)}),()=>{t=!0}},[e,r]);let o=(0,v.useMemo)(()=>vr(n),[n]),s=(0,v.useMemo)(()=>kj(n.tasks),[n.tasks]);return(0,R.jsxs)(`div`,{className:`flex h-full flex-col overflow-hidden bg-neutral-950 text-neutral-200 light:bg-white light:text-neutral-900`,children:[(0,R.jsxs)(`header`,{className:`flex items-center gap-2 border-b border-neutral-800 px-3 py-1.5 text-xs light:border-neutral-200`,children:[(0,R.jsx)(`span`,{className:`font-semibold uppercase tracking-wider text-neutral-400 light:text-neutral-600`,children:`Todos`}),(0,R.jsxs)(`span`,{className:`text-neutral-500 light:text-neutral-600`,children:[o.completed,`/`,o.total,o.inProgress>0?` · ${o.inProgress} in progress`:``]}),(0,R.jsx)(`div`,{className:`flex-1`}),(0,R.jsx)(`button`,{type:`button`,onClick:t,className:`rounded p-0.5 text-neutral-500 hover:bg-neutral-800 hover:text-neutral-200 light:hover:bg-neutral-200 light:hover:text-neutral-900`,title:`Hide todo panel`,children:(0,R.jsx)(rt,{size:12})})]}),i!==void 0&&n.tasks.length===0&&(0,R.jsxs)(`div`,{className:`border-b border-red-700/40 bg-red-900/20 px-3 py-1.5 text-[11px] text-red-300 light:border-red-300 light:bg-red-50 light:text-red-800`,children:[`Failed to load todos: `,i]}),(0,R.jsx)(`div`,{className:`flex-1 overflow-y-auto px-2 py-2`,children:o.total===0?(0,R.jsx)(`p`,{className:`px-1 text-[11px] italic text-neutral-500 light:text-neutral-600`,children:`No todos yet. The agent will add tasks here when it's planning multi-step work.`}):(0,R.jsxs)(`div`,{className:`space-y-2`,children:[s.in_progress.length>0&&(0,R.jsx)(Aj,{label:`In Progress`,tasks:s.in_progress}),s.pending.length>0&&(0,R.jsx)(Aj,{label:`Pending`,tasks:s.pending}),s.completed.length>0&&(0,R.jsx)(Aj,{label:`Completed`,tasks:s.completed})]})})]})}function kj(e){let t={pending:[],in_progress:[],completed:[],deleted:[]};for(let n of e)t[n.status].push(n);return t}function Aj({label:e,tasks:t}){return(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`div`,{className:`mb-1 px-1 text-[10px] uppercase tracking-wider text-neutral-500 light:text-neutral-600`,children:e}),(0,R.jsx)(`div`,{className:`space-y-0.5`,children:t.map(e=>(0,R.jsx)(jj,{task:e},e.id))})]})}function jj({task:e}){let[t,n]=(0,v.useState)(!1),r=e.description!==void 0||e.activeForm!==void 0||e.blockedBy!==void 0&&e.blockedBy.length>0||e.owner!==void 0;return(0,R.jsxs)(`div`,{className:`rounded border border-transparent px-1 py-0.5 text-xs hover:border-neutral-800 light:hover:border-neutral-300`,children:[(0,R.jsxs)(`button`,{type:`button`,onClick:()=>r&&n(e=>!e),className:`flex w-full items-start gap-1.5 text-left ${r?`cursor-pointer`:`cursor-default`}`,children:[r&&(0,R.jsx)(pe,{size:11,className:`mt-0.5 shrink-0 text-neutral-500 transition-transform light:text-neutral-600 ${t?`rotate-90`:``}`}),!r&&(0,R.jsx)(`span`,{className:`inline-block w-[11px] shrink-0`}),(0,R.jsx)(Mj,{status:e.status,activeForm:e.activeForm}),(0,R.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,R.jsx)(`span`,{className:`${e.status===`completed`?`text-neutral-500 line-through light:text-neutral-500`:e.status===`in_progress`?`text-neutral-100 light:text-neutral-900`:`text-neutral-300 light:text-neutral-700`}`,children:e.subject}),e.status===`in_progress`&&e.activeForm!==void 0&&(0,R.jsx)(`span`,{className:`ml-1 text-[10px] italic text-amber-400 light:text-amber-700`,children:e.activeForm})]}),(0,R.jsxs)(`span`,{className:`shrink-0 text-[10px] text-neutral-500 light:text-neutral-600`,children:[`#`,e.id]})]}),t&&r&&(0,R.jsxs)(`div`,{className:`mt-1 space-y-0.5 pl-[34px] text-[11px] text-neutral-400 light:text-neutral-600`,children:[e.description!==void 0&&(0,R.jsx)(`div`,{children:e.description}),e.blockedBy!==void 0&&e.blockedBy.length>0&&(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`span`,{className:`text-neutral-500 light:text-neutral-600`,children:`blocked by:`}),` `,e.blockedBy.map(e=>`#${e}`).join(`, `)]}),e.owner!==void 0&&(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`span`,{className:`text-neutral-500 light:text-neutral-600`,children:`owner:`}),` `,e.owner]})]})]})}function Mj({status:e,activeForm:t}){return e===`in_progress`?(0,R.jsx)(Ne,{size:11,className:`mt-0.5 shrink-0 animate-spin text-amber-400 light:text-amber-700`,"aria-label":t??`in progress`}):e===`completed`?(0,R.jsx)(ue,{size:11,className:`mt-0.5 shrink-0 text-emerald-400 light:text-emerald-700`,"aria-label":`completed`}):e===`deleted`?(0,R.jsx)(rt,{size:11,className:`mt-0.5 shrink-0 text-neutral-500 light:text-neutral-500`,"aria-label":`deleted`}):(0,R.jsx)(ge,{size:11,className:`mt-0.5 shrink-0 text-neutral-500 light:text-neutral-500`,"aria-label":`pending`})}function Nj({sessionId:e}){let t=Cr(t=>wr(t,e)),n=Cr(t=>Tr(t,e)),r=Cr(e=>e.setProcesses),i=Cr(e=>e.clearWatches),[a,o]=(0,v.useState)(void 0),[s,c]=(0,v.useState)(!1);(0,v.useEffect)(()=>{let t=!1;return I.listProcesses(e).then(n=>{if(t)return;let i=Cr.getState().bySession[e];(i===void 0||i.length===0)&&r(e,n.processes)}).catch(e=>{t||o(e instanceof M?e.code:e.message)}),()=>{t=!0}},[e,r]);let l=(0,v.useMemo)(()=>Pj(t),[t]),u=Er(t),d=t.length-u,f=async()=>{c(!0),o(void 0);try{await I.clearProcesses(e)}catch(e){o(e instanceof M?e.code:e.message)}finally{c(!1)}};return(0,R.jsxs)(`div`,{className:`flex h-full flex-col overflow-hidden bg-neutral-950 text-neutral-200 light:bg-white light:text-neutral-900`,children:[(0,R.jsxs)(`header`,{className:`flex items-center gap-2 border-b border-neutral-800 px-3 py-1.5 text-xs light:border-neutral-200`,children:[(0,R.jsx)(`span`,{className:`font-semibold uppercase tracking-wider text-neutral-400 light:text-neutral-600`,children:`Processes`}),(0,R.jsxs)(`span`,{className:`text-neutral-500 light:text-neutral-600`,children:[u,` running · `,d,` finished`]}),(0,R.jsx)(`div`,{className:`flex-1`}),d>0&&(0,R.jsxs)(`button`,{type:`button`,onClick:()=>void f(),disabled:s,className:`flex items-center gap-1 rounded border border-neutral-700 px-1.5 py-0.5 text-[10px] text-neutral-400 hover:border-neutral-500 hover:text-neutral-200 disabled:opacity-50 light:border-neutral-400 light:text-neutral-600`,title:`Drop all FINISHED processes from the list (running ones stay)`,children:[(0,R.jsx)(Qe,{size:10}),`Clear finished`]})]}),a!==void 0&&(0,R.jsx)(`div`,{className:`border-b border-red-700/40 bg-red-900/20 px-3 py-1.5 text-[11px] text-red-300 light:border-red-300 light:bg-red-50 light:text-red-800`,children:a}),n.length>0&&(0,R.jsxs)(`div`,{className:`flex items-start gap-2 border-b border-amber-700/40 bg-amber-900/20 px-3 py-1.5 text-[11px] text-amber-200 light:border-amber-300 light:bg-amber-50 light:text-amber-800`,children:[(0,R.jsx)(le,{size:11,className:`mt-0.5 shrink-0`}),(0,R.jsxs)(`div`,{className:`flex-1 space-y-0.5`,children:[n.slice(-3).map((e,t)=>(0,R.jsxs)(`div`,{className:`truncate font-mono`,children:[(0,R.jsxs)(`span`,{className:`text-neutral-500 light:text-neutral-600`,children:[`[`,e.processName,`]`]}),` `,e.line]},`${e.processId}-${t}`)),n.length>3&&(0,R.jsxs)(`div`,{className:`text-neutral-500 light:text-neutral-600`,children:[`+`,n.length-3,` more watch match(es)`]})]}),(0,R.jsx)(`button`,{type:`button`,onClick:()=>i(e),className:`rounded p-0.5 text-amber-300 hover:text-amber-100 light:text-amber-700 light:hover:text-amber-900`,title:`Clear watch alerts`,children:(0,R.jsx)(We,{size:11})})]}),(0,R.jsx)(`div`,{className:`flex-1 overflow-y-auto px-2 py-2`,children:t.length===0?(0,R.jsx)(`p`,{className:`px-1 text-[11px] italic text-neutral-500 light:text-neutral-600`,children:`No background processes yet. The agent will add them here when it starts dev servers, test watchers, builds, etc.`}):(0,R.jsxs)(`div`,{className:`space-y-2`,children:[l.live.length>0&&(0,R.jsx)(Fj,{label:`Running`,items:l.live,sessionId:e}),l.finished.length>0&&(0,R.jsx)(Fj,{label:`Finished`,items:l.finished,sessionId:e})]})}),(0,R.jsx)(`footer`,{className:`border-t border-neutral-800 px-3 py-1 text-[10px] italic text-neutral-500 light:border-neutral-200 light:text-neutral-600`,children:`In-memory only — processes don't survive a server restart.`})]})}function Pj(e){let t=[],n=[];for(let r of e)yr.has(r.status)?t.push(r):n.push(r);return{live:t,finished:n}}function Fj({label:e,items:t,sessionId:n}){return(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`div`,{className:`mb-1 px-1 text-[10px] uppercase tracking-wider text-neutral-500 light:text-neutral-600`,children:e}),(0,R.jsx)(`div`,{className:`space-y-1`,children:t.map(e=>(0,R.jsx)(Ij,{process:e,sessionId:n},e.id))})]})}function Ij({process:e,sessionId:t}){let[n,r]=(0,v.useState)(!1),[i,a]=(0,v.useState)(void 0),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(void 0),u=yr.has(e.status);(0,v.useEffect)(()=>{if(!n)return;let r=!1;return I.getProcessOutput(t,e.id,80).then(e=>{r||a(e)}).catch(()=>{}),()=>{r=!0}},[n,t,e.id,e.endTime,e.status]);let d=Cr(e=>e.setProcesses),f=async()=>{s(!0),l(void 0);try{let n=await I.killProcess(t,e.id);n.ok||l(n.reason??`kill failed`),setTimeout(()=>{I.listProcesses(t).then(e=>d(t,e.processes)).catch(()=>void 0)},800)}catch(e){l(e instanceof M?e.code:e.message)}finally{s(!1)}},p=zj(e.startTime,e.endTime);return(0,R.jsxs)(`div`,{className:`rounded border px-1.5 py-1 text-xs ${Lj(e.status)} ${u?`bg-neutral-900/40 light:bg-neutral-50`:`bg-neutral-900/20 light:bg-neutral-50/60`}`,children:[(0,R.jsxs)(`button`,{type:`button`,onClick:()=>r(e=>!e),className:`flex w-full items-start gap-1.5 text-left`,children:[(0,R.jsx)(pe,{size:11,className:`mt-0.5 shrink-0 text-neutral-500 transition-transform light:text-neutral-600 ${n?`rotate-90`:``}`}),(0,R.jsx)(Rj,{status:e.status,success:e.success}),(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,R.jsxs)(`div`,{className:`flex items-baseline gap-1.5`,children:[(0,R.jsx)(`span`,{className:`truncate font-medium text-neutral-100 light:text-neutral-900`,children:e.name}),(0,R.jsx)(`span`,{className:`shrink-0 text-[10px] text-neutral-500 light:text-neutral-600`,children:e.id})]}),(0,R.jsx)(`div`,{className:`truncate font-mono text-[10px] text-neutral-500 light:text-neutral-600`,children:e.command})]}),(0,R.jsx)(`span`,{className:`shrink-0 text-[10px] text-neutral-500 light:text-neutral-600`,children:p})]}),n&&(0,R.jsxs)(`div`,{className:`mt-1 space-y-1 pl-[24px]`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2 text-[10px] text-neutral-500 light:text-neutral-600`,children:[(0,R.jsxs)(`span`,{children:[`PID `,e.pid]}),e.exitCode!==null&&(0,R.jsxs)(`span`,{children:[`exit `,e.exitCode]}),(0,R.jsx)(`div`,{className:`flex-1`}),u&&(0,R.jsxs)(`button`,{type:`button`,onClick:()=>void f(),disabled:o,className:`flex items-center gap-1 rounded border border-red-700/40 px-1.5 py-0.5 text-[10px] text-red-300 hover:bg-red-900/40 disabled:opacity-50 light:border-red-400 light:text-red-700 light:hover:bg-red-100`,children:[(0,R.jsx)(he,{size:10}),`Kill`]})]}),c!==void 0&&(0,R.jsx)(`div`,{className:`text-[10px] text-red-300 light:text-red-700`,children:c}),i!==void 0&&i.stdout.length>0&&(0,R.jsxs)(`details`,{className:`rounded bg-neutral-950 light:bg-white`,children:[(0,R.jsx)(`summary`,{className:`cursor-pointer px-1 py-0.5 text-[10px] uppercase tracking-wider text-neutral-500 hover:text-neutral-300 light:text-neutral-600 light:hover:text-neutral-900`,children:`stdout (tail)`}),(0,R.jsx)(`pre`,{className:`max-h-48 overflow-auto whitespace-pre-wrap px-1.5 py-1 font-mono text-[10px] text-neutral-300 light:text-neutral-800`,children:i.stdout.join(`
354
+ `)})]}),i!==void 0&&i.stderr.length>0&&(0,R.jsxs)(`details`,{className:`rounded bg-neutral-950 light:bg-white`,children:[(0,R.jsx)(`summary`,{className:`cursor-pointer px-1 py-0.5 text-[10px] uppercase tracking-wider text-neutral-500 hover:text-neutral-300 light:text-neutral-600 light:hover:text-neutral-900`,children:`stderr (tail)`}),(0,R.jsx)(`pre`,{className:`max-h-48 overflow-auto whitespace-pre-wrap px-1.5 py-1 font-mono text-[10px] text-red-300 light:text-red-700`,children:i.stderr.join(`
355
+ `)})]}),(0,R.jsxs)(`div`,{className:`flex gap-2 text-[10px]`,children:[(0,R.jsx)(Bj,{sessionId:t,processId:e.id,stream:`stdout`}),(0,R.jsx)(Bj,{sessionId:t,processId:e.id,stream:`stderr`})]})]})]})}function Lj(e){return e===`running`||e===`terminating`?`border-neutral-700 light:border-neutral-300`:e===`terminate_timeout`?`border-amber-700/50 light:border-amber-400`:e===`killed`?`border-amber-700/40 light:border-amber-400`:`border-neutral-800 light:border-neutral-200`}function Rj({status:e,success:t}){return e===`running`?(0,R.jsx)(Ne,{size:11,className:`mt-0.5 shrink-0 animate-spin text-emerald-400 light:text-emerald-700`,"aria-label":`running`}):e===`terminating`||e===`terminate_timeout`?(0,R.jsx)(it,{size:11,className:`mt-0.5 shrink-0 text-amber-400 light:text-amber-700`,"aria-label":`terminating`}):e===`killed`?(0,R.jsx)($e,{size:11,className:`mt-0.5 shrink-0 text-amber-400 light:text-amber-700`,"aria-label":`killed`}):t===!0?(0,R.jsx)(me,{size:11,className:`mt-0.5 shrink-0 text-emerald-400 light:text-emerald-700`,"aria-label":`exited 0`}):(0,R.jsx)(he,{size:11,className:`mt-0.5 shrink-0 text-red-400 light:text-red-700`,"aria-label":`exited non-zero`})}function zj(e,t){let n=(t??Date.now())-e;if(n<1e3)return`${n}ms`;let r=n/1e3;if(r<60)return`${r.toFixed(1)}s`;let i=r/60;return i<60?`${i.toFixed(1)}m`:`${(i/60).toFixed(1)}h`}function Bj({sessionId:e,processId:t,stream:n}){let[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(void 0),s=async()=>{i(!0),o(void 0);try{let r=I.processLogFileUrl(e,t,n),i=Bt(),a={};i!==void 0&&(a.Authorization=`Bearer ${i.token}`);let s=await fetch(r,{headers:a});if(!s.ok){o(`${s.status} ${s.statusText}`);return}let c=await s.blob(),l=URL.createObjectURL(c);window.open(l,`_blank`,`noopener,noreferrer`)===null&&window.location.assign(l),setTimeout(()=>URL.revokeObjectURL(l),6e4)}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}};return(0,R.jsx)(`button`,{type:`button`,onClick:()=>void s(),disabled:r,className:`text-sky-400 hover:underline disabled:opacity-50 light:text-sky-700`,title:a,children:r?`loading…`:a===void 0?`full ${n} log`:`${n}: ${a}`})}function Vj(){let e=tr(),t=Jr(t=>e===void 0?void 0:t.treeByProject[e.id]),n=Jr(t=>e===void 0?!1:t.treeLoading[e.id]??!1),r=Jr(e=>e.error),i=Jr(e=>e.loadTree),a=Jr(e=>e.openFile),o=Jr(e=>e.createFile),s=Jr(e=>e.createFolder),c=Jr(e=>e.renameEntry),l=Jr(e=>e.moveEntry),u=Jr(e=>e.deleteEntry),[d,f]=(0,v.useState)({"":!0}),[p,m]=(0,v.useState)(void 0),[h,g]=(0,v.useState)(``),[_,y]=(0,v.useState)(void 0),[b,x]=(0,v.useState)(void 0),[S,C]=(0,v.useState)(void 0),w=(0,v.useRef)(null),T=(0,v.useRef)(void 0),E=Jr(e=>e.uploadFiles),[D,O]=(0,v.useState)(void 0),k=bA(e=>e.requestChatInsert),[ee,te]=(0,v.useState)(new Set);if((0,v.useEffect)(()=>{e!==void 0&&i(e.id)},[e?.id,i]),e===void 0)return(0,R.jsx)(`div`,{className:`p-4 text-xs italic text-neutral-500`,children:`Select a project to browse its files.`});let ne=async(t,n,r)=>{x(void 0);try{if(t===`file`){let t=await o(e.id,n,r);await a(e.id,t)}else await s(e.id,n,r)}catch{}},re=(e,t,n)=>{f(e=>({...e,[t]:!0})),x({kind:`create`,entryKind:n,parentAbsPath:e})},ie=(e,t)=>{m(e),g(t)},ae=async t=>{let n=h.trim();if(m(void 0),g(``),n.length!==0)try{await c(e.id,t,n)}catch{}},A=()=>te(new Set),oe=e=>{te(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},j=(e,t,n)=>{x({kind:`delete`,absPath:e,name:t,isDir:n,recursive:!1})},se=async()=>{if(b?.kind!==`delete`)return;let{absPath:t,name:n,isDir:r,recursive:i}=b;x(void 0);try{await u(e.id,t,i?{recursive:!0}:void 0)}catch(e){if(e instanceof M&&e.code===`directory_not_empty`){x({kind:`delete`,absPath:t,name:n,isDir:r,recursive:!0});return}}},ce=async()=>{if(b?.kind!==`deleteMany`)return;let{paths:t}=b;x(void 0);for(let n of t)try{await u(e.id,n,{recursive:!0})}catch{}A()},le=async t=>{if(t.type===`directory`){f(e=>({...e,[t.path]:!e[t.path]}));return}await a(e.id,Gj(e.path,t.path))},ue=(e,t)=>{e.preventDefault(),e.stopPropagation(),O({x:e.clientX,y:e.clientY,kind:t.isDir?`folder`:`file`,absPath:t.absPath,name:t.name,relPath:t.relPath})},de=t=>{t.preventDefault(),O({x:t.clientX,y:t.clientY,kind:`empty`,absPath:e.path,name:``,relPath:``})},fe=t=>{let n=t;t.startsWith(`${e.path}/`)&&(n=t.slice(e.path.length+1)),k(/\s/.test(n)?`@"${n}"`:`@${n}`),O(void 0)},pe=async(t,n)=>{if(t.preventDefault(),t.stopPropagation(),y(void 0),t.dataTransfer.files.length>0){await me(n,Array.from(t.dataTransfer.files));return}let r=t.dataTransfer.getData(`application/x-pi-path`);if(r.length===0)return;let i=r.split(`/`).pop()??``;if(i.length===0)return;let a=`${n}/${i}`;if(a!==r&&!(n===r||n.startsWith(`${r}/`)))try{await l(e.id,r,a)}catch{}},me=async(t,n)=>{if(n.length===0)return;let r=n.reduce((e,t)=>e+t.size,0);C(`Hashing ${n.length} file${n.length===1?``:`s`} (${Xj(r)})…`);try{let r=await E(e.id,t,n,{onHashProgress:(e,t)=>{C(e<t?`Hashing ${Xj(e)} / ${Xj(t)} (${Math.floor(e/t*100)}%)…`:`Uploading ${n.length} file${n.length===1?``:`s`} (${Xj(t)})…`)}});C(`Uploaded ${r.length} file${r.length===1?``:`s`}.`),window.setTimeout(()=>C(void 0),2500)}catch{C(void 0)}},he=e=>{T.current=e,w.current?.click()},ge=async t=>{C(`Preparing download…`);try{let{blob:n,filename:r}=await I.filesDownload(e.id,t),i=URL.createObjectURL(n),a=document.createElement(`a`);a.href=i,a.download=r,document.body.appendChild(a),a.click(),a.remove(),window.setTimeout(()=>URL.revokeObjectURL(i),1e3),C(void 0)}catch(e){C(void 0),Jr.setState({error:e instanceof Error?e.message:`download_failed`})}},_e=async t=>{let n=t.target.files,r=n===null?[]:Array.from(n),i=T.current??e.path;t.target.value=``,T.current=void 0,r.length!==0&&await me(i,r)};return(0,R.jsxs)(`div`,{className:`flex h-full flex-col text-xs text-neutral-300`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between border-b border-neutral-800 px-3 py-2`,children:[(0,R.jsx)(`span`,{className:`truncate font-medium text-neutral-200`,title:e.path,children:e.name}),(0,R.jsxs)(`div`,{className:`flex gap-1`,children:[(0,R.jsx)(`button`,{onClick:()=>x({kind:`create`,entryKind:`file`,parentAbsPath:e.path}),className:`rounded p-1 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-200`,title:`New file`,children:(0,R.jsx)(we,{size:14})}),(0,R.jsx)(`button`,{onClick:()=>x({kind:`create`,entryKind:`folder`,parentAbsPath:e.path}),className:`rounded p-1 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-200`,title:`New folder`,children:(0,R.jsx)(Ee,{size:14})}),(0,R.jsx)(`button`,{onClick:()=>he(e.path),className:`rounded p-1 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-200`,title:`Upload files into project root (drag-and-drop also works on any folder)`,children:(0,R.jsx)(tt,{size:14})}),(0,R.jsx)(`button`,{onClick:()=>void ge(void 0),className:`rounded p-1 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-200`,title:`Download project as .tar.gz (skips node_modules, .git, dist, etc.)`,children:(0,R.jsx)(be,{size:14})}),(0,R.jsx)(`button`,{onClick:()=>void i(e.id),className:`rounded p-1 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-200`,title:`Refresh`,children:(0,R.jsx)(Ue,{size:14,className:n?`animate-spin`:``})})]})]}),(0,R.jsx)(`input`,{ref:w,type:`file`,multiple:!0,className:`hidden`,onChange:e=>void _e(e)}),S!==void 0&&(0,R.jsxs)(`div`,{className:`flex items-center gap-1.5 border-b border-emerald-700/40 bg-emerald-900/20 px-3 py-1.5 text-[11px] text-emerald-200 light:border-emerald-300 light:bg-emerald-50 light:text-emerald-800`,children:[!S.startsWith(`Uploaded`)&&(0,R.jsx)(Ne,{size:11,className:`animate-spin`}),(0,R.jsx)(`span`,{children:S})]}),r!==void 0&&(0,R.jsx)(`div`,{className:`border-b border-red-700/40 bg-red-900/20 px-3 py-1.5 text-[11px] text-red-300 light:border-red-300 light:bg-red-50 light:text-red-700`,children:r}),ee.size>0&&(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b border-neutral-800 bg-neutral-900/60 px-3 py-1.5 text-[11px] text-neutral-300`,children:[(0,R.jsxs)(`span`,{children:[ee.size,` selected`,(0,R.jsx)(`span`,{className:`ml-2 text-neutral-500`,children:`(Cmd/Ctrl+click rows to add or remove)`})]}),(0,R.jsxs)(`div`,{className:`flex gap-1`,children:[(0,R.jsx)(`button`,{onClick:()=>x({kind:`deleteMany`,paths:Array.from(ee)}),className:`rounded border border-red-700/50 px-2 py-0.5 text-red-300 hover:bg-red-900/20 light:border-red-400 light:text-red-700 light:hover:bg-red-50`,children:`Delete selected`}),(0,R.jsx)(`button`,{onClick:A,className:`rounded border border-neutral-700 px-2 py-0.5 text-neutral-300 hover:border-neutral-500`,children:`Clear`})]})]}),(0,R.jsxs)(`div`,{className:`flex-1 overflow-y-auto py-1`,onContextMenu:de,onDragOver:e=>{(e.dataTransfer.types.includes(`application/x-pi-path`)||e.dataTransfer.types.includes(`Files`))&&(e.preventDefault(),e.dataTransfer.dropEffect=e.dataTransfer.types.includes(`Files`)?`copy`:`move`)},onDrop:t=>void pe(t,e.path),children:[t===void 0&&!n&&(0,R.jsx)(`p`,{className:`px-3 py-2 italic text-neutral-500`,children:`Tree not loaded.`}),t!==void 0&&(0,R.jsx)(Wj,{node:t,depth:0,projectPath:e.path,expanded:d,onToggle:e=>f(t=>({...t,[e]:!t[e]})),onOpen:e=>void le(e),renaming:p,renameDraft:h,onRenameDraftChange:g,onRenameCommit:e=>void ae(e),onRenameStart:ie,onDelete:(e,t,n)=>j(e,t,n),onCreate:(e,t,n)=>re(e,t,n),onUpload:e=>he(e),onDownload:e=>void ge(e),dropTarget:_,onDropTargetChange:y,onDrop:(e,t)=>void pe(e,t),onContextMenu:ue,selectedPaths:ee,onToggleSelect:oe})]}),(0,R.jsx)(fi,{open:b?.kind===`create`,onClose:()=>x(void 0),onSubmit:e=>{b?.kind===`create`&&ne(b.entryKind,b.parentAbsPath,e)},title:qj(b,e.path),label:Jj(b,e.path),placeholder:Yj(b),primaryLabel:`Create`}),(0,R.jsx)(pi,{open:b?.kind===`delete`,onClose:()=>x(void 0),onConfirm:()=>void se(),title:b?.kind===`delete`?b.recursive?`"${b.name}" is not empty`:b.isDir?`Delete directory`:`Delete file`:``,message:b?.kind===`delete`?b.recursive?`"${b.name}" contains files. Delete the directory and ALL its contents? This cannot be undone.`:`Delete ${b.isDir?`directory`:`file`} "${b.name}"? This cannot be undone.`:``,primaryLabel:b?.kind===`delete`&&b.recursive?`Delete contents`:`Delete`,tone:`danger`}),(0,R.jsx)(pi,{open:b?.kind===`deleteMany`,onClose:()=>x(void 0),onConfirm:()=>void ce(),title:b?.kind===`deleteMany`?`Delete ${b.paths.length} item${b.paths.length===1?``:`s`}`:``,message:b?.kind===`deleteMany`?`Delete the ${b.paths.length} selected file${b.paths.length===1?``:`s`} / folder${b.paths.length===1?``:`s`}? Folders are deleted recursively. This cannot be undone.`:``,primaryLabel:`Delete all`,tone:`danger`}),D!==void 0&&(0,R.jsx)(Hj,{x:D.x,y:D.y,kind:D.kind,onClose:()=>O(void 0),onAddAsContext:()=>fe(D.absPath),...D.kind!==`empty`&&{onRename:()=>ie(D.absPath,D.name),onDelete:()=>j(D.absPath,D.name,D.kind===`folder`),onDownload:()=>void ge(D.absPath)},...D.kind!==`file`&&{onAddFile:()=>re(D.absPath,D.relPath,`file`),onAddFolder:()=>re(D.absPath,D.relPath,`folder`)}})]})}function Hj(e){let t=(0,v.useRef)(e.onClose);t.current=e.onClose,(0,v.useEffect)(()=>{let e=e=>{e.key===`Escape`&&t.current()},n=()=>t.current();window.addEventListener(`keydown`,e);let r=setTimeout(()=>window.addEventListener(`mousedown`,n),0);return()=>{window.removeEventListener(`keydown`,e),window.removeEventListener(`mousedown`,n),clearTimeout(r)}},[]);let n=t=>{if(t!==void 0)return()=>{t(),e.onClose()}},r=e.kind===`empty`?void 0:n(e.onAddAsContext),i=n(e.onRename),a=n(e.onDelete),o=n(e.onDownload),s=n(e.onAddFile),c=n(e.onAddFolder);return(0,R.jsxs)(`div`,{className:`fixed z-50 min-w-[200px] overflow-hidden rounded-md border border-neutral-700 bg-neutral-900 shadow-lg`,style:{left:e.x,top:e.y},onMouseDown:e=>e.stopPropagation(),children:[r!==void 0&&(0,R.jsx)(Uj,{onClick:r,icon:(0,R.jsx)(ce,{size:12}),label:`Add as @ context`,title:e.kind===`folder`?`Append @<path>/ to the chat input so the model can ls / grep this folder`:`Append @<path> to the chat input so the file's content is sent with the next prompt`}),s!==void 0&&(0,R.jsx)(Uj,{onClick:s,icon:(0,R.jsx)(we,{size:12}),label:`Add file`,title:e.kind===`folder`?`Create a new file inside this folder`:`Create a new file at the project root`}),c!==void 0&&(0,R.jsx)(Uj,{onClick:c,icon:(0,R.jsx)(Ee,{size:12}),label:`Add folder`,title:e.kind===`folder`?`Create a new subfolder inside this folder`:`Create a new folder at the project root`}),i!==void 0&&(0,R.jsx)(Uj,{onClick:i,icon:(0,R.jsx)(Ve,{size:12}),label:`Rename`,title:`Rename this file or folder`}),o!==void 0&&(0,R.jsx)(Uj,{onClick:o,icon:(0,R.jsx)(be,{size:12}),label:`Download`,title:e.kind===`folder`?`Download folder as .tar.gz`:`Download this file`}),a!==void 0&&(0,R.jsx)(Uj,{onClick:a,icon:(0,R.jsx)(Qe,{size:12}),label:`Delete`,title:`Delete this file or folder`,tone:`danger`})]})}function Uj(e){let t=e.tone===`danger`;return(0,R.jsxs)(`button`,{type:`button`,onClick:e.onClick,title:e.title,className:`flex w-full items-center gap-2 px-3 py-1.5 text-left text-xs ${t?`text-red-300 hover:bg-red-900/30 hover:text-red-100 light:text-red-700 light:hover:bg-red-100 light:hover:text-red-900`:`text-neutral-200 hover:bg-neutral-800`}`,children:[e.icon,e.label]})}function Wj(e){let{node:t,depth:n,projectPath:r}=e;if(n===0&&t.type===`directory`)return(0,R.jsx)(`ul`,{children:t.children?.map(t=>(0,R.jsx)(Wj,{...e,node:t,depth:1},t.path))});let i=Gj(r,t.path),a=t.type===`directory`,o=a&&(e.expanded[t.path]??!1),s=e.renaming===i,c=a&&e.dropTarget===i;return(0,R.jsxs)(`li`,{children:[(0,R.jsxs)(`div`,{className:`group flex items-center gap-1 border-l-2 py-0.5 pr-2 ${e.selectedPaths.has(i)?`border-blue-400 bg-blue-500/15 hover:bg-blue-500/25`:`border-transparent hover:bg-neutral-900`} ${c?`bg-emerald-900/30 ring-1 ring-emerald-700/50`:``}`,style:{paddingLeft:`${n*12+6}px`},onContextMenu:s?void 0:n=>e.onContextMenu(n,{absPath:i,isDir:a,name:t.name,relPath:t.path}),draggable:!s,onDragStart:e=>{e.dataTransfer.setData(`application/x-pi-path`,i),e.dataTransfer.effectAllowed=`move`},onDragOver:a?t=>{let n=t.dataTransfer.types.includes(`Files`),r=t.dataTransfer.types.includes(`application/x-pi-path`);!n&&!r||(t.preventDefault(),t.stopPropagation(),t.dataTransfer.dropEffect=n?`copy`:`move`,e.dropTarget!==i&&e.onDropTargetChange(i))}:void 0,onDragLeave:a?()=>{e.dropTarget===i&&e.onDropTargetChange(void 0)}:void 0,onDrop:a?t=>{t.stopPropagation(),e.onDrop(t,i)}:void 0,children:[(0,R.jsxs)(`button`,{onClick:n=>{if(n.metaKey||n.ctrlKey){e.onToggleSelect(i);return}e.onOpen(t)},className:`flex flex-1 items-center gap-1 truncate text-left`,title:i,children:[a?o?(0,R.jsx)(de,{size:12,className:`text-neutral-500`}):(0,R.jsx)(pe,{size:12,className:`text-neutral-500`}):(0,R.jsx)(`span`,{className:`inline-block w-3`}),s?(0,R.jsx)(`input`,{autoFocus:!0,value:e.renameDraft,onChange:t=>e.onRenameDraftChange(t.target.value),onKeyDown:t=>{(t.key===`Enter`||t.key===`Escape`)&&(t.preventDefault(),e.onRenameCommit(i))},onBlur:()=>e.onRenameCommit(i),onClick:e=>e.stopPropagation(),className:`flex-1 rounded border border-neutral-700 bg-neutral-950 px-1 text-[11px] text-neutral-100 outline-none focus:border-neutral-500`}):(0,R.jsx)(`span`,{className:`truncate ${a?`text-neutral-200`:`text-neutral-300`}`,children:t.name}),t.truncated===!0&&(0,R.jsx)(`span`,{className:`ml-1 text-[10px] text-neutral-600`,children:`…`})]}),!s&&(0,R.jsxs)(`div`,{className:`hidden items-center gap-0.5 group-hover:flex`,children:[a&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`button`,{onClick:n=>{n.stopPropagation(),e.onCreate(i,t.path,`file`)},className:`rounded p-0.5 text-neutral-500 hover:bg-neutral-800 hover:text-neutral-200`,title:`New file in this folder`,children:(0,R.jsx)(we,{size:11})}),(0,R.jsx)(`button`,{onClick:n=>{n.stopPropagation(),e.onCreate(i,t.path,`folder`)},className:`rounded p-0.5 text-neutral-500 hover:bg-neutral-800 hover:text-neutral-200`,title:`New subfolder in this folder`,children:(0,R.jsx)(Ee,{size:11})}),(0,R.jsx)(`button`,{onClick:t=>{t.stopPropagation(),e.onUpload(i)},className:`rounded p-0.5 text-neutral-500 hover:bg-neutral-800 hover:text-neutral-200`,title:`Upload into this folder`,children:(0,R.jsx)(tt,{size:11})})]}),(0,R.jsx)(`button`,{onClick:t=>{t.stopPropagation(),e.onDownload(i)},className:`rounded p-0.5 text-neutral-500 hover:bg-neutral-800 hover:text-neutral-200`,title:a?`Download folder as .tar.gz`:`Download file`,children:(0,R.jsx)(be,{size:11})}),(0,R.jsx)(`button`,{onClick:n=>{n.stopPropagation(),e.onRenameStart(i,t.name)},className:`rounded p-0.5 text-neutral-500 hover:bg-neutral-800 hover:text-neutral-200`,title:`Rename`,children:(0,R.jsx)(Ve,{size:11})}),(0,R.jsx)(`button`,{onClick:n=>{n.stopPropagation(),e.onDelete(i,t.name,a)},className:`rounded p-0.5 text-neutral-500 hover:bg-red-900/30 hover:text-red-300 light:hover:bg-red-100 light:hover:text-red-700`,title:`Delete`,children:(0,R.jsx)(Qe,{size:11})})]})]}),a&&o&&t.children!==void 0&&(0,R.jsx)(`ul`,{children:t.children.map(t=>(0,R.jsx)(Wj,{...e,node:t,depth:n+1},t.path))})]})}function Gj(e,t){return t===``?e:`${e}/${t.replaceAll(`\\`,`/`)}`}function Kj(e,t){if(e!==t)return e.startsWith(`${t}/`)?e.slice(t.length+1):e}function qj(e,t){if(e?.kind!==`create`)return``;let n=Kj(e.parentAbsPath,t),r=e.entryKind===`folder`?`folder`:`file`;return n===void 0?`New ${r}`:`New ${r} in ${n}/`}function Jj(e,t){if(e?.kind!==`create`)return``;let n=Kj(e.parentAbsPath,t),r=e.entryKind===`folder`?`Folder name`:`File name`;return n===void 0?`${r} (relative to project root)`:`${r} (in ${n}/)`}function Yj(e){return e?.kind===`create`?e.entryKind===`folder`?`utils`:`index.ts`:``}function Xj(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024*1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${(e/(1024*1024*1024)).toFixed(2)} GB`}var Zj=`forge.editor.wrap.`,Qj=[];function $j(e){let t=Math.max(e.lastIndexOf(`/`),e.lastIndexOf(`\\`)),n=t===-1?e:e.slice(t+1),r=n.lastIndexOf(`.`);return r<=0?``:n.slice(r+1).toLowerCase()}function eM(e){try{let t=localStorage.getItem(Zj+e);if(t===`0`)return!1;if(t===`1`)return!0}catch{}return!0}function tM(e,t){try{localStorage.setItem(Zj+e,t?`1`:`0`)}catch{}}var nM=(0,v.lazy)(()=>C(()=>import(`./CodeMirrorEditor-DXmxwE2Z.js`).then(e=>({default:e.CodeMirrorEditor})),[]));function rM(){let e=tr(),t=Jr(e=>e.openFiles),n=Jr(e=>e.activePath),r=Jr(e=>e.setActiveFile),i=Jr(e=>e.closeFile),a=Jr(e=>e.closeAllFiles),o=Jr(e=>e.updateDraft),s=Jr(e=>e.saveFile),c=Jr(e=>e.reloadFile),l=Jr(e=>e.externallyChanged),u=Jr(e=>e.gitDiffByPath),d=t.find(e=>e.path===n),f=d===void 0?``:$j(d.path),[p,m]=(0,v.useState)(()=>eM(f));(0,v.useEffect)(()=>{m(eM(f))},[f]);let h=(0,v.useCallback)(()=>{m(e=>{let t=!e;return tM(f,t),t})},[f]);return(0,R.jsxs)(`div`,{className:`flex h-full flex-col bg-neutral-950 text-sm text-neutral-200`,children:[(0,R.jsx)(aM,{files:t,activePath:n,externallyChanged:l,onActivate:r,onClose:i,onCloseAll:a}),d===void 0?(0,R.jsx)(`div`,{className:`flex flex-1 items-center justify-center text-xs italic text-neutral-500`,children:`No file open. Click a file in the tree to start editing.`}):(0,R.jsxs)(R.Fragment,{children:[l[d.path]===!0&&(0,R.jsx)(oM,{path:d.path,onReload:()=>{e!==void 0&&c(e.id,d.path)},onDiscard:()=>Jr.getState().dismissExternallyChanged(d.path)}),d.binary?(0,R.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-6 text-center text-sm text-neutral-500`,children:d.loadingError??`Binary file.`}):(0,R.jsx)(v.Suspense,{fallback:(0,R.jsx)(iM,{}),children:(0,R.jsx)(nM,{file:d,wrap:p,diffChanges:u[d.path]??Qj,onChange:e=>o(d.path,e),onSaveShortcut:()=>{e!==void 0&&s(e.id,d.path)},onConsumePendingNav:e=>Jr.getState().consumePendingNav(e)},d.tabId)}),(0,R.jsx)(sM,{file:d,wrap:p,onToggleWrap:h,onSave:()=>{e!==void 0&&s(e.id,d.path)}})]})]})}function iM(){return(0,R.jsx)(`div`,{className:`flex flex-1 items-center justify-center text-xs italic text-neutral-500`,children:`Loading editor…`})}function aM({files:e,activePath:t,externallyChanged:n,onActivate:r,onClose:i,onCloseAll:a}){if(e.length===0)return null;let o=e.filter(e=>e.dirty).length;return(0,R.jsxs)(`div`,{className:`flex border-b border-neutral-800 bg-neutral-900/40`,children:[(0,R.jsx)(`button`,{onClick:()=>{o>0&&!window.confirm(`Close ${e.length} tab${e.length===1?``:`s`}? ${o} ha${o===1?`s`:`ve`} unsaved changes that will be lost.`)||a()},className:`flex shrink-0 items-center justify-center border-r border-neutral-800 px-2 py-1.5 text-neutral-500 hover:bg-neutral-800 hover:text-neutral-200`,title:`Close all ${e.length} tab${e.length===1?``:`s`}`,children:(0,R.jsx)(Ye,{size:14})}),(0,R.jsx)(`div`,{className:`flex flex-1 overflow-x-auto`,children:e.map(e=>{let a=e.path.split(`/`).pop()??e.path,o=e.path===t,s=n[e.path]===!0;return(0,R.jsxs)(`div`,{className:`group flex items-center gap-1 border-r border-neutral-800 px-3 py-1.5 text-xs ${o?`bg-neutral-950 text-neutral-100`:`text-neutral-400 hover:bg-neutral-900 hover:text-neutral-200`} ${s?`bg-amber-900/30 text-amber-200 light:bg-amber-100 light:text-amber-800`:``}`,title:s?`${e.path}\n\nExternal change while you have unsaved edits — open the tab to review.`:e.path,children:[(0,R.jsxs)(`button`,{onClick:()=>r(e.path),className:`truncate`,children:[s?(0,R.jsx)($e,{size:11,className:`mr-1 inline text-amber-400 light:text-amber-700`}):e.dirty?(0,R.jsx)(`span`,{className:`mr-1.5 inline-block h-2.5 w-2.5 rounded-full bg-amber-400 align-middle`,"aria-label":`Unsaved changes`,title:`Unsaved changes`}):null,a]}),(0,R.jsx)(`button`,{onClick:()=>i(e.path),className:`rounded p-1 text-neutral-600 hover:bg-neutral-800 hover:text-neutral-200`,title:`Close (any unsaved changes are lost)`,children:(0,R.jsx)(rt,{size:16})})]},e.tabId)})})]})}function oM({path:e,onReload:t,onDiscard:n}){return(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-amber-700/40 bg-amber-900/20 px-4 py-1.5 text-xs text-amber-200 light:border-amber-300 light:bg-amber-50 light:text-amber-800`,children:[(0,R.jsxs)(`span`,{children:[`File changed externally — local edits in this tab are stale. Reload from disk?`,(0,R.jsx)(`span`,{className:`ml-2 font-mono text-[10px] text-amber-400/70 light:text-amber-700/80`,children:e})]}),(0,R.jsxs)(`div`,{className:`flex gap-1`,children:[(0,R.jsx)(`button`,{onClick:t,className:`rounded border border-amber-700/50 px-2 py-0.5 hover:bg-amber-900/30 light:border-amber-400 light:hover:bg-amber-100`,children:`Reload`}),(0,R.jsx)(`button`,{onClick:n,className:`rounded border border-neutral-700 px-2 py-0.5 text-neutral-300 hover:border-neutral-500`,children:`Keep mine`})]})]})}function sM({file:e,wrap:t,onToggleWrap:n,onSave:r}){let i=e.dirty,a=e.saving,o=e.savedAt,s=e.saveError,c,l=`text-neutral-500`;s===void 0?a?c=`Saving…`:i?(c=`Unsaved changes`,l=`text-amber-400 light:text-amber-700`):o===void 0?c=`Up to date`:(c=`Saved ${new Date(o).toLocaleTimeString()}`,l=`text-emerald-500 light:text-emerald-700`):(c=`Save failed (${s}) — Cmd/Ctrl+S or Save to retry`,l=`text-rose-400 light:text-rose-700`);let u=(i||s!==void 0)&&!a&&!e.binary;return(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-t border-neutral-800 bg-neutral-900/40 px-3 py-1 text-[11px]`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(`span`,{className:`font-mono text-neutral-500`,children:e.language}),(0,R.jsxs)(`button`,{onClick:n,className:`flex items-center gap-1 rounded px-1 py-0.5 text-[10px] hover:bg-neutral-800 ${t?`text-neutral-300`:`text-neutral-500`}`,title:t?`Wrap on (click to switch to horizontal scroll, persisted per file extension)`:`Wrap off (click to enable wrap, persisted per file extension)`,children:[(0,R.jsx)(Ze,{size:11}),t?`wrap`:`no wrap`]})]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(`span`,{className:l,children:c}),(0,R.jsxs)(`button`,{onClick:r,disabled:!u,className:`flex items-center gap-1 rounded border border-neutral-700 px-1.5 py-0.5 text-[10px] text-neutral-200 hover:border-neutral-500 disabled:cursor-not-allowed disabled:border-neutral-800 disabled:text-neutral-600`,title:`Save (Cmd/Ctrl+S)`,children:[(0,R.jsx)(Ke,{size:11}),`Save`]})]})]})}var cM=o(((e,t)=>{(function(n,r){if(typeof e==`object`&&typeof t==`object`)t.exports=r();else if(typeof define==`function`&&define.amd)define([],r);else{var i=r();for(var a in i)(typeof e==`object`?e:n)[a]=i[a]}})(globalThis,(()=>(()=>{var e={4567:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.AccessibilityManager=void 0;let a=n(9042),o=n(9924),s=n(844),c=n(4725),l=n(2585),u=n(3656),d=t.AccessibilityManager=class extends s.Disposable{constructor(e,t,n,r){super(),this._terminal=e,this._coreBrowserService=n,this._renderService=r,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce=``,this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement(`div`),this._accessibilityContainer.classList.add(`xterm-accessibility`),this._rowContainer=this._coreBrowserService.mainDocument.createElement(`div`),this._rowContainer.setAttribute(`role`,`list`),this._rowContainer.classList.add(`xterm-accessibility-tree`),this._rowElements=[];for(let e=0;e<this._terminal.rows;e++)this._rowElements[e]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[e]);if(this._topBoundaryFocusListener=e=>this._handleBoundaryFocus(e,0),this._bottomBoundaryFocusListener=e=>this._handleBoundaryFocus(e,1),this._rowElements[0].addEventListener(`focus`,this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener(`focus`,this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement(`div`),this._liveRegion.classList.add(`live-region`),this._liveRegion.setAttribute(`aria-live`,`assertive`),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new o.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw Error(`Cannot enable accessibility before Terminal.open`);this._terminal.element.insertAdjacentElement(`afterbegin`,this._accessibilityContainer),this.register(this._terminal.onResize((e=>this._handleResize(e.rows)))),this.register(this._terminal.onRender((e=>this._refreshRows(e.start,e.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((e=>this._handleChar(e)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
356
+ `)))),this.register(this._terminal.onA11yTab((e=>this._handleTab(e)))),this.register(this._terminal.onKey((e=>this._handleKey(e.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,u.addDisposableDomListener)(document,`selectionchange`,(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,s.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(` `)}_handleChar(e){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
357
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=a.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent=``,this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),/\p{Control}/u.test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){let n=this._terminal.buffer,r=n.lines.length.toString();for(let i=e;i<=t;i++){let e=n.lines.get(n.ydisp+i),t=[],a=e?.translateToString(!0,void 0,void 0,t)||``,o=(n.ydisp+i+1).toString(),s=this._rowElements[i];s&&(a.length===0?(s.innerText=`\xA0`,this._rowColumns.set(s,[0,1])):(s.textContent=a,this._rowColumns.set(s,t)),s.setAttribute(`aria-posinset`,o),s.setAttribute(`aria-setsize`,r))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce=``)}_handleBoundaryFocus(e,t){let n=e.target,r=this._rowElements[t===0?1:this._rowElements.length-2];if(n.getAttribute(`aria-posinset`)===(t===0?`1`:`${this._terminal.buffer.lines.length}`)||e.relatedTarget!==r)return;let i,a;if(t===0?(i=n,a=this._rowElements.pop(),this._rowContainer.removeChild(a)):(i=this._rowElements.shift(),a=n,this._rowContainer.removeChild(i)),i.removeEventListener(`focus`,this._topBoundaryFocusListener),a.removeEventListener(`focus`,this._bottomBoundaryFocusListener),t===0){let e=this._createAccessibilityTreeNode();this._rowElements.unshift(e),this._rowContainer.insertAdjacentElement(`afterbegin`,e)}else{let e=this._createAccessibilityTreeNode();this._rowElements.push(e),this._rowContainer.appendChild(e)}this._rowElements[0].addEventListener(`focus`,this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener(`focus`,this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;let e=document.getSelection();if(!e)return;if(e.isCollapsed)return void(this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection());if(!e.anchorNode||!e.focusNode)return void console.error(`anchorNode and/or focusNode are null`);let t={node:e.anchorNode,offset:e.anchorOffset},n={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(n.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===n.node&&t.offset>n.offset)&&([t,n]=[n,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;let r=this._rowElements.slice(-1)[0];if(n.node.compareDocumentPosition(r)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(n={node:r,offset:r.textContent?.length??0}),!this._rowContainer.contains(n.node))return;let i=({node:e,offset:t})=>{let n=e instanceof Text?e.parentNode:e,r=parseInt(n?.getAttribute(`aria-posinset`),10)-1;if(isNaN(r))return console.warn(`row is invalid. Race condition?`),null;let i=this._rowColumns.get(n);if(!i)return console.warn(`columns is null. Race condition?`),null;let a=t<i.length?i[t]:i.slice(-1)[0]+1;return a>=this._terminal.cols&&(++r,a=0),{row:r,column:a}},a=i(t),o=i(n);if(a&&o){if(a.row>o.row||a.row===o.row&&a.column>=o.column)throw Error(`invalid range`);this._terminal.select(a.column,a.row,(o.row-a.row)*this._terminal.cols-a.column+o.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener(`focus`,this._bottomBoundaryFocusListener);for(let e=this._rowContainer.children.length;e<this._terminal.rows;e++)this._rowElements[e]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[e]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener(`focus`,this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement(`div`);return e.setAttribute(`role`,`listitem`),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}};t.AccessibilityManager=d=r([i(1,l.IInstantiationService),i(2,c.ICoreBrowserService),i(3,c.IRenderService)],d)},3614:(e,t)=>{function n(e){return e.replace(/\r?\n/g,`\r`)}function r(e,t){return t?`\x1B[200~`+e+`\x1B[201~`:e}function i(e,t,i,a){e=r(e=n(e),i.decPrivateModes.bracketedPasteMode&&!0!==a.rawOptions.ignoreBracketedPasteMode),i.triggerDataEvent(e,!0),t.value=``}function a(e,t,n){let r=n.getBoundingClientRect(),i=e.clientX-r.left-10,a=e.clientY-r.top-10;t.style.width=`20px`,t.style.height=`20px`,t.style.left=`${i}px`,t.style.top=`${a}px`,t.style.zIndex=`1000`,t.focus()}Object.defineProperty(t,`__esModule`,{value:!0}),t.rightClickHandler=t.moveTextAreaUnderMouseCursor=t.paste=t.handlePasteEvent=t.copyHandler=t.bracketTextForPaste=t.prepareTextForTerminal=void 0,t.prepareTextForTerminal=n,t.bracketTextForPaste=r,t.copyHandler=function(e,t){e.clipboardData&&e.clipboardData.setData(`text/plain`,t.selectionText),e.preventDefault()},t.handlePasteEvent=function(e,t,n,r){e.stopPropagation(),e.clipboardData&&i(e.clipboardData.getData(`text/plain`),t,n,r)},t.paste=i,t.moveTextAreaUnderMouseCursor=a,t.rightClickHandler=function(e,t,n,r,i){a(e,t,n),i&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}},7239:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.ColorContrastCache=void 0;let r=n(1505);t.ColorContrastCache=class{constructor(){this._color=new r.TwoKeyMap,this._css=new r.TwoKeyMap}setCss(e,t,n){this._css.set(e,t,n)}getCss(e,t){return this._css.get(e,t)}setColor(e,t,n){this._color.set(e,t,n)}getColor(e,t){return this._color.get(e,t)}clear(){this._color.clear(),this._css.clear()}}},3656:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.addDisposableDomListener=void 0,t.addDisposableDomListener=function(e,t,n,r){e.addEventListener(t,n,r);let i=!1;return{dispose:()=>{i||(i=!0,e.removeEventListener(t,n,r))}}}},3551:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.Linkifier=void 0;let a=n(3656),o=n(8460),s=n(844),c=n(2585),l=n(4725),u=t.Linkifier=class extends s.Disposable{get currentLink(){return this._currentLink}constructor(e,t,n,r,i){super(),this._element=e,this._mouseService=t,this._renderService=n,this._bufferService=r,this._linkProviderService=i,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new o.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new o.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,s.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,s.toDisposable)((()=>{this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,a.addDisposableDomListener)(this._element,`mouseleave`,(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,a.addDisposableDomListener)(this._element,`mousemove`,this._handleMouseMove.bind(this))),this.register((0,a.addDisposableDomListener)(this._element,`mousedown`,this._handleMouseDown.bind(this))),this.register((0,a.addDisposableDomListener)(this._element,`mouseup`,this._handleMouseUp.bind(this)))}_handleMouseMove(e){this._lastMouseEvent=e;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!t)return;this._isMouseOut=!1;let n=e.composedPath();for(let e=0;e<n.length;e++){let t=n[e];if(t.classList.contains(`xterm`))break;if(t.classList.contains(`xterm-hover`))return}this._lastBufferCell&&t.x===this._lastBufferCell.x&&t.y===this._lastBufferCell.y||(this._handleHover(t),this._lastBufferCell=t)}_handleHover(e){if(this._activeLine!==e.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(e,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,t){this._activeProviderReplies&&t||(this._activeProviderReplies?.forEach((e=>{e?.forEach((e=>{e.link.dispose&&e.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=e.y);let n=!1;for(let[r,i]of this._linkProviderService.linkProviders.entries())t?this._activeProviderReplies?.get(r)&&(n=this._checkLinkProviderResult(r,e,n)):i.provideLinks(e.y,(t=>{if(this._isMouseOut)return;let i=t?.map((e=>({link:e})));this._activeProviderReplies?.set(r,i),n=this._checkLinkProviderResult(r,e,n),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)}))}_removeIntersectingLinks(e,t){let n=new Set;for(let r=0;r<t.size;r++){let i=t.get(r);if(i)for(let t=0;t<i.length;t++){let r=i[t],a=r.link.range.start.y<e?0:r.link.range.start.x,o=r.link.range.end.y>e?this._bufferService.cols:r.link.range.end.x;for(let e=a;e<=o;e++){if(n.has(e)){i.splice(t--,1);break}n.add(e)}}}}_checkLinkProviderResult(e,t,n){if(!this._activeProviderReplies)return n;let r=this._activeProviderReplies.get(e),i=!1;for(let t=0;t<e;t++)this._activeProviderReplies.has(t)&&!this._activeProviderReplies.get(t)||(i=!0);if(!i&&r){let e=r.find((e=>this._linkAtPosition(e.link,t)));e&&(n=!0,this._handleNewLink(e))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!n)for(let e=0;e<this._activeProviderReplies.size;e++){let r=this._activeProviderReplies.get(e)?.find((e=>this._linkAtPosition(e.link,t)));if(r){n=!0,this._handleNewLink(r);break}}return n}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._currentLink)return;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,t)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,t){this._currentLink&&this._lastMouseEvent&&(!e||!t||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,s.disposeArray)(this._linkCacheDisposables))}_handleNewLink(e){if(!this._lastMouseEvent)return;let t=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);t&&this._linkAtPosition(e.link,t)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0||e.link.decorations.underline,pointerCursor:e.link.decorations===void 0||e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:e=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==e&&(this._currentLink.state.decorations.pointerCursor=e,this._currentLink.state.isHovered&&this._element.classList.toggle(`xterm-cursor-pointer`,e))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:t=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==t&&(this._currentLink.state.decorations.underline=t,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,t))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((e=>{if(!this._currentLink)return;let t=e.start===0?0:e.start+1+this._bufferService.buffer.ydisp,n=this._bufferService.buffer.ydisp+1+e.end;if(this._currentLink.link.range.start.y>=t&&this._currentLink.link.range.end.y<=n&&(this._clearCurrentLink(t,n),this._lastMouseEvent)){let e=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);e&&this._askForLink(e,!1)}}))))}_linkHover(e,t,n){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add(`xterm-cursor-pointer`)),t.hover&&t.hover(n,t.text)}_fireUnderlineEvent(e,t){let n=e.range,r=this._bufferService.buffer.ydisp,i=this._createLinkUnderlineEvent(n.start.x-1,n.start.y-r-1,n.end.x,n.end.y-r-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(i)}_linkLeave(e,t,n){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove(`xterm-cursor-pointer`)),t.leave&&t.leave(n,t.text)}_linkAtPosition(e,t){let n=e.range.start.y*this._bufferService.cols+e.range.start.x,r=e.range.end.y*this._bufferService.cols+e.range.end.x,i=t.y*this._bufferService.cols+t.x;return n<=i&&i<=r}_positionFromMouseEvent(e,t,n){let r=n.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(r)return{x:r[0],y:r[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,n,r,i){return{x1:e,y1:t,x2:n,y2:r,cols:this._bufferService.cols,fg:i}}};t.Linkifier=u=r([i(1,l.IMouseService),i(2,l.IRenderService),i(3,c.IBufferService),i(4,l.ILinkProviderService)],u)},9042:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.tooMuchOutput=t.promptLabel=void 0,t.promptLabel=`Terminal input`,t.tooMuchOutput=`Too much output to announce, navigate to rows manually to read`},3730:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.OscLinkProvider=void 0;let a=n(511),o=n(2585),s=t.OscLinkProvider=class{constructor(e,t,n){this._bufferService=e,this._optionsService=t,this._oscLinkService=n}provideLinks(e,t){let n=this._bufferService.buffer.lines.get(e-1);if(!n)return void t(void 0);let r=[],i=this._optionsService.rawOptions.linkHandler,o=new a.CellData,s=n.getTrimmedLength(),l=-1,u=-1,d=!1;for(let t=0;t<s;t++)if(u!==-1||n.hasContent(t)){if(n.loadCell(t,o),o.hasExtendedAttrs()&&o.extended.urlId){if(u===-1){u=t,l=o.extended.urlId;continue}d=o.extended.urlId!==l}else u!==-1&&(d=!0);if(d||u!==-1&&t===s-1){let n=this._oscLinkService.getLinkData(l)?.uri;if(n){let a={start:{x:u+1,y:e},end:{x:t+(d||t!==s-1?0:1),y:e}},o=!1;if(!i?.allowNonHttpProtocols)try{let e=new URL(n);[`http:`,`https:`].includes(e.protocol)||(o=!0)}catch{o=!0}o||r.push({text:n,range:a,activate:(e,t)=>i?i.activate(e,t,a):c(0,t),hover:(e,t)=>i?.hover?.(e,t,a),leave:(e,t)=>i?.leave?.(e,t,a)})}d=!1,o.hasExtendedAttrs()&&o.extended.urlId?(u=t,l=o.extended.urlId):(u=-1,l=-1)}}t(r)}};function c(e,t){if(confirm(`Do you want to navigate to ${t}?\n\nWARNING: This link could potentially be dangerous`)){let e=window.open();if(e){try{e.opener=null}catch{}e.location.href=t}else console.warn(`Opening link blocked as opener could not be cleared`)}}t.OscLinkProvider=s=r([i(0,o.IBufferService),i(1,o.IOptionsService),i(2,o.IOscLinkService)],s)},6193:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.RenderDebouncer=void 0,t.RenderDebouncer=class{constructor(e,t){this._renderCallback=e,this._coreBrowserService=t,this._refreshCallbacks=[]}dispose(){this._animationFrame&&=(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),void 0)}addRefreshCallback(e){return this._refreshCallbacks.push(e),this._animationFrame||=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())),this._animationFrame}refresh(e,t,n){this._rowCount=n,e=e===void 0?0:e,t=t===void 0?this._rowCount-1:t,this._rowStart=this._rowStart===void 0?e:Math.min(this._rowStart,e),this._rowEnd=this._rowEnd===void 0?t:Math.max(this._rowEnd,t),this._animationFrame||=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}}},3236:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.Terminal=void 0;let r=n(3614),i=n(3656),a=n(3551),o=n(9042),s=n(3730),c=n(1680),l=n(3107),u=n(5744),d=n(2950),f=n(1296),p=n(428),m=n(4269),h=n(5114),g=n(8934),_=n(3230),v=n(9312),y=n(4725),b=n(6731),x=n(8055),S=n(8969),C=n(8460),w=n(844),T=n(6114),E=n(8437),D=n(2584),O=n(7399),k=n(5941),ee=n(9074),te=n(2585),ne=n(5435),re=n(4567),ie=n(779);class ae extends S.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(e={}){super(e),this.browser=T,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new w.MutableDisposable),this._onCursorMove=this.register(new C.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new C.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new C.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new C.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new C.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new C.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new C.EventEmitter),this._onBlur=this.register(new C.EventEmitter),this._onA11yCharEmitter=this.register(new C.EventEmitter),this._onA11yTabEmitter=this.register(new C.EventEmitter),this._onWillOpen=this.register(new C.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(ee.DecorationService),this._instantiationService.setService(te.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(ie.LinkProviderService),this._instantiationService.setService(y.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(s.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((e,t)=>this.refresh(e,t)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((e=>this._reportWindowsOptions(e)))),this.register(this._inputHandler.onColor((e=>this._handleColorEvent(e)))),this.register((0,C.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,C.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,C.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,C.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((e=>this._afterResize(e.cols,e.rows)))),this.register((0,w.toDisposable)((()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)})))}_handleColorEvent(e){if(this._themeService)for(let t of e){let e,n=``;switch(t.index){case 256:e=`foreground`,n=`10`;break;case 257:e=`background`,n=`11`;break;case 258:e=`cursor`,n=`12`;break;default:e=`ansi`,n=`4;`+t.index}switch(t.type){case 0:let r=x.color.toColorRGB(e===`ansi`?this._themeService.colors.ansi[t.index]:this._themeService.colors[e]);this.coreService.triggerDataEvent(`${D.C0.ESC}]${n};${(0,k.toRgbString)(r)}${D.C1_ESCAPED.ST}`);break;case 1:if(e===`ansi`)this._themeService.modifyColors((e=>e.ansi[t.index]=x.channels.toColor(...t.color)));else{let n=e;this._themeService.modifyColors((e=>e[n]=x.channels.toColor(...t.color)))}break;case 2:this._themeService.restoreColor(t.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(e){e?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(re.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(D.C0.ESC+`[I`),this.element.classList.add(`focus`),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value=``,this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(D.C0.ESC+`[O`),this.element.classList.remove(`focus`),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let e=this.buffer.ybase+this.buffer.y,t=this.buffer.lines.get(e);if(!t)return;let n=Math.min(this.buffer.x,this.cols-1),r=this._renderService.dimensions.css.cell.height,i=t.getWidth(n),a=this._renderService.dimensions.css.cell.width*i,o=this.buffer.y*this._renderService.dimensions.css.cell.height,s=n*this._renderService.dimensions.css.cell.width;this.textarea.style.left=s+`px`,this.textarea.style.top=o+`px`,this.textarea.style.width=a+`px`,this.textarea.style.height=r+`px`,this.textarea.style.lineHeight=r+`px`,this.textarea.style.zIndex=`-5`}_initGlobal(){this._bindKeys(),this.register((0,i.addDisposableDomListener)(this.element,`copy`,(e=>{this.hasSelection()&&(0,r.copyHandler)(e,this._selectionService)})));let e=e=>(0,r.handlePasteEvent)(e,this.textarea,this.coreService,this.optionsService);this.register((0,i.addDisposableDomListener)(this.textarea,`paste`,e)),this.register((0,i.addDisposableDomListener)(this.element,`paste`,e)),T.isFirefox?this.register((0,i.addDisposableDomListener)(this.element,`mousedown`,(e=>{e.button===2&&(0,r.rightClickHandler)(e,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,i.addDisposableDomListener)(this.element,`contextmenu`,(e=>{(0,r.rightClickHandler)(e,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),T.isLinux&&this.register((0,i.addDisposableDomListener)(this.element,`auxclick`,(e=>{e.button===1&&(0,r.moveTextAreaUnderMouseCursor)(e,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,i.addDisposableDomListener)(this.textarea,`keyup`,(e=>this._keyUp(e)),!0)),this.register((0,i.addDisposableDomListener)(this.textarea,`keydown`,(e=>this._keyDown(e)),!0)),this.register((0,i.addDisposableDomListener)(this.textarea,`keypress`,(e=>this._keyPress(e)),!0)),this.register((0,i.addDisposableDomListener)(this.textarea,`compositionstart`,(()=>this._compositionHelper.compositionstart()))),this.register((0,i.addDisposableDomListener)(this.textarea,`compositionupdate`,(e=>this._compositionHelper.compositionupdate(e)))),this.register((0,i.addDisposableDomListener)(this.textarea,`compositionend`,(()=>this._compositionHelper.compositionend()))),this.register((0,i.addDisposableDomListener)(this.textarea,`input`,(e=>this._inputEvent(e)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(e){if(!e)throw Error(`Terminal requires a parent element.`);if(e.isConnected||this._logService.debug(`Terminal.open was called on an element that was not attached to the DOM`),this.element?.ownerDocument.defaultView&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=e.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement(`div`),this.element.dir=`ltr`,this.element.classList.add(`terminal`),this.element.classList.add(`xterm`),e.appendChild(this.element);let t=this._document.createDocumentFragment();this._viewportElement=this._document.createElement(`div`),this._viewportElement.classList.add(`xterm-viewport`),t.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement(`div`),this._viewportScrollArea.classList.add(`xterm-scroll-area`),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement(`div`),this.screenElement.classList.add(`xterm-screen`),this.register((0,i.addDisposableDomListener)(this.screenElement,`mousemove`,(e=>this.updateCursorStyle(e)))),this._helperContainer=this._document.createElement(`div`),this._helperContainer.classList.add(`xterm-helpers`),this.screenElement.appendChild(this._helperContainer),t.appendChild(this.screenElement),this.textarea=this._document.createElement(`textarea`),this.textarea.classList.add(`xterm-helper-textarea`),this.textarea.setAttribute(`aria-label`,o.promptLabel),T.isChromeOS||this.textarea.setAttribute(`aria-multiline`,`false`),this.textarea.setAttribute(`autocorrect`,`off`),this.textarea.setAttribute(`autocapitalize`,`off`),this.textarea.setAttribute(`spellcheck`,`false`),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(h.CoreBrowserService,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<`u`?window.document:null)),this._instantiationService.setService(y.ICoreBrowserService,this._coreBrowserService),this.register((0,i.addDisposableDomListener)(this.textarea,`focus`,(e=>this._handleTextAreaFocus(e)))),this.register((0,i.addDisposableDomListener)(this.textarea,`blur`,(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(p.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(y.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(b.ThemeService),this._instantiationService.setService(y.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(m.CharacterJoinerService),this._instantiationService.setService(y.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(_.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(y.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((e=>this._onRender.fire(e)))),this.onResize((e=>this._renderService.resize(e.cols,e.rows))),this._compositionView=this._document.createElement(`div`),this._compositionView.classList.add(`composition-view`),this._compositionHelper=this._instantiationService.createInstance(d.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(g.MouseService),this._instantiationService.setService(y.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(a.Linkifier,this.screenElement)),this.element.appendChild(t);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(c.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((e=>this.scrollLines(e.amount,e.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.handleCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.handleResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.handleBlur()))),this.register(this.onFocus((()=>this._renderService.handleFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(v.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(y.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((e=>this.scrollLines(e.amount,e.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((e=>this._renderService.handleSelectionChanged(e.start,e.end,e.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((e=>{this.textarea.value=e,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((e=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,i.addDisposableDomListener)(this._viewportElement,`scroll`,(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(l.BufferDecorationRenderer,this.screenElement)),this.register((0,i.addDisposableDomListener)(this.element,`mousedown`,(e=>this._selectionService.handleMouseDown(e)))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add(`enable-mouse-events`)):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(re.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange(`screenReaderMode`,(e=>this._handleScreenReaderModeOptionChange(e)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(u.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange(`overviewRulerWidth`,(e=>{!this._overviewRulerRenderer&&e&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(u.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(f.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,t=this.element;function n(t){let n=e._mouseService.getMouseReportCoords(t,e.screenElement);if(!n)return!1;let r,i;switch(t.overrideType||t.type){case`mousemove`:i=32,t.buttons===void 0?(r=3,t.button!==void 0&&(r=t.button<3?t.button:3)):r=1&t.buttons?0:4&t.buttons?1:2&t.buttons?2:3;break;case`mouseup`:i=0,r=t.button<3?t.button:3;break;case`mousedown`:i=1,r=t.button<3?t.button:3;break;case`wheel`:if(e._customWheelEventHandler&&!1===e._customWheelEventHandler(t)||e.viewport.getLinesScrolled(t)===0)return!1;i=t.deltaY<0?0:1,r=4;break;default:return!1}return!(i===void 0||r===void 0||r>4)&&e.coreMouseService.triggerMouseEvent({col:n.col,row:n.row,x:n.x,y:n.y,button:r,action:i,ctrl:t.ctrlKey,alt:t.altKey,shift:t.shiftKey})}let r={mouseup:null,wheel:null,mousedrag:null,mousemove:null},a={mouseup:e=>(n(e),e.buttons||(this._document.removeEventListener(`mouseup`,r.mouseup),r.mousedrag&&this._document.removeEventListener(`mousemove`,r.mousedrag)),this.cancel(e)),wheel:e=>(n(e),this.cancel(e,!0)),mousedrag:e=>{e.buttons&&n(e)},mousemove:e=>{e.buttons||n(e)}};this.register(this.coreMouseService.onProtocolChange((e=>{e?(this.optionsService.rawOptions.logLevel===`debug`&&this._logService.debug(`Binding to mouse events:`,this.coreMouseService.explainEvents(e)),this.element.classList.add(`enable-mouse-events`),this._selectionService.disable()):(this._logService.debug(`Unbinding from mouse events.`),this.element.classList.remove(`enable-mouse-events`),this._selectionService.enable()),8&e?r.mousemove||=(t.addEventListener(`mousemove`,a.mousemove),a.mousemove):(t.removeEventListener(`mousemove`,r.mousemove),r.mousemove=null),16&e?r.wheel||=(t.addEventListener(`wheel`,a.wheel,{passive:!1}),a.wheel):(t.removeEventListener(`wheel`,r.wheel),r.wheel=null),2&e?r.mouseup||=a.mouseup:(this._document.removeEventListener(`mouseup`,r.mouseup),r.mouseup=null),4&e?r.mousedrag||=a.mousedrag:(this._document.removeEventListener(`mousemove`,r.mousedrag),r.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,i.addDisposableDomListener)(t,`mousedown`,(e=>{if(e.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(e))return n(e),r.mouseup&&this._document.addEventListener(`mouseup`,r.mouseup),r.mousedrag&&this._document.addEventListener(`mousemove`,r.mousedrag),this.cancel(e)}))),this.register((0,i.addDisposableDomListener)(t,`wheel`,(e=>{if(!r.wheel){if(this._customWheelEventHandler&&!1===this._customWheelEventHandler(e))return!1;if(!this.buffer.hasScrollback){let t=this.viewport.getLinesScrolled(e);if(t===0)return;let n=D.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?`O`:`[`)+(e.deltaY<0?`A`:`B`),r=``;for(let e=0;e<Math.abs(t);e++)r+=n;return this.coreService.triggerDataEvent(r,!0),this.cancel(e,!0)}return this.viewport.handleWheel(e)?this.cancel(e):void 0}}),{passive:!1})),this.register((0,i.addDisposableDomListener)(t,`touchstart`,(e=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(e),this.cancel(e)}),{passive:!0})),this.register((0,i.addDisposableDomListener)(t,`touchmove`,(e=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(e)?void 0:this.cancel(e)}),{passive:!1}))}refresh(e,t){this._renderService?.refreshRows(e,t)}updateCursorStyle(e){this._selectionService?.shouldColumnSelect(e)?this.element.classList.add(`column-select`):this.element.classList.remove(`column-select`)}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(e,t,n=0){n===1?(super.scrollLines(e,t,n),this.refresh(0,this.rows-1)):this.viewport?.scrollLines(e)}paste(e){(0,r.paste)(e,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}attachCustomWheelEventHandler(e){this._customWheelEventHandler=e}registerLinkProvider(e){return this._linkProviderService.registerLinkProvider(e)}registerCharacterJoiner(e){if(!this._characterJoinerService)throw Error(`Terminal must be opened first`);let t=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),t}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw Error(`Terminal must be opened first`);this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(e,t,n){this._selectionService.setSelection(e,t,n)}getSelection(){return this._selectionService?this._selectionService.selectionText:``}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(e,t){this._selectionService?.selectLines(e,t)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&!1===this._customKeyEventHandler(e))return!1;let t=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!t&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;t||e.key!==`Dead`&&e.key!==`AltGraph`||(this._unprocessedDeadKey=!0);let n=(0,O.evaluateKeyboardEvent)(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),n.type===3||n.type===2){let t=this.rows-1;return this.scrollLines(n.type===2?-t:t),this.cancel(e,!0)}return n.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,e)||(n.cancel&&this.cancel(e,!0),!n.key||!!(e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.key.length===1&&e.key.charCodeAt(0)>=65&&e.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(n.key!==D.C0.ETX&&n.key!==D.C0.CR||(this.textarea.value=``),this._onKey.fire({key:n.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(n.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey?this.cancel(e,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(e,t){let n=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isWindows&&t.altKey&&t.ctrlKey&&!t.metaKey||e.isWindows&&t.getModifierState(`AltGraph`);return t.type===`keypress`?n:n&&(!t.keyCode||t.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,this._customKeyEventHandler&&!1===this._customKeyEventHandler(e)||(function(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let t;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&!1===this._customKeyEventHandler(e))return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(e.which===null||e.which===void 0)t=e.keyCode;else{if(e.which===0||e.charCode===0)return!1;t=e.which}return!(!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)||(t=String.fromCharCode(t),this._onKey.fire({key:t,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(t,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(e){if(e.data&&e.inputType===`insertText`&&(!e.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let t=e.data;return this.coreService.triggerDataEvent(t,!0),this.cancel(e),!0}return!1}resize(e,t){e!==this.cols||t!==this.rows?super.resize(e,t):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(e,t){this._charSizeService?.measure(),this.viewport?.syncScrollArea(!0)}clear(){if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let e=1;e<this.rows;e++)this.buffer.lines.push(this.buffer.getBlankLine(E.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),this.viewport?.reset(),this.refresh(0,this.rows-1)}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;let e=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this.viewport?.reset(),this._customKeyEventHandler=e,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains(`focus`)?this.coreService.triggerDataEvent(D.C0.ESC+`[I`):this.coreService.triggerDataEvent(D.C0.ESC+`[O`)}_reportWindowsOptions(e){if(this._renderService)switch(e){case ne.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:let e=this._renderService.dimensions.css.canvas.width.toFixed(0),t=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${D.C0.ESC}[4;${t};${e}t`);break;case ne.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:let n=this._renderService.dimensions.css.cell.width.toFixed(0),r=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${D.C0.ESC}[6;${r};${n}t`)}}cancel(e,t){if(this.options.cancelEvents||t)return e.preventDefault(),e.stopPropagation(),!1}}t.Terminal=ae},9924:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.TimeBasedDebouncer=void 0,t.TimeBasedDebouncer=class{constructor(e,t=1e3){this._renderCallback=e,this._debounceThresholdMS=t,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,t,n){this._rowCount=n,e=e===void 0?0:e,t=t===void 0?this._rowCount-1:t,this._rowStart=this._rowStart===void 0?e:Math.min(this._rowStart,e),this._rowEnd=this._rowEnd===void 0?t:Math.max(this._rowEnd,t);let r=Date.now();if(r-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=r,this._innerRefresh();else if(!this._additionalRefreshRequested){let e=r-this._lastRefreshMs,t=this._debounceThresholdMS-e;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),t)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t)}}},1680:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.Viewport=void 0;let a=n(3656),o=n(4725),s=n(8460),c=n(844),l=n(2585),u=t.Viewport=class extends c.Disposable{constructor(e,t,n,r,i,o,c,l){super(),this._viewportElement=e,this._scrollArea=t,this._bufferService=n,this._optionsService=r,this._charSizeService=i,this._renderService=o,this._coreBrowserService=c,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new s.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,a.addDisposableDomListener)(this._viewportElement,`scroll`,this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((e=>this._activeBuffer=e.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((e=>this._renderDimensions=e))),this._handleThemeChange(l.colors),this.register(l.onChangeColors((e=>this._handleThemeChange(e)))),this.register(this._optionsService.onSpecificOptionChange(`scrollback`,(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(e){this._viewportElement.style.backgroundColor=e.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(e){if(e)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;let e=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==e&&(this._lastRecordedBufferHeight=e,this._scrollArea.style.height=this._lastRecordedBufferHeight+`px`)}let e=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==e&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=e),this._refreshAnimationFrame=null}syncScrollArea(e=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(e);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(e)}_handleScroll(e){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});let t=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:t,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;let e=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(e*(this._smoothScrollState.target-this._smoothScrollState.origin)),e<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(e,t){let n=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(t<0&&this._viewportElement.scrollTop!==0||t>0&&n<this._lastRecordedBufferHeight)||(e.cancelable&&e.preventDefault(),!1)}handleWheel(e){let t=this._getPixelsScrolled(e);return t!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+t:this._smoothScrollState.target+=t,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=t,this._bubbleScroll(e,t))}scrollLines(e){if(e!==0)if(this._optionsService.rawOptions.smoothScrollDuration){let t=e*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+t,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:e,suppressScrollEvent:!1})}_getPixelsScrolled(e){if(e.deltaY===0||e.shiftKey)return 0;let t=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_LINE?t*=this._currentRowHeight:e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(t*=this._currentRowHeight*this._bufferService.rows),t}getBufferElements(e,t){let n,r=``,i=[],a=t??this._bufferService.buffer.lines.length,o=this._bufferService.buffer.lines;for(let t=e;t<a;t++){let e=o.get(t);if(!e)continue;let a=o.get(t+1)?.isWrapped;if(r+=e.translateToString(!a),!a||t===o.length-1){let e=document.createElement(`div`);e.textContent=r,i.push(e),r.length>0&&(n=e),r=``}}return{bufferElements:i,cursorElement:n}}getLinesScrolled(e){if(e.deltaY===0||e.shiftKey)return 0;let t=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(t/=this._currentRowHeight+0,this._wheelPartialScroll+=t,t=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(t*=this._bufferService.rows),t}_applyScrollModifier(e,t){let n=this._optionsService.rawOptions.fastScrollModifier;return n===`alt`&&t.altKey||n===`ctrl`&&t.ctrlKey||n===`shift`&&t.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(e){this._lastTouchY=e.touches[0].pageY}handleTouchMove(e){let t=this._lastTouchY-e.touches[0].pageY;return this._lastTouchY=e.touches[0].pageY,t!==0&&(this._viewportElement.scrollTop+=t,this._bubbleScroll(e,t))}};t.Viewport=u=r([i(2,l.IBufferService),i(3,l.IOptionsService),i(4,o.ICharSizeService),i(5,o.IRenderService),i(6,o.ICoreBrowserService),i(7,o.IThemeService)],u)},3107:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.BufferDecorationRenderer=void 0;let a=n(4725),o=n(844),s=n(2585),c=t.BufferDecorationRenderer=class extends o.Disposable{constructor(e,t,n,r,i){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=n,this._decorationService=r,this._renderService=i,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement(`div`),this._container.classList.add(`xterm-decoration-container`),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((e=>this._removeDecoration(e)))),this.register((0,o.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(let e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){let t=this._coreBrowserService.mainDocument.createElement(`div`);t.classList.add(`xterm-decoration`),t.classList.toggle(`xterm-decoration-top-layer`,e?.options?.layer===`top`),t.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,t.style.height=(e.options.height||1)*this._renderService.dimensions.css.cell.height+`px`,t.style.top=(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+`px`,t.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let n=e.options.x??0;return n&&n>this._bufferService.cols&&(t.style.display=`none`),this._refreshXPosition(e,t),t}_refreshStyle(e){let t=e.marker.line-this._bufferService.buffers.active.ydisp;if(t<0||t>=this._bufferService.rows)e.element&&(e.element.style.display=`none`,e.onRenderEmitter.fire(e.element));else{let n=this._decorationElements.get(e);n||(n=this._createElement(e),e.element=n,this._decorationElements.set(e,n),this._container.appendChild(n),e.onDispose((()=>{this._decorationElements.delete(e),n.remove()}))),n.style.top=t*this._renderService.dimensions.css.cell.height+`px`,n.style.display=this._altBufferIsActive?`none`:`block`,e.onRenderEmitter.fire(n)}}_refreshXPosition(e,t=e.element){if(!t)return;let n=e.options.x??0;(e.options.anchor||`left`)===`right`?t.style.right=n?n*this._renderService.dimensions.css.cell.width+`px`:``:t.style.left=n?n*this._renderService.dimensions.css.cell.width+`px`:``}_removeDecoration(e){this._decorationElements.get(e)?.remove(),this._decorationElements.delete(e),e.dispose()}};t.BufferDecorationRenderer=c=r([i(1,s.IBufferService),i(2,a.ICoreBrowserService),i(3,s.IDecorationService),i(4,a.IRenderService)],c)},5871:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.ColorZoneStore=void 0,t.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(e){if(e.options.overviewRulerOptions){for(let t of this._zones)if(t.color===e.options.overviewRulerOptions.color&&t.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(t,e.marker.line))return;if(this._lineAdjacentToZone(t,e.marker.line,e.options.overviewRulerOptions.position))return void this._addLineToZone(t,e.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=e.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=e.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=e.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=e.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:e.options.overviewRulerOptions.color,position:e.options.overviewRulerOptions.position,startBufferLine:e.marker.line,endBufferLine:e.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(e){this._linePadding=e}_lineIntersectsZone(e,t){return t>=e.startBufferLine&&t<=e.endBufferLine}_lineAdjacentToZone(e,t,n){return t>=e.startBufferLine-this._linePadding[n||`full`]&&t<=e.endBufferLine+this._linePadding[n||`full`]}_addLineToZone(e,t){e.startBufferLine=Math.min(e.startBufferLine,t),e.endBufferLine=Math.max(e.endBufferLine,t)}}},5744:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.OverviewRulerRenderer=void 0;let a=n(5871),o=n(4725),s=n(844),c=n(2585),l={full:0,left:0,center:0,right:0},u={full:0,left:0,center:0,right:0},d={full:0,left:0,center:0,right:0},f=t.OverviewRulerRenderer=class extends s.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(e,t,n,r,i,o,c){super(),this._viewportElement=e,this._screenElement=t,this._bufferService=n,this._decorationService=r,this._renderService=i,this._optionsService=o,this._coreBrowserService=c,this._colorZoneStore=new a.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement(`canvas`),this._canvas.classList.add(`xterm-decoration-overview-ruler`),this._refreshCanvasDimensions(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement);let l=this._canvas.getContext(`2d`);if(!l)throw Error(`Ctx cannot be null`);this._ctx=l,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,s.toDisposable)((()=>{this._canvas?.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?`none`:`block`}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange(`overviewRulerWidth`,(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){let e=Math.floor(this._canvas.width/3),t=Math.ceil(this._canvas.width/3);u.full=this._canvas.width,u.left=e,u.center=t,u.right=e,this._refreshDrawHeightConstants(),d.full=0,d.left=0,d.center=u.left,d.right=u.left+u.center}_refreshDrawHeightConstants(){l.full=Math.round(2*this._coreBrowserService.dpr);let e=this._canvas.height/this._bufferService.buffer.lines.length,t=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowserService.dpr);l.left=t,l.center=t,l.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*l.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*l.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*l.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*l.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(let e of this._decorationService.decorations)this._colorZoneStore.addDecoration(e);this._ctx.lineWidth=1;let e=this._colorZoneStore.zones;for(let t of e)t.position!==`full`&&this._renderColorZone(t);for(let t of e)t.position===`full`&&this._renderColorZone(t);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(e){this._ctx.fillStyle=e.color,this._ctx.fillRect(d[e.position||`full`],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-l[e.position||`full`]/2),u[e.position||`full`],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+l[e.position||`full`]))}_queueRefresh(e,t){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=t||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};t.OverviewRulerRenderer=f=r([i(2,c.IBufferService),i(3,c.IDecorationService),i(4,o.IRenderService),i(5,c.IOptionsService),i(6,o.ICoreBrowserService)],f)},2950:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.CompositionHelper=void 0;let a=n(4725),o=n(2585),s=n(2584),c=t.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(e,t,n,r,i,a){this._textarea=e,this._compositionView=t,this._bufferService=n,this._optionsService=r,this._coreService=i,this._renderService=a,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=``}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent=``,this._dataAlreadySent=``,this._compositionView.classList.add(`active`)}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(e.keyCode===229||e.keyCode===16||e.keyCode===17||e.keyCode===18)return!1;this._finalizeComposition(!1)}return e.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(e){if(this._compositionView.classList.remove(`active`),this._isComposing=!1,e){let e={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let t;this._isSendingComposition=!1,e.start+=this._dataAlreadySent.length,t=this._isComposing?this._textarea.value.substring(e.start,e.end):this._textarea.value.substring(e.start),t.length>0&&this._coreService.triggerDataEvent(t,!0)}}),0)}else{this._isSendingComposition=!1;let e=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(e,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout((()=>{if(!this._isComposing){let t=this._textarea.value,n=t.replace(e,``);this._dataAlreadySent=n,t.length>e.length?this._coreService.triggerDataEvent(n,!0):t.length<e.length?this._coreService.triggerDataEvent(`${s.C0.DEL}`,!0):t.length===e.length&&t!==e&&this._coreService.triggerDataEvent(t,!0)}}),0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let e=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),t=this._renderService.dimensions.css.cell.height,n=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,r=e*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=r+`px`,this._compositionView.style.top=n+`px`,this._compositionView.style.height=t+`px`,this._compositionView.style.lineHeight=t+`px`,this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+`px`;let i=this._compositionView.getBoundingClientRect();this._textarea.style.left=r+`px`,this._textarea.style.top=n+`px`,this._textarea.style.width=Math.max(i.width,1)+`px`,this._textarea.style.height=Math.max(i.height,1)+`px`,this._textarea.style.lineHeight=i.height+`px`}e||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};t.CompositionHelper=c=r([i(2,o.IBufferService),i(3,o.IOptionsService),i(4,o.ICoreService),i(5,a.IRenderService)],c)},9806:(e,t)=>{function n(e,t,n){let r=n.getBoundingClientRect(),i=e.getComputedStyle(n),a=parseInt(i.getPropertyValue(`padding-left`)),o=parseInt(i.getPropertyValue(`padding-top`));return[t.clientX-r.left-a,t.clientY-r.top-o]}Object.defineProperty(t,`__esModule`,{value:!0}),t.getCoords=t.getCoordsRelativeToElement=void 0,t.getCoordsRelativeToElement=n,t.getCoords=function(e,t,r,i,a,o,s,c,l){if(!o)return;let u=n(e,t,r);return u?(u[0]=Math.ceil((u[0]+(l?s/2:0))/s),u[1]=Math.ceil(u[1]/c),u[0]=Math.min(Math.max(u[0],1),i+ +!!l),u[1]=Math.min(Math.max(u[1],1),a),u):void 0}},9504:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.moveToCellSequence=void 0;let r=n(2584);function i(e,t,n,r){let i=e-a(e,n),s=t-a(t,n);return l(Math.abs(i-s)-function(e,t,n){let r=0,i=e-a(e,n),s=t-a(t,n);for(let a=0;a<Math.abs(i-s);a++){let s=o(e,t)===`A`?-1:1;n.buffer.lines.get(i+s*a)?.isWrapped&&r++}return r}(e,t,n),c(o(e,t),r))}function a(e,t){let n=0,r=t.buffer.lines.get(e),i=r?.isWrapped;for(;i&&e>=0&&e<t.rows;)n++,r=t.buffer.lines.get(--e),i=r?.isWrapped;return n}function o(e,t){return e>t?`A`:`B`}function s(e,t,n,r,i,a){let o=e,s=t,c=``;for(;o!==n||s!==r;)o+=i?1:-1,i&&o>a.cols-1?(c+=a.buffer.translateBufferLineToString(s,!1,e,o),o=0,e=0,s++):!i&&o<0&&(c+=a.buffer.translateBufferLineToString(s,!1,0,e+1),o=a.cols-1,e=o,s--);return c+a.buffer.translateBufferLineToString(s,!1,e,o)}function c(e,t){let n=t?`O`:`[`;return r.C0.ESC+n+e}function l(e,t){e=Math.floor(e);let n=``;for(let r=0;r<e;r++)n+=t;return n}t.moveToCellSequence=function(e,t,n,r){let o=n.buffer.x,u=n.buffer.y;if(!n.buffer.hasScrollback)return function(e,t,n,r,o,u){return i(t,r,o,u).length===0?``:l(s(e,t,e,t-a(t,o),!1,o).length,c(`D`,u))}(o,u,0,t,n,r)+i(u,t,n,r)+function(e,t,n,r,o,u){let d;d=i(t,r,o,u).length>0?r-a(r,o):t;let f=r,p=function(e,t,n,r,o,s){let c;return c=i(n,r,o,s).length>0?r-a(r,o):t,e<n&&c<=r||e>=n&&c<r?`C`:`D`}(e,t,n,r,o,u);return l(s(e,d,n,f,p===`C`,o).length,c(p,u))}(o,u,e,t,n,r);let d;if(u===t)return d=o>e?`D`:`C`,l(Math.abs(o-e),c(d,r));d=u>t?`D`:`C`;let f=Math.abs(u-t);return l(function(e,t){return t.cols-e}(u>t?e:o,n)+(f-1)*n.cols+1+((u>t?o:e)-1),c(d,r))}},1296:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.DomRenderer=void 0;let a=n(3787),o=n(2550),s=n(2223),c=n(6171),l=n(6052),u=n(4725),d=n(8055),f=n(8460),p=n(844),m=n(2585),h=`xterm-dom-renderer-owner-`,g=`xterm-rows`,_=`xterm-fg-`,v=`xterm-bg-`,y=`xterm-focus`,b=`xterm-selection`,x=1,S=t.DomRenderer=class extends p.Disposable{constructor(e,t,n,r,i,s,u,d,m,_,v,y,S){super(),this._terminal=e,this._document=t,this._element=n,this._screenElement=r,this._viewportElement=i,this._helperContainer=s,this._linkifier2=u,this._charSizeService=m,this._optionsService=_,this._bufferService=v,this._coreBrowserService=y,this._themeService=S,this._terminalClass=x++,this._rowElements=[],this._selectionRenderModel=(0,l.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new f.EventEmitter).event,this._rowContainer=this._document.createElement(`div`),this._rowContainer.classList.add(g),this._rowContainer.style.lineHeight=`normal`,this._rowContainer.setAttribute(`aria-hidden`,`true`),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement(`div`),this._selectionContainer.classList.add(b),this._selectionContainer.setAttribute(`aria-hidden`,`true`),this.dimensions=(0,c.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((e=>this._injectCss(e)))),this._injectCss(this._themeService.colors),this._rowFactory=d.createInstance(a.DomRendererRowFactory,document),this._element.classList.add(h+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((e=>this._handleLinkHover(e)))),this.register(this._linkifier2.onHideLinkUnderline((e=>this._handleLinkLeave(e)))),this.register((0,p.toDisposable)((()=>{this._element.classList.remove(h+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new o.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){let e=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*e,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*e),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/e),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/e),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(let e of this._rowElements)e.style.width=`${this.dimensions.css.canvas.width}px`,e.style.height=`${this.dimensions.css.cell.height}px`,e.style.lineHeight=`${this.dimensions.css.cell.height}px`,e.style.overflow=`hidden`;this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement(`style`),this._screenElement.appendChild(this._dimensionsStyleElement));let t=`${this._terminalSelector} .${g} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=t,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(e){this._themeStyleElement||(this._themeStyleElement=this._document.createElement(`style`),this._screenElement.appendChild(this._themeStyleElement));let t=`${this._terminalSelector} .${g} { color: ${e.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;t+=`${this._terminalSelector} .${g} .xterm-dim { color: ${d.color.multiplyOpacity(e.foreground,.5).css};}`,t+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;let n=`blink_underline_${this._terminalClass}`,r=`blink_bar_${this._terminalClass}`,i=`blink_block_${this._terminalClass}`;t+=`@keyframes ${n} { 50% { border-bottom-style: hidden; }}`,t+=`@keyframes ${r} { 50% { box-shadow: none; }}`,t+=`@keyframes ${i} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,t+=`${this._terminalSelector} .${g}.${y} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${n} 1s step-end infinite;}${this._terminalSelector} .${g}.${y} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${r} 1s step-end infinite;}${this._terminalSelector} .${g}.${y} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${i} 1s step-end infinite;}${this._terminalSelector} .${g} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${g} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${g} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${g} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${g} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${b} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${b} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${b} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[n,r]of e.ansi.entries())t+=`${this._terminalSelector} .${_}${n} { color: ${r.css}; }${this._terminalSelector} .${_}${n}.xterm-dim { color: ${d.color.multiplyOpacity(r,.5).css}; }${this._terminalSelector} .${v}${n} { background-color: ${r.css}; }`;t+=`${this._terminalSelector} .${_}${s.INVERTED_DEFAULT_COLOR} { color: ${d.color.opaque(e.background).css}; }${this._terminalSelector} .${_}${s.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${d.color.multiplyOpacity(d.color.opaque(e.background),.5).css}; }${this._terminalSelector} .${v}${s.INVERTED_DEFAULT_COLOR} { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=t}_setDefaultSpacing(){let e=this.dimensions.css.cell.width-this._widthCache.get(`W`,!1,!1);this._rowContainer.style.letterSpacing=`${e}px`,this._rowFactory.defaultSpacing=e}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(e,t){for(let e=this._rowElements.length;e<=t;e++){let e=this._document.createElement(`div`);this._rowContainer.appendChild(e),this._rowElements.push(e)}for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(e,t){this._refreshRowElements(e,t),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(y),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(y),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,t,n){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,t,n),this.renderRows(0,this._bufferService.rows-1),!e||!t)return;this._selectionRenderModel.update(this._terminal,e,t,n);let r=this._selectionRenderModel.viewportStartRow,i=this._selectionRenderModel.viewportEndRow,a=this._selectionRenderModel.viewportCappedStartRow,o=this._selectionRenderModel.viewportCappedEndRow;if(a>=this._bufferService.rows||o<0)return;let s=this._document.createDocumentFragment();if(n){let n=e[0]>t[0];s.appendChild(this._createSelectionElement(a,n?t[0]:e[0],n?e[0]:t[0],o-a+1))}else{let n=r===a?e[0]:0,c=a===i?t[0]:this._bufferService.cols;s.appendChild(this._createSelectionElement(a,n,c));let l=o-a-1;if(s.appendChild(this._createSelectionElement(a+1,0,this._bufferService.cols,l)),a!==o){let e=i===o?t[0]:this._bufferService.cols;s.appendChild(this._createSelectionElement(o,0,e))}}this._selectionContainer.appendChild(s)}_createSelectionElement(e,t,n,r=1){let i=this._document.createElement(`div`),a=t*this.dimensions.css.cell.width,o=this.dimensions.css.cell.width*(n-t);return a+o>this.dimensions.css.canvas.width&&(o=this.dimensions.css.canvas.width-a),i.style.height=r*this.dimensions.css.cell.height+`px`,i.style.top=e*this.dimensions.css.cell.height+`px`,i.style.left=`${a}px`,i.style.width=`${o}px`,i}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(let e of this._rowElements)e.replaceChildren()}renderRows(e,t){let n=this._bufferService.buffer,r=n.ybase+n.y,i=Math.min(n.x,this._bufferService.cols-1),a=this._optionsService.rawOptions.cursorBlink,o=this._optionsService.rawOptions.cursorStyle,s=this._optionsService.rawOptions.cursorInactiveStyle;for(let c=e;c<=t;c++){let e=c+n.ydisp,t=this._rowElements[c],l=n.lines.get(e);if(!t||!l)break;t.replaceChildren(...this._rowFactory.createRow(l,e,e===r,o,s,i,a,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${h}${this._terminalClass}`}_handleLinkHover(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)}_handleLinkLeave(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)}_setCellUnderline(e,t,n,r,i,a){n<0&&(e=0),r<0&&(t=0);let o=this._bufferService.rows-1;n=Math.max(Math.min(n,o),0),r=Math.max(Math.min(r,o),0),i=Math.min(i,this._bufferService.cols);let s=this._bufferService.buffer,c=s.ybase+s.y,l=Math.min(s.x,i-1),u=this._optionsService.rawOptions.cursorBlink,d=this._optionsService.rawOptions.cursorStyle,f=this._optionsService.rawOptions.cursorInactiveStyle;for(let o=n;o<=r;++o){let p=o+s.ydisp,m=this._rowElements[o],h=s.lines.get(p);if(!m||!h)break;m.replaceChildren(...this._rowFactory.createRow(h,p,p===c,d,f,l,u,this.dimensions.css.cell.width,this._widthCache,a?o===n?e:0:-1,a?(o===r?t:i)-1:-1))}}};t.DomRenderer=S=r([i(7,m.IInstantiationService),i(8,u.ICharSizeService),i(9,m.IOptionsService),i(10,m.IBufferService),i(11,u.ICoreBrowserService),i(12,u.IThemeService)],S)},3787:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.DomRendererRowFactory=void 0;let a=n(2223),o=n(643),s=n(511),c=n(2585),l=n(8055),u=n(4725),d=n(4269),f=n(6171),p=n(3734),m=t.DomRendererRowFactory=class{constructor(e,t,n,r,i,a,o){this._document=e,this._characterJoinerService=t,this._optionsService=n,this._coreBrowserService=r,this._coreService=i,this._decorationService=a,this._themeService=o,this._workCell=new s.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,t,n){this._selectionStart=e,this._selectionEnd=t,this._columnSelectMode=n}createRow(e,t,n,r,i,s,c,u,f,m,g){let _=[],v=this._characterJoinerService.getJoinedCharacters(t),y=this._themeService.colors,b,x=e.getNoBgTrimmedLength();n&&x<s+1&&(x=s+1);let S=0,C=``,w=0,T=0,E=0,D=!1,O=0,k=!1,ee=0,te=[],ne=m!==-1&&g!==-1;for(let re=0;re<x;re++){e.loadCell(re,this._workCell);let x=this._workCell.getWidth();if(x===0)continue;let ie=!1,ae=re,A=this._workCell;if(v.length>0&&re===v[0][0]){ie=!0;let t=v.shift();A=new d.JoinedCellData(this._workCell,e.translateToString(!0,t[0],t[1]),t[1]-t[0]),ae=t[1]-1,x=A.getWidth()}let oe=this._isCellInSelection(re,t),j=n&&re===s,se=ne&&re>=m&&re<=g,ce=!1;this._decorationService.forEachDecorationAtCell(re,t,void 0,(e=>{ce=!0}));let le=A.getChars()||o.WHITESPACE_CELL_CHAR;if(le===` `&&(A.isUnderline()||A.isOverline())&&(le=`\xA0`),ee=x*u-f.get(le,A.isBold(),A.isItalic()),b){if(S&&(oe&&k||!oe&&!k&&A.bg===w)&&(oe&&k&&y.selectionForeground||A.fg===T)&&A.extended.ext===E&&se===D&&ee===O&&!j&&!ie&&!ce){A.isInvisible()?C+=o.WHITESPACE_CELL_CHAR:C+=le,S++;continue}S&&(b.textContent=C),b=this._document.createElement(`span`),S=0,C=``}else b=this._document.createElement(`span`);if(w=A.bg,T=A.fg,E=A.extended.ext,D=se,O=ee,k=oe,ie&&s>=re&&s<=ae&&(s=re),!this._coreService.isCursorHidden&&j&&this._coreService.isCursorInitialized){if(te.push(`xterm-cursor`),this._coreBrowserService.isFocused)c&&te.push(`xterm-cursor-blink`),te.push(r===`bar`?`xterm-cursor-bar`:r===`underline`?`xterm-cursor-underline`:`xterm-cursor-block`);else if(i)switch(i){case`outline`:te.push(`xterm-cursor-outline`);break;case`block`:te.push(`xterm-cursor-block`);break;case`bar`:te.push(`xterm-cursor-bar`);break;case`underline`:te.push(`xterm-cursor-underline`)}}if(A.isBold()&&te.push(`xterm-bold`),A.isItalic()&&te.push(`xterm-italic`),A.isDim()&&te.push(`xterm-dim`),C=A.isInvisible()?o.WHITESPACE_CELL_CHAR:A.getChars()||o.WHITESPACE_CELL_CHAR,A.isUnderline()&&(te.push(`xterm-underline-${A.extended.underlineStyle}`),C===` `&&(C=`\xA0`),!A.isUnderlineColorDefault()))if(A.isUnderlineColorRGB())b.style.textDecorationColor=`rgb(${p.AttributeData.toColorRGB(A.getUnderlineColor()).join(`,`)})`;else{let e=A.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&A.isBold()&&e<8&&(e+=8),b.style.textDecorationColor=y.ansi[e].css}A.isOverline()&&(te.push(`xterm-overline`),C===` `&&(C=`\xA0`)),A.isStrikethrough()&&te.push(`xterm-strikethrough`),se&&(b.style.textDecoration=`underline`);let ue=A.getFgColor(),de=A.getFgColorMode(),fe=A.getBgColor(),pe=A.getBgColorMode(),me=!!A.isInverse();if(me){let e=ue;ue=fe,fe=e;let t=de;de=pe,pe=t}let he,ge,_e,ve=!1;switch(this._decorationService.forEachDecorationAtCell(re,t,void 0,(e=>{e.options.layer!==`top`&&ve||(e.backgroundColorRGB&&(pe=50331648,fe=e.backgroundColorRGB.rgba>>8&16777215,he=e.backgroundColorRGB),e.foregroundColorRGB&&(de=50331648,ue=e.foregroundColorRGB.rgba>>8&16777215,ge=e.foregroundColorRGB),ve=e.options.layer===`top`)})),!ve&&oe&&(he=this._coreBrowserService.isFocused?y.selectionBackgroundOpaque:y.selectionInactiveBackgroundOpaque,fe=he.rgba>>8&16777215,pe=50331648,ve=!0,y.selectionForeground&&(de=50331648,ue=y.selectionForeground.rgba>>8&16777215,ge=y.selectionForeground)),ve&&te.push(`xterm-decoration-top`),pe){case 16777216:case 33554432:_e=y.ansi[fe],te.push(`xterm-bg-${fe}`);break;case 50331648:_e=l.channels.toColor(fe>>16,fe>>8&255,255&fe),this._addStyle(b,`background-color:#${h((fe>>>0).toString(16),`0`,6)}`);break;default:me?(_e=y.foreground,te.push(`xterm-bg-${a.INVERTED_DEFAULT_COLOR}`)):_e=y.background}switch(he||A.isDim()&&(he=l.color.multiplyOpacity(_e,.5)),de){case 16777216:case 33554432:A.isBold()&&ue<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ue+=8),this._applyMinimumContrast(b,_e,y.ansi[ue],A,he,void 0)||te.push(`xterm-fg-${ue}`);break;case 50331648:let e=l.channels.toColor(ue>>16&255,ue>>8&255,255&ue);this._applyMinimumContrast(b,_e,e,A,he,ge)||this._addStyle(b,`color:#${h(ue.toString(16),`0`,6)}`);break;default:this._applyMinimumContrast(b,_e,y.foreground,A,he,ge)||me&&te.push(`xterm-fg-${a.INVERTED_DEFAULT_COLOR}`)}te.length&&=(b.className=te.join(` `),0),j||ie||ce?b.textContent=C:S++,ee!==this.defaultSpacing&&(b.style.letterSpacing=`${ee}px`),_.push(b),re=ae}return b&&S&&(b.textContent=C),_}_applyMinimumContrast(e,t,n,r,i,a){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,f.treatGlyphAsBackgroundColor)(r.getCode()))return!1;let o=this._getContrastCache(r),s;if(i||a||(s=o.getColor(t.rgba,n.rgba)),s===void 0){let e=this._optionsService.rawOptions.minimumContrastRatio/(r.isDim()?2:1);s=l.color.ensureContrastRatio(i||t,a||n,e),o.setColor((i||t).rgba,(a||n).rgba,s??null)}return!!s&&(this._addStyle(e,`color:${s.css}`),!0)}_getContrastCache(e){return e.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(e,t){e.setAttribute(`style`,`${e.getAttribute(`style`)||``}${t};`)}_isCellInSelection(e,t){let n=this._selectionStart,r=this._selectionEnd;return!(!n||!r)&&(this._columnSelectMode?n[0]<=r[0]?e>=n[0]&&t>=n[1]&&e<r[0]&&t<=r[1]:e<n[0]&&t>=n[1]&&e>=r[0]&&t<=r[1]:t>n[1]&&t<r[1]||n[1]===r[1]&&t===n[1]&&e>=n[0]&&e<r[0]||n[1]<r[1]&&t===r[1]&&e<r[0]||n[1]<r[1]&&t===n[1]&&e>=n[0])}};function h(e,t,n){for(;e.length<n;)e=t+e;return e}t.DomRendererRowFactory=m=r([i(1,u.ICharacterJoinerService),i(2,c.IOptionsService),i(3,u.ICoreBrowserService),i(4,c.ICoreService),i(5,c.IDecorationService),i(6,u.IThemeService)],m)},2550:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.WidthCache=void 0,t.WidthCache=class{constructor(e,t){this._flat=new Float32Array(256),this._font=``,this._fontSize=0,this._weight=`normal`,this._weightBold=`bold`,this._measureElements=[],this._container=e.createElement(`div`),this._container.classList.add(`xterm-width-cache-measure-container`),this._container.setAttribute(`aria-hidden`,`true`),this._container.style.whiteSpace=`pre`,this._container.style.fontKerning=`none`;let n=e.createElement(`span`);n.classList.add(`xterm-char-measure-element`);let r=e.createElement(`span`);r.classList.add(`xterm-char-measure-element`),r.style.fontWeight=`bold`;let i=e.createElement(`span`);i.classList.add(`xterm-char-measure-element`),i.style.fontStyle=`italic`;let a=e.createElement(`span`);a.classList.add(`xterm-char-measure-element`),a.style.fontWeight=`bold`,a.style.fontStyle=`italic`,this._measureElements=[n,r,i,a],this._container.appendChild(n),this._container.appendChild(r),this._container.appendChild(i),this._container.appendChild(a),t.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(e,t,n,r){e===this._font&&t===this._fontSize&&n===this._weight&&r===this._weightBold||(this._font=e,this._fontSize=t,this._weight=n,this._weightBold=r,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${n}`,this._measureElements[1].style.fontWeight=`${r}`,this._measureElements[2].style.fontWeight=`${n}`,this._measureElements[3].style.fontWeight=`${r}`,this.clear())}get(e,t,n){let r=0;if(!t&&!n&&e.length===1&&(r=e.charCodeAt(0))<256){if(this._flat[r]!==-9999)return this._flat[r];let t=this._measure(e,0);return t>0&&(this._flat[r]=t),t}let i=e;t&&(i+=`B`),n&&(i+=`I`);let a=this._holey.get(i);if(a===void 0){let r=0;t&&(r|=1),n&&(r|=2),a=this._measure(e,r),a>0&&this._holey.set(i,a)}return a}_measure(e,t){let n=this._measureElements[t];return n.textContent=e.repeat(32),n.offsetWidth/32}}},2223:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.TEXT_BASELINE=t.DIM_OPACITY=t.INVERTED_DEFAULT_COLOR=void 0;let r=n(6114);t.INVERTED_DEFAULT_COLOR=257,t.DIM_OPACITY=.5,t.TEXT_BASELINE=r.isFirefox||r.isLegacyEdge?`bottom`:`ideographic`},6171:(e,t)=>{function n(e){return 57508<=e&&e<=57558}function r(e){return e>=128512&&e<=128591||e>=127744&&e<=128511||e>=128640&&e<=128767||e>=9728&&e<=9983||e>=9984&&e<=10175||e>=65024&&e<=65039||e>=129280&&e<=129535||e>=127462&&e<=127487}Object.defineProperty(t,`__esModule`,{value:!0}),t.computeNextVariantOffset=t.createRenderDimensions=t.treatGlyphAsBackgroundColor=t.allowRescaling=t.isEmoji=t.isRestrictedPowerlineGlyph=t.isPowerlineGlyph=t.throwIfFalsy=void 0,t.throwIfFalsy=function(e){if(!e)throw Error(`value must not be falsy`);return e},t.isPowerlineGlyph=n,t.isRestrictedPowerlineGlyph=function(e){return 57520<=e&&e<=57527},t.isEmoji=r,t.allowRescaling=function(e,t,i,a){return t===1&&i>Math.ceil(1.5*a)&&e!==void 0&&e>255&&!r(e)&&!n(e)&&!function(e){return 57344<=e&&e<=63743}(e)},t.treatGlyphAsBackgroundColor=function(e){return n(e)||function(e){return 9472<=e&&e<=9631}(e)},t.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},t.computeNextVariantOffset=function(e,t,n=0){return(e-(2*Math.round(t)-n))%(2*Math.round(t))}},6052:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.createSelectionRenderModel=void 0;class n{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(e,t,n,r=!1){if(this.selectionStart=t,this.selectionEnd=n,!t||!n||t[0]===n[0]&&t[1]===n[1])return void this.clear();let i=e.buffers.active.ydisp,a=t[1]-i,o=n[1]-i,s=Math.max(a,0),c=Math.min(o,e.rows-1);s>=e.rows||c<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=r,this.viewportStartRow=a,this.viewportEndRow=o,this.viewportCappedStartRow=s,this.viewportCappedEndRow=c,this.startCol=t[0],this.endCol=n[0])}isCellSelected(e,t,n){return!!this.hasSelection&&(n-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?t>=this.startCol&&n>=this.viewportCappedStartRow&&t<this.endCol&&n<=this.viewportCappedEndRow:t<this.startCol&&n>=this.viewportCappedStartRow&&t>=this.endCol&&n<=this.viewportCappedEndRow:n>this.viewportStartRow&&n<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&n===this.viewportStartRow&&t>=this.startCol&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportEndRow&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportStartRow&&t>=this.startCol)}}t.createSelectionRenderModel=function(){return new n}},456:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.SelectionModel=void 0,t.SelectionModel=class{constructor(e){this._bufferService=e,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?e%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)-1]:[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[e,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[Math.max(e,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let e=this.selectionStart,t=this.selectionEnd;return!(!e||!t)&&(e[1]>t[1]||e[1]===t[1]&&e[0]>t[0])}handleTrim(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.CharSizeService=void 0;let a=n(2585),o=n(8460),s=n(844),c=t.CharSizeService=class extends s.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(e,t,n){super(),this._optionsService=n,this.width=0,this.height=0,this._onCharSizeChange=this.register(new o.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new d(this._optionsService))}catch{this._measureStrategy=this.register(new u(e,t,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange([`fontFamily`,`fontSize`],(()=>this.measure())))}measure(){let e=this._measureStrategy.measure();e.width===this.width&&e.height===this.height||(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};t.CharSizeService=c=r([i(2,a.IOptionsService)],c);class l extends s.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(e,t){e!==void 0&&e>0&&t!==void 0&&t>0&&(this._result.width=e,this._result.height=t)}}class u extends l{constructor(e,t,n){super(),this._document=e,this._parentElement=t,this._optionsService=n,this._measureElement=this._document.createElement(`span`),this._measureElement.classList.add(`xterm-char-measure-element`),this._measureElement.textContent=`W`.repeat(32),this._measureElement.setAttribute(`aria-hidden`,`true`),this._measureElement.style.whiteSpace=`pre`,this._measureElement.style.fontKerning=`none`,this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class d extends l{constructor(e){super(),this._optionsService=e,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext(`2d`);let t=this._ctx.measureText(`W`);if(!(`width`in t&&`fontBoundingBoxAscent`in t&&`fontBoundingBoxDescent`in t))throw Error(`Required font metrics not supported`)}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;let e=this._ctx.measureText(`W`);return this._validateAndSet(e.width,e.fontBoundingBoxAscent+e.fontBoundingBoxDescent),this._result}}},4269:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.CharacterJoinerService=t.JoinedCellData=void 0;let a=n(3734),o=n(643),s=n(511),c=n(2585);class l extends a.AttributeData{constructor(e,t,n){super(),this.content=0,this.combinedData=``,this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=n}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw Error(`not implemented`)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}t.JoinedCellData=l;let u=t.CharacterJoinerService=class e{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new s.CellData}register(e){let t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id}deregister(e){for(let t=0;t<this._characterJoiners.length;t++)if(this._characterJoiners[t].id===e)return this._characterJoiners.splice(t,1),!0;return!1}getJoinedCharacters(e){if(this._characterJoiners.length===0)return[];let t=this._bufferService.buffer.lines.get(e);if(!t||t.length===0)return[];let n=[],r=t.translateToString(!0),i=0,a=0,s=0,c=t.getFg(0),l=t.getBg(0);for(let e=0;e<t.getTrimmedLength();e++)if(t.loadCell(e,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==c||this._workCell.bg!==l){if(e-i>1){let e=this._getJoinedRanges(r,s,a,t,i);for(let t=0;t<e.length;t++)n.push(e[t])}i=e,s=a,c=this._workCell.fg,l=this._workCell.bg}a+=this._workCell.getChars().length||o.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-i>1){let e=this._getJoinedRanges(r,s,a,t,i);for(let t=0;t<e.length;t++)n.push(e[t])}return n}_getJoinedRanges(t,n,r,i,a){let o=t.substring(n,r),s=[];try{s=this._characterJoiners[0].handler(o)}catch(e){console.error(e)}for(let t=1;t<this._characterJoiners.length;t++)try{let n=this._characterJoiners[t].handler(o);for(let t=0;t<n.length;t++)e._mergeRanges(s,n[t])}catch(e){console.error(e)}return this._stringRangesToCellRanges(s,i,a),s}_stringRangesToCellRanges(e,t,n){let r=0,i=!1,a=0,s=e[r];if(s){for(let c=n;c<this._bufferService.cols;c++){let n=t.getWidth(c),l=t.getString(c).length||o.WHITESPACE_CELL_CHAR.length;if(n!==0){if(!i&&s[0]<=a&&(s[0]=c,i=!0),s[1]<=a){if(s[1]=c,s=e[++r],!s)break;s[0]<=a?(s[0]=c,i=!0):i=!1}a+=l}}s&&(s[1]=this._bufferService.cols)}}static _mergeRanges(e,t){let n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(n){if(t[1]<=i[0])return e[r-1][1]=t[1],e;if(t[1]<=i[1])return e[r-1][1]=Math.max(t[1],i[1]),e.splice(r,1),e;e.splice(r,1),r--}else{if(t[1]<=i[0])return e.splice(r,0,t),e;if(t[1]<=i[1])return i[0]=Math.min(t[0],i[0]),e;t[0]<i[1]&&(i[0]=Math.min(t[0],i[0]),n=!0)}}return n?e[e.length-1][1]=t[1]:e.push(t),e}};t.CharacterJoinerService=u=r([i(0,c.IBufferService)],u)},5114:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.CoreBrowserService=void 0;let r=n(844),i=n(8460),a=n(3656);class o extends r.Disposable{constructor(e,t,n){super(),this._textarea=e,this._window=t,this.mainDocument=n,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new s(this._window),this._onDprChange=this.register(new i.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new i.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((e=>this._screenDprMonitor.setWindow(e)))),this.register((0,i.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener(`focus`,(()=>this._isFocused=!0)),this._textarea.addEventListener(`blur`,(()=>this._isFocused=!1))}get window(){return this._window}set window(e){this._window!==e&&(this._window=e,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}t.CoreBrowserService=o;class s extends r.Disposable{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this.register(new r.MutableDisposable),this._onDprChange=this.register(new i.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,r.toDisposable)((()=>this.clearListener())))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,a.addDisposableDomListener)(this._parentWindow,`resize`,(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.LinkProviderService=void 0;let r=n(844);class i extends r.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,r.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(e){return this.linkProviders.push(e),{dispose:()=>{let t=this.linkProviders.indexOf(e);t!==-1&&this.linkProviders.splice(t,1)}}}}t.LinkProviderService=i},8934:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.MouseService=void 0;let a=n(4725),o=n(9806),s=t.MouseService=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,n,r,i){return(0,o.getCoords)(window,e,t,n,r,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,i)}getMouseReportCoords(e,t){let n=(0,o.getCoordsRelativeToElement)(window,e,t);if(this._charSizeService.hasValidSize)return n[0]=Math.min(Math.max(n[0],0),this._renderService.dimensions.css.canvas.width-1),n[1]=Math.min(Math.max(n[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(n[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(n[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(n[0]),y:Math.floor(n[1])}}};t.MouseService=s=r([i(0,a.IRenderService),i(1,a.ICharSizeService)],s)},3230:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.RenderService=void 0;let a=n(6193),o=n(4725),s=n(8460),c=n(844),l=n(7226),u=n(2585),d=t.RenderService=class extends c.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(e,t,n,r,i,o,u,d){super(),this._rowCount=e,this._charSizeService=r,this._renderer=this.register(new c.MutableDisposable),this._pausedResizeTask=new l.DebouncedIdleTask,this._observerDisposable=this.register(new c.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new s.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new s.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new s.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new s.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new a.RenderDebouncer(((e,t)=>this._renderRows(e,t)),u),this.register(this._renderDebouncer),this.register(u.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(o.onResize((()=>this._fullRefresh()))),this.register(o.buffers.onBufferActivate((()=>this._renderer.value?.clear()))),this.register(n.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(i.onDecorationRegistered((()=>this._fullRefresh()))),this.register(i.onDecorationRemoved((()=>this._fullRefresh()))),this.register(n.onMultipleOptionChange([`customGlyphs`,`drawBoldTextInBrightColors`,`letterSpacing`,`lineHeight`,`fontFamily`,`fontSize`,`fontWeight`,`fontWeightBold`,`minimumContrastRatio`,`rescaleOverlappingGlyphs`],(()=>{this.clear(),this.handleResize(o.cols,o.rows),this._fullRefresh()}))),this.register(n.onMultipleOptionChange([`cursorBlink`,`cursorStyle`],(()=>this.refreshRows(o.buffer.y,o.buffer.y,!0)))),this.register(d.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(u.window,t),this.register(u.onWindowChange((e=>this._registerIntersectionObserver(e,t))))}_registerIntersectionObserver(e,t){if(`IntersectionObserver`in e){let n=new e.IntersectionObserver((e=>this._handleIntersectionChange(e[e.length-1])),{threshold:0});n.observe(t),this._observerDisposable.value=(0,c.toDisposable)((()=>n.disconnect()))}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(e,t,n=!1){this._isPaused?this._needsFullRefresh=!0:(n||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount))}_renderRows(e,t){this._renderer.value&&(e=Math.min(e,this._rowCount-1),t=Math.min(t,this._rowCount-1),this._renderer.value.renderRows(e,t),this._needsSelectionRefresh&&=(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:t}),this._onRender.fire({start:e,end:t}),this._isNextRenderRedrawOnly=!0)}resize(e,t){this._rowCount=t,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw((e=>this.refreshRows(e.start,e.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,t){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>this._renderer.value?.handleResize(e,t))):this._renderer.value.handleResize(e,t),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(e,t,n){this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=n,this._renderer.value?.handleSelectionChanged(e,t,n)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};t.RenderService=d=r([i(2,u.IOptionsService),i(3,o.ICharSizeService),i(4,u.IDecorationService),i(5,u.IBufferService),i(6,o.ICoreBrowserService),i(7,o.IThemeService)],d)},9312:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.SelectionService=void 0;let a=n(9806),o=n(9504),s=n(456),c=n(4725),l=n(8460),u=n(844),d=n(6114),f=n(4841),p=n(511),m=n(2585),h=RegExp(`\xA0`,`g`),g=t.SelectionService=class extends u.Disposable{constructor(e,t,n,r,i,a,o,c,d){super(),this._element=e,this._screenElement=t,this._linkifier=n,this._bufferService=r,this._coreService=i,this._mouseService=a,this._optionsService=o,this._renderService=c,this._coreBrowserService=d,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new p.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new l.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new l.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new l.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new l.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=e=>this._handleMouseMove(e),this._mouseUpListener=e=>this._handleMouseUp(e),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((e=>this._handleTrim(e))),this.register(this._bufferService.buffers.onBufferActivate((e=>this._handleBufferActivate(e)))),this.enable(),this._model=new s.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,u.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;return!(!e||!t||e[0]===t[0]&&e[1]===t[1])}get selectionText(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return``;let n=this._bufferService.buffer,r=[];if(this._activeSelectionMode===3){if(e[0]===t[0])return``;let i=e[0]<t[0]?e[0]:t[0],a=e[0]<t[0]?t[0]:e[0];for(let o=e[1];o<=t[1];o++){let e=n.translateBufferLineToString(o,!0,i,a);r.push(e)}}else{let i=e[1]===t[1]?t[0]:void 0;r.push(n.translateBufferLineToString(e[1],!0,e[0],i));for(let i=e[1]+1;i<=t[1]-1;i++){let e=n.lines.get(i),t=n.translateBufferLineToString(i,!0);e?.isWrapped?r[r.length-1]+=t:r.push(t)}if(e[1]!==t[1]){let e=n.lines.get(t[1]),i=n.translateBufferLineToString(t[1],!0,0,t[0]);e&&e.isWrapped?r[r.length-1]+=i:r.push(i)}}return r.map((e=>e.replace(h,` `))).join(d.isWindows?`\r
358
+ `:`
359
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh())),d.isLinux&&e&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(e){let t=this._getMouseBufferCoords(e),n=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!!(n&&r&&t)&&this._areCoordsInSelection(t,n,r)}isCellInSelection(e,t){let n=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!(!n||!r)&&this._areCoordsInSelection([e,t],n,r)}_areCoordsInSelection(e,t,n){return e[1]>t[1]&&e[1]<n[1]||t[1]===n[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<n[0]||t[1]<n[1]&&e[1]===n[1]&&e[0]<n[0]||t[1]<n[1]&&e[1]===t[1]&&e[0]>=t[0]}_selectWordAtCursor(e,t){let n=this._linkifier.currentLink?.link?.range;if(n)return this._model.selectionStart=[n.start.x-1,n.start.y-1],this._model.selectionStartLength=(0,f.getRangeLength)(n,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let r=this._getMouseBufferCoords(e);return!!r&&(this._selectWordAt(r,t),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,t],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(t)return t[0]--,t[1]--,t[1]+=this._bufferService.buffer.ydisp,t}_getMouseEventScrollAmount(e){let t=(0,a.getCoordsRelativeToElement)(this._coreBrowserService.window,e,this._screenElement)[1],n=this._renderService.dimensions.css.canvas.height;return t>=0&&t<=n?0:(t>n&&(t-=n),t=Math.min(Math.max(t,-50),50),t/=50,t/Math.abs(t)+Math.round(14*t))}shouldForceSelection(e){return d.isMac?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}handleMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,(e.button!==2||!this.hasSelection)&&e.button===0){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._handleIncrementalClick(e):e.detail===1?this._handleSingleClick(e):e.detail===2?this._handleDoubleClick(e):e.detail===3&&this._handleTripleClick(e),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener(`mousemove`,this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener(`mouseup`,this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval((()=>this._dragScroll()),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener(`mousemove`,this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener(`mouseup`,this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_handleSingleClick(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let t=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);t&&t.length!==this._model.selectionStart[0]&&t.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))}shouldColumnSelect(e){return e.altKey&&!(d.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(e),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));let n=this._bufferService.buffer;if(this._model.selectionEnd[1]<n.lines.length){let e=n.lines.get(this._model.selectionEnd[1]);e&&e.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}t&&t[0]===this._model.selectionEnd[0]&&t[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});let e=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(e.ydisp+this._bufferService.rows,e.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh()}}_handleMouseUp(e){let t=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&t<500&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let t=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(t&&t[0]!==void 0&&t[1]!==void 0){let e=(0,o.moveToCellSequence)(t[0]-1,t[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(e,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd,n=!(!e||!t||e[0]===t[0]&&e[1]===t[1]);n?e&&t&&(this._oldSelectionStart&&this._oldSelectionEnd&&e[0]===this._oldSelectionStart[0]&&e[1]===this._oldSelectionStart[1]&&t[0]===this._oldSelectionEnd[0]&&t[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(e,t,n)):this._oldHasSelection&&this._fireOnSelectionChange(e,t,n)}_fireOnSelectionChange(e,t,n){this._oldSelectionStart=e,this._oldSelectionEnd=t,this._oldHasSelection=n,this._onSelectionChange.fire()}_handleBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim((e=>this._handleTrim(e)))}_convertViewportColToCharacterIndex(e,t){let n=t;for(let r=0;t>=r;r++){let i=e.loadCell(r,this._workCell).getChars().length;this._workCell.getWidth()===0?n--:i>1&&t!==r&&(n+=i-1)}return n}setSelection(e,t,n){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=n,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,t,n=!0,r=!0){if(e[0]>=this._bufferService.cols)return;let i=this._bufferService.buffer,a=i.lines.get(e[1]);if(!a)return;let o=i.translateBufferLineToString(e[1],!1),s=this._convertViewportColToCharacterIndex(a,e[0]),c=s,l=e[0]-s,u=0,d=0,f=0,p=0;if(o.charAt(s)===` `){for(;s>0&&o.charAt(s-1)===` `;)s--;for(;c<o.length&&o.charAt(c+1)===` `;)c++}else{let t=e[0],n=e[0];a.getWidth(t)===0&&(u++,t--),a.getWidth(n)===2&&(d++,n++);let r=a.getString(n).length;for(r>1&&(p+=r-1,c+=r-1);t>0&&s>0&&!this._isCharWordSeparator(a.loadCell(t-1,this._workCell));){a.loadCell(t-1,this._workCell);let e=this._workCell.getChars().length;this._workCell.getWidth()===0?(u++,t--):e>1&&(f+=e-1,s-=e-1),s--,t--}for(;n<a.length&&c+1<o.length&&!this._isCharWordSeparator(a.loadCell(n+1,this._workCell));){a.loadCell(n+1,this._workCell);let e=this._workCell.getChars().length;this._workCell.getWidth()===2?(d++,n++):e>1&&(p+=e-1,c+=e-1),c++,n++}}c++;let m=s+l-u+f,h=Math.min(this._bufferService.cols,c-s+u+d-f-p);if(t||o.slice(s,c).trim()!==``){if(n&&m===0&&a.getCodePoint(0)!==32){let t=i.lines.get(e[1]-1);if(t&&a.isWrapped&&t.getCodePoint(this._bufferService.cols-1)!==32){let t=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(t){let e=this._bufferService.cols-t.start;m-=e,h+=e}}}if(r&&m+h===this._bufferService.cols&&a.getCodePoint(this._bufferService.cols-1)!==32){let t=i.lines.get(e[1]+1);if(t?.isWrapped&&t.getCodePoint(0)!==32){let t=this._getWordAt([0,e[1]+1],!1,!1,!0);t&&(h+=t.length)}}return{start:m,length:h}}}_selectWordAt(e,t){let n=this._getWordAt(e,t);if(n){for(;n.start<0;)n.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[n.start,e[1]],this._model.selectionStartLength=n.length}}_selectToWordAt(e){let t=this._getWordAt(e,!0);if(t){let n=e[1];for(;t.start<0;)t.start+=this._bufferService.cols,n--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._bufferService.cols;)t.length-=this._bufferService.cols,n++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,n]}}_isCharWordSeparator(e){return e.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let t=this._bufferService.buffer.getWrappedRangeForLine(e),n={start:{x:0,y:t.first},end:{x:this._bufferService.cols-1,y:t.last}};this._model.selectionStart=[0,t.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,f.getRangeLength)(n,this._bufferService.cols)}};t.SelectionService=g=r([i(3,m.IBufferService),i(4,m.ICoreService),i(5,c.IMouseService),i(6,m.IOptionsService),i(7,c.IRenderService),i(8,c.ICoreBrowserService)],g)},4725:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.ILinkProviderService=t.IThemeService=t.ICharacterJoinerService=t.ISelectionService=t.IRenderService=t.IMouseService=t.ICoreBrowserService=t.ICharSizeService=void 0;let r=n(8343);t.ICharSizeService=(0,r.createDecorator)(`CharSizeService`),t.ICoreBrowserService=(0,r.createDecorator)(`CoreBrowserService`),t.IMouseService=(0,r.createDecorator)(`MouseService`),t.IRenderService=(0,r.createDecorator)(`RenderService`),t.ISelectionService=(0,r.createDecorator)(`SelectionService`),t.ICharacterJoinerService=(0,r.createDecorator)(`CharacterJoinerService`),t.IThemeService=(0,r.createDecorator)(`ThemeService`),t.ILinkProviderService=(0,r.createDecorator)(`LinkProviderService`)},6731:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.ThemeService=t.DEFAULT_ANSI_COLORS=void 0;let a=n(7239),o=n(8055),s=n(8460),c=n(844),l=n(2585),u=o.css.toColor(`#ffffff`),d=o.css.toColor(`#000000`),f=o.css.toColor(`#ffffff`),p=o.css.toColor(`#000000`),m={css:`rgba(255, 255, 255, 0.3)`,rgba:4294967117};t.DEFAULT_ANSI_COLORS=Object.freeze((()=>{let e=[o.css.toColor(`#2e3436`),o.css.toColor(`#cc0000`),o.css.toColor(`#4e9a06`),o.css.toColor(`#c4a000`),o.css.toColor(`#3465a4`),o.css.toColor(`#75507b`),o.css.toColor(`#06989a`),o.css.toColor(`#d3d7cf`),o.css.toColor(`#555753`),o.css.toColor(`#ef2929`),o.css.toColor(`#8ae234`),o.css.toColor(`#fce94f`),o.css.toColor(`#729fcf`),o.css.toColor(`#ad7fa8`),o.css.toColor(`#34e2e2`),o.css.toColor(`#eeeeec`)],t=[0,95,135,175,215,255];for(let n=0;n<216;n++){let r=t[n/36%6|0],i=t[n/6%6|0],a=t[n%6];e.push({css:o.channels.toCss(r,i,a),rgba:o.channels.toRgba(r,i,a)})}for(let t=0;t<24;t++){let n=8+10*t;e.push({css:o.channels.toCss(n,n,n),rgba:o.channels.toRgba(n,n,n)})}return e})());let h=t.ThemeService=class extends c.Disposable{get colors(){return this._colors}constructor(e){super(),this._optionsService=e,this._contrastCache=new a.ColorContrastCache,this._halfContrastCache=new a.ColorContrastCache,this._onChangeColors=this.register(new s.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:u,background:d,cursor:f,cursorAccent:p,selectionForeground:void 0,selectionBackgroundTransparent:m,selectionBackgroundOpaque:o.color.blend(d,m),selectionInactiveBackgroundTransparent:m,selectionInactiveBackgroundOpaque:o.color.blend(d,m),ansi:t.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange(`minimumContrastRatio`,(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange(`theme`,(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(e={}){let n=this._colors;if(n.foreground=g(e.foreground,u),n.background=g(e.background,d),n.cursor=g(e.cursor,f),n.cursorAccent=g(e.cursorAccent,p),n.selectionBackgroundTransparent=g(e.selectionBackground,m),n.selectionBackgroundOpaque=o.color.blend(n.background,n.selectionBackgroundTransparent),n.selectionInactiveBackgroundTransparent=g(e.selectionInactiveBackground,n.selectionBackgroundTransparent),n.selectionInactiveBackgroundOpaque=o.color.blend(n.background,n.selectionInactiveBackgroundTransparent),n.selectionForeground=e.selectionForeground?g(e.selectionForeground,o.NULL_COLOR):void 0,n.selectionForeground===o.NULL_COLOR&&(n.selectionForeground=void 0),o.color.isOpaque(n.selectionBackgroundTransparent)&&(n.selectionBackgroundTransparent=o.color.opacity(n.selectionBackgroundTransparent,.3)),o.color.isOpaque(n.selectionInactiveBackgroundTransparent)&&(n.selectionInactiveBackgroundTransparent=o.color.opacity(n.selectionInactiveBackgroundTransparent,.3)),n.ansi=t.DEFAULT_ANSI_COLORS.slice(),n.ansi[0]=g(e.black,t.DEFAULT_ANSI_COLORS[0]),n.ansi[1]=g(e.red,t.DEFAULT_ANSI_COLORS[1]),n.ansi[2]=g(e.green,t.DEFAULT_ANSI_COLORS[2]),n.ansi[3]=g(e.yellow,t.DEFAULT_ANSI_COLORS[3]),n.ansi[4]=g(e.blue,t.DEFAULT_ANSI_COLORS[4]),n.ansi[5]=g(e.magenta,t.DEFAULT_ANSI_COLORS[5]),n.ansi[6]=g(e.cyan,t.DEFAULT_ANSI_COLORS[6]),n.ansi[7]=g(e.white,t.DEFAULT_ANSI_COLORS[7]),n.ansi[8]=g(e.brightBlack,t.DEFAULT_ANSI_COLORS[8]),n.ansi[9]=g(e.brightRed,t.DEFAULT_ANSI_COLORS[9]),n.ansi[10]=g(e.brightGreen,t.DEFAULT_ANSI_COLORS[10]),n.ansi[11]=g(e.brightYellow,t.DEFAULT_ANSI_COLORS[11]),n.ansi[12]=g(e.brightBlue,t.DEFAULT_ANSI_COLORS[12]),n.ansi[13]=g(e.brightMagenta,t.DEFAULT_ANSI_COLORS[13]),n.ansi[14]=g(e.brightCyan,t.DEFAULT_ANSI_COLORS[14]),n.ansi[15]=g(e.brightWhite,t.DEFAULT_ANSI_COLORS[15]),e.extendedAnsi){let r=Math.min(n.ansi.length-16,e.extendedAnsi.length);for(let i=0;i<r;i++)n.ansi[i+16]=g(e.extendedAnsi[i],t.DEFAULT_ANSI_COLORS[i+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(e){this._restoreColor(e),this._onChangeColors.fire(this.colors)}_restoreColor(e){if(e!==void 0)switch(e){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[e]=this._restoreColors.ansi[e]}else for(let e=0;e<this._restoreColors.ansi.length;++e)this._colors.ansi[e]=this._restoreColors.ansi[e]}modifyColors(e){e(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function g(e,t){if(e!==void 0)try{return o.css.toColor(e)}catch{}return t}t.ThemeService=h=r([i(0,l.IOptionsService)],h)},6349:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.CircularList=void 0;let r=n(8460),i=n(844);class a extends i.Disposable{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this.register(new r.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new r.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new r.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(e){if(this._maxLength===e)return;let t=Array(e);for(let n=0;n<Math.min(e,this.length);n++)t[n]=this._array[this._getCyclicIndex(n)];this._array=t,this._maxLength=e,this._startIndex=0}get length(){return this._length}set length(e){if(e>this._length)for(let t=this._length;t<e;t++)this._array[t]=void 0;this._length=e}get(e){return this._array[this._getCyclicIndex(e)]}set(e,t){this._array[this._getCyclicIndex(e)]=t}push(e){this._array[this._getCyclicIndex(this._length)]=e,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw Error(`Can only recycle when the buffer is full`);return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(e,t,...n){if(t){for(let n=e;n<this._length-t;n++)this._array[this._getCyclicIndex(n)]=this._array[this._getCyclicIndex(n+t)];this._length-=t,this.onDeleteEmitter.fire({index:e,amount:t})}for(let t=this._length-1;t>=e;t--)this._array[this._getCyclicIndex(t+n.length)]=this._array[this._getCyclicIndex(t)];for(let t=0;t<n.length;t++)this._array[this._getCyclicIndex(e+t)]=n[t];if(n.length&&this.onInsertEmitter.fire({index:e,amount:n.length}),this._length+n.length>this._maxLength){let e=this._length+n.length-this._maxLength;this._startIndex+=e,this._length=this._maxLength,this.onTrimEmitter.fire(e)}else this._length+=n.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,t,n){if(!(t<=0)){if(e<0||e>=this._length)throw Error(`start argument out of range`);if(e+n<0)throw Error(`Cannot shift elements in list beyond index 0`);if(n>0){for(let r=t-1;r>=0;r--)this.set(e+r+n,this.get(e+r));let r=e+t+n-this._length;if(r>0)for(this._length+=r;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let r=0;r<t;r++)this.set(e+r+n,this.get(e+r))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}}t.CircularList=a},1439:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.clone=void 0,t.clone=function e(t,n=5){if(typeof t!=`object`)return t;let r=Array.isArray(t)?[]:{};for(let i in t)r[i]=n<=1?t[i]:t[i]&&e(t[i],n-1);return r}},8055:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.contrastRatio=t.toPaddedHex=t.rgba=t.rgb=t.css=t.color=t.channels=t.NULL_COLOR=void 0;let n=0,r=0,i=0,a=0;var o,s,c,l,u;function d(e){let t=e.toString(16);return t.length<2?`0`+t:t}function f(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}t.NULL_COLOR={css:`#00000000`,rgba:0},function(e){e.toCss=function(e,t,n,r){return r===void 0?`#${d(e)}${d(t)}${d(n)}`:`#${d(e)}${d(t)}${d(n)}${d(r)}`},e.toRgba=function(e,t,n,r=255){return(e<<24|t<<16|n<<8|r)>>>0},e.toColor=function(t,n,r,i){return{css:e.toCss(t,n,r,i),rgba:e.toRgba(t,n,r,i)}}}(o||(t.channels=o={})),function(e){function t(e,t){return a=Math.round(255*t),[n,r,i]=u.toChannels(e.rgba),{css:o.toCss(n,r,i,a),rgba:o.toRgba(n,r,i,a)}}e.blend=function(e,t){if(a=(255&t.rgba)/255,a===1)return{css:t.css,rgba:t.rgba};let s=t.rgba>>24&255,c=t.rgba>>16&255,l=t.rgba>>8&255,u=e.rgba>>24&255,d=e.rgba>>16&255,f=e.rgba>>8&255;return n=u+Math.round((s-u)*a),r=d+Math.round((c-d)*a),i=f+Math.round((l-f)*a),{css:o.toCss(n,r,i),rgba:o.toRgba(n,r,i)}},e.isOpaque=function(e){return(255&e.rgba)==255},e.ensureContrastRatio=function(e,t,n){let r=u.ensureContrastRatio(e.rgba,t.rgba,n);if(r)return o.toColor(r>>24&255,r>>16&255,r>>8&255)},e.opaque=function(e){let t=(255|e.rgba)>>>0;return[n,r,i]=u.toChannels(t),{css:o.toCss(n,r,i),rgba:t}},e.opacity=t,e.multiplyOpacity=function(e,n){return a=255&e.rgba,t(e,a*n/255)},e.toColorRGB=function(e){return[e.rgba>>24&255,e.rgba>>16&255,e.rgba>>8&255]}}(s||(t.color=s={})),function(e){let t,s;try{let e=document.createElement(`canvas`);e.width=1,e.height=1;let n=e.getContext(`2d`,{willReadFrequently:!0});n&&(t=n,t.globalCompositeOperation=`copy`,s=t.createLinearGradient(0,0,1,1))}catch{}e.toColor=function(e){if(e.match(/#[\da-f]{3,8}/i))switch(e.length){case 4:return n=parseInt(e.slice(1,2).repeat(2),16),r=parseInt(e.slice(2,3).repeat(2),16),i=parseInt(e.slice(3,4).repeat(2),16),o.toColor(n,r,i);case 5:return n=parseInt(e.slice(1,2).repeat(2),16),r=parseInt(e.slice(2,3).repeat(2),16),i=parseInt(e.slice(3,4).repeat(2),16),a=parseInt(e.slice(4,5).repeat(2),16),o.toColor(n,r,i,a);case 7:return{css:e,rgba:(parseInt(e.slice(1),16)<<8|255)>>>0};case 9:return{css:e,rgba:parseInt(e.slice(1),16)>>>0}}let c=e.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(c)return n=parseInt(c[1]),r=parseInt(c[2]),i=parseInt(c[3]),a=Math.round(255*(c[5]===void 0?1:parseFloat(c[5]))),o.toColor(n,r,i,a);if(!t||!s||(t.fillStyle=s,t.fillStyle=e,typeof t.fillStyle!=`string`)||(t.fillRect(0,0,1,1),[n,r,i,a]=t.getImageData(0,0,1,1).data,a!==255))throw Error(`css.toColor: Unsupported css format`);return{rgba:o.toRgba(n,r,i,a),css:e}}}(c||(t.css=c={})),function(e){function t(e,t,n){let r=e/255,i=t/255,a=n/255;return .2126*(r<=.03928?r/12.92:((r+.055)/1.055)**2.4)+.7152*(i<=.03928?i/12.92:((i+.055)/1.055)**2.4)+.0722*(a<=.03928?a/12.92:((a+.055)/1.055)**2.4)}e.relativeLuminance=function(e){return t(e>>16&255,e>>8&255,255&e)},e.relativeLuminance2=t}(l||(t.rgb=l={})),function(e){function t(e,t,n){let r=e>>24&255,i=e>>16&255,a=e>>8&255,o=t>>24&255,s=t>>16&255,c=t>>8&255,u=f(l.relativeLuminance2(o,s,c),l.relativeLuminance2(r,i,a));for(;u<n&&(o>0||s>0||c>0);)o-=Math.max(0,Math.ceil(.1*o)),s-=Math.max(0,Math.ceil(.1*s)),c-=Math.max(0,Math.ceil(.1*c)),u=f(l.relativeLuminance2(o,s,c),l.relativeLuminance2(r,i,a));return(o<<24|s<<16|c<<8|255)>>>0}function s(e,t,n){let r=e>>24&255,i=e>>16&255,a=e>>8&255,o=t>>24&255,s=t>>16&255,c=t>>8&255,u=f(l.relativeLuminance2(o,s,c),l.relativeLuminance2(r,i,a));for(;u<n&&(o<255||s<255||c<255);)o=Math.min(255,o+Math.ceil(.1*(255-o))),s=Math.min(255,s+Math.ceil(.1*(255-s))),c=Math.min(255,c+Math.ceil(.1*(255-c))),u=f(l.relativeLuminance2(o,s,c),l.relativeLuminance2(r,i,a));return(o<<24|s<<16|c<<8|255)>>>0}e.blend=function(e,t){if(a=(255&t)/255,a===1)return t;let s=t>>24&255,c=t>>16&255,l=t>>8&255,u=e>>24&255,d=e>>16&255,f=e>>8&255;return n=u+Math.round((s-u)*a),r=d+Math.round((c-d)*a),i=f+Math.round((l-f)*a),o.toRgba(n,r,i)},e.ensureContrastRatio=function(e,n,r){let i=l.relativeLuminance(e>>8),a=l.relativeLuminance(n>>8);if(f(i,a)<r){if(a<i){let a=t(e,n,r),o=f(i,l.relativeLuminance(a>>8));if(o<r){let t=s(e,n,r);return o>f(i,l.relativeLuminance(t>>8))?a:t}return a}let o=s(e,n,r),c=f(i,l.relativeLuminance(o>>8));if(c<r){let a=t(e,n,r);return c>f(i,l.relativeLuminance(a>>8))?o:a}return o}},e.reduceLuminance=t,e.increaseLuminance=s,e.toChannels=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]}}(u||(t.rgba=u={})),t.toPaddedHex=d,t.contrastRatio=f},8969:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.CoreTerminal=void 0;let r=n(844),i=n(2585),a=n(4348),o=n(7866),s=n(744),c=n(7302),l=n(6975),u=n(8460),d=n(1753),f=n(1480),p=n(7994),m=n(9282),h=n(5435),g=n(5981),_=n(2660),v=!1;class y extends r.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new u.EventEmitter),this._onScroll.event((e=>{this._onScrollApi?.fire(e.position)}))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(e){for(let t in e)this.optionsService.options[t]=e[t]}constructor(e){super(),this._windowsWrappingHeuristics=this.register(new r.MutableDisposable),this._onBinary=this.register(new u.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new u.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new u.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new u.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new u.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new u.EventEmitter),this._instantiationService=new a.InstantiationService,this.optionsService=this.register(new c.OptionsService(e)),this._instantiationService.setService(i.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(s.BufferService)),this._instantiationService.setService(i.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(o.LogService)),this._instantiationService.setService(i.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(l.CoreService)),this._instantiationService.setService(i.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(d.CoreMouseService)),this._instantiationService.setService(i.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(f.UnicodeService)),this._instantiationService.setService(i.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(p.CharsetService),this._instantiationService.setService(i.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(_.OscLinkService),this._instantiationService.setService(i.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new h.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,u.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,u.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,u.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,u.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange([`windowsMode`,`windowsPty`],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((e=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll((e=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new g.WriteBuffer(((e,t)=>this._inputHandler.parse(e,t)))),this.register((0,u.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(e,t){this._writeBuffer.write(e,t)}writeSync(e,t){this._logService.logLevel<=i.LogLevelEnum.WARN&&!v&&(this._logService.warn(`writeSync is unreliable and will be removed soon.`),v=!0),this._writeBuffer.writeSync(e,t)}input(e,t=!0){this.coreService.triggerDataEvent(e,t)}resize(e,t){isNaN(e)||isNaN(t)||(e=Math.max(e,s.MINIMUM_COLS),t=Math.max(t,s.MINIMUM_ROWS),this._bufferService.resize(e,t))}scroll(e,t=!1){this._bufferService.scroll(e,t)}scrollLines(e,t,n){this._bufferService.scrollLines(e,t,n)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}registerEscHandler(e,t){return this._inputHandler.registerEscHandler(e,t)}registerDcsHandler(e,t){return this._inputHandler.registerDcsHandler(e,t)}registerCsiHandler(e,t){return this._inputHandler.registerCsiHandler(e,t)}registerOscHandler(e,t){return this._inputHandler.registerOscHandler(e,t)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let e=!1,t=this.optionsService.rawOptions.windowsPty;t&&t.buildNumber!==void 0&&t.buildNumber!==void 0?e=t.backend===`conpty`&&t.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(e=!0),e?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){let e=[];e.push(this.onLineFeed(m.updateWindowsModeWrappedState.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:`H`},(()=>((0,m.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,r.toDisposable)((()=>{for(let t of e)t.dispose()}))}}}t.CoreTerminal=y},8460:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.runAndSubscribe=t.forwardEvent=t.EventEmitter=void 0,t.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||=e=>(this._listeners.push(e),{dispose:()=>{if(!this._disposed){for(let t=0;t<this._listeners.length;t++)if(this._listeners[t]===e)return void this._listeners.splice(t,1)}}}),this._event}fire(e,t){let n=[];for(let e=0;e<this._listeners.length;e++)n.push(this._listeners[e]);for(let r=0;r<n.length;r++)n[r].call(void 0,e,t)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},t.forwardEvent=function(e,t){return e((e=>t.fire(e)))},t.runAndSubscribe=function(e,t){return t(void 0),e((e=>t(e)))}},5435:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.InputHandler=t.WindowsOptionsReportType=void 0;let a=n(2584),o=n(7116),s=n(2015),c=n(844),l=n(482),u=n(8437),d=n(8460),f=n(643),p=n(511),m=n(3734),h=n(2585),g=n(1480),_=n(6242),v=n(6351),y=n(5941),b={"(":0,")":1,"*":2,"+":3,"-":1,".":2},x=131072;function S(e,t){if(e>24)return t.setWinLines||!1;switch(e){case 1:return!!t.restoreWin;case 2:return!!t.minimizeWin;case 3:return!!t.setWinPosition;case 4:return!!t.setWinSizePixels;case 5:return!!t.raiseWin;case 6:return!!t.lowerWin;case 7:return!!t.refreshWin;case 8:return!!t.setWinSizeChars;case 9:return!!t.maximizeWin;case 10:return!!t.fullscreenWin;case 11:return!!t.getWinState;case 13:return!!t.getWinPosition;case 14:return!!t.getWinSizePixels;case 15:return!!t.getScreenSizePixels;case 16:return!!t.getCellSizePixels;case 18:return!!t.getWinSizeChars;case 19:return!!t.getScreenSizeChars;case 20:return!!t.getIconTitle;case 21:return!!t.getWinTitle;case 22:return!!t.pushTitle;case 23:return!!t.popTitle;case 24:return!!t.setWinLines}return!1}var C;(function(e){e[e.GET_WIN_SIZE_PIXELS=0]=`GET_WIN_SIZE_PIXELS`,e[e.GET_CELL_SIZE_PIXELS=1]=`GET_CELL_SIZE_PIXELS`})(C||(t.WindowsOptionsReportType=C={}));let w=0;class T extends c.Disposable{getAttrData(){return this._curAttrData}constructor(e,t,n,r,i,c,f,m,h=new s.EscapeSequenceParser){super(),this._bufferService=e,this._charsetService=t,this._coreService=n,this._logService=r,this._optionsService=i,this._oscLinkService=c,this._coreMouseService=f,this._unicodeService=m,this._parser=h,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new l.StringToUtf32,this._utf8Decoder=new l.Utf8ToUtf32,this._workCell=new p.CellData,this._windowTitle=``,this._iconName=``,this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=u.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=u.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new d.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new d.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new d.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new d.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new d.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new d.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new d.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new d.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new d.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new d.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new d.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new d.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new d.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new E(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((e=>this._activeBuffer=e.activeBuffer))),this._parser.setCsiHandlerFallback(((e,t)=>{this._logService.debug(`Unknown CSI code: `,{identifier:this._parser.identToString(e),params:t.toArray()})})),this._parser.setEscHandlerFallback((e=>{this._logService.debug(`Unknown ESC code: `,{identifier:this._parser.identToString(e)})})),this._parser.setExecuteHandlerFallback((e=>{this._logService.debug(`Unknown EXECUTE code: `,{code:e})})),this._parser.setOscHandlerFallback(((e,t,n)=>{this._logService.debug(`Unknown OSC code: `,{identifier:e,action:t,data:n})})),this._parser.setDcsHandlerFallback(((e,t,n)=>{t===`HOOK`&&(n=n.toArray()),this._logService.debug(`Unknown DCS code: `,{identifier:this._parser.identToString(e),action:t,payload:n})})),this._parser.setPrintHandler(((e,t,n)=>this.print(e,t,n))),this._parser.registerCsiHandler({final:`@`},(e=>this.insertChars(e))),this._parser.registerCsiHandler({intermediates:` `,final:`@`},(e=>this.scrollLeft(e))),this._parser.registerCsiHandler({final:`A`},(e=>this.cursorUp(e))),this._parser.registerCsiHandler({intermediates:` `,final:`A`},(e=>this.scrollRight(e))),this._parser.registerCsiHandler({final:`B`},(e=>this.cursorDown(e))),this._parser.registerCsiHandler({final:`C`},(e=>this.cursorForward(e))),this._parser.registerCsiHandler({final:`D`},(e=>this.cursorBackward(e))),this._parser.registerCsiHandler({final:`E`},(e=>this.cursorNextLine(e))),this._parser.registerCsiHandler({final:`F`},(e=>this.cursorPrecedingLine(e))),this._parser.registerCsiHandler({final:`G`},(e=>this.cursorCharAbsolute(e))),this._parser.registerCsiHandler({final:`H`},(e=>this.cursorPosition(e))),this._parser.registerCsiHandler({final:`I`},(e=>this.cursorForwardTab(e))),this._parser.registerCsiHandler({final:`J`},(e=>this.eraseInDisplay(e,!1))),this._parser.registerCsiHandler({prefix:`?`,final:`J`},(e=>this.eraseInDisplay(e,!0))),this._parser.registerCsiHandler({final:`K`},(e=>this.eraseInLine(e,!1))),this._parser.registerCsiHandler({prefix:`?`,final:`K`},(e=>this.eraseInLine(e,!0))),this._parser.registerCsiHandler({final:`L`},(e=>this.insertLines(e))),this._parser.registerCsiHandler({final:`M`},(e=>this.deleteLines(e))),this._parser.registerCsiHandler({final:`P`},(e=>this.deleteChars(e))),this._parser.registerCsiHandler({final:`S`},(e=>this.scrollUp(e))),this._parser.registerCsiHandler({final:`T`},(e=>this.scrollDown(e))),this._parser.registerCsiHandler({final:`X`},(e=>this.eraseChars(e))),this._parser.registerCsiHandler({final:`Z`},(e=>this.cursorBackwardTab(e))),this._parser.registerCsiHandler({final:"`"},(e=>this.charPosAbsolute(e))),this._parser.registerCsiHandler({final:`a`},(e=>this.hPositionRelative(e))),this._parser.registerCsiHandler({final:`b`},(e=>this.repeatPrecedingCharacter(e))),this._parser.registerCsiHandler({final:`c`},(e=>this.sendDeviceAttributesPrimary(e))),this._parser.registerCsiHandler({prefix:`>`,final:`c`},(e=>this.sendDeviceAttributesSecondary(e))),this._parser.registerCsiHandler({final:`d`},(e=>this.linePosAbsolute(e))),this._parser.registerCsiHandler({final:`e`},(e=>this.vPositionRelative(e))),this._parser.registerCsiHandler({final:`f`},(e=>this.hVPosition(e))),this._parser.registerCsiHandler({final:`g`},(e=>this.tabClear(e))),this._parser.registerCsiHandler({final:`h`},(e=>this.setMode(e))),this._parser.registerCsiHandler({prefix:`?`,final:`h`},(e=>this.setModePrivate(e))),this._parser.registerCsiHandler({final:`l`},(e=>this.resetMode(e))),this._parser.registerCsiHandler({prefix:`?`,final:`l`},(e=>this.resetModePrivate(e))),this._parser.registerCsiHandler({final:`m`},(e=>this.charAttributes(e))),this._parser.registerCsiHandler({final:`n`},(e=>this.deviceStatus(e))),this._parser.registerCsiHandler({prefix:`?`,final:`n`},(e=>this.deviceStatusPrivate(e))),this._parser.registerCsiHandler({intermediates:`!`,final:`p`},(e=>this.softReset(e))),this._parser.registerCsiHandler({intermediates:` `,final:`q`},(e=>this.setCursorStyle(e))),this._parser.registerCsiHandler({final:`r`},(e=>this.setScrollRegion(e))),this._parser.registerCsiHandler({final:`s`},(e=>this.saveCursor(e))),this._parser.registerCsiHandler({final:`t`},(e=>this.windowOptions(e))),this._parser.registerCsiHandler({final:`u`},(e=>this.restoreCursor(e))),this._parser.registerCsiHandler({intermediates:`'`,final:`}`},(e=>this.insertColumns(e))),this._parser.registerCsiHandler({intermediates:`'`,final:`~`},(e=>this.deleteColumns(e))),this._parser.registerCsiHandler({intermediates:`"`,final:`q`},(e=>this.selectProtected(e))),this._parser.registerCsiHandler({intermediates:`$`,final:`p`},(e=>this.requestMode(e,!0))),this._parser.registerCsiHandler({prefix:`?`,intermediates:`$`,final:`p`},(e=>this.requestMode(e,!1))),this._parser.setExecuteHandler(a.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(a.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(a.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(a.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(a.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(a.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(a.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(a.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(a.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(a.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(a.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(a.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new _.OscHandler((e=>(this.setTitle(e),this.setIconName(e),!0)))),this._parser.registerOscHandler(1,new _.OscHandler((e=>this.setIconName(e)))),this._parser.registerOscHandler(2,new _.OscHandler((e=>this.setTitle(e)))),this._parser.registerOscHandler(4,new _.OscHandler((e=>this.setOrReportIndexedColor(e)))),this._parser.registerOscHandler(8,new _.OscHandler((e=>this.setHyperlink(e)))),this._parser.registerOscHandler(10,new _.OscHandler((e=>this.setOrReportFgColor(e)))),this._parser.registerOscHandler(11,new _.OscHandler((e=>this.setOrReportBgColor(e)))),this._parser.registerOscHandler(12,new _.OscHandler((e=>this.setOrReportCursorColor(e)))),this._parser.registerOscHandler(104,new _.OscHandler((e=>this.restoreIndexedColor(e)))),this._parser.registerOscHandler(110,new _.OscHandler((e=>this.restoreFgColor(e)))),this._parser.registerOscHandler(111,new _.OscHandler((e=>this.restoreBgColor(e)))),this._parser.registerOscHandler(112,new _.OscHandler((e=>this.restoreCursorColor(e)))),this._parser.registerEscHandler({final:`7`},(()=>this.saveCursor())),this._parser.registerEscHandler({final:`8`},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:`D`},(()=>this.index())),this._parser.registerEscHandler({final:`E`},(()=>this.nextLine())),this._parser.registerEscHandler({final:`H`},(()=>this.tabSet())),this._parser.registerEscHandler({final:`M`},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:`=`},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:`>`},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:`c`},(()=>this.fullReset())),this._parser.registerEscHandler({final:`n`},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:`o`},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:`|`},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:`}`},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:`~`},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:`%`,final:`@`},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:`%`,final:`G`},(()=>this.selectDefaultCharset()));for(let e in o.CHARSETS)this._parser.registerEscHandler({intermediates:`(`,final:e},(()=>this.selectCharset(`(`+e))),this._parser.registerEscHandler({intermediates:`)`,final:e},(()=>this.selectCharset(`)`+e))),this._parser.registerEscHandler({intermediates:`*`,final:e},(()=>this.selectCharset(`*`+e))),this._parser.registerEscHandler({intermediates:`+`,final:e},(()=>this.selectCharset(`+`+e))),this._parser.registerEscHandler({intermediates:`-`,final:e},(()=>this.selectCharset(`-`+e))),this._parser.registerEscHandler({intermediates:`.`,final:e},(()=>this.selectCharset(`.`+e))),this._parser.registerEscHandler({intermediates:`/`,final:e},(()=>this.selectCharset(`/`+e)));this._parser.registerEscHandler({intermediates:`#`,final:`8`},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((e=>(this._logService.error(`Parsing error: `,e),e))),this._parser.registerDcsHandler({intermediates:`$`,final:`q`},new v.DcsHandler(((e,t)=>this.requestStatusString(e,t))))}_preserveStack(e,t,n,r){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=n,this._parseStack.position=r}_logSlowResolvingAsync(e){this._logService.logLevel<=h.LogLevelEnum.WARN&&Promise.race([e,new Promise(((e,t)=>setTimeout((()=>t(`#SLOW_TIMEOUT`)),5e3)))]).catch((e=>{if(e!==`#SLOW_TIMEOUT`)throw e;console.warn(`async parser handler taking longer than 5000 ms`)}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let n,r=this._activeBuffer.x,i=this._activeBuffer.y,a=0,o=this._parseStack.paused;if(o){if(n=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,t))return this._logSlowResolvingAsync(n),n;r=this._parseStack.cursorStartX,i=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>x&&(a=this._parseStack.position+x)}if(this._logService.logLevel<=h.LogLevelEnum.DEBUG&&this._logService.debug(`parsing data`+(typeof e==`string`?` "${e}"`:` "${Array.prototype.map.call(e,(e=>String.fromCharCode(e))).join(``)}"`),typeof e==`string`?e.split(``).map((e=>e.charCodeAt(0))):e),this._parseBuffer.length<e.length&&this._parseBuffer.length<x&&(this._parseBuffer=new Uint32Array(Math.min(e.length,x))),o||this._dirtyRowTracker.clearRange(),e.length>x)for(let t=a;t<e.length;t+=x){let a=t+x<e.length?t+x:e.length,o=typeof e==`string`?this._stringDecoder.decode(e.substring(t,a),this._parseBuffer):this._utf8Decoder.decode(e.subarray(t,a),this._parseBuffer);if(n=this._parser.parse(this._parseBuffer,o))return this._preserveStack(r,i,o,t),this._logSlowResolvingAsync(n),n}else if(!o){let t=typeof e==`string`?this._stringDecoder.decode(e,this._parseBuffer):this._utf8Decoder.decode(e,this._parseBuffer);if(n=this._parser.parse(this._parseBuffer,t))return this._preserveStack(r,i,t,0),this._logSlowResolvingAsync(n),n}this._activeBuffer.x===r&&this._activeBuffer.y===i||this._onCursorMove.fire();let s=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),c=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);c<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(c,this._bufferService.rows-1),Math.min(s,this._bufferService.rows-1))}print(e,t,n){let r,i,a=this._charsetService.charset,o=this._optionsService.rawOptions.screenReaderMode,s=this._bufferService.cols,c=this._coreService.decPrivateModes.wraparound,d=this._coreService.modes.insertMode,p=this._curAttrData,m=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&n-t>0&&m.getWidth(this._activeBuffer.x-1)===2&&m.setCellFromCodepoint(this._activeBuffer.x-1,0,1,p);let h=this._parser.precedingJoinState;for(let _=t;_<n;++_){if(r=e[_],r<127&&a){let e=a[String.fromCharCode(r)];e&&(r=e.charCodeAt(0))}let t=this._unicodeService.charProperties(r,h);i=g.UnicodeService.extractWidth(t);let n=g.UnicodeService.extractShouldJoin(t),v=n?g.UnicodeService.extractWidth(h):0;if(h=t,o&&this._onA11yChar.fire((0,l.stringFromCodePoint)(r)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+i-v>s){if(c){let e=m,t=this._activeBuffer.x-v;for(this._activeBuffer.x=v,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),m=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),v>0&&m instanceof u.BufferLine&&m.copyCellsFrom(e,t,0,v,!1);t<s;)e.setCellFromCodepoint(t++,0,1,p)}else if(this._activeBuffer.x=s-1,i===2)continue}if(n&&this._activeBuffer.x){let e=m.getWidth(this._activeBuffer.x-1)?1:2;m.addCodepointToCell(this._activeBuffer.x-e,r,i);for(let e=i-v;--e>=0;)m.setCellFromCodepoint(this._activeBuffer.x++,0,0,p)}else if(d&&(m.insertCells(this._activeBuffer.x,i-v,this._activeBuffer.getNullCell(p)),m.getWidth(s-1)===2&&m.setCellFromCodepoint(s-1,f.NULL_CELL_CODE,f.NULL_CELL_WIDTH,p)),m.setCellFromCodepoint(this._activeBuffer.x++,r,i,p),i>0)for(;--i;)m.setCellFromCodepoint(this._activeBuffer.x++,0,0,p)}this._parser.precedingJoinState=h,this._activeBuffer.x<s&&n-t>0&&m.getWidth(this._activeBuffer.x)===0&&!m.hasContent(this._activeBuffer.x)&&m.setCellFromCodepoint(this._activeBuffer.x,0,1,p),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return e.final!==`t`||e.prefix||e.intermediates?this._parser.registerCsiHandler(e,t):this._parser.registerCsiHandler(e,(e=>!S(e.params[0],this._optionsService.rawOptions.windowOptions)||t(e)))}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new v.DcsHandler(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new _.OscHandler(t))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);e.hasWidth(this._activeBuffer.x)&&!e.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-e),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(e=this._bufferService.cols-1){this._activeBuffer.x=Math.min(e,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(e,t){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e,this._activeBuffer.y=this._activeBuffer.scrollTop+t):(this._activeBuffer.x=e,this._activeBuffer.y=t),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(e,t){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+t)}cursorUp(e){let t=this._activeBuffer.y-this._activeBuffer.scrollTop;return t>=0?this._moveCursor(0,-Math.min(t,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0}cursorDown(e){let t=this._activeBuffer.scrollBottom-this._activeBuffer.y;return t>=0?this._moveCursor(0,Math.min(t,e.params[0]||1)):this._moveCursor(0,e.params[0]||1),!0}cursorForward(e){return this._moveCursor(e.params[0]||1,0),!0}cursorBackward(e){return this._moveCursor(-(e.params[0]||1),0),!0}cursorNextLine(e){return this.cursorDown(e),this._activeBuffer.x=0,!0}cursorPrecedingLine(e){return this.cursorUp(e),this._activeBuffer.x=0,!0}cursorCharAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(e){return this._setCursor(e.length>=2?(e.params[1]||1)-1:0,(e.params[0]||1)-1),!0}charPosAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(e){return this._moveCursor(e.params[0]||1,0),!0}linePosAbsolute(e){return this._setCursor(this._activeBuffer.x,(e.params[0]||1)-1),!0}vPositionRelative(e){return this._moveCursor(0,e.params[0]||1),!0}hVPosition(e){return this.cursorPosition(e),!0}tabClear(e){let t=e.params[0];return t===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:t===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(e){let t=e.params[0];return t===1&&(this._curAttrData.bg|=536870912),t!==2&&t!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e,t,n,r=!1,i=!1){let a=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);a.replaceCells(t,n,this._activeBuffer.getNullCell(this._eraseAttrData()),i),r&&(a.isWrapped=!1)}_resetBufferLine(e,t=!1){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n&&(n.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),n.isWrapped=!1)}eraseInDisplay(e,t=!1){let n;switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:for(n=this._activeBuffer.y,this._dirtyRowTracker.markDirty(n),this._eraseInBufferLine(n++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);n<this._bufferService.rows;n++)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(n);break;case 1:for(n=this._activeBuffer.y,this._dirtyRowTracker.markDirty(n),this._eraseInBufferLine(n,0,this._activeBuffer.x+1,!0,t),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(n+1).isWrapped=!1);n--;)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(0);break;case 2:for(n=this._bufferService.rows,this._dirtyRowTracker.markDirty(n-1);n--;)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(0);break;case 3:let e=this._activeBuffer.lines.length-this._bufferService.rows;e>0&&(this._activeBuffer.lines.trimStart(e),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-e,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-e,0),this._onScroll.fire(0))}return!0}eraseInLine(e,t=!1){switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,t);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,t)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let n=this._activeBuffer.ybase+this._activeBuffer.y,r=this._bufferService.rows-1-this._activeBuffer.scrollBottom,i=this._bufferService.rows-1+this._activeBuffer.ybase-r+1;for(;t--;)this._activeBuffer.lines.splice(i-1,1),this._activeBuffer.lines.splice(n,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let n=this._activeBuffer.ybase+this._activeBuffer.y,r;for(r=this._bufferService.rows-1-this._activeBuffer.scrollBottom,r=this._bufferService.rows-1+this._activeBuffer.ybase-r;t--;)this._activeBuffer.lines.splice(n,1),this._activeBuffer.lines.splice(r,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.insertCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.deleteCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(e){let t=e.params[0]||1;for(;t--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(e){let t=e.params[0]||1;for(;t--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(u.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n.deleteCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n.insertCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n.insertCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n.deleteCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(e.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(e){let t=this._parser.precedingJoinState;if(!t)return!0;let n=e.params[0]||1,r=g.UnicodeService.extractWidth(t),i=this._activeBuffer.x-r,a=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(i),o=new Uint32Array(a.length*n),s=0;for(let e=0;e<a.length;){let t=a.codePointAt(e)||0;o[s++]=t,e+=t>65535?2:1}let c=s;for(let e=1;e<n;++e)o.copyWithin(c,0,s),c+=s;return this.print(o,0,c),!0}sendDeviceAttributesPrimary(e){return e.params[0]>0||(this._is(`xterm`)||this._is(`rxvt-unicode`)||this._is(`screen`)?this._coreService.triggerDataEvent(a.C0.ESC+`[?1;2c`):this._is(`linux`)&&this._coreService.triggerDataEvent(a.C0.ESC+`[?6c`)),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is(`xterm`)?this._coreService.triggerDataEvent(a.C0.ESC+`[>0;276;0c`):this._is(`rxvt-unicode`)?this._coreService.triggerDataEvent(a.C0.ESC+`[>85;95;0c`):this._is(`linux`)?this._coreService.triggerDataEvent(e.params[0]+`c`):this._is(`screen`)&&this._coreService.triggerDataEvent(a.C0.ESC+`[>83;40003;0c`)),!0}_is(e){return(this._optionsService.rawOptions.termName+``).indexOf(e)===0}setMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,o.DEFAULT_CHARSET),this._charsetService.setgCharset(1,o.DEFAULT_CHARSET),this._charsetService.setgCharset(2,o.DEFAULT_CHARSET),this._charsetService.setgCharset(3,o.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug(`Serial port requested application keypad.`),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol=`X10`;break;case 1e3:this._coreMouseService.activeProtocol=`VT200`;break;case 1002:this._coreMouseService.activeProtocol=`DRAG`;break;case 1003:this._coreMouseService.activeProtocol=`ANY`;break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug(`DECSET 1005 not supported (see #2507)`);break;case 1006:this._coreMouseService.activeEncoding=`SGR`;break;case 1015:this._logService.debug(`DECSET 1015 not supported (see #2507)`);break;case 1016:this._coreMouseService.activeEncoding=`SGR_PIXELS`;break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug(`Switching back to normal keypad.`),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol=`NONE`;break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug(`DECRST 1005 not supported (see #2507)`);break;case 1006:case 1016:this._coreMouseService.activeEncoding=`DEFAULT`;break;case 1015:this._logService.debug(`DECRST 1015 not supported (see #2507)`);break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),e.params[t]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(e,t){let n=this._coreService.decPrivateModes,{activeProtocol:r,activeEncoding:i}=this._coreMouseService,o=this._coreService,{buffers:s,cols:c}=this._bufferService,{active:l,alt:u}=s,d=this._optionsService.rawOptions,f=e=>e?1:2,p=e.params[0];return m=p,h=t?p===2?4:p===4?f(o.modes.insertMode):p===12?3:p===20?f(d.convertEol):0:p===1?f(n.applicationCursorKeys):p===3?d.windowOptions.setWinLines?c===80?2:+(c===132):0:p===6?f(n.origin):p===7?f(n.wraparound):p===8?3:p===9?f(r===`X10`):p===12?f(d.cursorBlink):p===25?f(!o.isCursorHidden):p===45?f(n.reverseWraparound):p===66?f(n.applicationKeypad):p===67?4:p===1e3?f(r===`VT200`):p===1002?f(r===`DRAG`):p===1003?f(r===`ANY`):p===1004?f(n.sendFocus):p===1005?4:p===1006?f(i===`SGR`):p===1015?4:p===1016?f(i===`SGR_PIXELS`):p===1048?1:p===47||p===1047||p===1049?f(l===u):p===2004?f(n.bracketedPasteMode):0,o.triggerDataEvent(`${a.C0.ESC}[${t?``:`?`}${m};${h}$y`),!0;var m,h}_updateAttrColor(e,t,n,r,i){return t===2?(e|=50331648,e&=-16777216,e|=m.AttributeData.fromColorRGB([n,r,i])):t===5&&(e&=-50331904,e|=33554432|255&n),e}_extractColor(e,t,n){let r=[0,0,-1,0,0,0],i=0,a=0;do{if(r[a+i]=e.params[t+a],e.hasSubParams(t+a)){let n=e.getSubParams(t+a),o=0;do r[1]===5&&(i=1),r[a+o+1+i]=n[o];while(++o<n.length&&o+a+1+i<r.length);break}if(r[1]===5&&a+i>=2||r[1]===2&&a+i>=5)break;r[1]&&(i=1)}while(++a+t<e.length&&a+i<r.length);for(let e=2;e<r.length;++e)r[e]===-1&&(r[e]=0);switch(r[0]){case 38:n.fg=this._updateAttrColor(n.fg,r[1],r[3],r[4],r[5]);break;case 48:n.bg=this._updateAttrColor(n.bg,r[1],r[3],r[4],r[5]);break;case 58:n.extended=n.extended.clone(),n.extended.underlineColor=this._updateAttrColor(n.extended.underlineColor,r[1],r[3],r[4],r[5])}return a}_processUnderline(e,t){t.extended=t.extended.clone(),(!~e||e>5)&&(e=1),t.extended.underlineStyle=e,t.fg|=268435456,e===0&&(t.fg&=-268435457),t.updateExtended()}_processSGR0(e){e.fg=u.DEFAULT_ATTR_DATA.fg,e.bg=u.DEFAULT_ATTR_DATA.bg,e.extended=e.extended.clone(),e.extended.underlineStyle=0,e.extended.underlineColor&=-67108864,e.updateExtended()}charAttributes(e){if(e.length===1&&e.params[0]===0)return this._processSGR0(this._curAttrData),!0;let t=e.length,n,r=this._curAttrData;for(let i=0;i<t;i++)n=e.params[i],n>=30&&n<=37?(r.fg&=-50331904,r.fg|=16777216|n-30):n>=40&&n<=47?(r.bg&=-50331904,r.bg|=16777216|n-40):n>=90&&n<=97?(r.fg&=-50331904,r.fg|=16777224|n-90):n>=100&&n<=107?(r.bg&=-50331904,r.bg|=16777224|n-100):n===0?this._processSGR0(r):n===1?r.fg|=134217728:n===3?r.bg|=67108864:n===4?(r.fg|=268435456,this._processUnderline(e.hasSubParams(i)?e.getSubParams(i)[0]:1,r)):n===5?r.fg|=536870912:n===7?r.fg|=67108864:n===8?r.fg|=1073741824:n===9?r.fg|=2147483648:n===2?r.bg|=134217728:n===21?this._processUnderline(2,r):n===22?(r.fg&=-134217729,r.bg&=-134217729):n===23?r.bg&=-67108865:n===24?(r.fg&=-268435457,this._processUnderline(0,r)):n===25?r.fg&=-536870913:n===27?r.fg&=-67108865:n===28?r.fg&=-1073741825:n===29?r.fg&=2147483647:n===39?(r.fg&=-67108864,r.fg|=16777215&u.DEFAULT_ATTR_DATA.fg):n===49?(r.bg&=-67108864,r.bg|=16777215&u.DEFAULT_ATTR_DATA.bg):n===38||n===48||n===58?i+=this._extractColor(e,i,r):n===53?r.bg|=1073741824:n===55?r.bg&=-1073741825:n===59?(r.extended=r.extended.clone(),r.extended.underlineColor=-1,r.updateExtended()):n===100?(r.fg&=-67108864,r.fg|=16777215&u.DEFAULT_ATTR_DATA.fg,r.bg&=-67108864,r.bg|=16777215&u.DEFAULT_ATTR_DATA.bg):this._logService.debug(`Unknown SGR attribute: %d.`,n);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${a.C0.ESC}[0n`);break;case 6:let e=this._activeBuffer.y+1,t=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${a.C0.ESC}[${e};${t}R`)}return!0}deviceStatusPrivate(e){if(e.params[0]===6){let e=this._activeBuffer.y+1,t=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${a.C0.ESC}[?${e};${t}R`)}return!0}softReset(e){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=u.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(e){let t=e.params[0]||1;switch(t){case 1:case 2:this._optionsService.options.cursorStyle=`block`;break;case 3:case 4:this._optionsService.options.cursorStyle=`underline`;break;case 5:case 6:this._optionsService.options.cursorStyle=`bar`}let n=t%2==1;return this._optionsService.options.cursorBlink=n,!0}setScrollRegion(e){let t=e.params[0]||1,n;return(e.length<2||(n=e.params[1])>this._bufferService.rows||n===0)&&(n=this._bufferService.rows),n>t&&(this._activeBuffer.scrollTop=t-1,this._activeBuffer.scrollBottom=n-1,this._setCursor(0,0)),!0}windowOptions(e){if(!S(e.params[0],this._optionsService.rawOptions.windowOptions))return!0;let t=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:t!==2&&this._onRequestWindowsOptionsReport.fire(C.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(C.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${a.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:t!==0&&t!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),t!==0&&t!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:t!==0&&t!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),t!==0&&t!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(e){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(e){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(e){return this._windowTitle=e,this._onTitleChange.fire(e),!0}setIconName(e){return this._iconName=e,!0}setOrReportIndexedColor(e){let t=[],n=e.split(`;`);for(;n.length>1;){let e=n.shift(),r=n.shift();if(/^\d+$/.exec(e)){let n=parseInt(e);if(D(n))if(r===`?`)t.push({type:0,index:n});else{let e=(0,y.parseColor)(r);e&&t.push({type:1,index:n,color:e})}}}return t.length&&this._onColor.fire(t),!0}setHyperlink(e){let t=e.split(`;`);return!(t.length<2)&&(t[1]?this._createHyperlink(t[0],t[1]):!t[0]&&this._finishHyperlink())}_createHyperlink(e,t){this._getCurrentLinkId()&&this._finishHyperlink();let n=e.split(`:`),r,i=n.findIndex((e=>e.startsWith(`id=`)));return i!==-1&&(r=n[i].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:r,uri:t}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(e,t){let n=e.split(`;`);for(let e=0;e<n.length&&!(t>=this._specialColors.length);++e,++t)if(n[e]===`?`)this._onColor.fire([{type:0,index:this._specialColors[t]}]);else{let r=(0,y.parseColor)(n[e]);r&&this._onColor.fire([{type:1,index:this._specialColors[t],color:r}])}return!0}setOrReportFgColor(e){return this._setOrReportSpecialColor(e,0)}setOrReportBgColor(e){return this._setOrReportSpecialColor(e,1)}setOrReportCursorColor(e){return this._setOrReportSpecialColor(e,2)}restoreIndexedColor(e){if(!e)return this._onColor.fire([{type:2}]),!0;let t=[],n=e.split(`;`);for(let e=0;e<n.length;++e)if(/^\d+$/.exec(n[e])){let r=parseInt(n[e]);D(r)&&t.push({type:2,index:r})}return t.length&&this._onColor.fire(t),!0}restoreFgColor(e){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(e){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(e){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug(`Serial port requested application keypad.`),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug(`Switching back to normal keypad.`),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,o.DEFAULT_CHARSET),!0}selectCharset(e){return e.length===2?(e[0]===`/`||this._charsetService.setgCharset(b[e[0]],o.CHARSETS[e[1]]||o.DEFAULT_CHARSET),!0):(this.selectDefaultCharset(),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){let e=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,e,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=u.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=u.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(e){return this._charsetService.setgLevel(e),!0}screenAlignmentPattern(){let e=new p.CellData;e.content=4194373,e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._setCursor(0,0);for(let t=0;t<this._bufferService.rows;++t){let n=this._activeBuffer.ybase+this._activeBuffer.y+t,r=this._activeBuffer.lines.get(n);r&&(r.fill(e),r.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e,t){let n=this._bufferService.buffer,r=this._optionsService.rawOptions;return(e=>(this._coreService.triggerDataEvent(`${a.C0.ESC}${e}${a.C0.ESC}\\`),!0))(e===`"q`?`P1$r${+!!this._curAttrData.isProtected()}"q`:e===`"p`?`P1$r61;1"p`:e===`r`?`P1$r${n.scrollTop+1};${n.scrollBottom+1}r`:e===`m`?`P1$r0m`:e===` q`?`P1$r${{block:2,underline:4,bar:6}[r.cursorStyle]-+!!r.cursorBlink} q`:`P0$r`)}markRangeDirty(e,t){this._dirtyRowTracker.markRangeDirty(e,t)}}t.InputHandler=T;let E=class{constructor(e){this._bufferService=e,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(e){e<this.start?this.start=e:e>this.end&&(this.end=e)}markRangeDirty(e,t){e>t&&(w=e,e=t,t=w),e<this.start&&(this.start=e),t>this.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function D(e){return 0<=e&&e<256}E=r([i(0,h.IBufferService)],E)},844:(e,t)=>{function n(e){for(let t of e)t.dispose();e.length=0}Object.defineProperty(t,`__esModule`,{value:!0}),t.getDisposeArrayDisposable=t.disposeArray=t.toDisposable=t.MutableDisposable=t.Disposable=void 0,t.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(let e of this._disposables)e.dispose();this._disposables.length=0}register(e){return this._disposables.push(e),e}unregister(e){let t=this._disposables.indexOf(e);t!==-1&&this._disposables.splice(t,1)}},t.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}},t.toDisposable=function(e){return{dispose:e}},t.disposeArray=n,t.getDisposeArrayDisposable=function(e){return{dispose:()=>n(e)}}},1505:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.FourKeyMap=t.TwoKeyMap=void 0;class n{constructor(){this._data={}}set(e,t,n){this._data[e]||(this._data[e]={}),this._data[e][t]=n}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}}t.TwoKeyMap=n,t.FourKeyMap=class{constructor(){this._data=new n}set(e,t,r,i,a){this._data.get(e,t)||this._data.set(e,t,new n),this._data.get(e,t).set(r,i,a)}get(e,t,n,r){return this._data.get(e,t)?.get(n,r)}clear(){this._data.clear()}}},6114:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.isChromeOS=t.isLinux=t.isWindows=t.isIphone=t.isIpad=t.isMac=t.getSafariVersion=t.isSafari=t.isLegacyEdge=t.isFirefox=t.isNode=void 0,t.isNode=typeof process<`u`&&`title`in process;let n=t.isNode?`node`:navigator.userAgent,r=t.isNode?`node`:navigator.platform;t.isFirefox=n.includes(`Firefox`),t.isLegacyEdge=n.includes(`Edge`),t.isSafari=/^((?!chrome|android).)*safari/i.test(n),t.getSafariVersion=function(){if(!t.isSafari)return 0;let e=n.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])},t.isMac=[`Macintosh`,`MacIntel`,`MacPPC`,`Mac68K`].includes(r),t.isIpad=r===`iPad`,t.isIphone=r===`iPhone`,t.isWindows=[`Windows`,`Win16`,`Win32`,`WinCE`].includes(r),t.isLinux=r.indexOf(`Linux`)>=0,t.isChromeOS=/\bCrOS\b/.test(n)},6106:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.SortedList=void 0;let n=0;t.SortedList=class{constructor(e){this._getKey=e,this._array=[]}clear(){this._array.length=0}insert(e){this._array.length===0?this._array.push(e):(n=this._search(this._getKey(e)),this._array.splice(n,0,e))}delete(e){if(this._array.length===0)return!1;let t=this._getKey(e);if(t===void 0||(n=this._search(t),n===-1)||this._getKey(this._array[n])!==t)return!1;do if(this._array[n]===e)return this._array.splice(n,1),!0;while(++n<this._array.length&&this._getKey(this._array[n])===t);return!1}*getKeyIterator(e){if(this._array.length!==0&&(n=this._search(e),!(n<0||n>=this._array.length)&&this._getKey(this._array[n])===e))do yield this._array[n];while(++n<this._array.length&&this._getKey(this._array[n])===e)}forEachByKey(e,t){if(this._array.length!==0&&(n=this._search(e),!(n<0||n>=this._array.length)&&this._getKey(this._array[n])===e))do t(this._array[n]);while(++n<this._array.length&&this._getKey(this._array[n])===e)}values(){return[...this._array].values()}_search(e){let t=0,n=this._array.length-1;for(;n>=t;){let r=t+n>>1,i=this._getKey(this._array[r]);if(i>e)n=r-1;else{if(!(i<e)){for(;r>0&&this._getKey(this._array[r-1])===e;)r--;return r}t=r+1}}return t}}},7226:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.DebouncedIdleTask=t.IdleTaskQueue=t.PriorityTaskQueue=void 0;let r=n(6114);class i{constructor(){this._tasks=[],this._i=0}enqueue(e){this._tasks.push(e),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&=(this._cancelCallback(this._idleCallback),void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||=this._requestCallback(this._process.bind(this))}_process(e){this._idleCallback=void 0;let t=0,n=0,r=e.timeRemaining(),i=0;for(;this._i<this._tasks.length;){if(t=Date.now(),this._tasks[this._i]()||this._i++,t=Math.max(1,Date.now()-t),n=Math.max(t,n),i=e.timeRemaining(),1.5*n>i)return r-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(r-t))}ms`),void this._start();r=i}this.clear()}}class a extends i{_requestCallback(e){return setTimeout((()=>e(this._createDeadline(16))))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let t=Date.now()+e;return{timeRemaining:()=>Math.max(0,t-Date.now())}}}t.PriorityTaskQueue=a,t.IdleTaskQueue=!r.isNode&&`requestIdleCallback`in window?class extends i{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}}:a,t.DebouncedIdleTask=class{constructor(){this._queue=new t.IdleTaskQueue}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}}},9282:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.updateWindowsModeWrappedState=void 0;let r=n(643);t.updateWindowsModeWrappedState=function(e){let t=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1)?.get(e.cols-1),n=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);n&&t&&(n.isWrapped=t[r.CHAR_DATA_CODE_INDEX]!==r.NULL_CELL_CODE&&t[r.CHAR_DATA_CODE_INDEX]!==r.WHITESPACE_CELL_CODE)}},3734:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.ExtendedAttrs=t.AttributeData=void 0;class n{constructor(){this.fg=0,this.bg=0,this.extended=new r}static toColorRGB(e){return[e>>>16&255,e>>>8&255,255&e]}static fromColorRGB(e){return(255&e[0])<<16|(255&e[1])<<8|255&e[2]}clone(){let e=new n;return e.fg=this.fg,e.bg=this.bg,e.extended=this.extended.clone(),e}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}t.AttributeData=n;class r{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(e){this._ext&=-67108864,this._ext|=67108863&e}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(3758096384&this._ext)>>29;return e<0?4294967288^e:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}constructor(e=0,t=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=t}clone(){return new r(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}t.ExtendedAttrs=r},9092:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.Buffer=t.MAX_BUFFER_SIZE=void 0;let r=n(6349),i=n(7226),a=n(3734),o=n(8437),s=n(4634),c=n(511),l=n(643),u=n(4863),d=n(7116);t.MAX_BUFFER_SIZE=4294967295,t.Buffer=class{constructor(e,t,n){this._hasScrollback=e,this._optionsService=t,this._bufferService=n,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=o.DEFAULT_ATTR_DATA.clone(),this.savedCharset=d.DEFAULT_CHARSET,this.markers=[],this._nullCell=c.CellData.fromCharData([0,l.NULL_CELL_CHAR,l.NULL_CELL_WIDTH,l.NULL_CELL_CODE]),this._whitespaceCell=c.CellData.fromCharData([0,l.WHITESPACE_CELL_CHAR,l.WHITESPACE_CELL_WIDTH,l.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new i.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new r.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new a.ExtendedAttrs),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new a.ExtendedAttrs),this._whitespaceCell}getBlankLine(e,t){return new o.BufferLine(this._bufferService.cols,this.getNullCell(e),t)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows}_getCorrectBufferLength(e){if(!this._hasScrollback)return e;let n=e+this._optionsService.rawOptions.scrollback;return n>t.MAX_BUFFER_SIZE?t.MAX_BUFFER_SIZE:n}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=o.DEFAULT_ATTR_DATA);let t=this._rows;for(;t--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new r.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){let n=this.getNullCell(o.DEFAULT_ATTR_DATA),r=0,i=this._getCorrectBufferLength(t);if(i>this.lines.maxLength&&(this.lines.maxLength=i),this.lines.length>0){if(this._cols<e)for(let t=0;t<this.lines.length;t++)r+=+this.lines.get(t).resize(e,n);let a=0;if(this._rows<t)for(let r=this._rows;r<t;r++)this.lines.length<t+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new o.BufferLine(e,n)):this.ybase>0&&this.lines.length<=this.ybase+this.y+a+1?(this.ybase--,a++,this.ydisp>0&&this.ydisp--):this.lines.push(new o.BufferLine(e,n)));else for(let e=this._rows;e>t;e--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(i<this.lines.maxLength){let e=this.lines.length-i;e>0&&(this.lines.trimStart(e),this.ybase=Math.max(this.ybase-e,0),this.ydisp=Math.max(this.ydisp-e,0),this.savedY=Math.max(this.savedY-e,0)),this.lines.maxLength=i}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),a&&(this.y+=a),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(let t=0;t<this.lines.length;t++)r+=+this.lines.get(t).resize(e,n);this._cols=e,this._rows=t,this._memoryCleanupQueue.clear(),r>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let t=0;for(;this._memoryCleanupPosition<this.lines.length;)if(t+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),t>100)return!0;return e}get _isReflowEnabled(){let e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&e.backend===`conpty`&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))}_reflowLarger(e,t){let n=(0,s.reflowLargerGetLinesToRemove)(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(o.DEFAULT_ATTR_DATA));if(n.length>0){let r=(0,s.reflowLargerCreateNewLayout)(this.lines,n);(0,s.reflowLargerApplyNewLayout)(this.lines,r.layout),this._reflowLargerAdjustViewport(e,t,r.countRemoved)}}_reflowLargerAdjustViewport(e,t,n){let r=this.getNullCell(o.DEFAULT_ATTR_DATA),i=n;for(;i-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new o.BufferLine(e,r))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-n,0)}_reflowSmaller(e,t){let n=this.getNullCell(o.DEFAULT_ATTR_DATA),r=[],i=0;for(let a=this.lines.length-1;a>=0;a--){let c=this.lines.get(a);if(!c||!c.isWrapped&&c.getTrimmedLength()<=e)continue;let l=[c];for(;c.isWrapped&&a>0;)c=this.lines.get(--a),l.unshift(c);let u=this.ybase+this.y;if(u>=a&&u<a+l.length)continue;let d=l[l.length-1].getTrimmedLength(),f=(0,s.reflowSmallerGetNewLineLengths)(l,this._cols,e),p=f.length-l.length,m;m=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+p):Math.max(0,this.lines.length-this.lines.maxLength+p);let h=[];for(let e=0;e<p;e++){let e=this.getBlankLine(o.DEFAULT_ATTR_DATA,!0);h.push(e)}h.length>0&&(r.push({start:a+l.length+i,newLines:h}),i+=h.length),l.push(...h);let g=f.length-1,_=f[g];_===0&&(g--,_=f[g]);let v=l.length-p-1,y=d;for(;v>=0;){let e=Math.min(y,_);if(l[g]===void 0)break;if(l[g].copyCellsFrom(l[v],y-e,_-e,e,!0),_-=e,_===0&&(g--,_=f[g]),y-=e,y===0){v--;let e=Math.max(v,0);y=(0,s.getWrappedLineTrimmedLength)(l,e,this._cols)}}for(let t=0;t<l.length;t++)f[t]<e&&l[t].setCell(f[t],n);let b=p-m;for(;b-- >0;)this.ybase===0?this.y<t-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+i)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+p,this.ybase+t-1)}if(r.length>0){let e=[],t=[];for(let e=0;e<this.lines.length;e++)t.push(this.lines.get(e));let n=this.lines.length,a=n-1,o=0,s=r[o];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+i);let c=0;for(let l=Math.min(this.lines.maxLength-1,n+i-1);l>=0;l--)if(s&&s.start>a+c){for(let e=s.newLines.length-1;e>=0;e--)this.lines.set(l--,s.newLines[e]);l++,e.push({index:a+1,amount:s.newLines.length}),c+=s.newLines.length,s=r[++o]}else this.lines.set(l,t[a--]);let l=0;for(let t=e.length-1;t>=0;t--)e[t].index+=l,this.lines.onInsertEmitter.fire(e[t]),l+=e[t].amount;let u=Math.max(0,n+i-this.lines.maxLength);u>0&&this.lines.onTrimEmitter.fire(u)}}translateBufferLineToString(e,t,n=0,r){let i=this.lines.get(e);return i?i.translateToString(t,n,r):``}getWrappedRangeForLine(e){let t=e,n=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;n+1<this.lines.length&&this.lines.get(n+1).isWrapped;)n++;return{first:t,last:n}}setupTabStops(e){for(e==null?(this.tabs={},e=0):this.tabs[e]||(e=this.prevStop(e));e<this._cols;e+=this._optionsService.rawOptions.tabStopWidth)this.tabs[e]=!0}prevStop(e){for(e??=this.x;!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e??=this.x;!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let t=0;t<this.markers.length;t++)this.markers[t].line===e&&(this.markers[t].dispose(),this.markers.splice(t--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].dispose(),this.markers.splice(e--,1);this._isClearing=!1}addMarker(e){let t=new u.Marker(e);return this.markers.push(t),t.register(this.lines.onTrim((e=>{t.line-=e,t.line<0&&t.dispose()}))),t.register(this.lines.onInsert((e=>{t.line>=e.index&&(t.line+=e.amount)}))),t.register(this.lines.onDelete((e=>{t.line>=e.index&&t.line<e.index+e.amount&&t.dispose(),t.line>e.index&&(t.line-=e.amount)}))),t.register(t.onDispose((()=>this._removeMarker(t)))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}}},8437:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.BufferLine=t.DEFAULT_ATTR_DATA=void 0;let r=n(3734),i=n(511),a=n(643),o=n(482);t.DEFAULT_ATTR_DATA=Object.freeze(new r.AttributeData);let s=0;class c{constructor(e,t,n=!1){this.isWrapped=n,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*e);let r=t||i.CellData.fromCharData([0,a.NULL_CELL_CHAR,a.NULL_CELL_WIDTH,a.NULL_CELL_CODE]);for(let t=0;t<e;++t)this.setCell(t,r);this.length=e}get(e){let t=this._data[3*e+0],n=2097151&t;return[this._data[3*e+1],2097152&t?this._combined[e]:n?(0,o.stringFromCodePoint)(n):``,t>>22,2097152&t?this._combined[e].charCodeAt(this._combined[e].length-1):n]}set(e,t){this._data[3*e+1]=t[a.CHAR_DATA_ATTR_INDEX],t[a.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[e]=t[1],this._data[3*e+0]=2097152|e|t[a.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*e+0]=t[a.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|t[a.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(e){return this._data[3*e+0]>>22}hasWidth(e){return 12582912&this._data[3*e+0]}getFg(e){return this._data[3*e+1]}getBg(e){return this._data[3*e+2]}hasContent(e){return 4194303&this._data[3*e+0]}getCodePoint(e){let t=this._data[3*e+0];return 2097152&t?this._combined[e].charCodeAt(this._combined[e].length-1):2097151&t}isCombined(e){return 2097152&this._data[3*e+0]}getString(e){let t=this._data[3*e+0];return 2097152&t?this._combined[e]:2097151&t?(0,o.stringFromCodePoint)(2097151&t):``}isProtected(e){return 536870912&this._data[3*e+2]}loadCell(e,t){return s=3*e,t.content=this._data[s+0],t.fg=this._data[s+1],t.bg=this._data[s+2],2097152&t.content&&(t.combinedData=this._combined[e]),268435456&t.bg&&(t.extended=this._extendedAttrs[e]),t}setCell(e,t){2097152&t.content&&(this._combined[e]=t.combinedData),268435456&t.bg&&(this._extendedAttrs[e]=t.extended),this._data[3*e+0]=t.content,this._data[3*e+1]=t.fg,this._data[3*e+2]=t.bg}setCellFromCodepoint(e,t,n,r){268435456&r.bg&&(this._extendedAttrs[e]=r.extended),this._data[3*e+0]=t|n<<22,this._data[3*e+1]=r.fg,this._data[3*e+2]=r.bg}addCodepointToCell(e,t,n){let r=this._data[3*e+0];2097152&r?this._combined[e]+=(0,o.stringFromCodePoint)(t):2097151&r?(this._combined[e]=(0,o.stringFromCodePoint)(2097151&r)+(0,o.stringFromCodePoint)(t),r&=-2097152,r|=2097152):r=t|1<<22,n&&(r&=-12582913,r|=n<<22),this._data[3*e+0]=r}insertCells(e,t,n){if((e%=this.length)&&this.getWidth(e-1)===2&&this.setCellFromCodepoint(e-1,0,1,n),t<this.length-e){let r=new i.CellData;for(let n=this.length-e-t-1;n>=0;--n)this.setCell(e+t+n,this.loadCell(e+n,r));for(let r=0;r<t;++r)this.setCell(e+r,n)}else for(let t=e;t<this.length;++t)this.setCell(t,n);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,n)}deleteCells(e,t,n){if(e%=this.length,t<this.length-e){let r=new i.CellData;for(let n=0;n<this.length-e-t;++n)this.setCell(e+n,this.loadCell(e+t+n,r));for(let e=this.length-t;e<this.length;++e)this.setCell(e,n)}else for(let t=e;t<this.length;++t)this.setCell(t,n);e&&this.getWidth(e-1)===2&&this.setCellFromCodepoint(e-1,0,1,n),this.getWidth(e)!==0||this.hasContent(e)||this.setCellFromCodepoint(e,0,1,n)}replaceCells(e,t,n,r=!1){if(r)for(e&&this.getWidth(e-1)===2&&!this.isProtected(e-1)&&this.setCellFromCodepoint(e-1,0,1,n),t<this.length&&this.getWidth(t-1)===2&&!this.isProtected(t)&&this.setCellFromCodepoint(t,0,1,n);e<t&&e<this.length;)this.isProtected(e)||this.setCell(e,n),e++;else for(e&&this.getWidth(e-1)===2&&this.setCellFromCodepoint(e-1,0,1,n),t<this.length&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t,0,1,n);e<t&&e<this.length;)this.setCell(e++,n)}resize(e,t){if(e===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;let n=3*e;if(e>this.length){if(this._data.buffer.byteLength>=4*n)this._data=new Uint32Array(this._data.buffer,0,n);else{let e=new Uint32Array(n);e.set(this._data),this._data=e}for(let n=this.length;n<e;++n)this.setCell(n,t)}else{this._data=this._data.subarray(0,n);let t=Object.keys(this._combined);for(let n=0;n<t.length;n++){let r=parseInt(t[n],10);r>=e&&delete this._combined[r]}let r=Object.keys(this._extendedAttrs);for(let t=0;t<r.length;t++){let n=parseInt(r[t],10);n>=e&&delete this._extendedAttrs[n]}}return this.length=e,4*n*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){let e=new Uint32Array(this._data.length);return e.set(this._data),this._data=e,1}return 0}fill(e,t=!1){if(t)for(let t=0;t<this.length;++t)this.isProtected(t)||this.setCell(t,e);else{this._combined={},this._extendedAttrs={};for(let t=0;t<this.length;++t)this.setCell(t,e)}}copyFrom(e){this.length===e.length?this._data.set(e._data):this._data=new Uint32Array(e._data),this.length=e.length,this._combined={};for(let t in e._combined)this._combined[t]=e._combined[t];this._extendedAttrs={};for(let t in e._extendedAttrs)this._extendedAttrs[t]=e._extendedAttrs[t];this.isWrapped=e.isWrapped}clone(){let e=new c(0);e._data=new Uint32Array(this._data),e.length=this.length;for(let t in this._combined)e._combined[t]=this._combined[t];for(let t in this._extendedAttrs)e._extendedAttrs[t]=this._extendedAttrs[t];return e.isWrapped=this.isWrapped,e}getTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(4194303&this._data[3*e+0])return e+(this._data[3*e+0]>>22);return 0}getNoBgTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(4194303&this._data[3*e+0]||50331648&this._data[3*e+2])return e+(this._data[3*e+0]>>22);return 0}copyCellsFrom(e,t,n,r,i){let a=e._data;if(i)for(let i=r-1;i>=0;i--){for(let e=0;e<3;e++)this._data[3*(n+i)+e]=a[3*(t+i)+e];268435456&a[3*(t+i)+2]&&(this._extendedAttrs[n+i]=e._extendedAttrs[t+i])}else for(let i=0;i<r;i++){for(let e=0;e<3;e++)this._data[3*(n+i)+e]=a[3*(t+i)+e];268435456&a[3*(t+i)+2]&&(this._extendedAttrs[n+i]=e._extendedAttrs[t+i])}let o=Object.keys(e._combined);for(let r=0;r<o.length;r++){let i=parseInt(o[r],10);i>=t&&(this._combined[i-t+n]=e._combined[i])}}translateToString(e,t,n,r){t??=0,n??=this.length,e&&(n=Math.min(n,this.getTrimmedLength())),r&&(r.length=0);let i=``;for(;t<n;){let e=this._data[3*t+0],n=2097151&e,s=2097152&e?this._combined[t]:n?(0,o.stringFromCodePoint)(n):a.WHITESPACE_CELL_CHAR;if(i+=s,r)for(let e=0;e<s.length;++e)r.push(t);t+=e>>22||1}return r&&r.push(t),i}}t.BufferLine=c},4841:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.getRangeLength=void 0,t.getRangeLength=function(e,t){if(e.start.y>e.end.y)throw Error(`Buffer range end (${e.end.x}, ${e.end.y}) cannot be before start (${e.start.x}, ${e.start.y})`);return t*(e.end.y-e.start.y)+(e.end.x-e.start.x+1)}},4634:(e,t)=>{function n(e,t,n){if(t===e.length-1)return e[t].getTrimmedLength();let r=!e[t].hasContent(n-1)&&e[t].getWidth(n-1)===1,i=e[t+1].getWidth(0)===2;return r&&i?n-1:n}Object.defineProperty(t,`__esModule`,{value:!0}),t.getWrappedLineTrimmedLength=t.reflowSmallerGetNewLineLengths=t.reflowLargerApplyNewLayout=t.reflowLargerCreateNewLayout=t.reflowLargerGetLinesToRemove=void 0,t.reflowLargerGetLinesToRemove=function(e,t,r,i,a){let o=[];for(let s=0;s<e.length-1;s++){let c=s,l=e.get(++c);if(!l.isWrapped)continue;let u=[e.get(s)];for(;c<e.length&&l.isWrapped;)u.push(l),l=e.get(++c);if(i>=s&&i<c){s+=u.length-1;continue}let d=0,f=n(u,d,t),p=1,m=0;for(;p<u.length;){let e=n(u,p,t),i=e-m,o=r-f,s=Math.min(i,o);u[d].copyCellsFrom(u[p],m,f,s,!1),f+=s,f===r&&(d++,f=0),m+=s,m===e&&(p++,m=0),f===0&&d!==0&&u[d-1].getWidth(r-1)===2&&(u[d].copyCellsFrom(u[d-1],r-1,f++,1,!1),u[d-1].setCell(r-1,a))}u[d].replaceCells(f,r,a);let h=0;for(let e=u.length-1;e>0&&(e>d||u[e].getTrimmedLength()===0);e--)h++;h>0&&(o.push(s+u.length-h),o.push(h)),s+=u.length-1}return o},t.reflowLargerCreateNewLayout=function(e,t){let n=[],r=0,i=t[r],a=0;for(let o=0;o<e.length;o++)if(i===o){let n=t[++r];e.onDeleteEmitter.fire({index:o-a,amount:n}),o+=n-1,a+=n,i=t[++r]}else n.push(o);return{layout:n,countRemoved:a}},t.reflowLargerApplyNewLayout=function(e,t){let n=[];for(let r=0;r<t.length;r++)n.push(e.get(t[r]));for(let t=0;t<n.length;t++)e.set(t,n[t]);e.length=t.length},t.reflowSmallerGetNewLineLengths=function(e,t,r){let i=[],a=e.map(((r,i)=>n(e,i,t))).reduce(((e,t)=>e+t)),o=0,s=0,c=0;for(;c<a;){if(a-c<r){i.push(a-c);break}o+=r;let l=n(e,s,t);o>l&&(o-=l,s++);let u=e[s].getWidth(o-1)===2;u&&o--;let d=u?r-1:r;i.push(d),c+=d}return i},t.getWrappedLineTrimmedLength=n},5295:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.BufferSet=void 0;let r=n(8460),i=n(844),a=n(9092);class o extends i.Disposable{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this.register(new r.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange(`scrollback`,(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange(`tabStopWidth`,(()=>this.setupTabStops())))}reset(){this._normal=new a.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new a.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(e,t){this._normal.resize(e,t),this._alt.resize(e,t),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}}t.BufferSet=o},511:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.CellData=void 0;let r=n(482),i=n(643),a=n(3734);class o extends a.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new a.ExtendedAttrs,this.combinedData=``}static fromCharData(e){let t=new o;return t.setFromCharData(e),t}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,r.stringFromCodePoint)(2097151&this.content):``}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(e){this.fg=e[i.CHAR_DATA_ATTR_INDEX],this.bg=0;let t=!1;if(e[i.CHAR_DATA_CHAR_INDEX].length>2)t=!0;else if(e[i.CHAR_DATA_CHAR_INDEX].length===2){let n=e[i.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=n&&n<=56319){let r=e[i.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=r&&r<=57343?this.content=1024*(n-55296)+r-56320+65536|e[i.CHAR_DATA_WIDTH_INDEX]<<22:t=!0}else t=!0}else this.content=e[i.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|e[i.CHAR_DATA_WIDTH_INDEX]<<22;t&&(this.combinedData=e[i.CHAR_DATA_CHAR_INDEX],this.content=2097152|e[i.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}t.CellData=o},643:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.WHITESPACE_CELL_CODE=t.WHITESPACE_CELL_WIDTH=t.WHITESPACE_CELL_CHAR=t.NULL_CELL_CODE=t.NULL_CELL_WIDTH=t.NULL_CELL_CHAR=t.CHAR_DATA_CODE_INDEX=t.CHAR_DATA_WIDTH_INDEX=t.CHAR_DATA_CHAR_INDEX=t.CHAR_DATA_ATTR_INDEX=t.DEFAULT_EXT=t.DEFAULT_ATTR=t.DEFAULT_COLOR=void 0,t.DEFAULT_COLOR=0,t.DEFAULT_ATTR=256|t.DEFAULT_COLOR<<9,t.DEFAULT_EXT=0,t.CHAR_DATA_ATTR_INDEX=0,t.CHAR_DATA_CHAR_INDEX=1,t.CHAR_DATA_WIDTH_INDEX=2,t.CHAR_DATA_CODE_INDEX=3,t.NULL_CELL_CHAR=``,t.NULL_CELL_WIDTH=1,t.NULL_CELL_CODE=0,t.WHITESPACE_CELL_CHAR=` `,t.WHITESPACE_CELL_WIDTH=1,t.WHITESPACE_CELL_CODE=32},4863:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.Marker=void 0;let r=n(8460),i=n(844);class a{get id(){return this._id}constructor(e){this.line=e,this.isDisposed=!1,this._disposables=[],this._id=a._nextId++,this._onDispose=this.register(new r.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,i.disposeArray)(this._disposables),this._disposables.length=0)}register(e){return this._disposables.push(e),e}}t.Marker=a,a._nextId=1},7116:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.DEFAULT_CHARSET=t.CHARSETS=void 0,t.CHARSETS={},t.DEFAULT_CHARSET=t.CHARSETS.B,t.CHARSETS[0]={"`":`◆`,a:`▒`,b:`␉`,c:`␌`,d:`␍`,e:`␊`,f:`°`,g:`±`,h:`␤`,i:`␋`,j:`┘`,k:`┐`,l:`┌`,m:`└`,n:`┼`,o:`⎺`,p:`⎻`,q:`─`,r:`⎼`,s:`⎽`,t:`├`,u:`┤`,v:`┴`,w:`┬`,x:`│`,y:`≤`,z:`≥`,"{":`π`,"|":`≠`,"}":`£`,"~":`·`},t.CHARSETS.A={"#":`£`},t.CHARSETS.B=void 0,t.CHARSETS[4]={"#":`£`,"@":`¾`,"[":`ij`,"\\":`½`,"]":`|`,"{":`¨`,"|":`f`,"}":`¼`,"~":`´`},t.CHARSETS.C=t.CHARSETS[5]={"[":`Ä`,"\\":`Ö`,"]":`Å`,"^":`Ü`,"`":`é`,"{":`ä`,"|":`ö`,"}":`å`,"~":`ü`},t.CHARSETS.R={"#":`£`,"@":`à`,"[":`°`,"\\":`ç`,"]":`§`,"{":`é`,"|":`ù`,"}":`è`,"~":`¨`},t.CHARSETS.Q={"@":`à`,"[":`â`,"\\":`ç`,"]":`ê`,"^":`î`,"`":`ô`,"{":`é`,"|":`ù`,"}":`è`,"~":`û`},t.CHARSETS.K={"@":`§`,"[":`Ä`,"\\":`Ö`,"]":`Ü`,"{":`ä`,"|":`ö`,"}":`ü`,"~":`ß`},t.CHARSETS.Y={"#":`£`,"@":`§`,"[":`°`,"\\":`ç`,"]":`é`,"`":`ù`,"{":`à`,"|":`ò`,"}":`è`,"~":`ì`},t.CHARSETS.E=t.CHARSETS[6]={"@":`Ä`,"[":`Æ`,"\\":`Ø`,"]":`Å`,"^":`Ü`,"`":`ä`,"{":`æ`,"|":`ø`,"}":`å`,"~":`ü`},t.CHARSETS.Z={"#":`£`,"@":`§`,"[":`¡`,"\\":`Ñ`,"]":`¿`,"{":`°`,"|":`ñ`,"}":`ç`},t.CHARSETS.H=t.CHARSETS[7]={"@":`É`,"[":`Ä`,"\\":`Ö`,"]":`Å`,"^":`Ü`,"`":`é`,"{":`ä`,"|":`ö`,"}":`å`,"~":`ü`},t.CHARSETS[`=`]={"#":`ù`,"@":`à`,"[":`é`,"\\":`ç`,"]":`ê`,"^":`î`,_:`è`,"`":`ô`,"{":`ä`,"|":`ö`,"}":`ü`,"~":`û`}},2584:(e,t)=>{var n,r,i;Object.defineProperty(t,`__esModule`,{value:!0}),t.C1_ESCAPED=t.C1=t.C0=void 0,function(e){e.NUL=`\0`,e.SOH=``,e.STX=``,e.ETX=``,e.EOT=``,e.ENQ=``,e.ACK=``,e.BEL=`\x07`,e.BS=`\b`,e.HT=` `,e.LF=`
360
+ `,e.VT=`\v`,e.FF=`\f`,e.CR=`\r`,e.SO=``,e.SI=``,e.DLE=``,e.DC1=``,e.DC2=``,e.DC3=``,e.DC4=``,e.NAK=``,e.SYN=``,e.ETB=``,e.CAN=``,e.EM=``,e.SUB=``,e.ESC=`\x1B`,e.FS=``,e.GS=``,e.RS=``,e.US=``,e.SP=` `,e.DEL=``}(n||(t.C0=n={})),function(e){e.PAD=`€`,e.HOP=``,e.BPH=`‚`,e.NBH=`ƒ`,e.IND=`„`,e.NEL=`…`,e.SSA=`†`,e.ESA=`‡`,e.HTS=`ˆ`,e.HTJ=`‰`,e.VTS=`Š`,e.PLD=`‹`,e.PLU=`Œ`,e.RI=``,e.SS2=`Ž`,e.SS3=``,e.DCS=``,e.PU1=`‘`,e.PU2=`’`,e.STS=`“`,e.CCH=`”`,e.MW=`•`,e.SPA=`–`,e.EPA=`—`,e.SOS=`˜`,e.SGCI=`™`,e.SCI=`š`,e.CSI=`›`,e.ST=`œ`,e.OSC=``,e.PM=`ž`,e.APC=`Ÿ`}(r||(t.C1=r={})),function(e){e.ST=`${n.ESC}\\`}(i||(t.C1_ESCAPED=i={}))},7399:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.evaluateKeyboardEvent=void 0;let r=n(2584),i={48:[`0`,`)`],49:[`1`,`!`],50:[`2`,`@`],51:[`3`,`#`],52:[`4`,`$`],53:[`5`,`%`],54:[`6`,`^`],55:[`7`,`&`],56:[`8`,`*`],57:[`9`,`(`],186:[`;`,`:`],187:[`=`,`+`],188:[`,`,`<`],189:[`-`,`_`],190:[`.`,`>`],191:[`/`,`?`],192:["`",`~`],219:[`[`,`{`],220:[`\\`,`|`],221:[`]`,`}`],222:[`'`,`"`]};t.evaluateKeyboardEvent=function(e,t,n,a){let o={type:0,cancel:!1,key:void 0},s=!!e.shiftKey|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:e.key===`UIKeyInputUpArrow`?o.key=t?r.C0.ESC+`OA`:r.C0.ESC+`[A`:e.key===`UIKeyInputLeftArrow`?o.key=t?r.C0.ESC+`OD`:r.C0.ESC+`[D`:e.key===`UIKeyInputRightArrow`?o.key=t?r.C0.ESC+`OC`:r.C0.ESC+`[C`:e.key===`UIKeyInputDownArrow`&&(o.key=t?r.C0.ESC+`OB`:r.C0.ESC+`[B`);break;case 8:o.key=e.ctrlKey?`\b`:r.C0.DEL,e.altKey&&(o.key=r.C0.ESC+o.key);break;case 9:if(e.shiftKey){o.key=r.C0.ESC+`[Z`;break}o.key=r.C0.HT,o.cancel=!0;break;case 13:o.key=e.altKey?r.C0.ESC+r.C0.CR:r.C0.CR,o.cancel=!0;break;case 27:o.key=r.C0.ESC,e.altKey&&(o.key=r.C0.ESC+r.C0.ESC),o.cancel=!0;break;case 37:if(e.metaKey)break;s?(o.key=r.C0.ESC+`[1;`+(s+1)+`D`,o.key===r.C0.ESC+`[1;3D`&&(o.key=r.C0.ESC+(n?`b`:`[1;5D`))):o.key=t?r.C0.ESC+`OD`:r.C0.ESC+`[D`;break;case 39:if(e.metaKey)break;s?(o.key=r.C0.ESC+`[1;`+(s+1)+`C`,o.key===r.C0.ESC+`[1;3C`&&(o.key=r.C0.ESC+(n?`f`:`[1;5C`))):o.key=t?r.C0.ESC+`OC`:r.C0.ESC+`[C`;break;case 38:if(e.metaKey)break;s?(o.key=r.C0.ESC+`[1;`+(s+1)+`A`,n||o.key!==r.C0.ESC+`[1;3A`||(o.key=r.C0.ESC+`[1;5A`)):o.key=t?r.C0.ESC+`OA`:r.C0.ESC+`[A`;break;case 40:if(e.metaKey)break;s?(o.key=r.C0.ESC+`[1;`+(s+1)+`B`,n||o.key!==r.C0.ESC+`[1;3B`||(o.key=r.C0.ESC+`[1;5B`)):o.key=t?r.C0.ESC+`OB`:r.C0.ESC+`[B`;break;case 45:e.shiftKey||e.ctrlKey||(o.key=r.C0.ESC+`[2~`);break;case 46:o.key=s?r.C0.ESC+`[3;`+(s+1)+`~`:r.C0.ESC+`[3~`;break;case 36:o.key=s?r.C0.ESC+`[1;`+(s+1)+`H`:t?r.C0.ESC+`OH`:r.C0.ESC+`[H`;break;case 35:o.key=s?r.C0.ESC+`[1;`+(s+1)+`F`:t?r.C0.ESC+`OF`:r.C0.ESC+`[F`;break;case 33:e.shiftKey?o.type=2:e.ctrlKey?o.key=r.C0.ESC+`[5;`+(s+1)+`~`:o.key=r.C0.ESC+`[5~`;break;case 34:e.shiftKey?o.type=3:e.ctrlKey?o.key=r.C0.ESC+`[6;`+(s+1)+`~`:o.key=r.C0.ESC+`[6~`;break;case 112:o.key=s?r.C0.ESC+`[1;`+(s+1)+`P`:r.C0.ESC+`OP`;break;case 113:o.key=s?r.C0.ESC+`[1;`+(s+1)+`Q`:r.C0.ESC+`OQ`;break;case 114:o.key=s?r.C0.ESC+`[1;`+(s+1)+`R`:r.C0.ESC+`OR`;break;case 115:o.key=s?r.C0.ESC+`[1;`+(s+1)+`S`:r.C0.ESC+`OS`;break;case 116:o.key=s?r.C0.ESC+`[15;`+(s+1)+`~`:r.C0.ESC+`[15~`;break;case 117:o.key=s?r.C0.ESC+`[17;`+(s+1)+`~`:r.C0.ESC+`[17~`;break;case 118:o.key=s?r.C0.ESC+`[18;`+(s+1)+`~`:r.C0.ESC+`[18~`;break;case 119:o.key=s?r.C0.ESC+`[19;`+(s+1)+`~`:r.C0.ESC+`[19~`;break;case 120:o.key=s?r.C0.ESC+`[20;`+(s+1)+`~`:r.C0.ESC+`[20~`;break;case 121:o.key=s?r.C0.ESC+`[21;`+(s+1)+`~`:r.C0.ESC+`[21~`;break;case 122:o.key=s?r.C0.ESC+`[23;`+(s+1)+`~`:r.C0.ESC+`[23~`;break;case 123:o.key=s?r.C0.ESC+`[24;`+(s+1)+`~`:r.C0.ESC+`[24~`;break;default:if(!e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)if(n&&!a||!e.altKey||e.metaKey)!n||e.altKey||e.ctrlKey||e.shiftKey||!e.metaKey?e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&e.key.length===1?o.key=e.key:e.key&&e.ctrlKey&&(e.key===`_`&&(o.key=r.C0.US),e.key===`@`&&(o.key=r.C0.NUL)):e.keyCode===65&&(o.type=1);else{let t=i[e.keyCode]?.[+!!e.shiftKey];if(t)o.key=r.C0.ESC+t;else if(e.keyCode>=65&&e.keyCode<=90){let t=e.ctrlKey?e.keyCode-64:e.keyCode+32,n=String.fromCharCode(t);e.shiftKey&&(n=n.toUpperCase()),o.key=r.C0.ESC+n}else if(e.keyCode===32)o.key=r.C0.ESC+(e.ctrlKey?r.C0.NUL:` `);else if(e.key===`Dead`&&e.code.startsWith(`Key`)){let t=e.code.slice(3,4);e.shiftKey||(t=t.toLowerCase()),o.key=r.C0.ESC+t,o.cancel=!0}}else e.keyCode>=65&&e.keyCode<=90?o.key=String.fromCharCode(e.keyCode-64):e.keyCode===32?o.key=r.C0.NUL:e.keyCode>=51&&e.keyCode<=55?o.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?o.key=r.C0.DEL:e.keyCode===219?o.key=r.C0.ESC:e.keyCode===220?o.key=r.C0.FS:e.keyCode===221&&(o.key=r.C0.GS)}return o}},482:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.Utf8ToUtf32=t.StringToUtf32=t.utf32ToString=t.stringFromCodePoint=void 0,t.stringFromCodePoint=function(e){return e>65535?(e-=65536,String.fromCharCode(55296+(e>>10))+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)},t.utf32ToString=function(e,t=0,n=e.length){let r=``;for(let i=t;i<n;++i){let t=e[i];t>65535?(t-=65536,r+=String.fromCharCode(55296+(t>>10))+String.fromCharCode(t%1024+56320)):r+=String.fromCharCode(t)}return r},t.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i=0;if(this._interim){let n=e.charCodeAt(i++);56320<=n&&n<=57343?t[r++]=1024*(this._interim-55296)+n-56320+65536:(t[r++]=this._interim,t[r++]=n),this._interim=0}for(let a=i;a<n;++a){let i=e.charCodeAt(a);if(55296<=i&&i<=56319){if(++a>=n)return this._interim=i,r;let o=e.charCodeAt(a);56320<=o&&o<=57343?t[r++]=1024*(i-55296)+o-56320+65536:(t[r++]=i,t[r++]=o)}else i!==65279&&(t[r++]=i)}return r}},t.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let n=e.length;if(!n)return 0;let r,i,a,o,s=0,c=0,l=0;if(this.interim[0]){let r=!1,i=this.interim[0];i&=(224&i)==192?31:(240&i)==224?15:7;let a,o=0;for(;(a=63&this.interim[++o])&&o<4;)i<<=6,i|=a;let c=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,u=c-o;for(;l<u;){if(l>=n)return 0;if(a=e[l++],(192&a)!=128){l--,r=!0;break}this.interim[o++]=a,i<<=6,i|=63&a}r||(c===2?i<128?l--:t[s++]=i:c===3?i<2048||i>=55296&&i<=57343||i===65279||(t[s++]=i):i<65536||i>1114111||(t[s++]=i)),this.interim.fill(0)}let u=n-4,d=l;for(;d<n;){for(;!(!(d<u)||128&(r=e[d])||128&(i=e[d+1])||128&(a=e[d+2])||128&(o=e[d+3]));)t[s++]=r,t[s++]=i,t[s++]=a,t[s++]=o,d+=4;if(r=e[d++],r<128)t[s++]=r;else if((224&r)==192){if(d>=n)return this.interim[0]=r,s;if(i=e[d++],(192&i)!=128){d--;continue}if(c=(31&r)<<6|63&i,c<128){d--;continue}t[s++]=c}else if((240&r)==224){if(d>=n)return this.interim[0]=r,s;if(i=e[d++],(192&i)!=128){d--;continue}if(d>=n)return this.interim[0]=r,this.interim[1]=i,s;if(a=e[d++],(192&a)!=128){d--;continue}if(c=(15&r)<<12|(63&i)<<6|63&a,c<2048||c>=55296&&c<=57343||c===65279)continue;t[s++]=c}else if((248&r)==240){if(d>=n)return this.interim[0]=r,s;if(i=e[d++],(192&i)!=128){d--;continue}if(d>=n)return this.interim[0]=r,this.interim[1]=i,s;if(a=e[d++],(192&a)!=128){d--;continue}if(d>=n)return this.interim[0]=r,this.interim[1]=i,this.interim[2]=a,s;if(o=e[d++],(192&o)!=128){d--;continue}if(c=(7&r)<<18|(63&i)<<12|(63&a)<<6|63&o,c<65536||c>1114111)continue;t[s++]=c}}return s}}},225:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.UnicodeV6=void 0;let r=n(1480),i=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],a=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],o;t.UnicodeV6=class{constructor(){if(this.version=`6`,!o){o=new Uint8Array(65536),o.fill(1),o[0]=0,o.fill(0,1,32),o.fill(0,127,160),o.fill(2,4352,4448),o[9001]=2,o[9002]=2,o.fill(2,11904,42192),o[12351]=1,o.fill(2,44032,55204),o.fill(2,63744,64256),o.fill(2,65040,65050),o.fill(2,65072,65136),o.fill(2,65280,65377),o.fill(2,65504,65511);for(let e=0;e<i.length;++e)o.fill(0,i[e][0],i[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?o[e]:function(e,t){let n,r=0,i=t.length-1;if(e<t[0][0]||e>t[i][1])return!1;for(;i>=r;)if(n=r+i>>1,e>t[n][1])r=n+1;else{if(!(e<t[n][0]))return!0;i=n-1}return!1}(e,a)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let n=this.wcwidth(e),i=n===0&&t!==0;if(i){let e=r.UnicodeService.extractWidth(t);e===0?i=!1:e>n&&(n=e)}return r.UnicodeService.createPropertyValue(0,n,i)}}},5981:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.WriteBuffer=void 0;let r=n(8460),i=n(844);class a extends i.Disposable{constructor(e){super(),this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new r.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,t){if(t!==void 0&&this._syncCalls>t)return void(this._syncCalls=0);if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let n;for(this._isSyncWriting=!0;n=this._writeBuffer.shift();){this._action(n);let e=this._callbacks.shift();e&&e()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,t){if(this._pendingData>5e7)throw Error(`write data discarded, use flow control to avoid losing data`);if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t)}_innerWrite(e=0,t=!0){let n=e||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){let e=this._writeBuffer[this._bufferOffset],r=this._action(e,t);if(r){r.catch((e=>(queueMicrotask((()=>{throw e})),Promise.resolve(!1)))).then(e=>Date.now()-n>=12?setTimeout((()=>this._innerWrite(0,e))):this._innerWrite(n,e));return}let i=this._callbacks[this._bufferOffset];if(i&&i(),this._bufferOffset++,this._pendingData-=e.length,Date.now()-n>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}t.WriteBuffer=a},5941:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.toRgbString=t.parseColor=void 0;let n=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,r=/^[\da-f]+$/;function i(e,t){let n=e.toString(16),r=n.length<2?`0`+n:n;switch(t){case 4:return n[0];case 8:return r;case 12:return(r+r).slice(0,3);default:return r+r}}t.parseColor=function(e){if(!e)return;let t=e.toLowerCase();if(t.indexOf(`rgb:`)===0){t=t.slice(4);let e=n.exec(t);if(e){let t=e[1]?15:e[4]?255:e[7]?4095:65535;return[Math.round(parseInt(e[1]||e[4]||e[7]||e[10],16)/t*255),Math.round(parseInt(e[2]||e[5]||e[8]||e[11],16)/t*255),Math.round(parseInt(e[3]||e[6]||e[9]||e[12],16)/t*255)]}}else if(t.indexOf(`#`)===0&&(t=t.slice(1),r.exec(t)&&[3,6,9,12].includes(t.length))){let e=t.length/3,n=[0,0,0];for(let r=0;r<3;++r){let i=parseInt(t.slice(e*r,e*r+e),16);n[r]=e===1?i<<4:e===2?i:e===3?i>>4:i>>8}return n}},t.toRgbString=function(e,t=16){let[n,r,a]=e;return`rgb:${i(n,t)}/${i(r,t)}/${i(a,t)}`}},5770:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.PAYLOAD_LIMIT=void 0,t.PAYLOAD_LIMIT=1e7},6351:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.DcsHandler=t.DcsParser=void 0;let r=n(482),i=n(8742),a=n(5770),o=[];t.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=o,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=o}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let n=this._handlers[e];return n.push(t),{dispose:()=>{let e=n.indexOf(t);e!==-1&&n.splice(e,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}reset(){if(this._active.length)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].unhook(!1);this._stack.paused=!1,this._active=o,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||o,this._active.length)for(let e=this._active.length-1;e>=0;e--)this._active[e].hook(t);else this._handlerFb(this._ident,`HOOK`,t)}put(e,t,n){if(this._active.length)for(let r=this._active.length-1;r>=0;r--)this._active[r].put(e,t,n);else this._handlerFb(this._ident,`PUT`,(0,r.utf32ToString)(e,t,n))}unhook(e,t=!0){if(this._active.length){let n=!1,r=this._active.length-1,i=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,n=t,i=this._stack.fallThrough,this._stack.paused=!1),!i&&!1===n){for(;r>=0&&(n=this._active[r].unhook(e),!0!==n);r--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,n;r--}for(;r>=0;r--)if(n=this._active[r].unhook(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,n}else this._handlerFb(this._ident,`UNHOOK`,e);this._active=o,this._ident=0}};let s=new i.Params;s.addParam(0),t.DcsHandler=class{constructor(e){this._handler=e,this._data=``,this._params=s,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():s,this._data=``,this._hitLimit=!1}put(e,t,n){this._hitLimit||(this._data+=(0,r.utf32ToString)(e,t,n),this._data.length>a.PAYLOAD_LIMIT&&(this._data=``,this._hitLimit=!0))}unhook(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data,this._params),t instanceof Promise))return t.then((e=>(this._params=s,this._data=``,this._hitLimit=!1,e)));return this._params=s,this._data=``,this._hitLimit=!1,t}}},2015:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.EscapeSequenceParser=t.VT500_TRANSITION_TABLE=t.TransitionTable=void 0;let r=n(844),i=n(8742),a=n(6242),o=n(6351);class s{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){this.table.fill(e<<4|t)}add(e,t,n,r){this.table[t<<8|e]=n<<4|r}addMany(e,t,n,r){for(let i=0;i<e.length;i++)this.table[t<<8|e[i]]=n<<4|r}}t.TransitionTable=s,t.VT500_TRANSITION_TABLE=function(){let e=new s(4095),t=Array.apply(null,Array(256)).map(((e,t)=>t)),n=(e,n)=>t.slice(e,n),r=n(32,127),i=n(0,24);i.push(25),i.push.apply(i,n(28,32));let a=n(0,14),o;for(o in e.setDefault(1,0),e.addMany(r,0,2,0),a)e.addMany([24,26,153,154],o,3,0),e.addMany(n(128,144),o,3,0),e.addMany(n(144,152),o,3,0),e.add(156,o,0,0),e.add(27,o,11,1),e.add(157,o,4,8),e.addMany([152,158,159],o,0,7),e.add(155,o,11,3),e.add(144,o,11,9);return e.addMany(i,0,3,0),e.addMany(i,1,3,1),e.add(127,1,0,1),e.addMany(i,8,0,8),e.addMany(i,3,3,3),e.add(127,3,0,3),e.addMany(i,4,3,4),e.add(127,4,0,4),e.addMany(i,6,3,6),e.addMany(i,5,3,5),e.add(127,5,0,5),e.addMany(i,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(r,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(n(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(r,7,0,7),e.addMany(i,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(n(64,127),3,7,0),e.addMany(n(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(n(48,60),4,8,4),e.addMany(n(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(n(32,64),6,0,6),e.add(127,6,0,6),e.addMany(n(64,127),6,0,0),e.addMany(n(32,48),3,9,5),e.addMany(n(32,48),5,9,5),e.addMany(n(48,64),5,0,6),e.addMany(n(64,127),5,7,0),e.addMany(n(32,48),4,9,5),e.addMany(n(32,48),1,9,2),e.addMany(n(32,48),2,9,2),e.addMany(n(48,127),2,10,0),e.addMany(n(48,80),1,10,0),e.addMany(n(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(n(96,127),1,10,0),e.add(80,1,11,9),e.addMany(i,9,0,9),e.add(127,9,0,9),e.addMany(n(28,32),9,0,9),e.addMany(n(32,48),9,9,12),e.addMany(n(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(i,11,0,11),e.addMany(n(32,128),11,0,11),e.addMany(n(28,32),11,0,11),e.addMany(i,10,0,10),e.add(127,10,0,10),e.addMany(n(28,32),10,0,10),e.addMany(n(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(n(32,48),10,9,12),e.addMany(i,12,0,12),e.add(127,12,0,12),e.addMany(n(28,32),12,0,12),e.addMany(n(32,48),12,9,12),e.addMany(n(48,64),12,0,11),e.addMany(n(64,127),12,12,13),e.addMany(n(64,127),10,12,13),e.addMany(n(64,127),9,12,13),e.addMany(i,13,13,13),e.addMany(r,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(160,0,2,0),e.add(160,8,5,8),e.add(160,6,0,6),e.add(160,11,0,11),e.add(160,13,13,13),e}();class c extends r.Disposable{constructor(e=t.VT500_TRANSITION_TABLE){super(),this._transitions=e,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new i.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(e,t,n)=>{},this._executeHandlerFb=e=>{},this._csiHandlerFb=(e,t)=>{},this._escHandlerFb=e=>{},this._errorHandlerFb=e=>e,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,r.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new a.OscParser),this._dcsParser=this.register(new o.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:`\\`},(()=>!0))}_identifier(e,t=[64,126]){let n=0;if(e.prefix){if(e.prefix.length>1)throw Error(`only one byte as prefix supported`);if(n=e.prefix.charCodeAt(0),n&&60>n||n>63)throw Error(`prefix must be in range 0x3c .. 0x3f`)}if(e.intermediates){if(e.intermediates.length>2)throw Error(`only two bytes as intermediates are supported`);for(let t=0;t<e.intermediates.length;++t){let r=e.intermediates.charCodeAt(t);if(32>r||r>47)throw Error(`intermediate must be in range 0x20 .. 0x2f`);n<<=8,n|=r}}if(e.final.length!==1)throw Error(`final must be a single byte`);let r=e.final.charCodeAt(0);if(t[0]>r||r>t[1])throw Error(`final must be in range ${t[0]} .. ${t[1]}`);return n<<=8,n|=r,n}identToString(e){let t=[];for(;e;)t.push(String.fromCharCode(255&e)),e>>=8;return t.reverse().join(``)}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,t){let n=this._identifier(e,[48,126]);this._escHandlers[n]===void 0&&(this._escHandlers[n]=[]);let r=this._escHandlers[n];return r.push(t),{dispose:()=>{let e=r.indexOf(t);e!==-1&&r.splice(e,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,t){this._executeHandlers[e.charCodeAt(0)]=t}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,t){let n=this._identifier(e);this._csiHandlers[n]===void 0&&(this._csiHandlers[n]=[]);let r=this._csiHandlers[n];return r.push(t),{dispose:()=>{let e=r.indexOf(t);e!==-1&&r.splice(e,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,t){return this._dcsParser.registerHandler(this._identifier(e),t)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,t){return this._oscParser.registerHandler(e,t)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(e,t,n,r,i){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=n,this._parseStack.transition=r,this._parseStack.chunkPos=i}parse(e,t,n){let r,i=0,a=0,o=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,o=this._parseStack.chunkPos+1;else{if(n===void 0||this._parseStack.state===1)throw this._parseStack.state=1,Error(`improper continuation due to previous async handler, giving up parsing`);let t=this._parseStack.handlers,a=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(!1===n&&a>-1){for(;a>=0&&(r=t[a](this._params),!0!==r);a--)if(r instanceof Promise)return this._parseStack.handlerPos=a,r}this._parseStack.handlers=[];break;case 4:if(!1===n&&a>-1){for(;a>=0&&(r=t[a](),!0!==r);a--)if(r instanceof Promise)return this._parseStack.handlerPos=a,r}this._parseStack.handlers=[];break;case 6:if(i=e[this._parseStack.chunkPos],r=this._dcsParser.unhook(i!==24&&i!==26,n),r)return r;i===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(i=e[this._parseStack.chunkPos],r=this._oscParser.end(i!==24&&i!==26,n),r)return r;i===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,o=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let n=o;n<t;++n){switch(i=e[n],a=this._transitions.table[this.currentState<<8|(i<160?i:160)],a>>4){case 2:for(let r=n+1;;++r){if(r>=t||(i=e[r])<32||i>126&&i<160){this._printHandler(e,n,r),n=r-1;break}if(++r>=t||(i=e[r])<32||i>126&&i<160){this._printHandler(e,n,r),n=r-1;break}if(++r>=t||(i=e[r])<32||i>126&&i<160){this._printHandler(e,n,r),n=r-1;break}if(++r>=t||(i=e[r])<32||i>126&&i<160){this._printHandler(e,n,r),n=r-1;break}}break;case 3:this._executeHandlers[i]?this._executeHandlers[i]():this._executeHandlerFb(i),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:n,code:i,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let o=this._csiHandlers[this._collect<<8|i],s=o?o.length-1:-1;for(;s>=0&&(r=o[s](this._params),!0!==r);s--)if(r instanceof Promise)return this._preserveStack(3,o,s,a,n),r;s<0&&this._csiHandlerFb(this._collect<<8|i,this._params),this.precedingJoinState=0;break;case 8:do switch(i){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(i-48)}while(++n<t&&(i=e[n])>47&&i<60);n--;break;case 9:this._collect<<=8,this._collect|=i;break;case 10:let c=this._escHandlers[this._collect<<8|i],l=c?c.length-1:-1;for(;l>=0&&(r=c[l](),!0!==r);l--)if(r instanceof Promise)return this._preserveStack(4,c,l,a,n),r;l<0&&this._escHandlerFb(this._collect<<8|i),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|i,this._params);break;case 13:for(let r=n+1;;++r)if(r>=t||(i=e[r])===24||i===26||i===27||i>127&&i<160){this._dcsParser.put(e,n,r),n=r-1;break}break;case 14:if(r=this._dcsParser.unhook(i!==24&&i!==26),r)return this._preserveStack(6,[],0,a,n),r;i===27&&(a|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let r=n+1;;r++)if(r>=t||(i=e[r])<32||i>127&&i<160){this._oscParser.put(e,n,r),n=r-1;break}break;case 6:if(r=this._oscParser.end(i!==24&&i!==26),r)return this._preserveStack(5,[],0,a,n),r;i===27&&(a|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&a}}}t.EscapeSequenceParser=c},6242:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.OscHandler=t.OscParser=void 0;let r=n(5770),i=n(482),a=[];t.OscParser=class{constructor(){this._state=0,this._active=a,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let n=this._handlers[e];return n.push(t),{dispose:()=>{let e=n.indexOf(t);e!==-1&&n.splice(e,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=a}reset(){if(this._state===2)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].end(!1);this._stack.paused=!1,this._active=a,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||a,this._active.length)for(let e=this._active.length-1;e>=0;e--)this._active[e].start();else this._handlerFb(this._id,`START`)}_put(e,t,n){if(this._active.length)for(let r=this._active.length-1;r>=0;r--)this._active[r].put(e,t,n);else this._handlerFb(this._id,`PUT`,(0,i.utf32ToString)(e,t,n))}start(){this.reset(),this._state=1}put(e,t,n){if(this._state!==3){if(this._state===1)for(;t<n;){let n=e[t++];if(n===59){this._state=2,this._start();break}if(n<48||57<n)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+n-48}this._state===2&&n-t>0&&this._put(e,t,n)}}end(e,t=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let n=!1,r=this._active.length-1,i=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,n=t,i=this._stack.fallThrough,this._stack.paused=!1),!i&&!1===n){for(;r>=0&&(n=this._active[r].end(e),!0!==n);r--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,n;r--}for(;r>=0;r--)if(n=this._active[r].end(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,n}else this._handlerFb(this._id,`END`,e);this._active=a,this._id=-1,this._state=0}}},t.OscHandler=class{constructor(e){this._handler=e,this._data=``,this._hitLimit=!1}start(){this._data=``,this._hitLimit=!1}put(e,t,n){this._hitLimit||(this._data+=(0,i.utf32ToString)(e,t,n),this._data.length>r.PAYLOAD_LIMIT&&(this._data=``,this._hitLimit=!0))}end(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data),t instanceof Promise))return t.then((e=>(this._data=``,this._hitLimit=!1,e)));return this._data=``,this._hitLimit=!1,t}}},8742:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.Params=void 0;let n=2147483647;class r{static fromArray(e){let t=new r;if(!e.length)return t;for(let n=+!!Array.isArray(e[0]);n<e.length;++n){let r=e[n];if(Array.isArray(r))for(let e=0;e<r.length;++e)t.addSubParam(r[e]);else t.addParam(r)}return t}constructor(e=32,t=32){if(this.maxLength=e,this.maxSubParamsLength=t,t>256)throw Error(`maxSubParamsLength must not be greater than 256`);this.params=new Int32Array(e),this.length=0,this._subParams=new Int32Array(t),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(e),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){let e=new r(this.maxLength,this.maxSubParamsLength);return e.params.set(this.params),e.length=this.length,e._subParams.set(this._subParams),e._subParamsLength=this._subParamsLength,e._subParamsIdx.set(this._subParamsIdx),e._rejectDigits=this._rejectDigits,e._rejectSubDigits=this._rejectSubDigits,e._digitIsSub=this._digitIsSub,e}toArray(){let e=[];for(let t=0;t<this.length;++t){e.push(this.params[t]);let n=this._subParamsIdx[t]>>8,r=255&this._subParamsIdx[t];r-n>0&&e.push(Array.prototype.slice.call(this._subParams,n,r))}return e}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(e){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(e<-1)throw Error(`values lesser than -1 are not allowed`);this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=e>n?n:e}}addSubParam(e){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(e<-1)throw Error(`values lesser than -1 are not allowed`);this._subParams[this._subParamsLength++]=e>n?n:e,this._subParamsIdx[this.length-1]++}}hasSubParams(e){return(255&this._subParamsIdx[e])-(this._subParamsIdx[e]>>8)>0}getSubParams(e){let t=this._subParamsIdx[e]>>8,n=255&this._subParamsIdx[e];return n-t>0?this._subParams.subarray(t,n):null}getSubParamsAll(){let e={};for(let t=0;t<this.length;++t){let n=this._subParamsIdx[t]>>8,r=255&this._subParamsIdx[t];r-n>0&&(e[t]=this._subParams.slice(n,r))}return e}addDigit(e){let t;if(this._rejectDigits||!(t=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let r=this._digitIsSub?this._subParams:this.params,i=r[t-1];r[t-1]=~i?Math.min(10*i+e,n):e}}t.Params=r},5741:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.AddonManager=void 0,t.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,t){let n={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(n),t.dispose=()=>this._wrappedAddonDispose(n),t.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let t=-1;for(let n=0;n<this._addons.length;n++)if(this._addons[n]===e){t=n;break}if(t===-1)throw Error(`Could not dispose an addon that has not been loaded`);e.isDisposed=!0,e.dispose.apply(e.instance),this._addons.splice(t,1)}}},8771:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.BufferApiView=void 0;let r=n(3785),i=n(511);t.BufferApiView=class{constructor(e,t){this._buffer=e,this.type=t}init(e){return this._buffer=e,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(e){let t=this._buffer.lines.get(e);if(t)return new r.BufferLineApiView(t)}getNullCell(){return new i.CellData}}},3785:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.BufferLineApiView=void 0;let r=n(511);t.BufferLineApiView=class{constructor(e){this._line=e}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(e,t){if(!(e<0||e>=this._line.length))return t?(this._line.loadCell(e,t),t):this._line.loadCell(e,new r.CellData)}translateToString(e,t,n){return this._line.translateToString(e,t,n)}}},8285:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.BufferNamespaceApi=void 0;let r=n(8771),i=n(8460),a=n(844);class o extends a.Disposable{constructor(e){super(),this._core=e,this._onBufferChange=this.register(new i.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new r.BufferApiView(this._core.buffers.normal,`normal`),this._alternate=new r.BufferApiView(this._core.buffers.alt,`alternate`),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw Error(`Active buffer is neither normal nor alternate`)}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}t.BufferNamespaceApi=o},7975:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.ParserApi=void 0,t.ParserApi=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,(e=>t(e.toArray())))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._core.registerDcsHandler(e,((e,n)=>t(e,n.toArray())))}addDcsHandler(e,t){return this.registerDcsHandler(e,t)}registerEscHandler(e,t){return this._core.registerEscHandler(e,t)}addEscHandler(e,t){return this.registerEscHandler(e,t)}registerOscHandler(e,t){return this._core.registerOscHandler(e,t)}addOscHandler(e,t){return this.registerOscHandler(e,t)}}},7090:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.UnicodeApi=void 0,t.UnicodeApi=class{constructor(e){this._core=e}register(e){this._core.unicodeService.register(e)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(e){this._core.unicodeService.activeVersion=e}}},744:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.BufferService=t.MINIMUM_ROWS=t.MINIMUM_COLS=void 0;let a=n(8460),o=n(844),s=n(5295),c=n(2585);t.MINIMUM_COLS=2,t.MINIMUM_ROWS=1;let l=t.BufferService=class extends o.Disposable{get buffer(){return this.buffers.active}constructor(e){super(),this.isUserScrolling=!1,this._onResize=this.register(new a.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new a.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,t.MINIMUM_COLS),this.rows=Math.max(e.rawOptions.rows||0,t.MINIMUM_ROWS),this.buffers=this.register(new s.BufferSet(e,this))}resize(e,t){this.cols=e,this.rows=t,this.buffers.resize(e,t),this._onResize.fire({cols:e,rows:t})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){let n=this.buffer,r;r=this._cachedBlankLine,r&&r.length===this.cols&&r.getFg(0)===e.fg&&r.getBg(0)===e.bg||(r=n.getBlankLine(e,t),this._cachedBlankLine=r),r.isWrapped=t;let i=n.ybase+n.scrollTop,a=n.ybase+n.scrollBottom;if(n.scrollTop===0){let e=n.lines.isFull;a===n.lines.length-1?e?n.lines.recycle().copyFrom(r):n.lines.push(r.clone()):n.lines.splice(a+1,0,r.clone()),e?this.isUserScrolling&&(n.ydisp=Math.max(n.ydisp-1,0)):(n.ybase++,this.isUserScrolling||n.ydisp++)}else{let e=a-i+1;n.lines.shiftElements(i+1,e-1,-1),n.lines.set(a,r.clone())}this.isUserScrolling||(n.ydisp=n.ybase),this._onScroll.fire(n.ydisp)}scrollLines(e,t,n){let r=this.buffer;if(e<0){if(r.ydisp===0)return;this.isUserScrolling=!0}else e+r.ydisp>=r.ybase&&(this.isUserScrolling=!1);let i=r.ydisp;r.ydisp=Math.max(Math.min(r.ydisp+e,r.ybase),0),i!==r.ydisp&&(t||this._onScroll.fire(r.ydisp))}};t.BufferService=l=r([i(0,c.IOptionsService)],l)},7994:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.CharsetService=void 0,t.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(e){this.glevel=e,this.charset=this._charsets[e]}setgCharset(e,t){this._charsets[e]=t,this.glevel===e&&(this.charset=t)}}},1753:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.CoreMouseService=void 0;let a=n(2585),o=n(8460),s=n(844),c={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:e=>e.button!==4&&e.action===1&&(e.ctrl=!1,e.alt=!1,e.shift=!1,!0)},VT200:{events:19,restrict:e=>e.action!==32},DRAG:{events:23,restrict:e=>e.action!==32||e.button!==3},ANY:{events:31,restrict:e=>!0}};function l(e,t){let n=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return e.button===4?(n|=64,n|=e.action):(n|=3&e.button,4&e.button&&(n|=64),8&e.button&&(n|=128),e.action===32?n|=32:e.action!==0||t||(n|=3)),n}let u=String.fromCharCode,d={DEFAULT:e=>{let t=[l(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?``:`${u(t[0])}${u(t[1])}${u(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?`m`:`M`;return`[<${l(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?`m`:`M`;return`[<${l(e,!0)};${e.x};${e.y}${t}`}},f=t.CoreMouseService=class extends s.Disposable{constructor(e,t){super(),this._bufferService=e,this._coreService=t,this._protocols={},this._encodings={},this._activeProtocol=``,this._activeEncoding=``,this._lastEvent=null,this._onProtocolChange=this.register(new o.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(let e of Object.keys(c))this.addProtocol(e,c[e]);for(let e of Object.keys(d))this.addEncoding(e,d[e]);this.reset()}addProtocol(e,t){this._protocols[e]=t}addEncoding(e,t){this._encodings[e]=t}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(e){if(!this._protocols[e])throw Error(`unknown protocol "${e}"`);this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(e){if(!this._encodings[e])throw Error(`unknown encoding "${e}"`);this._activeEncoding=e}reset(){this.activeProtocol=`NONE`,this.activeEncoding=`DEFAULT`,this._lastEvent=null}triggerMouseEvent(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows||e.button===4&&e.action===32||e.button===3&&e.action!==32||e.button!==4&&(e.action===2||e.action===3)||(e.col++,e.row++,e.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,e,this._activeEncoding===`SGR_PIXELS`))||!this._protocols[this._activeProtocol].restrict(e))return!1;let t=this._encodings[this._activeEncoding](e);return t&&(this._activeEncoding===`DEFAULT`?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=e,!0}explainEvents(e){return{down:!!(1&e),up:!!(2&e),drag:!!(4&e),move:!!(8&e),wheel:!!(16&e)}}_equalEvents(e,t,n){if(n){if(e.x!==t.x||e.y!==t.y)return!1}else if(e.col!==t.col||e.row!==t.row)return!1;return e.button===t.button&&e.action===t.action&&e.ctrl===t.ctrl&&e.alt===t.alt&&e.shift===t.shift}};t.CoreMouseService=f=r([i(0,a.IBufferService),i(1,a.ICoreService)],f)},6975:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.CoreService=void 0;let a=n(1439),o=n(8460),s=n(844),c=n(2585),l=Object.freeze({insertMode:!1}),u=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0}),d=t.CoreService=class extends s.Disposable{constructor(e,t,n){super(),this._bufferService=e,this._logService=t,this._optionsService=n,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new o.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new o.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new o.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new o.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,a.clone)(l),this.decPrivateModes=(0,a.clone)(u)}reset(){this.modes=(0,a.clone)(l),this.decPrivateModes=(0,a.clone)(u)}triggerDataEvent(e,t=!1){if(this._optionsService.rawOptions.disableStdin)return;let n=this._bufferService.buffer;t&&this._optionsService.rawOptions.scrollOnUserInput&&n.ybase!==n.ydisp&&this._onRequestScrollToBottom.fire(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`,(()=>e.split(``).map((e=>e.charCodeAt(0))))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`,(()=>e.split(``).map((e=>e.charCodeAt(0))))),this._onBinary.fire(e))}};t.CoreService=d=r([i(0,c.IBufferService),i(1,c.ILogService),i(2,c.IOptionsService)],d)},9074:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.DecorationService=void 0;let r=n(8055),i=n(8460),a=n(844),o=n(6106),s=0,c=0;class l extends a.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new o.SortedList((e=>e?.marker.line)),this._onDecorationRegistered=this.register(new i.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new i.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,a.toDisposable)((()=>this.reset())))}registerDecoration(e){if(e.marker.isDisposed)return;let t=new u(e);if(t){let e=t.marker.onDispose((()=>t.dispose()));t.onDispose((()=>{t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),e.dispose())})),this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(let e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,t,n){let r=0,i=0;for(let a of this._decorations.getKeyIterator(t))r=a.options.x??0,i=r+(a.options.width??1),e>=r&&e<i&&(!n||(a.options.layer??`bottom`)===n)&&(yield a)}forEachDecorationAtCell(e,t,n,r){this._decorations.forEachByKey(t,(t=>{s=t.options.x??0,c=s+(t.options.width??1),e>=s&&e<c&&(!n||(t.options.layer??`bottom`)===n)&&r(t)}))}}t.DecorationService=l;class u extends a.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=r.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=r.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(e){super(),this.options=e,this.onRenderEmitter=this.register(new i.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new i.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=e.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position=`full`)}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.InstantiationService=t.ServiceCollection=void 0;let r=n(2585),i=n(8343);class a{constructor(...e){this._entries=new Map;for(let[t,n]of e)this.set(t,n)}set(e,t){let n=this._entries.get(e);return this._entries.set(e,t),n}forEach(e){for(let[t,n]of this._entries.entries())e(t,n)}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}}t.ServiceCollection=a,t.InstantiationService=class{constructor(){this._services=new a,this._services.set(r.IInstantiationService,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(e,...t){let n=(0,i.getServiceDependencies)(e).sort(((e,t)=>e.index-t.index)),r=[];for(let t of n){let n=this._services.get(t.id);if(!n)throw Error(`[createInstance] ${e.name} depends on UNKNOWN service ${t.id}.`);r.push(n)}let a=n.length>0?n[0].index:t.length;if(t.length!==a)throw Error(`[createInstance] First service dependency of ${e.name} at position ${a+1} conflicts with ${t.length} static arguments`);return new e(...t,...r)}}},7866:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.traceCall=t.setTraceLogger=t.LogService=void 0;let a=n(844),o=n(2585),s={trace:o.LogLevelEnum.TRACE,debug:o.LogLevelEnum.DEBUG,info:o.LogLevelEnum.INFO,warn:o.LogLevelEnum.WARN,error:o.LogLevelEnum.ERROR,off:o.LogLevelEnum.OFF},c,l=t.LogService=class extends a.Disposable{get logLevel(){return this._logLevel}constructor(e){super(),this._optionsService=e,this._logLevel=o.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange(`logLevel`,(()=>this._updateLogLevel()))),c=this}_updateLogLevel(){this._logLevel=s[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)typeof e[t]==`function`&&(e[t]=e[t]())}_log(e,t,n){this._evalLazyOptionalParams(n),e.call(console,(this._optionsService.options.logger?``:`xterm.js: `)+t,...n)}trace(e,...t){this._logLevel<=o.LogLevelEnum.TRACE&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,t)}debug(e,...t){this._logLevel<=o.LogLevelEnum.DEBUG&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,t)}info(e,...t){this._logLevel<=o.LogLevelEnum.INFO&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,t)}warn(e,...t){this._logLevel<=o.LogLevelEnum.WARN&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,t)}error(e,...t){this._logLevel<=o.LogLevelEnum.ERROR&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,t)}};t.LogService=l=r([i(0,o.IOptionsService)],l),t.setTraceLogger=function(e){c=e},t.traceCall=function(e,t,n){if(typeof n.value!=`function`)throw Error(`not supported`);let r=n.value;n.value=function(...e){if(c.logLevel!==o.LogLevelEnum.TRACE)return r.apply(this,e);c.trace(`GlyphRenderer#${r.name}(${e.map((e=>JSON.stringify(e))).join(`, `)})`);let t=r.apply(this,e);return c.trace(`GlyphRenderer#${r.name} return`,t),t}}},7302:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.OptionsService=t.DEFAULT_OPTIONS=void 0;let r=n(8460),i=n(844);t.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:`block`,cursorWidth:1,cursorInactiveStyle:`outline`,customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:`alt`,fastScrollSensitivity:5,fontFamily:`courier-new, courier, monospace`,fontSize:15,fontWeight:`normal`,fontWeightBold:`bold`,ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:`info`,logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:n(6114).isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:` ()[]{}',"\``,altClickMovesCursor:!0,convertEol:!1,termName:`xterm`,cancelEvents:!1,overviewRulerWidth:0};let a=[`normal`,`bold`,`100`,`200`,`300`,`400`,`500`,`600`,`700`,`800`,`900`];class o extends i.Disposable{constructor(e){super(),this._onOptionChange=this.register(new r.EventEmitter),this.onOptionChange=this._onOptionChange.event;let n={...t.DEFAULT_OPTIONS};for(let t in e)if(t in n)try{let r=e[t];n[t]=this._sanitizeAndValidateOption(t,r)}catch(e){console.error(e)}this.rawOptions=n,this.options={...n},this._setupOptions(),this.register((0,i.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(e,t){return this.onOptionChange((n=>{n===e&&t(this.rawOptions[e])}))}onMultipleOptionChange(e,t){return this.onOptionChange((n=>{e.indexOf(n)!==-1&&t()}))}_setupOptions(){let e=e=>{if(!(e in t.DEFAULT_OPTIONS))throw Error(`No option with key "${e}"`);return this.rawOptions[e]},n=(e,n)=>{if(!(e in t.DEFAULT_OPTIONS))throw Error(`No option with key "${e}"`);n=this._sanitizeAndValidateOption(e,n),this.rawOptions[e]!==n&&(this.rawOptions[e]=n,this._onOptionChange.fire(e))};for(let t in this.rawOptions){let r={get:e.bind(this,t),set:n.bind(this,t)};Object.defineProperty(this.options,t,r)}}_sanitizeAndValidateOption(e,n){switch(e){case`cursorStyle`:if(n||=t.DEFAULT_OPTIONS[e],!function(e){return e===`block`||e===`underline`||e===`bar`}(n))throw Error(`"${n}" is not a valid value for ${e}`);break;case`wordSeparator`:n||=t.DEFAULT_OPTIONS[e];break;case`fontWeight`:case`fontWeightBold`:if(typeof n==`number`&&1<=n&&n<=1e3)break;n=a.includes(n)?n:t.DEFAULT_OPTIONS[e];break;case`cursorWidth`:n=Math.floor(n);case`lineHeight`:case`tabStopWidth`:if(n<1)throw Error(`${e} cannot be less than 1, value: ${n}`);break;case`minimumContrastRatio`:n=Math.max(1,Math.min(21,Math.round(10*n)/10));break;case`scrollback`:if((n=Math.min(n,4294967295))<0)throw Error(`${e} cannot be less than 0, value: ${n}`);break;case`fastScrollSensitivity`:case`scrollSensitivity`:if(n<=0)throw Error(`${e} cannot be less than or equal to 0, value: ${n}`);break;case`rows`:case`cols`:if(!n&&n!==0)throw Error(`${e} must be numeric, value: ${n}`);break;case`windowsPty`:n??={}}return n}}t.OptionsService=o},2660:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.OscLinkService=void 0;let a=n(2585),o=t.OscLinkService=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){let t=this._bufferService.buffer;if(e.id===void 0){let n=t.addMarker(t.ybase+t.y),r={data:e,id:this._nextId++,lines:[n]};return n.onDispose((()=>this._removeMarkerFromLink(r,n))),this._dataByLinkId.set(r.id,r),r.id}let n=e,r=this._getEntryIdKey(n),i=this._entriesWithId.get(r);if(i)return this.addLineToLink(i.id,t.ybase+t.y),i.id;let a=t.addMarker(t.ybase+t.y),o={id:this._nextId++,key:this._getEntryIdKey(n),data:n,lines:[a]};return a.onDispose((()=>this._removeMarkerFromLink(o,a))),this._entriesWithId.set(o.key,o),this._dataByLinkId.set(o.id,o),o.id}addLineToLink(e,t){let n=this._dataByLinkId.get(e);if(n&&n.lines.every((e=>e.line!==t))){let e=this._bufferService.buffer.addMarker(t);n.lines.push(e),e.onDispose((()=>this._removeMarkerFromLink(n,e)))}}getLinkData(e){return this._dataByLinkId.get(e)?.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,t){let n=e.lines.indexOf(t);n!==-1&&(e.lines.splice(n,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};t.OscLinkService=o=r([i(0,a.IBufferService)],o)},8343:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.createDecorator=t.getServiceDependencies=t.serviceRegistry=void 0;let n=`di$target`,r=`di$dependencies`;t.serviceRegistry=new Map,t.getServiceDependencies=function(e){return e[r]||[]},t.createDecorator=function(e){if(t.serviceRegistry.has(e))return t.serviceRegistry.get(e);let i=function(e,t,a){if(arguments.length!==3)throw Error(`@IServiceName-decorator can only be used to decorate a parameter`);(function(e,t,i){t[n]===t?t[r].push({id:e,index:i}):(t[r]=[{id:e,index:i}],t[n]=t)})(i,e,a)};return i.toString=()=>e,t.serviceRegistry.set(e,i),i}},2585:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.IDecorationService=t.IUnicodeService=t.IOscLinkService=t.IOptionsService=t.ILogService=t.LogLevelEnum=t.IInstantiationService=t.ICharsetService=t.ICoreService=t.ICoreMouseService=t.IBufferService=void 0;let r=n(8343);var i;t.IBufferService=(0,r.createDecorator)(`BufferService`),t.ICoreMouseService=(0,r.createDecorator)(`CoreMouseService`),t.ICoreService=(0,r.createDecorator)(`CoreService`),t.ICharsetService=(0,r.createDecorator)(`CharsetService`),t.IInstantiationService=(0,r.createDecorator)(`InstantiationService`),function(e){e[e.TRACE=0]=`TRACE`,e[e.DEBUG=1]=`DEBUG`,e[e.INFO=2]=`INFO`,e[e.WARN=3]=`WARN`,e[e.ERROR=4]=`ERROR`,e[e.OFF=5]=`OFF`}(i||(t.LogLevelEnum=i={})),t.ILogService=(0,r.createDecorator)(`LogService`),t.IOptionsService=(0,r.createDecorator)(`OptionsService`),t.IOscLinkService=(0,r.createDecorator)(`OscLinkService`),t.IUnicodeService=(0,r.createDecorator)(`UnicodeService`),t.IDecorationService=(0,r.createDecorator)(`DecorationService`)},1480:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.UnicodeService=void 0;let r=n(8460),i=n(225);class a{static extractShouldJoin(e){return(1&e)!=0}static extractWidth(e){return e>>1&3}static extractCharKind(e){return e>>3}static createPropertyValue(e,t,n=!1){return(16777215&e)<<3|(3&t)<<1|!!n}constructor(){this._providers=Object.create(null),this._active=``,this._onChange=new r.EventEmitter,this.onChange=this._onChange.event;let e=new i.UnicodeV6;this.register(e),this._active=e.version,this._activeProvider=e}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(e){if(!this._providers[e])throw Error(`unknown Unicode version "${e}"`);this._active=e,this._activeProvider=this._providers[e],this._onChange.fire(e)}register(e){this._providers[e.version]=e}wcwidth(e){return this._activeProvider.wcwidth(e)}getStringCellWidth(e){let t=0,n=0,r=e.length;for(let i=0;i<r;++i){let o=e.charCodeAt(i);if(55296<=o&&o<=56319){if(++i>=r)return t+this.wcwidth(o);let n=e.charCodeAt(i);56320<=n&&n<=57343?o=1024*(o-55296)+n-56320+65536:t+=this.wcwidth(n)}let s=this.charProperties(o,n),c=a.extractWidth(s);a.extractShouldJoin(s)&&(c-=a.extractWidth(n)),t+=c,n=s}return t}charProperties(e,t){return this._activeProvider.charProperties(e,t)}}t.UnicodeService=a}},t={};function n(r){var i=t[r];if(i!==void 0)return i.exports;var a=t[r]={exports:{}};return e[r].call(a.exports,a,a.exports,n),a.exports}var r={};return(()=>{var e=r;Object.defineProperty(e,`__esModule`,{value:!0}),e.Terminal=void 0;let t=n(9042),i=n(3236),a=n(844),o=n(5741),s=n(8285),c=n(7975),l=n(7090),u=[`cols`,`rows`];class d extends a.Disposable{constructor(e){super(),this._core=this.register(new i.Terminal(e)),this._addonManager=this.register(new o.AddonManager),this._publicOptions={...this._core.options};let t=e=>this._core.options[e],n=(e,t)=>{this._checkReadonlyOptions(e),this._core.options[e]=t};for(let e in this._core.options){let r={get:t.bind(this,e),set:n.bind(this,e)};Object.defineProperty(this._publicOptions,e,r)}}_checkReadonlyOptions(e){if(u.includes(e))throw Error(`Option "${e}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw Error(`You must set the allowProposedApi option to true to use proposed API`)}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||=new c.ParserApi(this._core),this._parser}get unicode(){return this._checkProposedApi(),new l.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||=this.register(new s.BufferNamespaceApi(this._core)),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let e=this._core.coreService.decPrivateModes,t=`none`;switch(this._core.coreMouseService.activeProtocol){case`X10`:t=`x10`;break;case`VT200`:t=`vt200`;break;case`DRAG`:t=`drag`;break;case`ANY`:t=`any`}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:t,originMode:e.origin,reverseWraparoundMode:e.reverseWraparound,sendFocusMode:e.sendFocus,wraparoundMode:e.wraparound}}get options(){return this._publicOptions}set options(e){for(let t in e)this._publicOptions[t]=e[t]}blur(){this._core.blur()}focus(){this._core.focus()}input(e,t=!0){this._core.input(e,t)}resize(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)}open(e){this._core.open(e)}attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}attachCustomWheelEventHandler(e){this._core.attachCustomWheelEventHandler(e)}registerLinkProvider(e){return this._core.registerLinkProvider(e)}registerCharacterJoiner(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)}deregisterCharacterJoiner(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)}registerMarker(e=0){return this._verifyIntegers(e),this._core.registerMarker(e)}registerDecoration(e){return this._checkProposedApi(),this._verifyPositiveIntegers(e.x??0,e.width??0,e.height??0),this._core.registerDecoration(e)}hasSelection(){return this._core.hasSelection()}select(e,t,n){this._verifyIntegers(e,t,n),this._core.select(e,t,n)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(e,t){this._verifyIntegers(e,t),this._core.selectLines(e,t)}dispose(){super.dispose()}scrollLines(e){this._verifyIntegers(e),this._core.scrollLines(e)}scrollPages(e){this._verifyIntegers(e),this._core.scrollPages(e)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(e){this._verifyIntegers(e),this._core.scrollToLine(e)}clear(){this._core.clear()}write(e,t){this._core.write(e,t)}writeln(e,t){this._core.write(e),this._core.write(`\r
361
+ `,t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return t}_verifyIntegers(...e){for(let t of e)if(t===1/0||isNaN(t)||t%1!=0)throw Error(`This API only accepts integers`)}_verifyPositiveIntegers(...e){for(let t of e)if(t&&(t===1/0||isNaN(t)||t%1!=0||t<0))throw Error(`This API only accepts positive integers`)}}e.Terminal=d})(),r})()))}))(),lM=2,uM=1,dM=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,n=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(n.getPropertyValue(`height`)),i=Math.max(0,parseInt(n.getPropertyValue(`width`))),a=window.getComputedStyle(this._terminal.element),o={top:parseInt(a.getPropertyValue(`padding-top`)),bottom:parseInt(a.getPropertyValue(`padding-bottom`)),right:parseInt(a.getPropertyValue(`padding-right`)),left:parseInt(a.getPropertyValue(`padding-left`))},s=o.top+o.bottom,c=o.right+o.left,l=r-s,u=i-c-t;return{cols:Math.max(lM,Math.floor(u/e.css.cell.width)),rows:Math.max(uM,Math.floor(l/e.css.cell.height))}}},fM=class{constructor(e,t,n,r={}){this._terminal=e,this._regex=t,this._handler=n,this._options=r}provideLinks(e,t){let n=mM.computeLink(e,this._regex,this._terminal,this._handler);t(this._addCallbacks(n))}_addCallbacks(e){return e.map(e=>(e.leave=this._options.leave,e.hover=(t,n)=>{if(this._options.hover){let{range:r}=e;this._options.hover(t,n,r)}},e))}};function pM(e){try{let t=new URL(e),n=t.password&&t.username?`${t.protocol}//${t.username}:${t.password}@${t.host}`:t.username?`${t.protocol}//${t.username}@${t.host}`:`${t.protocol}//${t.host}`;return e.toLocaleLowerCase().startsWith(n.toLocaleLowerCase())}catch{return!1}}var mM=class e{static computeLink(t,n,r,i){let a=new RegExp(n.source,(n.flags||``)+`g`),[o,s]=e._getWindowedLineStrings(t-1,r),c=o.join(``),l,u=[];for(;l=a.exec(c);){let t=l[0];if(!pM(t))continue;let[n,a]=e._mapStrIdx(r,s,0,l.index),[o,c]=e._mapStrIdx(r,n,a,t.length);if(n===-1||a===-1||o===-1||c===-1)continue;let d={start:{x:a+1,y:n+1},end:{x:c,y:o+1}};u.push({range:d,text:t,activate:i})}return u}static _getWindowedLineStrings(e,t){let n,r=e,i=e,a=0,o=``,s=[];if(n=t.buffer.active.getLine(e)){let e=n.translateToString(!0);if(n.isWrapped&&e[0]!==` `){for(a=0;(n=t.buffer.active.getLine(--r))&&a<2048&&(o=n.translateToString(!0),a+=o.length,s.push(o),!(!n.isWrapped||o.indexOf(` `)!==-1)););s.reverse()}for(s.push(e),a=0;(n=t.buffer.active.getLine(++i))&&n.isWrapped&&a<2048&&(o=n.translateToString(!0),a+=o.length,s.push(o),o.indexOf(` `)===-1););}return[s,r]}static _mapStrIdx(e,t,n,r){let i=e.buffer.active,a=i.getNullCell(),o=n;for(;r;){let e=i.getLine(t);if(!e)return[-1,-1];for(let n=o;n<e.length;++n){e.getCell(n,a);let o=a.getChars();if(a.getWidth()&&(r-=o.length||1,n===e.length-1&&o===``)){let e=i.getLine(t+1);e&&e.isWrapped&&(e.getCell(0,a),a.getWidth()===2&&(r+=1))}if(r<0)return[t,n]}t++,o=0}return[t,o]}},hM=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function gM(e,t){let n=window.open();if(n){try{n.opener=null}catch{}n.location.href=t}else console.warn(`Opening link blocked as opener could not be cleared`)}var _M=class{constructor(e=gM,t={}){this._handler=e,this._options=t}activate(e){this._terminal=e;let t=this._options,n=t.urlRegex||hM;this._linkProvider=this._terminal.registerLinkProvider(new fM(this._terminal,n,this._handler,t))}dispose(){this._linkProvider?.dispose()}},vM=`forge.terminal.tabs.v1`;function yM(){try{if(sessionStorage.getItem(vM)===null){let e=localStorage.getItem(vM);e!==null&&(sessionStorage.setItem(vM,e),localStorage.removeItem(vM))}let e=sessionStorage.getItem(vM);if(e===null)return{tabs:[],activeTabId:void 0};let t=JSON.parse(e);if(typeof t!=`object`||!t||!Array.isArray(t.tabs))return{tabs:[],activeTabId:void 0};let n=[];for(let e of t.tabs)typeof e==`object`&&e&&typeof e.id==`string`&&typeof e.projectId==`string`&&typeof e.label==`string`&&typeof e.createdAt==`number`&&n.push(e);let r=t.activeTabId,i=typeof r==`string`?r:void 0;return{tabs:n,activeTabId:n.some(e=>e.id===i)?i:n[0]?.id}}catch{return{tabs:[],activeTabId:void 0}}}function bM(e){try{sessionStorage.setItem(vM,JSON.stringify(e))}catch{}}var xM=0,SM=()=>`term-${Date.now().toString(36)}-${(xM++).toString(36)}`,CM=yM(),wM=ft(e=>({tabs:CM.tabs,activeTabId:CM.activeTabId,openTab:t=>{let n=SM();return e(e=>{let r={id:n,projectId:t,label:`Terminal ${e.tabs.filter(e=>e.projectId===t).length+1}`,createdAt:Date.now()},i={tabs:[...e.tabs,r],activeTabId:n};return bM(i),i}),n},closeTab:t=>{e(e=>{let n=e.tabs.findIndex(e=>e.id===t);if(n===-1)return{};let r=e.tabs.slice(0,n).concat(e.tabs.slice(n+1)),i={tabs:r,activeTabId:e.activeTabId===t?(r[n]??r[n-1]??r[0])?.id:e.activeTabId};return bM(i),i})},setActiveTab:t=>e(e=>(bM({tabs:{...e,activeTabId:t}.tabs,activeTabId:t}),{activeTabId:t})),closeProjectTabs:t=>{e(e=>{let n=e.tabs.filter(e=>e.projectId!==t),r={tabs:n,activeTabId:n.some(t=>t.id===e.activeTabId)?e.activeTabId:n[0]?.id};return bM(r),r})}})),TM=new Map;function EM(e){let t=[1,2,4,8,16,30];return(t[Math.min(e,t.length-1)]??30)*1e3}function DM(e){return e===1e3||e===4401||e===4404}function OM(){let e=tr(),t=wM(e=>e.tabs),n=wM(e=>e.activeTabId),r=wM(e=>e.openTab),i=wM(e=>e.closeTab),a=wM(e=>e.setActiveTab),o=er(e=>e.projects),s=t.filter(t=>t.projectId===e?.id),c=s.find(e=>e.id===n)??s[0],l=new Map(o.map(e=>[e.id,e.path]));if(e===void 0)return(0,R.jsx)(`div`,{className:`flex h-full items-center justify-center text-xs italic text-neutral-500`,children:`Select a project to open a terminal.`});let u=()=>{r(e.id)},d=e=>{jM(e),i(e)};return(0,R.jsxs)(`div`,{className:`flex h-full flex-col bg-black`,children:[(0,R.jsx)(`div`,{className:`flex items-center justify-between border-b border-neutral-800 bg-neutral-900/40 px-2 py-1`,children:(0,R.jsxs)(`div`,{className:`flex items-center gap-1 overflow-x-auto`,children:[s.length===0&&(0,R.jsx)(`span`,{className:`px-2 text-[11px] italic text-neutral-500`,children:`No terminals open.`}),s.map(e=>(0,R.jsxs)(`div`,{className:`group flex items-center gap-1 rounded px-2 py-0.5 text-xs ${e.id===c?.id?`bg-neutral-800 text-neutral-100`:`text-neutral-400 hover:bg-neutral-900 hover:text-neutral-200`}`,children:[(0,R.jsxs)(`button`,{onClick:()=>a(e.id),className:`flex items-center gap-1`,children:[(0,R.jsx)(Xe,{size:11}),e.label]}),(0,R.jsx)(`button`,{onClick:()=>d(e.id),className:`rounded p-1 text-neutral-600 hover:bg-neutral-800 hover:text-neutral-200`,title:`Close terminal (kills the PTY)`,children:(0,R.jsx)(rt,{size:16})})]},e.id)),(0,R.jsxs)(`button`,{onClick:u,className:`ml-1 flex items-center gap-1 rounded px-2 py-0.5 text-xs text-neutral-400 hover:bg-neutral-900 hover:text-neutral-200 light:text-neutral-200 light:hover:bg-neutral-800 light:hover:text-neutral-50`,title:`New terminal`,children:[(0,R.jsx)(He,{size:14}),`New`]})]})}),(0,R.jsxs)(`div`,{className:`relative flex-1 overflow-hidden`,children:[s.length===0&&(0,R.jsxs)(`div`,{className:`flex h-full items-center justify-center text-xs italic text-neutral-500`,children:[`Click "New" to open a terminal in `,e.path,`.`]}),t.map(t=>(0,R.jsx)(kM,{tab:t,projectPath:l.get(t.projectId)??``,visible:t.projectId===e.id&&t.id===c?.id},t.id))]})]})}function kM({tab:e,projectPath:t,visible:n}){let r=(0,v.useRef)(null);return(0,v.useEffect)(()=>{if(r.current===null)return;let t=r.current,n=TM.get(e.id);if(n!==void 0){try{let e=n.term.element;e!==void 0&&e.parentNode!==t?t.appendChild(e):n.term.open(t),n.fit.fit()}catch{}let e=new ResizeObserver(()=>{try{n.fit.fit()}catch{}let e=n.term.cols,t=n.term.rows;e===n.lastSize.cols&&t===n.lastSize.rows||(n.lastSize={cols:e,rows:t},n.ws.readyState===WebSocket.OPEN&&n.ws.send(JSON.stringify({type:`resize`,cols:e,rows:t})))});e.observe(t);try{n.observer.disconnect()}catch{}return n.observer=e,requestAnimationFrame(()=>{try{n.fit.fit(),n.term.focus()}catch{}}),()=>{try{e.disconnect()}catch{}}}let i=new cM.Terminal({theme:{background:GS(`--pi-terminal-bg`,`#0a0a0a`),foreground:GS(`--pi-terminal-fg`,`#e5e5e5`),cursor:GS(`--pi-terminal-fg`,`#e5e5e5`),black:GS(`--color-neutral-800`,`#262626`),brightBlack:GS(`--color-neutral-600`,`#525252`)},fontFamily:`ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace`,fontSize:13,cursorBlink:!0,scrollback:5e3,convertEol:!1}),a=new dM,o=new _M;i.loadAddon(a),i.loadAddon(o),i.open(t),a.fit();let s={cols:i.cols,rows:i.rows},c=AM(e.id,e.projectId,i,s,!1);i.onData(t=>{let n=TM.get(e.id)?.ws;n?.readyState===WebSocket.OPEN&&n.send(JSON.stringify({type:`input`,data:t}))});let l=new ResizeObserver(()=>{try{a.fit()}catch{}let t=i.cols,n=i.rows,r=TM.get(e.id);r!==void 0&&(t===r.lastSize.cols&&n===r.lastSize.rows||(r.lastSize={cols:t,rows:n},r.ws.readyState===WebSocket.OPEN&&r.ws.send(JSON.stringify({type:`resize`,cols:t,rows:n}))))});return l.observe(r.current),TM.set(e.id,{term:i,fit:a,ws:c,observer:l,lastSize:s,reconnectAttempt:0,reconnectTimer:void 0,disposed:!1}),()=>{try{l.disconnect()}catch{}}},[e.id]),(0,v.useEffect)(()=>{if(!n)return;let t=TM.get(e.id);t!==void 0&&requestAnimationFrame(()=>{try{t.fit.fit(),t.term.focus()}catch{}})},[n,e.id]),(0,v.useEffect)(()=>{let t=TM.get(e.id);t!==void 0&&(t.term.options.theme={background:GS(`--pi-terminal-bg`,`#0a0a0a`),foreground:GS(`--pi-terminal-fg`,`#e5e5e5`),cursor:GS(`--pi-terminal-fg`,`#e5e5e5`),black:GS(`--color-neutral-800`,`#262626`),brightBlack:GS(`--color-neutral-600`,`#525252`)})},[US(e=>e.theme),e.id]),(0,R.jsx)(`div`,{ref:r,onClick:()=>{TM.get(e.id)?.term.focus()},className:`absolute inset-y-0 left-2 right-0`,style:{visibility:n?`visible`:`hidden`,pointerEvents:n?`auto`:`none`,zIndex:+!!n},title:t})}function AM(e,t,n,r,i){let a=window.location.protocol===`https:`?`wss`:`ws`,o=Bt(),s=o===void 0?``:`&token=${encodeURIComponent(o.token)}`,c=`${a}://${window.location.host}/api/v1/terminal?projectId=${encodeURIComponent(t)}&tabId=${encodeURIComponent(e)}${s}`,l=new WebSocket(c);return l.binaryType=`arraybuffer`,l.onopen=()=>{l.send(JSON.stringify({type:`resize`,cols:r.cols,rows:r.rows}));let t=TM.get(e);t!==void 0&&(t.reconnectAttempt=0)},l.onmessage=e=>{typeof e.data==`string`?n.write(e.data):e.data instanceof ArrayBuffer&&n.write(new Uint8Array(e.data))},l.onclose=r=>{let i=TM.get(e);if(i===void 0||i.disposed)return;if(DM(r.code)){let e=`[connection closed: ${String(r.code)}]`;r.code===4401?e=`[connection closed (4401): your session expired — refresh the page after logging back in]`:r.code===4404&&(e=`[connection closed (4404): project no longer exists]`),n.write(`\r\n${e}\r\n`);return}let a=i.reconnectAttempt+1;i.reconnectAttempt=a;let o=EM(a);n.write(`\r\n[connection lost (${String(r.code)}) — reconnecting in ${String(o/1e3)}s, attempt ${String(a)}]\r\n`),i.reconnectTimer=setTimeout(()=>{let r=TM.get(e);r===void 0||r.disposed||(r.reconnectTimer=void 0,r.ws=AM(e,t,n,r.lastSize,!0))},o)},l}function jM(e){let t=TM.get(e);if(t!==void 0){t.disposed=!0,t.reconnectTimer!==void 0&&clearTimeout(t.reconnectTimer),TM.delete(e);try{t.observer.disconnect()}catch{}try{(t.ws.readyState===WebSocket.OPEN||t.ws.readyState===WebSocket.CONNECTING)&&t.ws.close(1e3,`tab_closed`)}catch{}try{t.term.dispose()}catch{}}}function MM(){let e=ot(),[t,n]=(0,v.useState)(``),[r,i]=(0,v.useState)([]),[a,o]=(0,v.useState)(!1),[s,c]=(0,v.useState)(!1),[l,u]=(0,v.useState)(void 0),[d,f]=(0,v.useState)(0),p=(0,v.useRef)(null),m=(0,v.useRef)(null),h=(0,v.useRef)(void 0),g=er(e=>e.setActive),_=er(e=>e.activeProjectId),y=L(e=>e.setActiveSession),b=L(e=>e.requestScrollToMessage),x=(0,v.useMemo)(()=>{let e=[];return r.forEach((t,n)=>{t.matches.forEach((r,i)=>{e.push({group:t,match:r,groupIndex:n,matchIndex:i})})}),e},[r]);if((0,v.useEffect)(()=>{f(0)},[r]),(0,v.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`k`&&(e.preventDefault(),p.current?.focus(),p.current?.select())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),(0,v.useEffect)(()=>{if(!a)return;let e=e=>{m.current!==null&&(m.current.contains(e.target)||o(!1))};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[a]),(0,v.useEffect)(()=>{if(t.trim().length===0){i([]),u(void 0),c(!1),h.current?.abort();return}let e=new AbortController;h.current?.abort(),h.current=e,c(!0),u(void 0);let n=window.setTimeout(()=>{I.searchSessions(t.trim(),{signal:e.signal}).then(t=>{e.signal.aborted||(i(t.results),c(!1),o(!0))}).catch(t=>{e.signal.aborted||(c(!1),u(t instanceof Error?t.message:`search failed`))})},250);return()=>{window.clearTimeout(n),e.abort()}},[t]),e)return null;let S=(e,t)=>{b(e.sessionId,t.messageIndex),_!==e.projectId&&g(e.projectId),y(e.sessionId),o(!1),n(``),p.current?.blur()},C=e=>{if(e.key===`Escape`){o(!1),p.current?.blur();return}if(!(!a||x.length===0)){if(e.key===`ArrowDown`)e.preventDefault(),f(e=>Math.min(x.length-1,e+1));else if(e.key===`ArrowUp`)e.preventDefault(),f(e=>Math.max(0,e-1));else if(e.key===`Enter`){e.preventDefault();let t=x[d];t!==void 0&&S(t.group,t.match)}}},w=e=>{let t=e.snippet.slice(0,e.matchOffset),n=e.snippet.slice(e.matchOffset,e.matchOffset+e.matchLength),r=e.snippet.slice(e.matchOffset+e.matchLength);return(0,R.jsxs)(R.Fragment,{children:[t,(0,R.jsx)(`mark`,{className:`rounded bg-amber-300/30 text-amber-100 light:bg-amber-200 light:text-amber-900`,children:n}),r]})},T=e=>e===`user`?`you`:e===`assistant`?`agent`:`tool`;return(0,R.jsxs)(`div`,{ref:m,className:`relative`,children:[(0,R.jsxs)(`div`,{className:`relative`,children:[(0,R.jsx)(qe,{size:13,className:`pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 text-neutral-500`,"aria-hidden":`true`}),(0,R.jsx)(`input`,{ref:p,type:`text`,value:t,onChange:e=>n(e.target.value),onFocus:()=>{r.length>0&&o(!0)},onKeyDown:C,placeholder:`Search sessions… ⌘K`,"aria-label":`Search across all sessions`,className:`w-64 rounded-md border border-neutral-700 bg-neutral-900 py-1 pl-7 pr-7 text-xs text-neutral-200 placeholder-neutral-500 focus:border-neutral-500 focus:outline-none`}),t.length>0&&(0,R.jsx)(`button`,{type:`button`,onClick:()=>{n(``),i([]),o(!1),p.current?.focus()},"aria-label":`Clear search`,className:`absolute right-1 top-1/2 -translate-y-1/2 rounded p-0.5 text-neutral-500 hover:bg-neutral-800 hover:text-neutral-200`,children:(0,R.jsx)(rt,{size:12})})]}),a&&(0,R.jsxs)(`div`,{role:`listbox`,"aria-label":`Search results`,className:`absolute right-0 top-full z-50 mt-1 max-h-[60vh] w-96 overflow-y-auto rounded-md border border-neutral-700 bg-neutral-900 shadow-xl`,children:[s&&(0,R.jsx)(`div`,{className:`px-3 py-2 text-xs text-neutral-400`,children:`Searching…`}),!s&&l!==void 0&&(0,R.jsx)(`div`,{className:`px-3 py-2 text-xs text-amber-400 light:text-amber-700`,children:l}),!s&&l===void 0&&x.length===0&&(0,R.jsx)(`div`,{className:`px-3 py-2 text-xs text-neutral-500`,children:`No matches.`}),x.length>0&&(0,R.jsx)(`div`,{children:r.map((e,t)=>(0,R.jsxs)(`div`,{className:`border-b border-neutral-800 last:border-b-0`,children:[(0,R.jsxs)(`div`,{className:`bg-neutral-950 px-3 py-1 text-[10px] uppercase tracking-wider text-neutral-500`,children:[(0,R.jsx)(`span`,{className:`text-neutral-300`,children:e.projectName}),e.sessionName!==void 0&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`span`,{className:`mx-1.5 text-neutral-600`,children:`/`}),(0,R.jsx)(`span`,{className:`text-neutral-400 normal-case tracking-normal`,children:e.sessionName})]})]}),e.matches.map((n,r)=>{let i=x.findIndex(e=>e.groupIndex===t&&e.matchIndex===r),a=i===d;return(0,R.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":a,onMouseEnter:()=>f(i),onClick:()=>S(e,n),className:`flex w-full items-start gap-2 px-3 py-1.5 text-left text-xs ${a?`bg-neutral-800 text-neutral-100`:`text-neutral-300 hover:bg-neutral-800/60`}`,children:[(0,R.jsx)(`span`,{className:`mt-0.5 shrink-0 rounded bg-neutral-800 px-1 py-0.5 text-[9px] uppercase tracking-wider text-neutral-400`,children:T(n.kind)}),(0,R.jsx)(`span`,{className:`flex-1 break-words`,children:w(n)})]},`${n.messageIndex}-${n.matchOffset}`)})]},e.sessionId))})]})]})}function NM(){let e=VA(e=>e.settings),t=bA(e=>e.openSettings);if(e===void 0||e.total===0&&e.enabled)return null;let{enabled:n,connected:r,total:i}=e,a=n?r===i?`bg-emerald-500`:r===0?`bg-red-500`:`bg-amber-400`:`bg-neutral-600`,o=n?`MCP ${r}/${i}`:`MCP off`;return(0,R.jsxs)(`button`,{type:`button`,onClick:()=>t(`mcp`),className:`inline-flex items-center gap-1.5 rounded-md border border-neutral-700 px-2 py-1 text-xs text-neutral-300 hover:border-neutral-500 hover:text-neutral-100`,title:n?`${r} of ${i} MCP server(s) connected. Click to open Settings → MCP.`:`MCP tools disabled. Click to open Settings → MCP.`,children:[(0,R.jsx)(`span`,{className:`h-2 w-2 rounded-full ${a}`}),o]})}var PM=`forge.turnDiff.viewType`;function FM(){try{return localStorage.getItem(PM)===`split`?`split`:`unified`}catch{return`unified`}}function IM(){let e=L(e=>e.activeSessionId),t=L(t=>e===void 0?0:t.agentEndCountBySession[e]??0),n=L(t=>e===void 0?!1:t.streamingBySession[e]??!1),[r,i]=(0,v.useState)([]),[a,o]=(0,v.useState)(void 0),[s,c]=(0,v.useState)(!1),[l,u]=(0,v.useState)({}),[d,f]=(0,v.useState)(FM),p=e=>{f(e);try{localStorage.setItem(PM,e)}catch{}},m=async()=>{if(e!==void 0){c(!0),o(void 0);try{i((await I.getTurnDiff(e)).entries)}catch(e){e instanceof M&&e.status===404?i([]):(i([]),o(e instanceof M?e.code:e.message))}finally{c(!1)}}};return(0,v.useEffect)(()=>{i([]),o(void 0)},[e]),(0,v.useEffect)(()=>{e===void 0||n||m()},[e,t,n]),e===void 0?(0,R.jsx)(`div`,{className:`flex h-full items-center justify-center px-4 text-center text-xs italic text-neutral-500`,children:`Pick a session to see its file changes.`}):(0,R.jsxs)(`div`,{className:`flex h-full flex-col text-xs text-neutral-300`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between border-b border-neutral-800 px-3 py-2`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2 font-medium text-neutral-200`,children:[(0,R.jsx)(Ce,{size:13}),`Last turn`,r.length>0&&(0,R.jsx)(`span`,{className:`rounded bg-neutral-800 px-1.5 py-0.5 text-[10px] text-neutral-400`,children:r.length})]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,R.jsx)(`button`,{onClick:()=>p(d===`split`?`unified`:`split`),className:`rounded p-1 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-200`,title:d===`split`?`Switch to unified view`:`Switch to side-by-side view`,children:d===`split`?(0,R.jsx)(Ge,{size:13}):(0,R.jsx)(ve,{size:13})}),(0,R.jsx)(`button`,{onClick:()=>void m(),className:`rounded p-1 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-200`,title:`Refresh diff`,children:(0,R.jsx)(Ue,{size:13,className:s?`animate-spin`:``})})]})]}),a!==void 0&&(0,R.jsx)(`div`,{className:`border-b border-red-700/40 bg-red-900/20 px-3 py-1.5 text-[11px] text-red-300`,children:a}),(0,R.jsxs)(`div`,{className:`flex-1 overflow-y-auto`,children:[r.length===0&&(0,R.jsx)(`p`,{className:`px-3 py-3 italic text-neutral-500`,children:s?`Loading…`:a===void 0?`No file changes from the most recent turn.`:`Couldn't load the latest turn diff (see banner).`}),r.map(e=>{let t=l[e.file]??!1,n=e.file.split(`/`).pop()??e.file;return(0,R.jsxs)(`div`,{className:`border-b border-neutral-800/60`,children:[(0,R.jsxs)(`button`,{onClick:()=>u(n=>({...n,[e.file]:!t})),className:`flex w-full items-center justify-between gap-2 px-3 py-2 text-left hover:bg-neutral-900`,title:e.file,children:[(0,R.jsxs)(`span`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,R.jsx)(`span`,{className:`truncate font-mono text-neutral-200`,children:n}),e.isPureAddition&&(0,R.jsx)(`span`,{className:`rounded bg-emerald-900/40 px-1 py-0.5 text-[9px] uppercase tracking-wider text-emerald-300 light:bg-emerald-100 light:text-emerald-800`,children:`new`})]}),(0,R.jsxs)(`span`,{className:`flex shrink-0 items-baseline gap-2 text-[11px]`,children:[(0,R.jsxs)(`span`,{className:`text-emerald-400 light:text-emerald-700`,children:[`+`,e.additions]}),(0,R.jsxs)(`span`,{className:`text-red-400 light:text-red-700`,children:[`−`,e.deletions]})]})]}),t&&(0,R.jsx)(nk,{diff:e.diff,viewType:d})]},e.file)})]})]})}var LM=15e3;function RM(e){let[t,n]=(0,v.useState)(void 0),[r,i]=(0,v.useState)(void 0),a=L(e=>e.activeSessionId),o=L(e=>a===void 0?!1:e.streamingBySession[a]??!1),s=L(e=>a===void 0?0:e.agentEndCountBySession[a]??0),c=(0,v.useRef)(0),l=async()=>{if(e===void 0)return;let t=c.current,r=e;try{let e=await I.gitStatus(r);if(c.current!==t)return;n(e),i(void 0)}catch(e){if(c.current!==t)return;i(e instanceof M?e.code:e.message)}};return(0,v.useEffect)(()=>{c.current+=1,n(void 0),i(void 0)},[e]),(0,v.useEffect)(()=>{if(e===void 0)return;if(l(),o)return()=>void 0;let t=window.setInterval(()=>{l()},LM);return()=>{window.clearInterval(t)}},[e,o]),(0,v.useEffect)(()=>{e!==void 0&&s!==0&&l()},[e,a,s]),{status:t,error:r,refresh:l}}function zM(e){let t=[],n=[];for(let r of e){let e=t.slice(),i=t.findIndex(e=>e===r.hash);i===-1&&(i=t.findIndex(e=>e===void 0),i===-1&&(i=t.length,t.push(void 0)));let a=[];for(let e=0;e<t.length;e++)t[e]===r.hash&&a.push(e);for(let e of a)t[e]=void 0;let o=[];if(r.parents.length>0){let e=r.parents[0];t[i]=e,o.push({lane:i,parent:e})}for(let e=1;e<r.parents.length;e++){let n=r.parents[e],i=t.findIndex(e=>e===n);i===-1&&(i=t.findIndex(e=>e===void 0),i===-1&&(i=t.length,t.push(void 0)),t[i]=n),o.push({lane:i,parent:n})}for(;t.length>0&&t[t.length-1]===void 0;)t.pop();let s=[];for(let t=0;t<e.length;t++)e[t]!==void 0&&t!==i&&(a.includes(t)||s.push(t));let c=Math.max(i+1,t.length,...a.map(e=>e+1),...o.map(e=>e.lane+1),...s.map(e=>e+1));n.push({hash:r.hash,lane:i,incomingLanes:a,outgoingLanes:o,through:s,width:c})}return n}var BM=[`#a5b4fc`,`#fde047`,`#a3e635`,`#f472b6`,`#67e8f9`,`#fb923c`,`#c084fc`,`#86efac`];function VM(e){return BM[e%BM.length]??`#a5b4fc`}function HM(){let e=tr(),{status:t,error:n,refresh:r}=RM(e?.id),[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(void 0),[u,d]=(0,v.useState)(void 0),[f,p]=(0,v.useState)(void 0),[m,h]=(0,v.useState)(void 0),[g,_]=(0,v.useState)(void 0),[y,b]=(0,v.useState)(!1),[x,S]=(0,v.useState)(!1),[C,w]=(0,v.useState)(!1),[T,E]=(0,v.useState)(void 0),[D,O]=(0,v.useState)(void 0),[k,ee]=(0,v.useState)(void 0),[te,ne]=(0,v.useState)(!1),[re,ie]=(0,v.useState)(``),[ae,A]=(0,v.useState)(``),[oe,j]=(0,v.useState)(void 0),se=async()=>{if(e!==void 0)try{_((await I.gitRemotes(e.id)).remotes)}catch(e){l(e instanceof M?e.code:e.message)}},ce=async()=>{if(e===void 0)return;let t=re.trim(),n=ae.trim();if(!(t.length===0||n.length===0)){ee(t),l(void 0);try{await I.gitRemoteAdd(e.id,t,n),ne(!1),ie(``),A(``),await se()}catch(e){l(e instanceof M?e.message||e.code:e.message)}finally{ee(void 0)}}},le=async()=>{if(e===void 0||oe===void 0)return;let t=oe;j(void 0),ee(t),l(void 0);try{await I.gitRemoteRemove(e.id,t),await se()}catch(e){l(e instanceof M?e.message||e.code:e.message)}finally{ee(void 0)}},de=async()=>{if(e!==void 0)try{h((await I.gitBranches(e.id)).branches)}catch(e){l(e instanceof M?e.code:e.message)}},fe=async t=>{if(e!==void 0){E(t),l(void 0);try{await I.gitCheckout(e.id,t),await de(),r()}catch(e){l(e instanceof M?e.code:e.message)}finally{E(void 0)}}},pe=async t=>{if(e!==void 0){O(void 0),E(t),l(void 0);try{await I.gitBranchCreate(e.id,t,{checkout:!0}),await de(),r()}catch(e){l(e instanceof M?e.code:e.message)}finally{E(void 0)}}},me=async t=>{if(e===void 0||D?.kind!==`delete`)return;let{name:n}=D;O(void 0),E(n),l(void 0);try{await I.gitBranchDelete(e.id,n,t),await de()}catch(e){l(e instanceof M?e.code:e.message)}finally{E(void 0)}},[he,ge]=(0,v.useState)({}),[_e,ye]=(0,v.useState)(void 0),[be,xe]=(0,v.useState)(void 0),[Se,Ce]=(0,v.useState)(``),[we,Te]=(0,v.useState)(!1),[Ee,De]=(0,v.useState)(!1),[Ae,je]=(0,v.useState)(()=>{try{return localStorage.getItem(`forge.gitPanel.viewType`)===`split`?`split`:`unified`}catch{return`unified`}}),Me=e=>{je(e);try{localStorage.setItem(`forge.gitPanel.viewType`,e)}catch{}};if((0,v.useEffect)(()=>{if(t===void 0)return;let e=new Set(t.files.map(e=>e.path));ge(t=>{let n=!1,r={};for(let[i,a]of Object.entries(t)){let t=i.split(`|`)[0]??``;e.has(t)?r[i]=a:n=!0}return n?r:t})},[t]),(0,v.useEffect)(()=>{y&&e!==void 0&&I.gitLog(e.id,30).then(e=>p(e.commits)).catch(e=>l(e instanceof M?e.code:e.message))},[y,e?.id]),(0,v.useEffect)(()=>{x&&e!==void 0&&I.gitBranches(e.id).then(e=>h(e.branches)).catch(e=>l(e instanceof M?e.code:e.message))},[x,e?.id]),(0,v.useEffect)(()=>{C&&e!==void 0&&I.gitRemotes(e.id).then(e=>_(e.remotes)).catch(e=>l(e instanceof M?e.code:e.message))},[C,e?.id]),e===void 0)return(0,R.jsx)(`div`,{className:`flex h-full items-center justify-center px-4 text-center text-xs italic text-neutral-500`,children:`Pick a project to see its git status.`});if(t?.isGitRepo===!1){let t=async()=>{s(!0),l(void 0);try{await I.gitInit(e.id),await r()}catch(e){l(e instanceof M?e.code:e.message)}finally{s(!1)}};return(0,R.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-3 px-4 text-center text-xs text-neutral-500`,children:[(0,R.jsxs)(`p`,{className:`italic`,children:[e.name,` isn't a git repository.`]}),(0,R.jsx)(`button`,{onClick:()=>void t(),disabled:o,className:`rounded-md bg-neutral-100 px-3 py-1.5 text-xs font-medium text-neutral-900 hover:bg-white disabled:cursor-not-allowed disabled:opacity-50`,title:"Run `git init -b main` in the project root",children:o?`Initializing…`:`Initialize git repo`}),(0,R.jsxs)(`p`,{className:`text-[10px] text-neutral-600`,children:[`Default branch will be `,(0,R.jsx)(`code`,{className:`font-mono text-neutral-400`,children:`main`}),`.`]}),c!==void 0&&(0,R.jsxs)(`p`,{className:`text-[10px] text-red-400 light:text-red-700`,children:[`git init failed: `,c]})]})}let Ne=t?.files.filter(e=>e.staged)??[],Pe=t?.files.filter(e=>e.unstaged)??[],Fe=t?.files.filter(e=>e.kind===`untracked`)??[],Ie=async(t,n)=>{let r=`${t.path}|${n?`staged`:`unstaged`}`;if(he[r]!==void 0){ge(e=>{let t={...e};return delete t[r],t});return}ge(e=>({...e,[r]:`loading`}));try{let i=await I.gitDiffFile(e.id,t.path,n);ge(e=>({...e,[r]:i.diff}))}catch{ge(e=>({...e,[r]:`error`}))}},Le=async t=>{if(t.length!==0){s(!0),l(void 0);try{await I.gitStage(e.id,t),await r()}catch(e){l((e instanceof M,e.message))}finally{s(!1)}}},Re=async t=>{if(t.length!==0){s(!0),l(void 0),d(void 0);try{await I.gitRevert(e.id,t),d(t.length===1?`Reverted ${t[0]}`:`Reverted ${t.length} files`),await r()}catch(e){l((e instanceof M,e.message))}finally{s(!1)}}},ze=async t=>{if(t.length!==0){s(!0),l(void 0);try{await I.gitUnstage(e.id,t),await r()}catch(e){l((e instanceof M,e.message))}finally{s(!1)}}},Be=async(t,n,i)=>{ye(t.path),l(void 0);try{let a=await I.gitApplyHunks(e.id,t.path,i,[n]);if(a.ok!==!0){l(`Hunk apply failed: ${a.error??`unknown_error`}`);return}await Promise.all([Ve(t,!0),Ve(t,!1),r()])}catch(e){l((e instanceof M,e.message))}finally{ye(void 0)}},Ve=async(t,n)=>{let r=`${t.path}|${n?`staged`:`unstaged`}`;if(he[r]!==void 0){ge(e=>({...e,[r]:`loading`}));try{let i=await I.gitDiffFile(e.id,t.path,n);ge(e=>{if(i.diff.length===0){let t={...e};return delete t[r],t}return{...e,[r]:i.diff}})}catch{ge(e=>({...e,[r]:`error`}))}}},We=async()=>{let t=i.trim();if(t.length!==0){s(!0),l(void 0),d(void 0);try{let{hash:n}=await I.gitCommit(e.id,t);a(``),d(`Committed ${n.slice(0,7)}`),await r(),y&&p((await I.gitLog(e.id,30)).commits)}catch(e){l((e instanceof M,e.message))}finally{s(!1)}}},Ke=(()=>{if(g!==void 0)return g.map(e=>e.name).sort();if(m===void 0)return[];let e=new Set;for(let t of m){if(!t.remote)continue;let n=t.name.indexOf(`/`);n>0&&e.add(t.name.slice(0,n))}return Array.from(e).sort()})(),qe=m===void 0?[]:m.filter(e=>!e.remote).map(e=>e.name).sort(),Je=async()=>{s(!0),l(void 0),d(void 0);try{let t={};be!==void 0&&(t.remote=be);let{output:n}=await I.gitFetch(e.id,t);d(n.trim().length>0?n.trim().split(`
362
+ `).pop()??`Fetched`:`Fetched`)}catch(e){l((e instanceof M,e.message))}finally{s(!1)}},Ye=async()=>{s(!0),l(void 0),d(void 0);try{let t={};be!==void 0&&(t.remote=be);let n=Se.trim();n.length>0&&(t.branch=n);let{output:i}=await I.gitPull(e.id,t);d(i.trim().length>0?i.trim().split(`
363
+ `).pop()??`Pulled`:`Pulled`),r()}catch(e){l((e instanceof M,e.message))}finally{s(!1)}},Xe=async()=>{s(!0),l(void 0),d(void 0);try{let t={};be!==void 0&&(t.remote=be);let n=Se.trim();n.length>0&&(t.branch=n),we&&(t.setUpstream=!0);let{output:r}=await I.gitPush(e.id,t);d(r.trim().length>0?r.trim().split(`
364
+ `).pop()??`Pushed`:`Pushed`),we&&Te(!1)}catch(e){l((e instanceof M,e.message))}finally{s(!1)}};return(0,R.jsxs)(`div`,{className:`flex h-full flex-col text-xs text-neutral-300`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between border-b border-neutral-800 px-3 py-2`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2 font-medium text-neutral-200`,children:[(0,R.jsx)(Oe,{size:13}),t?.branch??`—`,t!==void 0&&t.files.length>0&&(0,R.jsx)(`span`,{className:`rounded bg-neutral-800 px-1.5 py-0.5 text-[10px] text-neutral-400`,children:t.files.length})]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,R.jsx)(`button`,{onClick:()=>Me(Ae===`split`?`unified`:`split`),className:`rounded p-1 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-200`,title:Ae===`split`?`Switch git diffs to unified view`:`Switch git diffs to side-by-side view`,children:Ae===`split`?(0,R.jsx)(Ge,{size:13}):(0,R.jsx)(ve,{size:13})}),(0,R.jsx)(`button`,{onClick:()=>void r(),className:`rounded p-1 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-200`,title:`Refresh`,children:(0,R.jsx)(Ue,{size:13,className:o?`animate-spin`:``})})]})]}),(n!==void 0||c!==void 0)&&(0,R.jsx)(`div`,{className:`border-b border-red-700/40 bg-red-900/20 px-3 py-1.5 text-[11px] text-red-300 light:border-red-300 light:bg-red-50 light:text-red-700`,children:c??n}),u!==void 0&&(0,R.jsx)(`div`,{className:`border-b border-emerald-700/40 bg-emerald-900/20 px-3 py-1.5 text-[11px] text-emerald-300 light:border-emerald-300 light:bg-emerald-50 light:text-emerald-800`,children:u}),(0,R.jsxs)(`div`,{className:`flex-1 overflow-y-auto`,children:[t===void 0&&(0,R.jsx)(`p`,{className:`px-3 py-3 italic text-neutral-500`,children:`Loading…`}),t?.files.length===0&&(0,R.jsx)(`p`,{className:`px-3 py-3 italic text-neutral-500`,children:`Working tree clean.`}),Ne.length>0&&(0,R.jsx)(WM,{label:`Staged`,files:Ne,actionLabel:`Unstage all`,onGroupAction:()=>void ze(Ne.map(e=>e.path)),onFileAction:e=>void ze([e.path]),fileActionLabel:`Unstage`,onRevert:e=>void Re([e.path]),onClickFile:e=>void Ie(e,!0),openDiffs:he,staged:!0,diffViewType:Ae,onHunkAction:(e,t)=>void Be(e,t,`unstage`),pendingHunkPath:_e}),Pe.length>0&&(0,R.jsx)(WM,{label:`Unstaged`,files:Pe,actionLabel:`Stage all`,onGroupAction:()=>void Le(Pe.map(e=>e.path)),onFileAction:e=>void Le([e.path]),fileActionLabel:`Stage`,onRevert:e=>void Re([e.path]),onClickFile:e=>void Ie(e,!1),openDiffs:he,staged:!1,diffViewType:Ae,onHunkAction:(e,t)=>void Be(e,t,`stage`),pendingHunkPath:_e}),Fe.length>0&&(0,R.jsx)(WM,{label:`Untracked`,files:Fe,actionLabel:`Stage all`,onGroupAction:()=>void Le(Fe.map(e=>e.path)),onFileAction:e=>void Le([e.path]),fileActionLabel:`Stage`,onRevert:void 0,onClickFile:e=>void Ie(e,!1),openDiffs:he,staged:!1,diffViewType:Ae}),(0,R.jsxs)(`div`,{className:`border-t border-neutral-800/60 px-3 py-3`,children:[(0,R.jsxs)(`div`,{className:`mb-1 flex items-center gap-1 text-[10px] uppercase tracking-wider text-neutral-500`,children:[(0,R.jsx)(ke,{size:10}),` Commit`]}),(0,R.jsx)(`textarea`,{value:i,onChange:e=>a(e.target.value),placeholder:`Commit message…`,rows:3,className:`w-full resize-none rounded border border-neutral-700 bg-neutral-950 px-2 py-1 text-xs text-neutral-100 outline-none focus:border-neutral-500`}),(0,R.jsxs)(`div`,{className:`mt-1 flex items-center justify-between gap-2`,children:[(0,R.jsxs)(`span`,{className:`text-[10px] text-neutral-500`,children:[Ne.length,` staged`]}),(0,R.jsx)(`button`,{onClick:()=>void We(),disabled:o||Ne.length===0||i.trim().length===0,className:`rounded bg-neutral-100 px-3 py-1 text-xs font-medium text-neutral-900 disabled:cursor-not-allowed disabled:opacity-50`,children:`Commit`})]})]}),(0,R.jsxs)(`div`,{className:`border-t border-neutral-800/60 px-3 py-3`,children:[(0,R.jsxs)(`div`,{className:`mb-1 flex items-center justify-between gap-1 text-[10px] uppercase tracking-wider text-neutral-500`,children:[(0,R.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,R.jsx)(tt,{size:10}),` Push`]}),(0,R.jsx)(`button`,{onClick:()=>{De(e=>!e),!Ee&&m===void 0&&I.gitBranches(e.id).then(e=>h(e.branches)).catch(()=>void 0),!Ee&&g===void 0&&I.gitRemotes(e.id).then(e=>_(e.remotes)).catch(()=>void 0)},className:`rounded px-1 py-0.5 text-[10px] normal-case text-neutral-400 hover:bg-neutral-900 hover:text-neutral-200`,children:Ee?`Hide options`:`Options`})]}),Ee&&(0,R.jsxs)(`div`,{className:`mb-2 space-y-1.5 rounded border border-neutral-800 bg-neutral-900/40 p-2`,children:[(0,R.jsxs)(`label`,{className:`flex items-center gap-2 text-[11px]`,children:[(0,R.jsx)(`span`,{className:`w-16 shrink-0 text-neutral-400`,children:`Remote`}),Ke.length>0?(0,R.jsxs)(`select`,{value:be??``,onChange:e=>xe(e.target.value===``?void 0:e.target.value),className:`flex-1 rounded border border-neutral-700 bg-neutral-950 px-1 py-0.5 text-[11px] text-neutral-100 outline-none focus:border-neutral-500`,children:[(0,R.jsx)(`option`,{value:``,children:`configured upstream`}),Ke.map(e=>(0,R.jsx)(`option`,{value:e,children:e},e))]}):(0,R.jsx)(`input`,{type:`text`,value:be??``,onChange:e=>xe(e.target.value.length===0?void 0:e.target.value),placeholder:`origin`,className:`flex-1 rounded border border-neutral-700 bg-neutral-950 px-1 py-0.5 text-[11px] text-neutral-100 outline-none focus:border-neutral-500`})]}),(0,R.jsxs)(`label`,{className:`flex items-center gap-2 text-[11px]`,children:[(0,R.jsx)(`span`,{className:`w-16 shrink-0 text-neutral-400`,children:`Branch`}),qe.length>0?(0,R.jsxs)(`select`,{value:Se,onChange:e=>Ce(e.target.value),className:`flex-1 rounded border border-neutral-700 bg-neutral-950 px-1 py-0.5 text-[11px] text-neutral-100 outline-none focus:border-neutral-500`,children:[(0,R.jsx)(`option`,{value:``,children:t?.branch??`current branch`}),qe.map(e=>(0,R.jsx)(`option`,{value:e,children:e},e))]}):(0,R.jsx)(`input`,{type:`text`,value:Se,onChange:e=>Ce(e.target.value),placeholder:t?.branch??`current`,className:`flex-1 rounded border border-neutral-700 bg-neutral-950 px-1 py-0.5 text-[11px] text-neutral-100 outline-none focus:border-neutral-500`})]}),(0,R.jsxs)(`label`,{className:`flex items-center gap-2 text-[11px] text-neutral-300`,children:[(0,R.jsx)(`input`,{type:`checkbox`,checked:we,onChange:e=>Te(e.target.checked),className:`h-3 w-3`}),(0,R.jsx)(`span`,{children:`Set upstream (first push of a new branch)`})]})]}),(0,R.jsxs)(`div`,{className:`flex gap-1`,children:[(0,R.jsx)(`button`,{onClick:()=>void Je(),disabled:o,className:`flex-1 rounded border border-neutral-700 px-3 py-1 text-xs text-neutral-200 hover:border-neutral-500 disabled:opacity-50`,title:be===void 0?`git fetch (configured upstream)`:`git fetch ${be}`,children:`Fetch`}),(0,R.jsx)(`button`,{onClick:()=>void Ye(),disabled:o,className:`flex-1 rounded border border-neutral-700 px-3 py-1 text-xs text-neutral-200 hover:border-neutral-500 disabled:opacity-50`,title:`git pull — conflicts surface in the error banner; resolve via the integrated terminal`,children:`Pull`}),(0,R.jsx)(`button`,{onClick:()=>void Xe(),disabled:o,className:`flex-1 rounded border border-neutral-700 px-3 py-1 text-xs text-neutral-200 hover:border-neutral-500 disabled:opacity-50`,title:be===void 0&&Se.trim().length===0?`git push (configured upstream)`:`git push ${be??`(upstream)`}${Se.trim().length>0?` ${Se.trim()}`:``}`,children:`Push`})]})]}),(0,R.jsxs)(`div`,{className:`border-t border-neutral-800/60`,children:[(0,R.jsxs)(`button`,{onClick:()=>b(e=>!e),className:`flex w-full items-center justify-between px-3 py-2 text-left text-[10px] uppercase tracking-wider text-neutral-400 hover:bg-neutral-900`,children:[(0,R.jsx)(`span`,{children:`Log`}),(0,R.jsx)(`span`,{children:y?`−`:`+`})]}),y&&(0,R.jsx)(`div`,{className:`px-3 pb-3 text-[11px]`,children:f===void 0?(0,R.jsx)(`p`,{className:`italic text-neutral-500`,children:`Loading…`}):f.length===0?(0,R.jsx)(`p`,{className:`italic text-neutral-500`,children:`No commits yet.`}):(0,R.jsx)(JM,{commits:f})})]}),(0,R.jsxs)(`div`,{className:`border-t border-neutral-800/60`,children:[(0,R.jsxs)(`button`,{onClick:()=>S(e=>!e),className:`flex w-full items-center justify-between px-3 py-2 text-left text-[10px] uppercase tracking-wider text-neutral-400 hover:bg-neutral-900`,children:[(0,R.jsx)(`span`,{children:`Branches`}),(0,R.jsx)(`span`,{children:x?`−`:`+`})]}),x&&(0,R.jsx)(`div`,{className:`px-3 pb-3 text-[11px]`,children:m===void 0?(0,R.jsx)(`p`,{className:`italic text-neutral-500`,children:`Loading…`}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`ul`,{className:`space-y-0.5`,children:m.map(e=>{let t=T===e.name;return(0,R.jsxs)(`li`,{className:`group flex items-center gap-1 rounded px-1 py-0.5 font-mono hover:bg-neutral-900 ${e.current?`text-emerald-400 light:text-emerald-700`:`text-neutral-300`}`,children:[(0,R.jsx)(`span`,{className:`w-3 shrink-0`,children:e.current?(0,R.jsx)(ue,{size:10}):null}),(0,R.jsx)(`span`,{className:`flex-1 truncate`,title:e.name,children:e.name}),e.remote&&(0,R.jsx)(`span`,{className:`ml-1 text-[10px] text-neutral-600`,children:`remote`}),!e.current&&(0,R.jsxs)(`div`,{className:`hidden gap-0.5 group-hover:flex`,children:[(0,R.jsx)(`button`,{onClick:()=>void fe(e.name),disabled:t,className:`rounded px-1 py-0.5 text-[10px] text-neutral-400 hover:bg-neutral-800 hover:text-neutral-100 disabled:opacity-40`,title:e.remote?`Checkout (creates a tracking branch from ${e.name})`:`Checkout ${e.name}`,children:`checkout`}),!e.remote&&(0,R.jsx)(`button`,{onClick:()=>O({kind:`delete`,name:e.name}),disabled:t,className:`rounded p-0.5 text-neutral-500 hover:bg-red-900/30 hover:text-red-300 disabled:opacity-40 light:hover:bg-red-100 light:hover:text-red-700`,title:`Delete branch`,children:(0,R.jsx)(Qe,{size:10})})]})]},e.name)})}),(0,R.jsxs)(`button`,{onClick:()=>O({kind:`create`}),className:`mt-2 flex items-center gap-1 rounded px-1 py-0.5 text-[11px] text-neutral-400 hover:bg-neutral-900 hover:text-neutral-100`,children:[(0,R.jsx)(He,{size:10}),` New branch`]})]})})]}),(0,R.jsxs)(`div`,{className:`border-t border-neutral-800/60`,children:[(0,R.jsxs)(`button`,{onClick:()=>w(e=>!e),className:`flex w-full items-center justify-between px-3 py-2 text-left text-[10px] uppercase tracking-wider text-neutral-400 hover:bg-neutral-900`,children:[(0,R.jsx)(`span`,{children:`Remotes`}),(0,R.jsx)(`span`,{children:C?`−`:`+`})]}),C&&(0,R.jsx)(`div`,{className:`px-3 pb-3 text-[11px]`,children:g===void 0?(0,R.jsx)(`p`,{className:`italic text-neutral-500`,children:`Loading…`}):(0,R.jsxs)(R.Fragment,{children:[g.length===0?(0,R.jsx)(`p`,{className:`italic text-neutral-500`,children:`No remotes configured.`}):(0,R.jsx)(`ul`,{className:`space-y-1`,children:g.map(e=>{let t=e.fetchUrl!==e.pushUrl,n=k===e.name;return(0,R.jsxs)(`li`,{className:`group flex flex-col gap-0.5`,children:[(0,R.jsxs)(`div`,{className:`flex items-baseline gap-2`,children:[(0,R.jsx)(`span`,{className:`font-mono text-neutral-200`,children:e.name}),t&&(0,R.jsx)(`span`,{className:`rounded bg-amber-900/30 px-1 py-0.5 text-[9px] uppercase tracking-wider text-amber-300 light:bg-amber-100 light:text-amber-800`,children:`fetch ≠ push`}),(0,R.jsx)(`button`,{onClick:()=>j(e.name),disabled:n,className:`ml-auto hidden rounded p-0.5 text-neutral-500 hover:bg-red-900/30 hover:text-red-300 disabled:opacity-40 group-hover:inline-flex light:hover:bg-red-100 light:hover:text-red-700`,title:`Remove remote "${e.name}"`,children:(0,R.jsx)(Qe,{size:10})})]}),(0,R.jsx)(`span`,{className:`break-all font-mono text-[10px] text-neutral-500`,title:e.fetchUrl,children:e.fetchUrl}),t&&(0,R.jsxs)(`span`,{className:`break-all font-mono text-[10px] text-neutral-500`,title:`push → ${e.pushUrl}`,children:[`push → `,e.pushUrl]})]},e.name)})}),(0,R.jsxs)(`button`,{onClick:()=>{ie(``),A(``),ne(!0)},className:`mt-2 flex items-center gap-1 rounded px-1 py-0.5 text-[11px] text-neutral-400 hover:bg-neutral-900 hover:text-neutral-100`,children:[(0,R.jsx)(He,{size:10}),` Add remote`]})]})})]})]}),(0,R.jsx)(fi,{open:D?.kind===`create`,onClose:()=>O(void 0),onSubmit:e=>void pe(e),title:`New branch`,label:`Branch name`,placeholder:`feature/my-change`,primaryLabel:`Create + checkout`}),(0,R.jsx)(pi,{open:D?.kind===`delete`,onClose:()=>O(void 0),onConfirm:()=>void me(!1),title:`Delete branch`,message:D?.kind===`delete`?`Delete branch "${D.name}"? Refused if not merged into HEAD; force-delete from the terminal if you really mean it.`:``,primaryLabel:`Delete`,tone:`danger`}),(0,R.jsx)(di,{open:te,onClose:()=>ne(!1),title:`Add remote`,children:(0,R.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),ce()},className:`flex flex-col gap-3 px-4 py-3`,children:[(0,R.jsxs)(`label`,{className:`block space-y-1.5`,children:[(0,R.jsx)(`span`,{className:`text-xs text-neutral-300`,children:`Name`}),(0,R.jsx)(`input`,{type:`text`,value:re,onChange:e=>ie(e.target.value),placeholder:`origin`,autoFocus:!0,className:`w-full rounded-md border border-neutral-700 bg-neutral-950 px-3 py-1.5 font-mono text-sm text-neutral-100 outline-none focus:border-neutral-500`})]}),(0,R.jsxs)(`label`,{className:`block space-y-1.5`,children:[(0,R.jsx)(`span`,{className:`text-xs text-neutral-300`,children:`URL`}),(0,R.jsx)(`input`,{type:`text`,value:ae,onChange:e=>A(e.target.value),placeholder:`git@github.com:user/repo.git`,className:`w-full rounded-md border border-neutral-700 bg-neutral-950 px-3 py-1.5 font-mono text-sm text-neutral-100 outline-none focus:border-neutral-500`})]}),(0,R.jsxs)(`footer`,{className:`flex justify-end gap-2 pt-1`,children:[(0,R.jsx)(`button`,{type:`button`,onClick:()=>ne(!1),className:`rounded-md border border-neutral-700 px-3 py-1 text-xs text-neutral-200 hover:bg-neutral-800`,children:`Cancel`}),(0,R.jsx)(`button`,{type:`submit`,disabled:re.trim().length===0||ae.trim().length===0,className:`rounded-md bg-neutral-100 px-3 py-1 text-xs font-medium text-neutral-900 hover:bg-white disabled:cursor-not-allowed disabled:opacity-40`,children:`Add`})]})]})}),(0,R.jsx)(pi,{open:oe!==void 0,onClose:()=>j(void 0),onConfirm:()=>void le(),title:`Remove remote`,message:oe===void 0?``:`Remove remote "${oe}"? The local repo loses its reference to this URL; existing commits aren't affected.`,primaryLabel:`Remove`,tone:`danger`})]})}var UM=3e3;function WM(e){let[t,n]=(0,v.useState)(void 0),r=(0,v.useRef)(void 0),i=()=>{r.current!==void 0&&(window.clearTimeout(r.current),r.current=void 0),n(void 0)};(0,v.useEffect)(()=>()=>{r.current!==void 0&&window.clearTimeout(r.current)},[]);let a=a=>{if(e.onRevert!==void 0){if(t===a.path){i(),e.onRevert(a);return}r.current!==void 0&&window.clearTimeout(r.current),n(a.path),r.current=window.setTimeout(()=>{n(void 0),r.current=void 0},UM)}};return(0,R.jsxs)(`div`,{className:`border-t border-neutral-800/60`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-1.5`,children:[(0,R.jsxs)(`span`,{className:`text-[10px] uppercase tracking-wider text-neutral-500`,children:[e.label,` (`,e.files.length,`)`]}),(0,R.jsx)(`button`,{onClick:e.onGroupAction,className:`text-[10px] text-neutral-400 hover:text-neutral-200`,children:e.actionLabel})]}),(0,R.jsx)(`ul`,{children:e.files.map(n=>{let r=`${n.path}|${e.staged?`staged`:`unstaged`}`,i=e.openDiffs[r],o=t===n.path;return(0,R.jsxs)(`li`,{className:`border-t border-neutral-900`,children:[(0,R.jsxs)(`div`,{className:`group flex items-center gap-2 px-3 py-1 hover:bg-neutral-900`,children:[(0,R.jsx)(`span`,{className:`inline-block w-5 shrink-0 text-center font-mono text-[10px] text-neutral-500`,title:`porcelain code: ${n.code}`,children:GM(n.kind)}),(0,R.jsx)(`button`,{onClick:()=>e.onClickFile(n),className:`flex-1 truncate text-left font-mono`,title:n.path,children:n.path}),e.onRevert!==void 0&&(0,R.jsxs)(`button`,{onClick:()=>a(n),className:o?`inline-flex items-center gap-1 rounded bg-red-900/40 px-1 py-0.5 text-[10px] text-red-200 light:bg-red-100 light:text-red-800`:`hidden items-center gap-1 text-[10px] text-neutral-500 hover:text-red-300 group-hover:inline-flex light:hover:text-red-700`,title:o?`Click again to discard local changes (this cannot be undone)`:`Revert: discard local changes for this file`,children:[(0,R.jsx)(et,{size:10}),o?`Confirm?`:`Revert`]}),(0,R.jsxs)(`button`,{onClick:()=>e.onFileAction(n),className:`ml-3 hidden items-center gap-1 text-[10px] text-neutral-500 hover:text-neutral-200 group-hover:inline-flex`,children:[e.fileActionLabel===`Stage`?(0,R.jsx)(He,{size:10}):e.fileActionLabel===`Unstage`?(0,R.jsx)(Re,{size:10}):null,e.fileActionLabel]})]}),i!==void 0&&(0,R.jsx)(`div`,{className:`border-t border-neutral-900 bg-neutral-950`,children:i===`loading`?(0,R.jsx)(`p`,{className:`px-3 py-2 italic text-neutral-500`,children:`Loading…`}):i===`error`?(0,R.jsx)(`p`,{className:`px-3 py-2 text-red-400 light:text-red-700`,children:`Failed to load diff.`}):i.length===0?(0,R.jsx)(`p`,{className:`px-3 py-2 italic text-neutral-500`,children:`(no diff — file is binary or unchanged)`}):(0,R.jsx)(nk,{diff:i,viewType:e.diffViewType,onHunkAction:e.onHunkAction===void 0?void 0:t=>e.onHunkAction?.(n,t),hunkActionLabel:e.staged?`Unstage hunk`:`Stage hunk`,hunkActionDisabled:e.pendingHunkPath===n.path})})]},n.path)})})]})}function GM(e){switch(e){case`modified`:return`M`;case`added`:return`A`;case`deleted`:return`D`;case`renamed`:return`R`;case`copied`:return`C`;case`untracked`:return`?`;case`ignored`:return`!`;case`conflicted`:return`U`;default:return`·`}}var KM=14,qM=36;function JM({commits:e}){let t=zM(e),n=Math.max(1,...t.map(e=>e.width));return(0,R.jsx)(`ul`,{className:`space-y-0`,children:e.map((e,r)=>{let i=t[r];return i===void 0?null:(0,R.jsxs)(`li`,{className:`group flex items-stretch`,children:[(0,R.jsx)(YM,{layout:i,isLast:r===t.length-1,maxLanes:n}),(0,R.jsxs)(`div`,{className:`flex flex-col justify-center gap-0.5 pl-2`,style:{minHeight:qM},children:[(0,R.jsxs)(`div`,{className:`flex items-baseline gap-2`,children:[(0,R.jsx)(`span`,{className:`font-mono text-neutral-500`,children:e.hash.slice(0,7)}),e.refs.map((e,t)=>(0,R.jsx)(XM,{ref_:e},`${t}-${e}`)),(0,R.jsx)(`span`,{className:`truncate text-neutral-200`,title:e.message,children:e.message})]}),(0,R.jsxs)(`span`,{className:`font-mono text-[10px] text-neutral-600`,children:[e.author,` · `,new Date(e.date).toLocaleString()]})]})]},e.hash)})})}function YM({layout:e,isLast:t,maxLanes:n}){let r=n*KM,i=qM,a=e.lane*KM+KM/2,o=i/2,s=[];for(let t of e.through){let e=t*KM+KM/2;s.push({x1:e,y1:0,x2:e,y2:i,color:VM(t)})}for(let t of e.incomingLanes){let e=t*KM+KM/2;s.push({x1:e,y1:0,x2:a,y2:o,color:VM(t)})}if(!t)for(let t of e.outgoingLanes){let e=t.lane*KM+KM/2;s.push({x1:a,y1:o,x2:e,y2:i,color:VM(t.lane)})}if(t&&e.outgoingLanes.length>0)for(let t of e.outgoingLanes){let e=t.lane*KM+KM/2;s.push({x1:a,y1:o,x2:e,y2:o+6,color:VM(t.lane)})}return(0,R.jsxs)(`svg`,{width:r,height:i,viewBox:`0 0 ${r} ${i}`,className:`shrink-0`,"aria-hidden":!0,children:[s.map((e,t)=>(0,R.jsx)(`line`,{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,stroke:e.color,strokeWidth:1.5,strokeLinecap:`round`},t)),(0,R.jsx)(`circle`,{cx:a,cy:o,r:3.5,fill:VM(e.lane)})]})}function XM({ref_:e}){let t=e.startsWith(`HEAD ->`)||e===`HEAD`,n=e.startsWith(`tag:`),r=t?e.replace(/^HEAD ->\s*/,``):n?e.replace(/^tag:\s*/,``):e;return(0,R.jsx)(`span`,{className:`shrink-0 rounded px-1.5 py-0 text-[9px] uppercase tracking-wider ${t?`bg-emerald-900/40 text-emerald-300 light:bg-emerald-100 light:text-emerald-800`:n?`bg-amber-900/40 text-amber-300 light:bg-amber-100 light:text-amber-800`:e.includes(`/`)?`bg-neutral-800 text-neutral-500`:`bg-neutral-800 text-neutral-300`}`,children:n?`▼ ${r}`:r})}var ZM=250,QM=2,$M=200;function eN(){let e=tr(),t=Jr(e=>e.openFile),[n,r]=(0,v.useState)(``),[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(``),[f,p]=(0,v.useState)(``),[m,h]=(0,v.useState)(!1),[g,_]=(0,v.useState)(void 0),[y,b]=(0,v.useState)(!1),[x,S]=(0,v.useState)(void 0),C=(0,v.useRef)(void 0),w=(0,v.useCallback)(async t=>{if(e===void 0)return;if(t.length<QM){_(void 0),S(void 0);return}C.current?.abort();let n=new AbortController;C.current=n,b(!0),S(void 0);try{let r={query:t,regex:i,caseSensitive:o,includeGitignored:c,limit:$M,...u.length>0?{include:u}:{},...f.length>0?{exclude:f}:{}},a=await I.searchFiles(e.id,r,n.signal);if(n.signal.aborted)return;_(a)}catch(e){if(n.signal.aborted||e instanceof Error&&e.name===`AbortError`)return;e instanceof M&&e.code===`invalid_response_body`?S(`server returned an unexpected response`):e instanceof Error?S(e.message):S(`search failed`),_(void 0)}finally{n.signal.aborted||b(!1)}},[e,i,o,c,u,f]);(0,v.useEffect)(()=>{let e=window.setTimeout(()=>void w(n),ZM);return()=>window.clearTimeout(e)},[n,w]),(0,v.useEffect)(()=>()=>{C.current?.abort()},[]);let T=(0,v.useMemo)(()=>nN(g?.matches??[]),[g]);return e===void 0?(0,R.jsx)(`div`,{className:`p-4 text-xs italic text-neutral-500`,children:`Select a project to search its files.`}):(0,R.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,R.jsxs)(`div`,{className:`border-b border-neutral-800 bg-neutral-900/40 p-2`,children:[(0,R.jsxs)(`div`,{className:`relative`,children:[(0,R.jsx)(qe,{size:12,className:`pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 text-neutral-500`}),(0,R.jsx)(`input`,{type:`text`,value:n,onChange:e=>r(e.target.value),placeholder:i?`Regex…`:`Search project…`,className:`w-full rounded border border-neutral-700 bg-neutral-900 py-1.5 pl-7 pr-2 text-xs text-neutral-100 placeholder:text-neutral-500 focus:border-neutral-500 focus:outline-none`,autoFocus:!0})]}),(0,R.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-1`,children:[(0,R.jsx)(rN,{label:`Regex`,active:i,onClick:()=>a(e=>!e)}),(0,R.jsx)(rN,{label:`Aa`,title:`Case sensitive`,active:o,onClick:()=>s(e=>!e)}),(0,R.jsx)(rN,{label:`+ignored`,title:`Include files that .gitignore would normally skip`,active:c,onClick:()=>l(e=>!e)}),(0,R.jsxs)(`button`,{onClick:()=>h(e=>!e),className:`ml-auto flex items-center gap-1 rounded border border-neutral-700 px-1.5 py-0.5 text-[10px] text-neutral-400 hover:border-neutral-500`,children:[m?(0,R.jsx)(de,{size:10}):(0,R.jsx)(pe,{size:10}),`Globs`]})]}),m&&(0,R.jsxs)(`div`,{className:`mt-2 grid grid-cols-1 gap-1.5`,children:[(0,R.jsx)(`input`,{type:`text`,value:u,onChange:e=>d(e.target.value),placeholder:`include glob — e.g. **/*.ts`,className:`rounded border border-neutral-700 bg-neutral-900 px-2 py-1 text-[11px] text-neutral-200 placeholder:text-neutral-500 focus:border-neutral-500 focus:outline-none`}),(0,R.jsx)(`input`,{type:`text`,value:f,onChange:e=>p(e.target.value),placeholder:`exclude glob — e.g. **/dist/**`,className:`rounded border border-neutral-700 bg-neutral-900 px-2 py-1 text-[11px] text-neutral-200 placeholder:text-neutral-500 focus:border-neutral-500 focus:outline-none`})]})]}),(0,R.jsxs)(`div`,{className:`flex-1 overflow-auto`,children:[(0,R.jsx)(iN,{query:n,loading:y,error:x,results:g,totalFiles:T.length}),(0,R.jsx)(`ul`,{className:`divide-y divide-neutral-900`,children:T.map(([n,r])=>(0,R.jsx)(aN,{path:n,matches:r,onPick:r=>void t(e.id,tN(e.path,n),{line:r.line,column:r.column})},n))})]})]})}function tN(e,t){return t.startsWith(`/`)?t:`${e}${e.endsWith(`/`)?``:`/`}${t}`}function nN(e){let t=new Map;for(let n of e){let e=t.get(n.path);e===void 0?t.set(n.path,[n]):e.push(n)}return Array.from(t.entries())}function rN({label:e,title:t,active:n,onClick:r}){return(0,R.jsx)(`button`,{onClick:r,title:t,className:`rounded border px-1.5 py-0.5 text-[10px] ${n?`border-neutral-500 bg-neutral-800 text-neutral-100`:`border-neutral-700 text-neutral-400 hover:border-neutral-500`}`,children:e})}function iN({query:e,loading:t,error:n,results:r,totalFiles:i}){return e.length===0?(0,R.jsxs)(`div`,{className:`flex flex-col items-center gap-2 px-4 py-8 text-center text-xs text-neutral-500`,children:[(0,R.jsx)(Te,{size:20,className:`text-neutral-700`}),(0,R.jsx)(`p`,{children:`Type to search across project files.`}),(0,R.jsxs)(`p`,{className:`text-[10px] text-neutral-600`,children:[`Min `,QM,` chars · Click a result to jump to that line.`]})]}):e.length<QM?(0,R.jsxs)(`div`,{className:`px-4 py-3 text-xs italic text-neutral-500`,children:[`Keep typing — at least `,QM,` characters.`]}):t&&r===void 0?(0,R.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-3 text-xs text-neutral-400`,children:[(0,R.jsx)(Ne,{size:12,className:`animate-spin`}),` Searching…`]}):n===void 0?r===void 0?null:r.matches.length===0?(0,R.jsx)(`div`,{className:`px-4 py-3 text-xs italic text-neutral-500`,children:`No matches.`}):(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b border-neutral-800 bg-neutral-950/60 px-3 py-1.5 text-[10px]`,children:[(0,R.jsxs)(`span`,{className:`text-neutral-400`,children:[r.matches.length,` match`,r.matches.length===1?``:`es`,` in `,i,` `,`file`,i===1?``:`s`,r.truncated&&(0,R.jsxs)(`span`,{className:`ml-1 text-amber-400 light:text-amber-700`,children:[`· truncated at `,$M]})]}),r.engine===`node`&&(0,R.jsx)(`span`,{className:`rounded bg-amber-900/40 px-1.5 py-0.5 text-[9px] uppercase tracking-wider text-amber-300 light:bg-amber-100 light:text-amber-800`,title:`ripgrep was not found on this host — using the slower in-process fallback`,children:`fallback`})]}):(0,R.jsx)(`div`,{className:`px-4 py-3 text-xs text-rose-400 light:text-rose-700`,children:n})}function aN({path:e,matches:t,onPick:n}){let[r,i]=(0,v.useState)(!0);return(0,R.jsxs)(`li`,{className:`bg-neutral-950`,children:[(0,R.jsxs)(`button`,{onClick:()=>i(e=>!e),className:`flex w-full items-center gap-1 truncate px-2 py-1 text-left text-[11px] text-neutral-300 hover:bg-neutral-900`,title:e,children:[r?(0,R.jsx)(de,{size:11}):(0,R.jsx)(pe,{size:11}),(0,R.jsx)(`span`,{className:`truncate font-mono`,children:e}),(0,R.jsx)(`span`,{className:`ml-auto text-[10px] text-neutral-500`,children:t.length})]}),r&&(0,R.jsx)(`ul`,{children:t.map((t,r)=>(0,R.jsx)(`li`,{children:(0,R.jsxs)(`button`,{onClick:()=>n(t),className:`flex w-full gap-2 px-2 py-0.5 text-left font-mono text-[11px] text-neutral-400 hover:bg-neutral-900 hover:text-neutral-100`,title:`${e}:${t.line}:${t.column}`,children:[(0,R.jsx)(`span`,{className:`w-10 shrink-0 text-right text-neutral-600`,children:t.line}),(0,R.jsx)(`span`,{className:`truncate`,children:oN(t.lineSnippet,t.column,t.length)})]})},`${t.line}:${t.column}:${r}`))})]})}function oN(e,t,n){let r=Math.max(0,Math.min(e.length,t-1)),i=Math.max(r,Math.min(e.length,r+n)),a=e.length-e.trimStart().length,o=Math.min(a,r),s=e.slice(o,r),c=e.slice(r,i),l=e.slice(i);return n===0||c.length===0?(0,R.jsx)(`span`,{children:e.slice(o)}):(0,R.jsxs)(`span`,{children:[(0,R.jsx)(`span`,{children:s}),(0,R.jsx)(`span`,{className:`bg-amber-700/30 text-amber-100 light:bg-amber-200 light:text-amber-900`,children:c}),(0,R.jsx)(`span`,{children:l})]})}var sN=3;function cN(){let e=L(e=>e.activeSessionId),t=L(t=>e===void 0?0:t.agentEndCountBySession[e]??0),n=L(t=>e===void 0?0:t.compactionEndCountBySession[e]??0),r=L(t=>e===void 0?!1:t.streamingBySession[e]??!1),i=L(t=>e===void 0?``:t.streamingTextBySession[e]??``),[a,o]=(0,v.useState)(void 0),[s,c]=(0,v.useState)(!1),[l,u]=(0,v.useState)(void 0),[d,f]=(0,v.useState)(!1),[p,m]=(0,v.useState)(!1),[h,g]=(0,v.useState)(``),[_,y]=(0,v.useState)(void 0),b=(0,v.useRef)(void 0),x=async()=>{if(e===void 0){o(void 0);return}b.current?.abort();let t=new AbortController;b.current=t,c(!0),u(void 0);try{let n=await I.getSessionContext(e,t.signal);if(t.signal.aborted)return;o(n)}catch(e){if(t.signal.aborted||e instanceof Error&&e.name===`AbortError`)return;e instanceof M&&e.status===404?(o(void 0),u(void 0)):u(e instanceof M?e.code:e.message)}finally{t.signal.aborted||c(!1)}};return(0,v.useEffect)(()=>{x()},[e,t,n]),(0,v.useEffect)(()=>()=>{b.current?.abort()},[]),e===void 0?(0,R.jsx)(`div`,{className:`flex h-full items-center justify-center px-4 py-6 text-center text-xs italic text-neutral-500`,children:`Select a session to inspect its context.`}):(0,R.jsxs)(`div`,{className:`flex h-full flex-col bg-neutral-950 text-xs text-neutral-200`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between border-b border-neutral-800 bg-neutral-900/40 px-3 py-1.5`,children:[(0,R.jsx)(`span`,{className:`text-[10px] uppercase tracking-wider text-neutral-400`,children:`Context inspector`}),(0,R.jsxs)(`div`,{className:`flex items-center gap-1`,children:[s&&(0,R.jsx)(Ne,{size:11,className:`animate-spin text-neutral-500`}),(0,R.jsx)(`button`,{onClick:()=>void x(),disabled:s,className:`rounded p-1 text-neutral-500 hover:bg-neutral-800 hover:text-neutral-200 disabled:opacity-40`,title:`Refresh`,children:(0,R.jsx)(Ue,{size:11,className:s?`animate-spin`:``})})]})]}),l!==void 0&&(0,R.jsx)(`div`,{className:`border-b border-red-700/40 bg-red-900/20 px-3 py-1.5 text-[11px] text-red-300 light:border-red-300 light:bg-red-50 light:text-red-700`,children:l}),(0,R.jsx)(`div`,{className:`flex-1 overflow-y-auto`,children:a===void 0?(0,R.jsx)(`div`,{className:`px-4 py-6 text-center text-xs italic text-neutral-500`,children:s?`Loading…`:`No data — try refresh.`}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(lN,{data:a,turnsExpanded:d,onToggleTurns:()=>f(e=>!e)}),(0,R.jsx)(mN,{messages:a.messages,showThinking:p,onToggleThinking:()=>m(e=>!e),onViewRaw:(e,t)=>y({index:e,payload:t}),search:h,onSearchChange:g,...r&&i.length>0?{streamingTail:{content:i}}:{}})]})}),_!==void 0&&(0,R.jsx)(gN,{title:`Message ${_.index} — raw AgentMessage JSON`,payload:_.payload,onClose:()=>y(void 0)})]})}function lN({data:e,turnsExpanded:t,onToggleTurns:n}){let r=e.contextUsage,i=(0,v.useMemo)(()=>fN(e.messages,r.tokens),[e.messages,r.tokens]),a=(0,v.useMemo)(()=>bN(e.messages,e.turns),[e.messages,e.turns]),o=r.tokens??i.total,s=r.contextWindow>0?Math.min(1,o/r.contextWindow):0;return(0,R.jsxs)(`div`,{className:`space-y-2 border-b border-neutral-800 px-3 py-2`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(`div`,{className:`mb-1 flex items-center justify-between text-[10px] text-neutral-400`,children:[(0,R.jsxs)(`span`,{children:[`Context window (`,r.tokens===void 0?`estimate`:`current`,`)`]}),(0,R.jsxs)(`span`,{children:[CN(o),` /`,` `,r.contextWindow>0?CN(r.contextWindow):`unknown`,r.contextWindow>0&&(0,R.jsxs)(`span`,{className:`ml-1 text-neutral-600`,children:[`(`,(s*100).toFixed(1),`%)`]})]})]}),(0,R.jsx)(`div`,{className:`h-1.5 w-full overflow-hidden rounded bg-neutral-800`,children:(0,R.jsx)(`div`,{className:`h-full ${s>.9?`bg-red-500`:s>.7?`bg-amber-500`:`bg-emerald-500`}`,style:{width:`${Math.max(2,Math.min(100,s*100))}%`}})})]}),(0,R.jsx)(dN,{breakdown:i,contextWindow:r.contextWindow}),(0,R.jsxs)(`div`,{className:`space-y-0.5 border-t border-neutral-800 pt-1.5`,children:[e.turns.length>0&&(()=>{let t=e.turns[e.turns.length-1],n=a.get(t.index)??0;return(0,R.jsxs)(`div`,{className:`flex items-center justify-between text-[11px]`,children:[(0,R.jsx)(`span`,{className:`text-neutral-500`,children:`Last turn`}),(0,R.jsxs)(`span`,{className:`font-mono text-neutral-300`,title:`New = user message + tool results since the prior assistant turn (estimate). Out = assistant output tokens. Cost = that turn's billed cost.`,children:[`~`,CN(n),` new · `,CN(t.outputTokens),` out ·`,` `,wN(t.cost)]})]})})(),(0,R.jsxs)(`div`,{className:`flex items-center justify-between text-[11px]`,children:[(0,R.jsx)(`span`,{className:`text-neutral-500`,title:"Sum of `usage.input` per turn — NEW non-cached input the LLM saw across the session. Excludes cached portions (tracked separately below).",children:`Input (lifetime)`}),(0,R.jsx)(`span`,{className:`font-mono text-neutral-400`,children:CN(e.totalInputTokens)})]}),(0,R.jsxs)(`div`,{className:`flex items-center justify-between text-[11px]`,children:[(0,R.jsx)(`span`,{className:`text-neutral-500`,title:"Sum of `usage.cacheRead` per turn — prior context served from the prompt cache. Counted ONCE PER API CALL: every turn re-reads the same cached content and re-pays the (discounted) read fee, so this number grows ~quadratically with conversation length. Billed at ~10% of input rate on most providers.",children:`Cache served (lifetime)`}),(0,R.jsx)(`span`,{className:`font-mono text-neutral-400`,children:CN(e.totalCacheReadTokens)})]}),(0,R.jsxs)(`div`,{className:`flex items-center justify-between text-[11px]`,children:[(0,R.jsx)(`span`,{className:`text-neutral-500`,title:"Sum of `usage.cacheWrite` per turn — portions cached for reuse on subsequent turns. Billed at ~125% of input rate; small premium up front for big savings on the cache-served line.",children:`Cache written (lifetime)`}),(0,R.jsx)(`span`,{className:`font-mono text-neutral-400`,children:CN(e.totalCacheWriteTokens)})]}),(0,R.jsxs)(`div`,{className:`flex items-center justify-between text-[11px]`,children:[(0,R.jsx)(`span`,{className:`text-neutral-500`,title:"Sum of `usage.output` per turn — assistant tokens generated.",children:`Output (lifetime)`}),(0,R.jsx)(`span`,{className:`font-mono text-neutral-400`,children:CN(e.totalOutputTokens)})]}),(0,R.jsxs)(`div`,{className:`flex items-center justify-between text-[11px] font-medium`,children:[(0,R.jsx)(`span`,{className:`text-neutral-300`,children:`Total cost`}),(0,R.jsx)(`span`,{className:`font-mono text-emerald-400 light:text-emerald-700`,children:wN(e.totalCost)})]})]}),e.turns.length>0&&(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(`button`,{onClick:n,className:`flex items-center gap-1 text-[10px] uppercase tracking-wider text-neutral-400 hover:text-neutral-200`,children:[t?(0,R.jsx)(de,{size:10}):(0,R.jsx)(pe,{size:10}),`Per-turn (`,e.turns.length,`)`]}),t&&(0,R.jsx)(pN,{turns:e.turns,newDeltas:a})]})]})}var uN=[{key:`systemAndTools`,label:`System + tools`,color:`#64748b`},{key:`userPrompts`,label:`User prompts`,color:`#0ea5e9`},{key:`assistantText`,label:`Assistant text`,color:`#a78bfa`},{key:`thinking`,label:`Thinking`,color:`#71717a`},{key:`toolCalls`,label:`Tool calls`,color:`#f59e0b`},{key:`toolResults`,label:`Tool results`,color:`#10b981`},{key:`images`,label:`Images`,color:`#ec4899`}];function dN({breakdown:e,contextWindow:t}){let n=e.total;return n===0?null:(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(`div`,{className:`mb-1 flex items-center justify-between text-[10px] text-neutral-400`,children:[(0,R.jsx)(`span`,{children:`What’s in the context`}),(0,R.jsxs)(`span`,{className:`text-neutral-600`,title:`Sum of category estimates (~chars/3)`,children:[`~`,CN(n),` tok`,t>0&&(0,R.jsxs)(`span`,{className:`ml-1`,children:[`(`,(n/t*100).toFixed(1),`%)`]})]})]}),(0,R.jsx)(`div`,{className:`flex h-1.5 w-full overflow-hidden rounded bg-neutral-800`,children:uN.map(t=>{let r=e[t.key];if(r===0)return null;let i=r/n*100;return(0,R.jsx)(`div`,{style:{width:`${i}%`,background:t.color},title:`${t.label}: ${CN(r)} tok (${i.toFixed(1)}%)`},t.key)})}),(0,R.jsx)(`ul`,{className:`mt-1 grid grid-cols-2 gap-x-3 gap-y-0.5 text-[10px]`,children:uN.map(t=>{let r=e[t.key];if(r===0)return null;let i=r/n*100;return(0,R.jsxs)(`li`,{className:`flex items-center gap-1.5`,children:[(0,R.jsx)(`span`,{className:`inline-block h-2 w-2 rounded-sm`,style:{background:t.color},"aria-hidden":`true`}),(0,R.jsx)(`span`,{className:`flex-1 truncate text-neutral-400`,children:t.label}),(0,R.jsx)(`span`,{className:`font-mono text-neutral-300`,children:CN(r)}),(0,R.jsxs)(`span`,{className:`w-10 text-right text-neutral-600`,children:[i.toFixed(0),`%`]})]},t.key)})})]})}function fN(e,t){let n=0,r=0,i=0,a=0,o=0,s=0;for(let t of e){let e=typeof t.role==`string`?t.role:``,c=t.content;if(e===`user`){if(typeof c==`string`)n+=c.length;else if(Array.isArray(c))for(let e of c){let t=e;t.type===`text`&&typeof t.text==`string`?n+=t.text.length:t.type===`image`&&(s+=1)}}else if(e===`assistant`&&Array.isArray(c))for(let e of c){let t=e;if(t.type===`text`&&typeof t.text==`string`)r+=t.text.length;else if(t.type===`thinking`&&typeof t.thinking==`string`)i+=t.thinking.length;else if(t.type===`toolCall`)try{a+=JSON.stringify(t.arguments??{}).length}catch{a+=String(t.arguments??``).length}}else if(e===`toolResult`){if(typeof c==`string`)o+=c.length;else if(Array.isArray(c))for(let e of c){let t=e;t.type===`text`&&typeof t.text==`string`?o+=t.text.length:t.type===`image`&&(s+=1)}}}let c=e=>Math.ceil(e/sN),l=c(n),u=c(r),d=c(i),f=c(a),p=c(o),m=s*1500,h=l+u+d+f+p+m,g=t!==void 0&&t>h?t-h:0;return{systemAndTools:g,userPrompts:l,assistantText:u,thinking:d,toolCalls:f,toolResults:p,images:m,total:h+g}}function pN({turns:e,newDeltas:t}){return(0,R.jsx)(`div`,{className:`mt-1 overflow-x-auto`,children:(0,R.jsxs)(`table`,{className:`w-full font-mono text-[10px]`,children:[(0,R.jsx)(`thead`,{className:`text-neutral-500`,children:(0,R.jsxs)(`tr`,{children:[(0,R.jsx)(`th`,{className:`pr-2 text-left font-normal`,children:`#`}),(0,R.jsx)(`th`,{className:`pr-2 text-left font-normal`,children:`Model`}),(0,R.jsx)(`th`,{className:`pr-2 text-right font-normal`,title:`Estimated new tokens this turn — user message + tool results since the prior assistant turn (~chars/3 estimate). Distinct from Prompt.`,children:`New`}),(0,R.jsx)(`th`,{className:`pr-2 text-right font-normal`,title:`Full prompt sent to the LLM = usage.input + cacheRead + cacheWrite. Includes ALL re-sent prior context — this grows monotonically with conversation length, which is normal LLM behavior.`,children:`Prompt`}),(0,R.jsx)(`th`,{className:`pr-2 text-right font-normal`,title:`Assistant output tokens this turn`,children:`Out`}),(0,R.jsx)(`th`,{className:`text-right font-normal`,title:`Cost billed for this turn`,children:`Cost`})]})}),(0,R.jsx)(`tbody`,{className:`text-neutral-300`,children:e.map((e,n)=>{let r=e.inputTokens+e.cacheReadTokens+e.cacheWriteTokens,i=t.get(e.index)??0;return(0,R.jsxs)(`tr`,{className:`border-t border-neutral-800/60`,children:[(0,R.jsx)(`td`,{className:`pr-2 text-neutral-600`,children:n+1}),(0,R.jsx)(`td`,{className:`max-w-[140px] truncate pr-2`,title:`${e.provider}/${e.model}`,children:e.model}),(0,R.jsxs)(`td`,{className:`pr-2 text-right text-neutral-200`,title:`New content (estimate)`,children:[`~`,CN(i)]}),(0,R.jsx)(`td`,{className:`pr-2 text-right`,title:`input ${CN(e.inputTokens)} + cR ${CN(e.cacheReadTokens)} + cW ${CN(e.cacheWriteTokens)}`,children:CN(r)}),(0,R.jsx)(`td`,{className:`pr-2 text-right`,children:CN(e.outputTokens)}),(0,R.jsx)(`td`,{className:`text-right text-emerald-400 light:text-emerald-700`,children:wN(e.cost)})]},`${e.index}-${e.timestamp}`)})})]})})}function mN({messages:e,showThinking:t,onToggleThinking:n,onViewRaw:r,search:i,onSearchChange:a,streamingTail:o}){let s=i.trim().toLowerCase(),c=(0,v.useMemo)(()=>s.length===0?e.map((e,t)=>({msg:e,originalIndex:t})):e.map((e,t)=>({msg:e,originalIndex:t})).filter(({msg:e})=>(typeof e.role==`string`?e.role.toLowerCase():``).includes(s)?!0:vN(e,!0).toLowerCase().includes(s)),[e,s]);return(0,R.jsxs)(`div`,{className:`px-2 py-2`,children:[(0,R.jsxs)(`div`,{className:`mb-1 flex items-center justify-between gap-2 px-1`,children:[(0,R.jsxs)(`span`,{className:`shrink-0 text-[10px] uppercase tracking-wider text-neutral-400`,children:[`Messages (`,s.length>0?`${c.length}/${e.length}`:e.length,`)`]}),(0,R.jsxs)(`label`,{className:`flex items-center gap-1 text-[10px] text-neutral-500 hover:text-neutral-300`,children:[(0,R.jsx)(`input`,{type:`checkbox`,checked:t,onChange:n,className:`h-3 w-3`}),`Show thinking blocks`]})]}),e.length>=10&&(0,R.jsxs)(`div`,{className:`relative mb-1 px-1`,children:[(0,R.jsx)(qe,{size:11,className:`pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-neutral-500`}),(0,R.jsx)(`input`,{type:`text`,value:i,onChange:e=>a(e.target.value),placeholder:`Find in messages…`,className:`w-full rounded border border-neutral-800 bg-neutral-950 py-1 pl-6 pr-2 text-[11px] text-neutral-200 placeholder:text-neutral-600 focus:border-neutral-600 focus:outline-none`})]}),(0,R.jsxs)(`ul`,{className:`space-y-1`,children:[c.map(({msg:e,originalIndex:n})=>(0,R.jsx)(hN,{index:n,message:e,showThinking:t,onViewRaw:()=>r(n,e)},n)),o!==void 0&&s.length===0&&(0,R.jsx)(`li`,{className:`rounded border border-violet-700/40 bg-violet-900/10 light:border-violet-300 light:bg-violet-50`,children:(0,R.jsxs)(`div`,{className:`flex items-start gap-2 px-2 py-1.5`,children:[(0,R.jsx)(Ne,{size:11,className:`mt-0.5 shrink-0 animate-spin text-violet-300 light:text-violet-700`}),(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,R.jsx)(`div`,{className:`flex items-center gap-1.5`,children:(0,R.jsx)(`span`,{className:`rounded bg-violet-900/40 px-1.5 py-0.5 text-[9px] uppercase tracking-wider text-violet-300 light:bg-violet-100 light:text-violet-800`,children:`assistant (streaming)`})}),(0,R.jsx)(`p`,{className:`line-clamp-2 text-[11px] text-neutral-300`,children:o.content})]})]})})]})]})}function hN({index:e,message:t,showThinking:n,onViewRaw:r}){let[i,a]=(0,v.useState)(!1),o=typeof t.role==`string`?t.role:`unknown`,s=o===`compactionSummary`,c=(0,v.useMemo)(()=>vN(t,n),[t,n]),l=yN(t),u=typeof t.timestamp==`number`?t.timestamp:0;return(0,R.jsxs)(`li`,{className:`rounded border border-neutral-800/70 bg-neutral-900/30`,children:[(0,R.jsxs)(`button`,{onClick:()=>a(e=>!e),className:`flex w-full items-start gap-2 px-2 py-1.5 text-left hover:bg-neutral-900/60`,children:[(0,R.jsx)(`span`,{className:`pt-0.5 text-neutral-600`,children:i?(0,R.jsx)(de,{size:11}):(0,R.jsx)(pe,{size:11})}),(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,R.jsx)(`span`,{className:`rounded px-1.5 py-0.5 text-[9px] uppercase tracking-wider ${_N(o)}`,children:o}),s&&(0,R.jsx)(`span`,{className:`rounded bg-fuchsia-900/40 px-1.5 py-0.5 text-[9px] text-fuchsia-300 light:bg-fuchsia-100 light:text-fuchsia-800`,children:`compacted`}),(0,R.jsxs)(`span`,{className:`text-[10px] text-neutral-600`,children:[`~`,CN(l),` tok`]}),u>0&&(0,R.jsx)(`span`,{className:`text-[10px] text-neutral-600`,children:new Date(u).toLocaleTimeString()})]}),!i&&c.length>0&&(0,R.jsx)(`p`,{className:`line-clamp-2 text-[11px] text-neutral-400`,children:c})]}),(0,R.jsx)(`button`,{onClick:e=>{e.stopPropagation(),r()},className:`rounded p-1 text-neutral-500 hover:bg-neutral-800 hover:text-neutral-100`,title:`View raw AgentMessage JSON`,children:(0,R.jsx)(_e,{size:11})})]}),i&&(0,R.jsx)(`div`,{className:`space-y-1 border-t border-neutral-800/70 px-3 py-2`,children:xN(t,n,e)})]})}function gN({title:e,payload:t,onClose:n}){let r=(0,v.useMemo)(()=>{try{return JSON.stringify(t,null,2)}catch{return String(t)}},[t]);return(0,v.useEffect)(()=>{let e=e=>{e.key===`Escape`&&n()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[n]),(0,R.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/70 px-4 py-8`,onClick:n,children:(0,R.jsxs)(`div`,{onClick:e=>e.stopPropagation(),className:`flex h-full max-h-[720px] w-full max-w-4xl flex-col overflow-hidden rounded-lg border border-neutral-800 bg-neutral-950 shadow-2xl`,children:[(0,R.jsxs)(`header`,{className:`flex items-center justify-between border-b border-neutral-800 px-3 py-2`,children:[(0,R.jsx)(`span`,{className:`text-xs text-neutral-200`,children:e}),(0,R.jsx)(`button`,{onClick:n,className:`rounded p-2 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-200`,title:`Close (Esc)`,children:(0,R.jsx)(rt,{size:20})})]}),(0,R.jsx)(ha,{code:r,language:`json`,theme:Ri.vsDark,children:({style:e,tokens:t,getLineProps:n,getTokenProps:r})=>(0,R.jsx)(`pre`,{className:`flex-1 overflow-auto whitespace-pre p-3 font-mono text-[11px]`,style:{...e,background:`transparent`},children:t.map((e,t)=>(0,R.jsx)(`div`,{...n({line:e}),children:e.map((e,t)=>(0,R.jsx)(`span`,{...r({token:e})},t))},t))})})]})})}function _N(e){return e===`user`?`bg-sky-900/40 text-sky-300 light:bg-sky-100 light:text-sky-800`:e===`assistant`?`bg-violet-900/40 text-violet-300 light:bg-violet-100 light:text-violet-800`:e===`tool`||e===`toolResult`?`bg-amber-900/40 text-amber-300 light:bg-amber-100 light:text-amber-800`:e===`compactionSummary`?`bg-fuchsia-900/40 text-fuchsia-300 light:bg-fuchsia-100 light:text-fuchsia-800`:`bg-neutral-800 text-neutral-400`}function vN(e,t){let n=e.content;if(typeof n==`string`)return n.slice(0,200);if(!Array.isArray(n))return``;let r=[];for(let e of n){let n=e;n.type===`thinking`&&!t||(n.type===`text`&&typeof n.text==`string`?r.push(n.text):n.type===`thinking`&&typeof n.thinking==`string`?r.push(`[thinking] ${n.thinking}`):n.type===`toolCall`&&typeof n.name==`string`&&r.push(`[tool: ${n.name}]`))}return r.join(` `).slice(0,200)}function yN(e){let t=e.usage;if(t!==void 0&&typeof t.totalTokens==`number`)return t.totalTokens;let n=e.content;if(typeof n==`string`)return Math.ceil(n.length/sN);if(!Array.isArray(n))return 0;let r=0,i=0;for(let e of n){let t=e;typeof t.text==`string`&&(r+=t.text.length),t.type===`image`&&(i+=1)}return Math.ceil(r/sN)+i*1500}function bN(e,t){let n=new Map,r=-1;for(let i of t){let t=0;for(let n=r+1;n<i.index;n++){let r=e[n];if(r===void 0)continue;let i=typeof r.role==`string`?r.role:``;i!==`user`&&i!==`toolResult`||(t+=yN(r))}n.set(i.index,t),r=i.index}return n}function xN(e,t,n){let r=typeof e.role==`string`?e.role:`unknown`,i=e.content;return r===`toolResult`?(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(`p`,{className:`mb-1 text-[10px] text-neutral-500`,children:[`tool: `,(0,R.jsx)(`span`,{className:`font-mono`,children:String(e.toolName??`unknown`)}),` `,e.isError===!0&&(0,R.jsx)(`span`,{className:`text-red-400 light:text-red-700`,children:`(error)`})]}),(0,R.jsx)(`pre`,{className:`max-h-64 overflow-auto whitespace-pre-wrap break-words rounded bg-neutral-950 p-2 font-mono text-[10px] text-neutral-300`,children:SN(i)})]}):Array.isArray(i)?(0,R.jsx)(R.Fragment,{children:i.map((e,r)=>{let i=e;if(i.type===`thinking`&&!t)return null;if(i.type===`text`||i.type===`thinking`){let e=i.type===`thinking`?i.thinking:i.text;return(0,R.jsx)(`pre`,{className:`whitespace-pre-wrap break-words font-sans text-[11px] ${i.type===`thinking`?`italic text-neutral-500`:`text-neutral-200`}`,children:String(e??``)},`${n}-${r}`)}return i.type===`toolCall`?(0,R.jsxs)(`div`,{className:`rounded border border-neutral-800 p-2`,children:[(0,R.jsxs)(`p`,{className:`mb-1 text-[10px] text-neutral-500`,children:[`tool call: `,(0,R.jsx)(`span`,{className:`font-mono`,children:String(i.name??`unknown`)})]}),(0,R.jsx)(`pre`,{className:`max-h-48 overflow-auto whitespace-pre-wrap break-words font-mono text-[10px] text-neutral-300`,children:SN(i.arguments)})]},`${n}-${r}`):i.type===`image`?(0,R.jsx)(`p`,{className:`text-[11px] italic text-neutral-500`,children:`[image attachment]`},`${n}-${r}`):(0,R.jsx)(`pre`,{className:`whitespace-pre-wrap break-words font-mono text-[10px] text-neutral-500`,children:SN(i)},`${n}-${r}`)})}):typeof i==`string`?(0,R.jsx)(`pre`,{className:`whitespace-pre-wrap break-words font-sans text-[11px] text-neutral-200`,children:i}):(0,R.jsx)(`pre`,{className:`whitespace-pre-wrap break-words font-mono text-[10px] text-neutral-500`,children:SN(e)})}function SN(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}function CN(e){return e<1e3?String(e):e<1e6?`${(e/1e3).toFixed(+(e<1e4))}k`:`${(e/1e6).toFixed(2)}M`}function wN(e){return e===0?`$0`:e<.01?`$${e.toFixed(4)}`:e<1?`$${e.toFixed(3)}`:`$${e.toFixed(2)}`}function TN({getStartSize:e,onResize:t,direction:n,minSize:r,maxSize:i,orientation:a=`vertical`}){let o=(0,v.useRef)(null),s=a===`horizontal`,c=s?`row-resize`:`col-resize`;(0,v.useEffect)(()=>{let e=()=>{o.current!==null&&(o.current=null,document.body.style.removeProperty(`cursor`),document.body.style.removeProperty(`user-select`))},t=t=>{t.key===`Escape`&&e()};return window.addEventListener(`keydown`,t),window.addEventListener(`blur`,e),()=>{e(),window.removeEventListener(`keydown`,t),window.removeEventListener(`blur`,e)}},[]);let l=t=>{t.preventDefault(),t.currentTarget.setPointerCapture(t.pointerId),o.current={start:s?t.clientY:t.clientX,startSize:e()},document.body.style.cursor=c,document.body.style.userSelect=`none`},u=e=>{if(o.current===null)return;let a=(s?e.clientY:e.clientX)-o.current.start,c=o.current.startSize+a*n;t(Math.min(Math.max(c,r),i))},d=e=>{o.current!==null&&(e.currentTarget.releasePointerCapture(e.pointerId),o.current=null,document.body.style.removeProperty(`cursor`),document.body.style.removeProperty(`user-select`))},f=s?`h-1 w-full cursor-row-resize`:`w-1 h-full cursor-col-resize`,p=s?`absolute inset-x-0 -top-1 -bottom-1`:`absolute inset-y-0 -left-1 -right-1`;return(0,R.jsx)(`div`,{onPointerDown:l,onPointerMove:u,onPointerUp:d,onPointerCancel:d,className:`group relative shrink-0 bg-neutral-800 hover:bg-neutral-600 active:bg-neutral-500 ${f}`,role:`separator`,"aria-orientation":s?`horizontal`:`vertical`,children:(0,R.jsx)(`div`,{className:p})})}var EN=`pi-forge/files-width`,DN=`pi-forge/editor-width`,ON=`pi-forge/terminal-height`,kN=`pi-forge/todo-panel-height`,AN=280,jN=480,MN=280,NN=200,PN=200,FN=320,IN=320,LN=140,RN=100;function zN(e,t){let n=localStorage.getItem(e);if(n===null)return t;let r=Number.parseInt(n,10);return Number.isFinite(r)&&r>0?r:t}function BN(){let e=Yn(e=>e.ready),t=Yn(e=>e.isAuthenticated),n=Yn(e=>e.mustChangePassword),r=Yn(e=>e.bootstrap),i=Yn(e=>e.logout),a=er(e=>e.projects),o=er(e=>!e.loading),s=er(e=>e.load),c=tr(),l=er(e=>e.activeProjectId),u=L(e=>e.activeSessionId),d=ot(),[f,p]=(0,v.useState)(!1),[m,h]=(0,v.useState)(!1),[g,_]=(0,v.useState)(()=>localStorage.getItem(`pi-forge/files-open`)===`true`),y=e=>{_(e),localStorage.setItem(`pi-forge/files-open`,e?`true`:`false`)},[b,x]=(0,v.useState)(()=>{let e=localStorage.getItem(`pi-forge/right-tab`);return e===`files`||e===`search`||e===`changes`||e===`git`||e===`context`||e===`processes`?e:`files`}),S=e=>{x(e),localStorage.setItem(`pi-forge/right-tab`,e)},[C,w]=(0,v.useState)(()=>localStorage.getItem(`pi-forge/terminal-open`)===`true`),T=e=>{w(e),localStorage.setItem(`pi-forge/terminal-open`,e?`true`:`false`)},[E,D]=(0,v.useState)(()=>localStorage.getItem(`pi-forge/chat-open`)!==`false`),O=e=>{D(e),localStorage.setItem(`pi-forge/chat-open`,e?`true`:`false`)},[k,ee]=(0,v.useState)(()=>localStorage.getItem(`pi-forge/editor-open`)!==`false`),te=e=>{ee(e),localStorage.setItem(`pi-forge/editor-open`,e?`true`:`false`)},[ne,re]=(0,v.useState)(!1),[ie,ae]=(0,v.useState)(()=>zN(ON,MN)),A=(0,v.useRef)(ie);(0,v.useEffect)(()=>{A.current=ie,localStorage.setItem(ON,String(ie))},[ie]);let[oe,j]=(0,v.useState)(()=>zN(kN,NN)),se=(0,v.useRef)(oe);(0,v.useEffect)(()=>{se.current=oe,localStorage.setItem(kN,String(oe))},[oe]);let ce=bA(e=>e.todoPanelOpen);(0,v.useEffect)(()=>{ce&&!g&&!d&&y(!0)},[ce]);let le=bA(e=>e.openProcessesTabSeq);(0,v.useEffect)(()=>{le!==0&&(!g&&!d&&y(!0),S(`processes`))},[le]);let[ue,de]=(0,v.useState)(()=>zN(EN,AN)),[fe,pe]=(0,v.useState)(()=>zN(DN,jN)),me=(0,v.useRef)(ue),he=(0,v.useRef)(fe);(0,v.useEffect)(()=>{me.current=ue,localStorage.setItem(EN,String(ue))},[ue]),(0,v.useEffect)(()=>{he.current=fe,localStorage.setItem(DN,String(fe))},[fe]);let ge=Jr(e=>e.openFiles.length),_e=k&&ge>0,ve=RM(c?.id).status?.files.length??0,ye=Er(Cr(e=>wr(e,u))),be=L(e=>u===void 0?0:e.agentEndCountBySession[u]??0),xe=L(e=>u===void 0?!1:e.streamingBySession[u]??!1),Ce=Jr(e=>e.loadTree),we=Jr(e=>e.restoreTabs),Te=Jr(e=>e.refreshOpenFiles);(0,v.useEffect)(()=>{c===void 0||xe||(Ce(c.id),Te(c.id))},[c?.id,xe,be]),(0,v.useEffect)(()=>{c!==void 0&&we(c.id)},[c?.id]),(0,v.useEffect)(()=>{if(!m)return;let e=e=>{e.key===`Escape`&&h(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[m]);let Ee=(0,v.useRef)(!0);(0,v.useEffect)(()=>{if(Ee.current){Ee.current=!1;return}f&&p(!1)},[l,u]),(0,v.useEffect)(()=>{if(!f)return;let e=e=>{e.key===`Escape`&&p(!1)};window.addEventListener(`keydown`,e);let t=document.body.style.overflow;return document.body.style.overflow=`hidden`,()=>{window.removeEventListener(`keydown`,e),document.body.style.overflow=t}},[f]),(0,v.useEffect)(()=>{!d&&f&&p(!1)},[d,f]);let Oe=bA(e=>e.settingsRequest),ke=bA(e=>e.clearSettingsRequest),[Ae,je]=(0,v.useState)(void 0);(0,v.useEffect)(()=>{Oe!==void 0&&(h(!0),Oe.tab!==void 0&&je(Oe.tab),ke())},[Oe,ke]),(0,v.useEffect)(()=>{r()},[r]);let Me=Zr(e=>e.load),Ne=Zr(e=>e.minimal);(0,v.useEffect)(()=>{Me()},[Me]),(0,v.useEffect)(()=>{t&&!n&&s()},[t,n,s]);let Fe=Qr(e=>e.load);(0,v.useEffect)(()=>{t&&!n&&Fe()},[t,n,Fe]);let Ie=VA(e=>e.startPolling),Re=VA(e=>e.stopPolling);return(0,v.useEffect)(()=>{t&&!n?Ie():Re()},[t,n,Ie,Re]),e?t?n?(0,R.jsx)(ii,{}):(0,R.jsxs)(`div`,{className:`flex h-screen flex-col bg-neutral-950 text-neutral-100`,children:[(0,R.jsxs)(`header`,{className:`flex items-center justify-between border-b border-neutral-800 px-4 py-2`,style:{paddingTop:`max(0.5rem, env(safe-area-inset-top))`},children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,R.jsx)(`button`,{type:`button`,onClick:()=>p(e=>!e),"aria-label":f?`Close project sidebar`:`Open project sidebar`,"aria-expanded":f,className:`-ml-1 inline-flex min-h-11 min-w-11 items-center justify-center rounded-md text-neutral-300 hover:bg-neutral-800 md:hidden`,children:(0,R.jsx)(Pe,{size:20})}),(0,R.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,R.jsx)(`img`,{src:`/icons/icon.svg`,alt:``,className:`h-8 w-8`,"aria-hidden":`true`}),(0,R.jsx)(`span`,{className:`text-sm font-semibold tracking-tight`,children:`pi-forge`})]})]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsxs)(`div`,{className:`hidden md:contents`,children:[(0,R.jsxs)(`button`,{onClick:()=>O(!E),className:`flex items-center gap-1 rounded-md border px-2 py-1 text-xs ${E?`border-neutral-500 bg-neutral-800 text-neutral-100`:`border-neutral-700 text-neutral-300 hover:border-neutral-500`}`,title:`Toggle the chat pane`,children:[(0,R.jsx)(Le,{size:13}),`Chat`]}),(0,R.jsxs)(`button`,{onClick:()=>te(!k),className:`flex items-center gap-1 rounded-md border px-2 py-1 text-xs ${k?`border-neutral-500 bg-neutral-800 text-neutral-100`:`border-neutral-700 text-neutral-300 hover:border-neutral-500`}`,title:`Toggle the editor pane (open tabs persist across reloads)`,children:[(0,R.jsx)(Se,{size:13}),`Editor`]}),(0,R.jsxs)(`button`,{onClick:()=>y(!g),className:`flex items-center gap-1 rounded-md border px-2 py-1 text-xs ${g?`border-neutral-500 bg-neutral-800 text-neutral-100`:`border-neutral-700 text-neutral-300 hover:border-neutral-500`}`,title:`Toggle the file browser tree`,children:[(0,R.jsx)(De,{size:13}),`Files`]}),!Ne&&(0,R.jsxs)(`button`,{onClick:()=>T(!C),className:`flex items-center gap-1 rounded-md border px-2 py-1 text-xs ${C?`border-neutral-500 bg-neutral-800 text-neutral-100`:`border-neutral-700 text-neutral-300 hover:border-neutral-500`}`,title:`Toggle the integrated terminal`,children:[(0,R.jsx)(Xe,{size:13}),`Terminal`]})]}),(0,R.jsx)(`div`,{className:`hidden md:block`,children:(0,R.jsx)(MM,{})}),(0,R.jsx)(NM,{}),(0,R.jsx)(`button`,{onClick:()=>h(!0),className:`rounded-md border border-neutral-700 px-2 py-1 text-xs text-neutral-300 hover:border-neutral-500`,title:`Settings (providers, agent defaults, MCP, skills)`,children:`Settings`}),(0,R.jsx)(`button`,{onClick:i,className:`rounded-md border border-neutral-700 px-2 py-1 text-xs text-neutral-300 hover:border-neutral-500`,children:`Sign out`})]})]}),(0,R.jsx)(li,{}),m&&(0,R.jsx)(HA,{onClose:()=>{h(!1),je(void 0)},...Ae===void 0?{}:{initialTab:Ae}}),(0,R.jsxs)(`div`,{className:`flex flex-1 flex-col overflow-hidden`,children:[(0,R.jsxs)(`div`,{className:`flex flex-1 overflow-hidden`,children:[f&&(0,R.jsx)(`div`,{className:`fixed inset-0 z-30 bg-black/50 md:hidden`,onClick:()=>p(!1),"aria-hidden":!0}),d&&!f&&(0,R.jsx)(`div`,{className:`fixed inset-y-0 left-0 z-20 w-5 md:hidden`,"aria-hidden":!0,onPointerDown:e=>{let t=e.clientX,n=!1,r=e=>{n||e.clientX-t>50&&(p(!0),n=!0,i())},i=()=>{window.removeEventListener(`pointermove`,r),window.removeEventListener(`pointerup`,i),window.removeEventListener(`pointercancel`,i)};window.addEventListener(`pointermove`,r),window.addEventListener(`pointerup`,i),window.addEventListener(`pointercancel`,i)}}),(0,R.jsx)(_i,{className:`fixed inset-y-0 left-0 z-40 shadow-2xl transition-transform duration-200 ease-out md:static md:inset-auto md:z-auto md:shadow-none md:transition-none `+(f?`max-md:translate-x-0`:`max-md:-translate-x-full`)}),(0,R.jsxs)(`main`,{className:`flex flex-1 overflow-hidden`,children:[E&&(0,R.jsx)(`div`,{className:`flex flex-1 flex-col overflow-hidden`,children:o&&a.length===0?ne?(0,R.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-6 text-center`,children:(0,R.jsxs)(`div`,{className:`space-y-3 text-sm text-neutral-400`,children:[(0,R.jsx)(`p`,{children:`No projects yet.`}),(0,R.jsx)(`button`,{onClick:()=>re(!1),className:`rounded-md bg-neutral-100 px-3 py-1.5 text-sm font-medium text-neutral-900 hover:bg-white`,children:`+ New project`})]})}):(0,R.jsx)(`div`,{className:`flex flex-1 items-center justify-center`,children:(0,R.jsx)(ui,{onClose:()=>re(!0)})}):u===void 0?c?(0,R.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-6 text-center`,children:(0,R.jsxs)(`div`,{className:`space-y-3 text-sm text-neutral-400`,children:[(0,R.jsx)(`h2`,{className:`text-xl font-semibold text-neutral-100`,children:c.name}),(0,R.jsx)(`p`,{className:`font-mono text-xs`,children:c.path}),(0,R.jsx)(`p`,{children:`Pick a session from the sidebar — or start a new one here.`}),(0,R.jsx)(`button`,{onClick:()=>{L.getState().createSession(c.id)},className:`rounded-md bg-neutral-100 px-3 py-1.5 text-sm font-medium text-neutral-900 hover:bg-white`,children:`+ New session`})]})}):(0,R.jsx)(`div`,{className:`flex flex-1 items-center justify-center`,children:(0,R.jsx)(`p`,{className:`text-sm text-neutral-400`,children:`Select a project from the sidebar.`})}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Jk,{sessionId:u}),!Ne&&(0,R.jsx)(LA,{sessionId:u,alreadyOnChangesTab:g&&b===`changes`,onOpen:()=>{g||y(!0),S(`changes`)}}),(0,R.jsx)(Tj,{sessionId:u}),(0,R.jsx)(NA,{sessionId:u})]})}),!d&&_e&&(E?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(TN,{getStartSize:()=>he.current,onResize:e=>pe(e),direction:-1,minSize:FN,maxSize:Math.max(FN,window.innerWidth-(g?ue:0)-IN-240)}),(0,R.jsx)(`div`,{className:`flex shrink-0 flex-col border-l border-neutral-800`,style:{width:`${fe}px`},children:(0,R.jsx)(rM,{})})]}):(0,R.jsx)(`div`,{className:`flex flex-1 flex-col overflow-hidden`,children:(0,R.jsx)(rM,{})})),!d&&g&&(()=>{let e=!E&&!_e,t=(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`div`,{className:`flex border-b border-neutral-800 bg-neutral-900/40`,children:(Ne?[`files`,`search`,`processes`,`context`]:[`files`,`search`,`changes`,`git`,`processes`,`context`]).map(e=>(0,R.jsxs)(`button`,{onClick:()=>S(e),className:`flex items-center gap-1 px-3 py-1.5 text-[11px] uppercase tracking-wider ${b===e?`border-b border-neutral-100 text-neutral-100`:`text-neutral-500 hover:text-neutral-300`}`,children:[e===`files`?`Files`:e===`search`?`Search`:e===`changes`?`Last turn`:e===`git`?`Git`:e===`processes`?`Processes`:`Context`,e===`git`&&ve>0&&(0,R.jsx)(`span`,{className:`rounded bg-amber-900/40 px-1 py-0.5 text-[9px] text-amber-300 light:bg-amber-100 light:text-amber-800`,children:ve}),e===`processes`&&ye>0&&(0,R.jsx)(`span`,{className:`rounded bg-emerald-900/40 px-1 py-0.5 text-[9px] text-emerald-300 light:bg-emerald-100 light:text-emerald-800`,children:ye})]},e))}),(0,R.jsxs)(`div`,{className:`flex flex-1 flex-col overflow-hidden`,children:[(0,R.jsx)(`div`,{className:`flex-1 overflow-hidden`,children:b===`files`?(0,R.jsx)(Vj,{}):b===`search`?(0,R.jsx)(eN,{}):!Ne&&b===`changes`?(0,R.jsx)(IM,{}):!Ne&&b===`git`?(0,R.jsx)(HM,{}):b===`context`?(0,R.jsx)(cN,{}):b===`processes`&&u!==void 0?(0,R.jsx)(Nj,{sessionId:u}):(0,R.jsx)(Vj,{})}),ce&&u!==void 0&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(TN,{orientation:`horizontal`,getStartSize:()=>se.current,onResize:e=>j(e),direction:-1,minSize:RN,maxSize:Math.max(RN,window.innerHeight*.7)}),(0,R.jsx)(`div`,{className:`shrink-0 overflow-hidden border-t border-neutral-800 light:border-neutral-200`,style:{height:`${oe}px`},children:(0,R.jsx)(Oj,{sessionId:u,onClose:()=>bA.getState().setTodoPanelOpen(!1)})})]})]})]});return e?(0,R.jsx)(`div`,{className:`flex flex-1 flex-col overflow-hidden`,children:t}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(TN,{getStartSize:()=>me.current,onResize:e=>de(e),direction:-1,minSize:PN,maxSize:Math.max(PN,window.innerWidth-IN-240-(_e?FN:0))}),(0,R.jsx)(`div`,{className:`flex shrink-0 flex-col border-l border-neutral-800`,style:{width:`${ue}px`},children:t})]})})()]})]}),!d&&!Ne&&C&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(TN,{orientation:`horizontal`,getStartSize:()=>A.current,onResize:e=>ae(e),direction:-1,minSize:LN,maxSize:Math.max(LN,Math.floor(window.innerHeight*.7))}),(0,R.jsx)(`div`,{className:`shrink-0 border-t border-neutral-800`,style:{height:`${ie}px`},children:(0,R.jsx)(OM,{})})]})]})]}):(0,R.jsx)(ni,{}):(0,R.jsx)(`main`,{className:`flex min-h-screen items-center justify-center text-sm text-neutral-400`,children:`Loading…`})}HS(),O({immediate:!0});var VN=class extends v.Component{state={error:null};static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error(`[pi-forge] root render error`,e,t)}render(){return this.state.error===null?this.props.children:(0,R.jsxs)(`main`,{style:{padding:`2rem`,fontFamily:`monospace`,color:`#fca5a5`,background:`#0a0a0a`,minHeight:`100vh`,whiteSpace:`pre-wrap`,overflow:`auto`},children:[(0,R.jsx)(`h1`,{style:{color:`#fff`,marginBottom:`1rem`},children:`pi-forge: render crash`}),(0,R.jsx)(`p`,{style:{color:`#d4d4d4`,marginBottom:`1rem`},children:this.state.error.message}),(0,R.jsx)(`pre`,{style:{fontSize:`11px`,color:`#a3a3a3`},children:this.state.error.stack??`(no stack)`}),(0,R.jsx)(`p`,{style:{marginTop:`2rem`,color:`#71717a`,fontSize:`12px`},children:`Tip: open the browser console for more detail. Try clearing localStorage (devtools → Application → Local Storage → Clear) and refreshing if the error mentions stale state.`})]})}};window.addEventListener(`error`,e=>{console.error(`[pi-forge] uncaught error`,e.error)}),window.addEventListener(`unhandledrejection`,e=>{console.error(`[pi-forge] unhandled rejection`,e.reason)});var HN=document.getElementById(`root`);if(!HN)throw Error(`#root element missing in index.html`);(0,y.createRoot)(HN).render((0,R.jsx)(v.StrictMode,{children:(0,R.jsx)(VN,{children:(0,R.jsx)(BN,{})})}));export{l as a,d as i,US as n,ti as r,WS as t};
365
+ //# sourceMappingURL=index-CMSjnWtF.js.map